1 #include "StFgtGenAVEMaker.h"
3 #include "StRoot/StEvent/StFgtCollection.h"
4 #include "StRoot/StEvent/StFgtHitCollection.h"
5 #include "StRoot/StEvent/StFgtHit.h"
6 #include "StRoot/StFgtUtil/geometry/StFgtGeom.h"
7 #include "StRoot/StEvent/StEvent.h"
8 #include "StRoot/StEvent/StEventInfo.h"
9 #include "StRoot/StFgtUtil/geometry/StFgtGeom.h"
11 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
12 #include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h"
13 #include "StMuDSTMaker/COMMON/StMuDst.h"
14 #include "StMuDSTMaker/COMMON/StMuEvent.h"
15 #include "StarClassLibrary/StThreeVectorF.hh"
33 #include "StFgtCosmicAlignment.h"
35 #define MAX_PHI_DIFF 0.5//the maximal difference in phi a track is allowed
36 #define MAX_CLUSTERS 20
37 #define CHARGE_MEASURE clusterCharge
38 #define MAX_DIST_STRIP_R 0.7
39 #define MAX_DIST_STRIP_PHI 0.03
40 #include "StRoot/StFgtUtil/geometry/StFgtGeom.h"
42 #define PULSE_CONDITION
47 #define VERTEX_CUT 100000000
50 #include "StRoot/StEvent/StEvent.h"
51 #include "StRoot/StEvent/StFgtCollection.h"
55 #define MAX_CHARGE_RATIO
56 #define MIN_CHARGE_RATIO
60 #define MY_PI 3.14159265359
65 #define MAX_DIST_CHI 1.0
66 #define MAX_DIST2_EFF 1.0
69 #define MIN_NUM_POINTS 4
72 #define NUM_EFF_BIN 30
74 #define NUM_EFF_BIN 100
77 Bool_t StFgtGenAVEMaker::fitTheStrip(
generalStrip* pStrip,
generalStrip* pStripOtherLayer,
float* amp,
float* t0,
float* chi2Ndf,
int iD,
int iq,
int apvBin, Char_t layer)
83 sprintf(buffer,
"d%d_quad%d",iD,iq);
84 pulsePictureFile->cd();
85 pulsePictureFile->cd(buffer);
87 sprintf(buffer,
"apv%d_R",apvBin);
89 sprintf(buffer,
"apv%d_P",apvBin);
91 gDirectory->cd(buffer);
92 Int_t minAdcCount=100000;
94 for(Int_t tb=0;tb<7;tb++)
96 mHistPtr->SetBinContent(tb+1,0);
97 mHistPtr->SetBinError(tb+1,10000);
98 mHistPtr->SetBinContent(tb+1, pStrip->adc[tb]);
99 if(pStrip->adc[tb]<minAdcCount)
100 minAdcCount=pStrip->adc[tb]-pStrip->pedErr;
101 if(pStrip->adc[tb]>maxAdcCount)
102 maxAdcCount=pStrip->adc[tb]+pStrip->pedErr;
103 mHistPtr->SetBinError(tb+1,pStrip->pedErr);
107 (*amp)=mPulseShapePtr->GetParameter(0);
108 (*t0)=mPulseShapePtr->GetParameter(4);
109 (*chi2Ndf)=mPulseShapePtr->GetChisquare()/mPulseShapePtr->GetNDF();
110 sprintf(buffer,
"pulse histo_D%d_Q%d_APV%d_ev%d",iD,iq,apvBin,evtNr);
112 TH1F* tmpPulseHisto=(TH1F*)mHistPtr->Clone(buffer);
113 tmpPulseHisto->Write();
114 if(pStripOtherLayer!=0)
117 sprintf(buffer,
"tmpCnvsD%d_Q%d_APV%d_ev%d",iD,iq,apvBin,evtNr);
118 TCanvas* tmpCnv=(TCanvas*)mCanvas->Clone(buffer);
119 tmpCnv->SetTitle(buffer);
120 tmpCnv->SetName(buffer);
123 for(Int_t tb=0;tb<7;tb++)
125 mHistPtr2->SetBinContent(tb+1,0);
126 mHistPtr2->SetBinError(tb+1,10000);
127 mHistPtr2->SetBinContent(tb+1, pStripOtherLayer->adc[tb]);
128 mHistPtr2->SetBinError(tb+1,pStripOtherLayer->pedErr);
129 if(pStripOtherLayer->adc[tb]<minAdcCount)
130 minAdcCount=pStripOtherLayer->adc[tb]-pStripOtherLayer->pedErr;
131 if(pStripOtherLayer->adc[tb]>maxAdcCount)
132 maxAdcCount=pStripOtherLayer->adc[tb]+pStripOtherLayer->pedErr;
134 tmpPulseHisto->GetYaxis()->SetRangeUser(minAdcCount-10,maxAdcCount+10);
135 mHistPtr2->GetYaxis()->SetRangeUser(minAdcCount-10,maxAdcCount+10);
136 tmpPulseHisto->Draw();
137 mHistPtr2->Draw(
"SAME");
140 pulsePictureFile->cd();
146 template<
class T>
void createPlots(T*** pH,
int numH,
const char* nameBase,
int numBin,
int first,
int last)
153 for(
int iD=0;iD<numH;iD++)
155 sprintf(buffer,
"%s_APV%d", nameBase, iD);
156 (*pH)[iD]=
new T(buffer,buffer,numBin, first, last);
160 if ((numH == kFgtNumDiscs*4)&&(numH!=22))
163 for(
int iD=0;iD<kFgtNumDiscs;iD++)
165 for(
int iQ=0;iQ<4;iQ++)
167 sprintf(buffer,
"%s_disc%d_quad%d",nameBase,iD+1,iQ);
168 (*pH)[iD*4+iQ]=
new T(buffer,buffer,numBin,first,last);
174 for(
int iD=0;iD<kFgtNumDiscs;iD++)
177 if (numH==kFgtNumDiscs)
179 sprintf(buffer,
"%s_disc%d", nameBase, iD+1);
180 (*pH)[iD]=
new T(buffer, buffer,numBin, first, last);
184 for(
int binAPVi=0;binAPVi<40;binAPVi++)
187 if((binAPVi>= 0) && (binAPVi<= 9)) iQ=0;
188 if((binAPVi>=10) && (binAPVi<=19)) iQ=1;
189 if((binAPVi>=20) && (binAPVi<=29)) iQ=2;
190 if((binAPVi>=30) && (binAPVi<=39)) iQ=3;
191 sprintf(buffer,
"%s_disc%d_quad%d_apvBIN%d",nameBase,iD+1,iQ,binAPVi);
192 (*pH)[iD*40+binAPVi]=
new T(buffer,buffer,numBin,first,last);
200 template void createPlots(TH1I*** pH,
int numH,
const char* nameBase,
int numBin,
int first,
int last);
201 template void createPlots(TH1F*** pH,
int numH,
const char* nameBase,
int numBin,
int first,
int last);
203 void StFgtGenAVEMaker::doNormalize(TH2D** hEff, TH2D** hNonEff)
205 for(Int_t iD=0;iD<kFgtNumDiscs;iD++)
207 TH2D* tmpAllCounts=(TH2D*)hEff[iD]->
Clone(
"tmp");
208 hEff[iD]->Add(hNonEff[iD]);
209 for(
int nx=1;nx<hEff[iD]->GetNbinsX()+1;nx++)
211 for(
int ny=1;ny<hEff[iD]->GetNbinsY()+1;ny++)
213 Double_t denom=hEff[iD]->GetBinContent(nx,ny);
214 if(denom>0 && (tmpAllCounts->GetBinContent(nx,ny)/denom)<=1.0)
216 hEff[iD]->SetBinContent(nx,ny,tmpAllCounts->GetBinContent(nx,ny)/denom);
220 hEff[iD]->SetBinContent(nx,ny,0.0);
231 void StFgtGenAVEMaker::saveSigs(Double_t* sigR, Double_t* sigP, Double_t r, Double_t phi, Int_t maxR, Int_t maxPhi, Int_t discId, Int_t quad)
234 sprintf(buffer,
"Sig_Disc%d_quad%d_Phi_Evt_%d_R_%f_Phi_%f",discId,quad,evtNr,r,phi);
235 TH2D* histoP=
new TH2D(buffer,buffer,7,0,6,maxPhi,0,maxPhi-1);
236 for(
int i=0;i<maxPhi;i++)
240 histoP->SetBinContent(j+1,i+1,sigP[i*7+j]);
244 v_hClusP.push_back(histoP);
245 sprintf(buffer,
"Sig_Disc%d_quad%d_R_Evt_%d_R_%f_Phi_%f",discId,quad,evtNr,r,phi);
246 TH2D* histoR=
new TH2D(buffer,buffer,7,0,6,maxR,0,maxR-1);
247 for(
int i=0;i<maxR;i++)
251 histoR->SetBinContent(j+1,i+1,sigR[i*7+j]);
255 v_hClusR.push_back(histoR);
261 float oldDist=100000;
265 for(
float z=-100;z<100;z=z+zStep)
267 float x=it->mx*z+it->ax;
268 float y=it->my*z+it->ay;
280 return pair<double,double>(optZ,sqrt(dist));
284 Double_t StFgtGenAVEMaker::findClosestStrip(Char_t layer,
double ord, Int_t iD, Int_t iQ)
290 vector<generalCluster> &hitVec=*(pClusters[iD]);
292 for(vector<generalCluster>::iterator it=hitVec.begin();it!=hitVec.end();it++)
294 if(useChargeMatch && !it->hasMatch)
301 mDist=fabs(it->posPhi-ord);
304 mDist=fabs(it->posR-ord);
319 bool partOfClusterP=
false;
320 bool partOfClusterR=
false;
321 Double_t clusterChargeR=-9999;
322 Double_t clusterChargeP=-9999;
324 Double_t mClusterSizeP=-9999;
325 Double_t mClusterSizeR=-9999;
327 Double_t maxRCharge=-9999;
328 Double_t maxPhiCharge=-9999;
329 Double_t maxRChargeUncert=-9999;
330 Double_t maxPhiChargeUncert=-9999;
337 Double_t maxSigAdcR=-1;
338 Double_t maxSigAdcP=-1;
341 Int_t firstFSigTbP=0;
342 Int_t firstFSigTbR=0;
344 Float_t secondToLastRatioP=0;
345 Float_t secondToLastRatioR=0;
347 Float_t firstTbSigR=-1;
348 Float_t firstTbSigP=-1;
351 Double_t ordinate, lowerSpan, upperSpan;
352 Short_t disc, quadrant,strip;
355 Int_t APVmaxRCharge=-9999;
356 Int_t APVmaxPhiCharge=-9999;
365 Int_t APVmaxSigAdcR=-1;
366 Int_t APVmaxSigAdcP=-1;
369 Int_t APVfirstFSigTbP=0;
370 Int_t APVfirstFSigTbR=0;
372 Int_t APVsecondToLastRatioP=0;
373 Int_t APVsecondToLastRatioR=0;
375 Int_t APVfirstTbSigR=-1;
376 Int_t APVfirstTbSigP=-1;
380 for(
unsigned int i=0;i< pStrips[iD*4+iq].size();i++)
382 Int_t geoId=pStrips[iD*4+iq][i].geoId;
385 Int_t rdo, arm, apv, chan;
386 mDb->getElecCoordFromGeoId(geoId, rdo,arm,apv,chan);
388 Int_t binAPV = (iq*10)+(apv%12);
390 StFgtGeom::getPhysicalCoordinate(geoId,disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
391 StFgtGeom::decodeGeoId(geoId,disc, quadrant, layer, strip);
395 if(disc==iD && iq==quadrant && ((layer ==
'R' && fabs(ordinate-r)<0.7) || (layer==
'P' && fabs(ordinate-phi)<0.03) || (layer==
'P' && fabs(ordinate-phi+2*MY_PI)<0.03 ) || (layer==
'P' && fabs(ordinate-phi-2*MY_PI)<0.03)|| (layer==
'P' && fabs(ordinate-phi+MY_PI)<0.03 ) || (layer==
'P' && fabs(ordinate-phi-MY_PI)<0.03)))
399 if(pStrip.charge>maxPhiCharge)
401 if(pStrip.seedType==kFgtSeedType1|| pStrip.seedType==kFgtSeedType2 || pStrip.seedType==kFgtSeedType3 || pStrip.seedType==kFgtClusterPart || pStrip.seedType==kFgtClusterEndUp ||pStrip.seedType==kFgtClusterEndDown)
404 pair<Double_t, Double_t> cluSize=findCluChargeSize(iD,
'P',ordinate);
405 clusterChargeP=cluSize.first;
406 mClusterSizeP=cluSize.second;
410 partOfClusterP=
false;
411 clusterChargeP=-9999;
413 maxPhiCharge=pStrip.charge;
414 maxPhiChargeUncert=pStrip.chargeUncert;
431 secondToLastRatioP=pStrip.adc[5]/(float)pStrip.adc[6];
432 APVsecondToLastRatioP=binAPV;
436 firstTbSigP=pStrip.adc[0]/(float)pStrip.pedErr;
437 APVfirstTbSigP=binAPV;
439 for(
int iAdc=0;iAdc<7;iAdc++)
441 if(pStrip.adc[iAdc]>5*pStrip.pedErr)
448 APVfirstFSigTbP=binAPV;
451 if(pStrip.adc[iAdc]>maxPAdc)
453 maxPAdc=pStrip.adc[iAdc];
459 maxSigAdcP=(Double_t)maxPAdc/pStrip.pedErr;
460 APVmaxSigAdcP=binAPV;
468 if(pStrip.charge>maxRCharge)
470 if(pStrip.seedType==kFgtSeedType1|| pStrip.seedType==kFgtSeedType2 || pStrip.seedType==kFgtSeedType3 || pStrip.seedType==kFgtClusterPart || pStrip.seedType==kFgtClusterEndUp ||pStrip.seedType==kFgtClusterEndDown)
473 pair<Double_t, Double_t> cluSize=findCluChargeSize(iD,
'R',ordinate);
474 clusterChargeR=cluSize.first;
475 mClusterSizeR=cluSize.second;
479 clusterChargeR=-9999;
480 partOfClusterR=
false;
483 maxRCharge=pStrip.charge;
485 maxRChargeUncert=pStrip.chargeUncert;
501 secondToLastRatioR=pStrip.adc[5]/(float)pStrip.adc[6];
502 APVsecondToLastRatioR=binAPV;
506 firstTbSigR=pStrip.adc[0]/(float)pStrip.pedErr;
507 APVfirstTbSigR=binAPV;
509 for(
int iAdc=0;iAdc<7;iAdc++)
512 if(pStrip.adc[iAdc]>5*pStrip.pedErr)
519 APVfirstFSigTbR=binAPV;
522 if(pStrip.adc[iAdc]>maxRAdc)
524 maxRAdc=pStrip.adc[iAdc];
530 maxSigAdcR=(Double_t)maxRAdc/pStrip.pedErr;
531 APVmaxSigAdcR=binAPV;
543 firstTbSigCloseClusterP[iD*4+iq]->Fill(firstTbSigP);
544 maxAdcCloseClusterP[iD*4+iq]->Fill(maxPAdc);
546 maxTbCloseClusterP[iD*4+iq]->Fill(maxPTb);
547 numFSigCloseClusterP[iD*4+iq]->Fill(numFSigP);
548 numFirstHighCloseClusterP[iD*4+iq]->Fill(firstFSigTbP);
550 maxSigCloseClusterP[iD*4+iq]->Fill(maxSigAdcP);
553 secondToLastRatioCloseClusterP[iD*4+iq]->Fill(secondToLastRatioP);
555 if(APVfirstTbSigP>-1 && APVmaxPAdc>-1 && APVmaxPTb>-1 && APVnumFSigP>-1 && APVfirstFSigTbP>-1 && APVmaxSigAdcP>-1 && APVsecondToLastRatioP>-1)
557 APVfirstTbSigCloseClusterP[iD*40+APVfirstTbSigP]->Fill(firstTbSigP);
558 APVmaxAdcCloseClusterP[iD*40+APVmaxPAdc]->Fill(maxPAdc);
559 APVmaxTbCloseClusterP[iD*40+APVmaxPTb]->Fill(maxPTb);
560 APVnumFSigCloseClusterP[iD*40+APVnumFSigP]->Fill(numFSigP);
561 APVnumFirstHighCloseClusterP[iD*40+APVfirstFSigTbP]->Fill(firstFSigTbP);
562 APVmaxSigCloseClusterP[iD*40+APVmaxSigAdcP]->Fill(maxSigAdcP);
563 APVsecondToLastRatioCloseClusterP[iD*40+APVsecondToLastRatioP]->Fill(secondToLastRatioP);
566 if(iD==2 && iq==1 && (
float)pStrips[iD*4+iq][maxPInd].pedErr>0)
569 for(
int iB=0;iB<7;iB++)
571 exPulseMaxAdcNormP->SetBinContent(iB+1,exPulseMaxAdcNormP->GetBinContent(iB+1)+pStrips[iD*4+iq][maxPInd].adc[iB]/(float)maxPAdc);
572 exPulseSigP->SetBinContent(iB+1,exPulseSigP->GetBinContent(iB+1)+pStrips[iD*4+iq][maxPInd].adc[iB]/(float)pStrips[iD*4+iq][maxPInd].pedErr);
579 firstTbSigCloseClusterR[iD*4+iq]->Fill(firstTbSigR);
580 maxTbCloseClusterR[iD*4+iq]->Fill(maxRTb);
581 maxAdcCloseClusterR[iD*4+iq]->Fill(maxRAdc);
582 numFSigCloseClusterR[iD*4+iq]->Fill(numFSigR);
583 numFirstHighCloseClusterR[iD*4+iq]->Fill(firstFSigTbR);
585 maxSigCloseClusterR[iD*4+iq]->Fill(maxSigAdcR);
587 secondToLastRatioCloseClusterR[iD*4+iq]->Fill(secondToLastRatioR);
589 if(APVfirstTbSigR>-1 && APVmaxRAdc>-1 && APVmaxRTb>-1 && APVnumFSigR>-1 && APVfirstFSigTbR>-1 && APVmaxSigAdcR>-1 && APVsecondToLastRatioR>-1)
591 APVfirstTbSigCloseClusterR[iD*40+APVfirstTbSigR]->Fill(firstTbSigR);
592 APVmaxTbCloseClusterR[iD*40+APVmaxRTb]->Fill(maxRTb);
593 APVmaxAdcCloseClusterR[iD*40+APVmaxRAdc]->Fill(maxRAdc);
594 APVnumFSigCloseClusterR[iD*40+APVnumFSigR]->Fill(numFSigR);
595 APVnumFirstHighCloseClusterR[iD*40+APVfirstFSigTbR]->Fill(firstFSigTbR);
596 APVmaxSigCloseClusterR[iD*40+APVmaxSigAdcR]->Fill(maxSigAdcR);
597 APVsecondToLastRatioCloseClusterR[iD*40+APVsecondToLastRatioR]->Fill(secondToLastRatioR);
600 if(iD==2 && iq==1 && (
float)pStrips[iD*4+iq][maxRInd].pedErr>0)
603 for(
int iB=0;iB<7;iB++)
605 exPulseMaxAdcNormR->SetBinContent(iB+1,exPulseMaxAdcNormR->GetBinContent(iB+1)+pStrips[iD*4+iq][maxRInd].adc[iB]/(float)maxRAdc);
606 exPulseSigR->SetBinContent(iB+1,exPulseSigR->GetBinContent(iB+1)+pStrips[iD*4+iq][maxRInd].adc[iB]/(float)pStrips[iD*4+iq][maxRInd].pedErr);
612 if(maxRCharge> 200 && maxPhiCharge>200 && iD==m_effDisk)
614 StFgtGeom::getPhysicalCoordinate((
float)pStrips[iD*4+iq][maxRInd].geoId,disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
617 chargeCorrMaxStrip->Fill(maxRCharge,maxPhiCharge);
618 chargeCorrMaxAdc->Fill(maxRAdc,maxPAdc);
627 if(partOfClusterR&& partOfClusterP && iD==m_effDisk)
629 chargeCorrInEffDisk->Fill(clusterChargeR,clusterChargeP);
630 StFgtGeom::getPhysicalCoordinate((
float)pStrips[iD*4+iq][maxRInd].geoId,disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
633 chargeCorr[iD*4+iq]->Fill(clusterChargeR,clusterChargeP);
638 clusterSizeR[iD*4+iq]->Fill(mClusterSizeR);
639 clusterSizeP[iD*4+iq]->Fill(mClusterSizeP);
648 float intPCharge=(float)pStrips[iD*4+iq][maxPInd].charge+(
float)pStrips[iD*4+iq][maxPInd-1].charge+(float)pStrips[iD*4+iq][maxPInd+1].charge;
654 fitTheStrip(&(pStrips[iD*4+iq][maxPInd]),&(pStrips[iD*4+iq][maxRInd]),&,&t0,&chi2Ndf,iD,iq,APVmaxPAdc,
'P');
656 fitTheStrip(&(pStrips[iD*4+iq][maxPInd]),0,&,&t0,&chi2Ndf,iD,iq,APVmaxPAdc,
'P');
658 APVfitChi2P[iD*40+APVmaxPAdc]->Fill(chi2Ndf);
661 firstTbSigTrackClusterP[iD*4+iq]->Fill(firstTbSigP);
662 maxAdcTrackClusterP[iD*4+iq]->Fill(maxPAdc);
663 maxSigTrackClusterP[iD*4+iq]->Fill(maxSigAdcP);
664 maxTbTrackClusterP[iD*4+iq]->Fill(maxPTb);
665 numFSigTrackClusterP[iD*4+iq]->Fill(numFSigP);
666 numFirstHighTrackClusterP[iD*4+iq]->Fill(firstFSigTbP);
667 secondToLastRatioTrackClusterP[iD*4+iq]->Fill(secondToLastRatioP);
669 if(iD==2 && iq==1 && (
float)pStrips[iD*4+iq][maxPInd].pedErr>0)
672 for(
int iB=0;iB<7;iB++)
674 exPulseMaxAdcNormTrackP->SetBinContent(iB+1,exPulseMaxAdcNormTrackP->GetBinContent(iB+1)+pStrips[iD*4+iq][maxPInd].adc[iB]/(float)maxPAdc);
676 exPulseSigTrackP->SetBinContent(iB+1,exPulseSigTrackP->GetBinContent(iB+1)+pStrips[iD*4+iq][maxPInd].adc[iB]/(float)pStrips[iD*4+iq][maxPInd].pedErr);
686 float intRCharge=(float)pStrips[iD*4+iq][maxRInd].charge+(
float)pStrips[iD*4+iq][maxRInd-1].charge+(float)pStrips[iD*4+iq][maxRInd+1].charge;
692 fitTheStrip(&(pStrips[iD*4+iq][maxRInd]),&pStrips[iD*4+iq][maxPInd],&,&t0,&chi2Ndf, iD, iq, APVmaxRAdc,
'R');
694 fitTheStrip(&(pStrips[iD*4+iq][maxRInd]),0,&,&t0,&chi2Ndf, iD, iq, APVmaxRAdc,
'R');
695 APVfitChi2R[iD*40+APVmaxRAdc]->Fill(chi2Ndf);
698 firstTbSigTrackClusterR[iD*4+iq]->Fill(firstTbSigR);
699 maxTbTrackClusterR[iD*4+iq]->Fill(maxRTb);
700 maxAdcTrackClusterR[iD*4+iq]->Fill(maxRAdc);
701 maxSigTrackClusterR[iD*4+iq]->Fill(maxSigAdcR);
702 numFSigTrackClusterR[iD*4+iq]->Fill(numFSigR);
703 numFirstHighTrackClusterR[iD*4+iq]->Fill(firstFSigTbR);
704 secondToLastRatioTrackClusterR[iD*4+iq]->Fill(secondToLastRatioR);
706 if(iD==2 && iq==1 && (
float)pStrips[iD*4+iq][maxRInd].pedErr>0)
709 for(
int iB=0;iB<7;iB++)
711 exPulseMaxAdcNormTrackR->SetBinContent(iB+1,exPulseMaxAdcNormTrackR->GetBinContent(iB+1)+pStrips[iD*4+iq][maxRInd].adc[iB]/(float)maxRAdc);
712 exPulseSigTrackR->SetBinContent(iB+1,exPulseSigTrackR->GetBinContent(iB+1)+pStrips[iD*4+iq][maxRInd].adc[iB]/(float)pStrips[iD*4+iq][maxRInd].pedErr);
723 Bool_t StFgtGenAVEMaker::isSomewhatEff(Float_t r, Float_t phi, Int_t iD, Int_t iq)
725 Double_t maxRCharge=-9999;
726 Double_t maxPhiCharge=-9999;
727 Double_t maxRChargeUncert=-9999;
728 Double_t maxPhiChargeUncert=-9999;
731 Bool_t validPhiPulse=
false;
732 Bool_t validRPulse=
false;
733 for(
unsigned int i=0;i< pStrips[iD*4+iq].size();i++)
735 Int_t geoId=pStrips[iD*4+iq][i].geoId;
737 Short_t disc, quadrant,strip;
739 Double_t ordinate, lowerSpan, upperSpan;
740 StFgtGeom::getPhysicalCoordinate(geoId,disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
741 StFgtGeom::decodeGeoId(geoId,disc, quadrant, layer, strip);
744 if(disc==iD && iq==quadrant && ((layer ==
'R' && fabs(ordinate-r)<0.7) || (layer==
'P' && fabs(ordinate-phi)<0.04) || (layer==
'P' && fabs(ordinate-phi+2*MY_PI)<0.04 ) || (layer==
'P' && fabs(ordinate-phi-2*MY_PI)<0.04)|| (layer==
'P' && fabs(ordinate-phi+MY_PI)<0.04 ) || (layer==
'P' && fabs(ordinate-phi-MY_PI)<0.04)))
748 if(validPulse(pStrip))
751 if(pStrip.charge>maxPhiCharge)
753 maxPhiCharge=pStrip.charge;
754 maxPhiChargeUncert=pStrip.chargeUncert;
760 if(validPulse(pStrip))
763 if(pStrip.charge>maxRCharge)
765 maxRCharge=pStrip.charge;
767 maxRChargeUncert=pStrip.chargeUncert;
772 #ifdef PULSE_CONDITION
773 if(validPhiPulse && validRPulse)
778 if(maxRInd>=0 && maxPInd>=0)
781 if(maxRCharge>1000 && maxPhiCharge>1000)
787 maxRCharge+=pStrips[iD*4+iq][maxRInd-1].charge;
788 if(maxRInd< (
int)(pStrips[iD*4+iq].size()-1))
789 maxRCharge+=pStrips[iD*4+iq][maxRInd+1].charge;
791 maxPhiCharge+=pStrips[iD*4+iq][maxPInd-1].charge;
792 if(maxPInd< (
int)(pStrips[iD*4+iq].size()-1))
793 maxPhiCharge+=pStrips[iD*4+iq][maxPInd+1].charge;
797 if(maxRCharge>3*maxRChargeUncert && maxPhiCharge>3*maxPhiChargeUncert)
801 if(maxRCharge>maxPhiCharge)
803 if(maxRCharge/maxPhiCharge<4)
810 if(maxPhiCharge/maxPhiCharge<4)
822 pair<Double_t,Double_t> StFgtGenAVEMaker::findCluChargeSize(Int_t iD,Char_t layer, Double_t ordinate)
826 return pair<Double_t,Double_t>(-99999,-99999);
828 vector<generalCluster> &hitVec=*(pClusters[iD]);
829 Double_t charge=-99999;
830 Double_t cluSize=-9999;
831 Double_t minDist=99999;
832 for(vector<generalCluster>::iterator it=hitVec.begin();it!=hitVec.end();it++)
844 if(fabs(ordinate-(ord+MY_PI))<fabs(ord-ordinate))
846 if(fabs(ordinate-(ord-MY_PI))<fabs(ord-ordinate))
850 if((fabs(ordinate-ord)<minDist) && (!useChargeMatch || it->hasMatch))
852 charge=it->clusterCharge;
853 cluSize=it->clusterSize;
854 minDist=fabs(ordinate-ord);
857 return pair<Double_t,Double_t>(charge,cluSize);
867 vector<generalCluster> &hitVec=*(pClusters[iD]);
868 Double_t dist2=99999;
869 for(vector<generalCluster>::iterator it=hitVec.begin();it!=hitVec.end();it++)
871 for(vector<generalCluster>::iterator it2=hitVec.begin();it2!=hitVec.end();it2++)
874 if(useChargeMatch && !arePointsMatched(it,it2))
877 if(it->layer==it2->layer)
880 Float_t phi=it2->posPhi;
887 Float_t x=r*cos(phi);
888 Float_t y=r*sin(phi);
890 Double_t mDist=(x-xE)*(x-xE)+(y-yE)*(y-yE);
896 float tmpX, tmpY,tmpZ,tmpP,tmpR;
898 getAlign(iD,phi,r,tmpX,tmpY,tmpZ,tmpP,tmpR);
899 Double_t xExpUpdate=mx*tmpZ+bx;
900 Double_t yExpUpdate=my*tmpZ+by;
904 mDist=(tmpX-xExpUpdate)*(tmpX-xExpUpdate)+(tmpY-yExpUpdate)*(tmpY-yExpUpdate);
923 cout <<
"do not use this function!!!" <<endl;
937 Bool_t StFgtGenAVEMaker::printArea1D(Int_t iD,Int_t iq, Int_t centerGeoId)
940 for(
unsigned int i=0;i<pStrips[iD*4+iq].size();i++)
942 Int_t geoId=pStrips[iD*4+iq][i].geoId;
944 Short_t disc, quadrant,strip;
946 Double_t ordinate, lowerSpan, upperSpan;
947 StFgtGeom::getPhysicalCoordinate(geoId,disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
948 StFgtGeom::decodeGeoId(geoId,disc, quadrant, layer, strip);
950 switch(pStrip.seedType)
953 sprintf(buffer,
"No Seed");
956 sprintf(buffer,
"Seed1");
959 sprintf(buffer,
"Seed2");
962 sprintf(buffer,
"Seed3");
964 case kFgtClusterPart:
965 sprintf(buffer,
"PartOfCluster");
967 case kFgtClusterEndUp:
968 sprintf(buffer,
"EoC");
970 case kFgtClusterEndDown:
971 sprintf(buffer,
"BoC");
974 sprintf(buffer,
"DeadStrip");
976 case kFgtClusterTooBig:
977 sprintf(buffer,
"cluster too big");
979 case kFgtClusterSeedInSeaOfNoise:
980 sprintf(buffer,
"seed in noise");
983 sprintf(buffer,
"somethingWrong: %d", pStrip.seedType);
988 if(abs(geoId-centerGeoId)<8)
991 (*outTxtFile) <<StFgtGeom::encodeGeoName(iD,iq,layer,strip)<<
"geo: " << geoId<<
" ord: " << ordinate <<
" layer: " <<layer<<
" ped: " << pStrip.ped <<
" pedErr: " << pStrip.pedErr <<
" seedType: " <<buffer<<
" ";
992 for(
int iT=0;iT<7;iT++)
994 if(pStrip.adc[iT]<pStrip.pedErr)
995 (*outTxtFile) << setw(4) <<
" . "<<
" ";
997 (*outTxtFile) << setw(4) <<pStrip.adc[iT] <<
" ";
999 (*outTxtFile) <<endl;
1007 Bool_t StFgtGenAVEMaker::printArea(Float_t r, Float_t phi, Int_t iD, Int_t iq)
1012 if(printCounter>1000)
1016 Double_t signalsP[900];
1017 Double_t signalsR[900];
1022 for(
unsigned int i=0;i<pStrips[iD*4+iq].size();i++)
1024 Int_t geoId=pStrips[iD*4+iq][i].geoId;
1026 Short_t disc, quadrant,strip;
1028 Double_t ordinate, lowerSpan, upperSpan;
1029 StFgtGeom::getPhysicalCoordinate(geoId,disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
1030 StFgtGeom::decodeGeoId(geoId,disc, quadrant, layer, strip);
1032 switch(pStrip.seedType)
1034 case kFgtSeedTypeNo:
1035 sprintf(buffer,
"No Seed");
1038 sprintf(buffer,
"Seed1");
1041 sprintf(buffer,
"Seed2");
1044 sprintf(buffer,
"Seed3");
1046 case kFgtClusterPart:
1047 sprintf(buffer,
"PartOfCluster");
1049 case kFgtClusterEndUp:
1050 sprintf(buffer,
"EoC");
1052 case kFgtClusterEndDown:
1053 sprintf(buffer,
"BoC");
1056 sprintf(buffer,
"DeadStrip");
1058 case kFgtClusterTooBig:
1059 sprintf(buffer,
"cluster too big");
1061 case kFgtClusterSeedInSeaOfNoise:
1062 sprintf(buffer,
"seed in noise");
1065 sprintf(buffer,
"somethingWrong: %d", pStrip.seedType);
1072 if(disc==iD && iq==quadrant && ((layer ==
'R' && fabs(ordinate-r)<1.0) || (layer==
'P' && fabs(ordinate-phi)<0.04) || (layer==
'P' && fabs(ordinate-phi+2*MY_PI)<0.04 ) || (layer==
'P' && fabs(ordinate-phi-2*MY_PI)<0.04)|| (layer==
'P' && fabs(ordinate-phi+MY_PI)<0.04 ) || (layer==
'P' && fabs(ordinate-phi-MY_PI)<0.04)))
1075 (*outTxtFile) <<
"Id: " << geoId<<
" "<<StFgtGeom::encodeGeoName(iD,iq,layer,strip)<<
" ord: " << ordinate <<
" layer: " <<layer<<
" ped: " << pStrip.ped <<
" pedErr: " << pStrip.pedErr <<
" seedType: " <<buffer<<
" ";
1076 for(
int iT=0;iT<7;iT++)
1078 if(pStrip.adc[iT]<pStrip.pedErr)
1079 (*outTxtFile) << setw(4) <<
" . "<<
" ";
1081 (*outTxtFile) << setw(4) <<pStrip.adc[iT] <<
" ";
1084 if(layer==
'P'&& counterP<40)
1086 signalsP[counterP*7+iT]=pStrip.adc[iT];
1091 if(layer==
'R'&& counterR<40)
1093 signalsR[counterR*7+iT]=pStrip.adc[iT];
1099 (*outTxtFile) <<endl;
1103 saveSigs(signalsR,signalsP,r,phi,counterR,counterP, iD, iq);
1110 pair<Double_t,Double_t> StFgtGenAVEMaker::getChargeRatio(Float_t r, Float_t phi, Int_t iD, Int_t iq)
1113 Double_t maxRCharge=-9999;
1114 Double_t maxPhiCharge=-9999;
1117 for(
unsigned int i=0;i< pStrips[iD*4+iq].size();i++)
1119 Int_t geoId=pStrips[iD*4+iq][i].geoId;
1121 Short_t disc, quadrant,strip;
1123 Double_t ordinate, lowerSpan, upperSpan;
1124 StFgtGeom::getPhysicalCoordinate(geoId,disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
1125 StFgtGeom::decodeGeoId(geoId,disc, quadrant, layer, strip);
1128 if(disc==iD && iq==quadrant && ((layer ==
'R' && fabs(ordinate-r)<0.7) || (layer==
'P' && fabs(ordinate-phi)<0.03) || (layer==
'P' && fabs(ordinate-phi+2*MY_PI)<0.03 ) || (layer==
'P' && fabs(ordinate-phi-2*MY_PI)<0.03)|| (layer==
'P' && fabs(ordinate-phi+MY_PI)<0.03 ) || (layer==
'P' && fabs(ordinate-phi-MY_PI)<0.03)))
1132 if(pStrip.charge>maxPhiCharge)
1134 maxPhiCharge=pStrip.charge;
1140 if(pStrip.charge>maxRCharge)
1142 maxRCharge=pStrip.charge;
1148 if(maxRInd>=0 && maxPInd>=0)
1150 if(maxRCharge>1000 && maxPhiCharge>1000)
1154 maxRCharge+=pStrips[iD*4+iq][maxRInd-1].charge;
1155 if(maxRInd< (
int)(pStrips[iD*4+iq].size()-1))
1156 maxRCharge+=pStrips[iD*4+iq][maxRInd+1].charge;
1158 maxPhiCharge+=pStrips[iD*4+iq][maxPInd-1].charge;
1159 if(maxPInd< (
int)(pStrips[iD*4+iq].size()-1))
1160 maxPhiCharge+=pStrips[iD*4+iq][maxPInd+1].charge;
1162 return pair<Double_t,Double_t>(maxRCharge,maxPhiCharge);
1166 return pair<Double_t,Double_t>(-9999,-9999);
1180 vector<AVPoint>::iterator iter=points.begin();
1181 Double_t A = 0, B = 0, Cx = 0, Cy = 0, D = 0, Ex = 0, Ey = 0;
1189 float tmpX, tmpY,tmpZ,tmpP,tmpR;
1191 for( ; iter != points.end(); ++iter ){
1192 getAlign(iter->dID,iter->phi,iter->r,tmpX,tmpY,tmpZ,tmpP,tmpR);
1204 for( iter=points.begin(); iter != points.end(); ++iter ){
1206 Double_t x = iter->x;
1207 Double_t y = iter->y;
1208 Double_t z = iter->z;
1223 #ifdef FIT_WITH_VERTEX
1224 if(muDst && ipZ>-100 && ipZ<100)
1232 Double_t denom = D*A - B*B;
1234 Double_t bx = (-B*Cx + A*Ex)/denom;
1235 Double_t by = (-B*Cy + A*Ey)/denom;
1236 Double_t mx = ( D*Cx - B*Ex)/denom;
1237 Double_t my = ( D*Cy - B*Ey)/denom;
1239 for( iter = points.begin(); iter != points.end(); ++iter ){
1244 (*outTxtFile) <<
"--- Location at each disc, " << iter->dID <<
" "
1245 <<
"X: " << mx*iter->z+bx <<
" vs " << iter->x <<
' '
1246 <<
"Y: " << my*iter->z+by <<
" vs " << iter->y <<
" " <<
" charge r: " << iter->rCharge <<
" phi: " << iter->phiCharge <<
1247 " r: " << iter->r <<
" phi: " << iter->phi <<endl;
1251 vector<AVPoint> redPoints;
1253 for(
int iDx=0;iDx<6;iDx++)
1255 Double_t minDistance=9999;
1258 for( iter = points.begin(); iter != points.end(); ++iter ){
1259 Int_t dId=iter->dID;
1260 Double_t distX=fabs((iter->z*mx+bx)-(iter->x));
1261 Double_t distY=fabs((iter->z*my+by)-(iter->y));
1263 Double_t distance=distX*distX+distY*distY;
1265 if((iDx==dId)&&(distance<minDistance))
1267 minDistance=distance;
1276 redPoints.push_back(points[pointIdx]);
1291 for(vector<AVPoint>::iterator iterR=redPoints.begin() ; iterR != redPoints.end(); ++iterR )
1293 Double_t x = iterR->x;
1294 Double_t y = iterR->y;
1295 Double_t z = iterR->z;
1304 D = redPoints.size();
1305 #ifdef REFIT_WITH_VERTEX
1306 if(muDst && ipZ>-100 && ipZ<100)
1313 Double_t denom = D*A - B*B;
1316 bx = (-B*Cx + A*Ex)/denom;
1317 by = (-B*Cy + A*Ey)/denom;
1318 mx = ( D*Cx - B*Ex)/denom;
1319 my = ( D*Cy - B*Ey)/denom;
1325 for(vector<AVPoint>::iterator iterR = redPoints.begin(); iterR != redPoints.end(); ++iterR )
1327 Double_t distX, distY;
1328 distX=fabs((iterR->z*mx+bx)-(iterR->x));
1329 distY=fabs((iterR->z*my+by)-(iterR->y));
1331 dist += (distX*distX+distY*distY);
1339 m_tracks.push_back(
AVTrack(mx,my,bx,by,ipZ,dist));
1343 for(vector<AVPoint>::iterator it=redPoints.begin();it!=redPoints.end();it++)
1345 points.push_back(*it);
1364 for(vector<AVPoint>::iterator iter = points.begin(); iter != points.end(); ++iter ){
1373 vector<AVTrack>::iterator it_lastTrack=m_tracks.end();
1375 pair<double,double> dca=
getDca(it_lastTrack);
1377 Double_t vertZ = ( -( it_lastTrack->mx*it_lastTrack->ax + it_lastTrack->my*it_lastTrack->ay )/(it_lastTrack->mx*it_lastTrack->mx+it_lastTrack->my*it_lastTrack->my));
1378 (it_lastTrack)->trkZ=vertZ;
1379 it_lastTrack->dca=dca.second;
1380 it_lastTrack->ipZ=dca.first;
1384 if(dist< MAX_DIST_CHI && fabs(vertZ)<VERTEX_CUT)
1389 set<Short_t> disksHit;
1391 for(vector<AVPoint>::iterator iterP = points.begin(); iterP != points.end(); ++iterP ){
1397 chargeCorr[iterP->dID*4+iterP->quadID]->Fill(iterP->rCharge,iterP->phiCharge);
1398 clusterSizeP[iterP->dID*4+iterP->quadID]->Fill(iterP->phiSize);
1399 clusterSizeR[iterP->dID*4+iterP->quadID]->Fill(iterP->rSize);
1402 h_clusterChargeR[iterP->dID]->Fill(iterP->rCharge);
1404 h_clusterChargePhi[iterP->dID]->Fill(iterP->phiCharge);
1405 h_clusterSizeR[iterP->dID]->Fill(iterP->rSize);
1407 h_clusterSizePhi[iterP->dID]->Fill(iterP->phiSize);
1408 disksHit.insert(iterP->dID);
1412 for(
int i=0;i<6;i++)
1414 Double_t xExp=mx*getLocDiscZ(i)+bx;
1415 Double_t yExp=my*getLocDiscZ(i)+by;
1420 Double_t r=sqrt(xExp*xExp+yExp*yExp);
1422 Double_t phi=atan(yExp/xExp);
1423 if(xExp <0 && yExp <0)
1434 quad=StFgtGeom::getQuad(phi);
1437 phi-=StFgtGeom::phiQuadXaxis(quad);
1440 phi-=(2*TMath::Pi());
1441 if(phi<((-1)*TMath::Pi()))
1442 phi+=(2*TMath::Pi());
1446 (*outTxtFile) <<
" looking at Track with chi2/ndf *[cm}: " << it_lastTrack->chi2 <<
" z vertex: " << it_lastTrack->ipZ << endl;
1463 if(isSomewhatEff(r,phi,i,quad))
1466 radioPlotsEffLoose[i]->Fill(xExp,yExp);
1471 radioPlotsNonEffLoose[i]->Fill(xExp,yExp);
1474 if(i==m_effDisk && quad==QUAD_EFF)
1477 if(findClosestStrip(
'R',r,i,quad)<MAX_DIST_STRIP_R)
1478 radioPlotsEffR[i]->Fill(xExp,yExp);
1480 radioPlotsNonEffR[i]->Fill(xExp,yExp);
1482 if(findClosestStrip(
'P',phi+StFgtGeom::phiQuadXaxis(quad),i,quad)<MAX_DIST_STRIP_PHI)
1485 radioPlotsEffPhi[i]->Fill(xExp,yExp);
1490 radioPlotsNonEffPhi[i]->Fill(xExp,yExp);
1501 radioPlotsEff[i]->Fill(xExp,yExp);
1505 hResidua->Fill(sqrt(closestPoint));
1506 hResiduaX->Fill(xExp,sqrt(closestPoint));
1507 hResiduaY->Fill(yExp,sqrt(closestPoint));
1508 hResiduaR->Fill(r,sqrt(closestPoint));
1509 hResiduaP->Fill(phi,sqrt(closestPoint));
1512 (*outTxtFile) <<
"***** found hit in disk " <<i <<
" quad: " << quad <<
" at " << xExp<<
", " << yExp<<
" r: " << r <<
" phi: " <<phi << endl;
1516 printArea(r,phi,i,quad);
1523 radioPlotsNonEff[i]->Fill(xExp,yExp);
1525 (*outTxtFile) <<
"expected (but haven't found) point on disk " << i <<
", x: " << xExp <<
" y: " << yExp <<
" r: " << r <<
" phi: " << phi <<
" quad:: " << quad << endl;
1529 printArea(r,phi,i,quad);
1532 pair<Double_t,Double_t> rPhiRatio=getChargeRatio(r,phi,i,quad);
1534 if(rPhiRatio.first>0 && rPhiRatio.second>0)
1536 double asym=fabs((Double_t)1-rPhiRatio.first/rPhiRatio.second);
1537 double ratio=rPhiRatio.first/rPhiRatio.second;
1540 if(asym<2 && ratio <2)
1542 hChargeAsym->Fill(asym);
1543 hChargeRatio->Fill(ratio);
1544 chargeRatioInEffDisk->Fill(xExp,yExp,ratio);
1545 chargeAsymInEffDisk->Fill(xExp,yExp,asym);
1558 Double_t StFgtGenAVEMaker::getRPhiRatio(vector<generalCluster>::iterator hitIterBegin, vector<generalCluster>::iterator hitIterEnd)
1564 vector<generalCluster>::iterator hitIter=hitIterBegin;
1565 for(;hitIter!=hitIterEnd;hitIter++)
1568 layer=hitIter->layer;
1577 return (numR-numPhi)/((Double_t)(numR+numPhi));
1589 (*outTxtFile) <<
"----------------------------- Event Nr: " << evtNr<<
" -----------------" <<endl;
1591 unsigned int oldNumTracks=m_tracks.size();
1596 for(
int i=0;i<6;i++)
1599 for(
int j=0;j<pClusters[i]->size();j++)
1605 Int_t seedType=(*(pClusters[i]))[j].seedType;
1606 Double_t posPhi=(*(pClusters[i]))[j].posPhi;
1607 Double_t posR=(*(pClusters[i]))[j].posR;
1608 Int_t clusSize=(*(pClusters[i]))[j].clusterSize;
1609 Double_t charge=(*(pClusters[i]))[j].clusterCharge;
1610 Int_t cntGeoId=(*(pClusters[i]))[j].centralStripGeoId;
1615 for(
int iD=0;iD<6;iD++)
1617 (*outTxtFile) <<
" In Disc " << iD <<
" we have clusters with geo id: ";
1620 vector<generalCluster>::iterator hitIter;
1621 vector<generalCluster> &hitVec=*(pClusters[iD]);
1623 for(hitIter=hitVec.begin();hitIter != hitVec.end();hitIter++)
1625 (*outTxtFile) << hitIter->centralStripGeoId <<
", ";
1626 clusterGeoId[iD]->Fill(hitIter->centralStripGeoId);
1628 Int_t rdo, arm, apv, chan;
1629 mDb->getElecCoordFromGeoId(hitIter->centralStripGeoId, rdo,arm,apv,chan);
1631 if(iD==0 && rdo==1 && arm==0){
1632 disk1QuadA[apv]->Fill(chan);
1634 if(hitIter->layer==
'R')
1636 (*outTxtFile) <<
"R ordinate: " << hitIter->posR<<endl;
1638 clustersR[iD]->Fill(hitIter->posR);
1642 Double_t phiQ=StFgtGeom::phiQuadXaxis(hitIter->quad);
1643 (*outTxtFile) <<
"Phi ordinate: " << hitIter->posPhi-phiQ<<endl;
1645 clustersP[iD]->Fill(hitIter->posPhi);
1649 (*outTxtFile)<<endl;
1651 for(
int iq=0;iq<4;iq++)
1653 for(
unsigned int i=0;i< pStrips[iD*4+iq].size();i++)
1656 if(pStrip.seedType==kFgtSeedType1|| pStrip.seedType==kFgtSeedType2 || pStrip.seedType==kFgtSeedType3)
1659 for(hitIter=hitVec.begin();hitIter != hitVec.end();hitIter++)
1661 if(abs(hitIter->centralStripGeoId-pStrip.geoId)<2)
1663 (*outTxtFile) <<
"found cluster with geo id: " << hitIter->centralStripGeoId;
1664 Double_t phiQ=StFgtGeom::phiQuadXaxis(iq);
1665 if(hitIter->layer==
'R')
1666 (*outTxtFile) <<
"R ordinate: " << hitIter->posR<<endl;
1668 (*outTxtFile) <<
"Phi ordinate: " << hitIter->posPhi-phiQ<<endl;
1672 printArea1D(iD,iq,pStrip.geoId);
1697 for(
int iD=0;iD<6;iD++)
1701 memset(clusCounts,0,
sizeof(
int)*8);
1702 vector<generalCluster> &tHitVec=*(pClusters[iD]);
1703 vector<generalCluster>::iterator tHit=tHitVec.begin();
1704 for(;tHit!=tHitVec.end();tHit++)
1707 if(!useChargeMatch || tHit->hasMatch)
1711 if(tHit->layer==
'R')
1712 clusCounts[tHit->quad]++;
1714 clusCounts[tHit->quad+4]++;
1718 for(
int iq=0;iq<4;iq++)
1720 numClustersR[iD*4+iq]->Fill(clusCounts[iq]);
1721 numClustersPhi[iD*4+iq]->Fill(clusCounts[iq+4]);
1727 for(
int iq=0;iq<4;iq++)
1729 for(
unsigned int i=0;i< pStrips[iD*4+iq].size();i++)
1731 if(pStrips[iD*4+iq][i].charge>1000)
1735 if(validPulse(pStrips[iD*4+iq][i]))
1742 set<Int_t> usedPoints;
1743 Double_t D1Pos=getLocDiscZ(0);
1744 Double_t D6Pos=getLocDiscZ(5);
1745 Double_t zArm=D6Pos-D1Pos;
1746 vector<generalCluster>::iterator hitIterD1,hitIterD6, hitIterD1R, hitIterD6R, hitIter, hitIter2;
1748 int clusCountsTemp[24];
1750 memset(clusCounts,0,
sizeof(
int)*24);
1751 memset(clusCountsTemp,0,
sizeof(
int)*24);
1753 for(
int iSeed1=0;iSeed1<5;iSeed1++)
1755 for(
int iSeed2=iSeed1+1;iSeed2<6;iSeed2++)
1759 if((iSeed2-iSeed1)<1)
1761 if(iSeed1==m_effDisk || iSeed2==m_effDisk)
1763 if(pClusters[iSeed1]->size() > MAX_CLUSTERS || pClusters[iSeed2]->size() > MAX_CLUSTERS)
1771 vector<generalCluster> &hitVecSeed1=*(pClusters[iSeed1]);
1772 vector<generalCluster> &hitVecSeed2=*(pClusters[iSeed2]);
1774 D1Pos=getLocDiscZ(iSeed1);
1775 D6Pos=getLocDiscZ(iSeed2);
1778 for(hitIterD1=hitVecSeed1.begin();hitIterD1 != hitVecSeed1.end();hitIterD1++)
1781 if(useChargeMatch && !hitIterD1->hasMatch)
1783 Short_t quadP=hitIterD1->quad;
1786 Char_t layer=hitIterD1->layer;
1788 Double_t seed1ChargePhi=hitIterD1->CHARGE_MEASURE;
1789 Double_t seed1SizePhi=hitIterD1->clusterSize;
1794 Int_t geoIdSeed1=hitIterD1->centralStripGeoId;
1795 if(usedPoints.find(geoIdSeed1)!=usedPoints.end())
1800 Float_t phiD1=hitIterD1->posPhi;
1801 for(hitIterD6=hitVecSeed2.begin();hitIterD6 != hitVecSeed2.end();hitIterD6++)
1803 if(useChargeMatch && !hitIterD6->hasMatch)
1806 Int_t geoIdSeed2=hitIterD6->centralStripGeoId;
1807 Short_t quadP_2=hitIterD6->quad;
1810 Char_t layer=hitIterD6->layer;
1811 Double_t seed2ChargePhi=hitIterD6->CHARGE_MEASURE;
1812 Double_t seed2SizePhi=hitIterD6->clusterSize;
1815 if(usedPoints.find(geoIdSeed2)!=usedPoints.end())
1817 Float_t phiD6=hitIterD6->posPhi;
1818 if(fabs(phiD6-phiD1)>MAX_PHI_DIFF)
1821 for(hitIterD1R=hitVecSeed1.begin();hitIterD1R != hitVecSeed1.end();hitIterD1R++)
1823 if(useChargeMatch && !hitIterD1R->hasMatch)
1825 Int_t geoIdSeed1R=hitIterD1R->centralStripGeoId;
1826 Short_t quadR=hitIterD1R->quad;
1829 Char_t layer=hitIterD1R->layer;
1830 Double_t seed1ChargeR=hitIterD1R->CHARGE_MEASURE;
1831 Double_t seed1SizeR=hitIterD1R->clusterSize;
1838 if(usedPoints.find(geoIdSeed1R)!=usedPoints.end())
1841 Float_t rD1=hitIterD1R->posR;
1842 Float_t xD1=rD1*cos(phiD1);
1843 Float_t yD1=rD1*sin(phiD1);
1847 for(hitIterD6R=hitVecSeed2.begin();hitIterD6R != hitVecSeed2.end();hitIterD6R++)
1849 if(useChargeMatch && !hitIterD6R->hasMatch)
1851 Int_t geoIdSeed2R=hitIterD6R->centralStripGeoId;
1852 Short_t quadR_2=hitIterD6R->quad;
1855 Char_t layer=hitIterD6R->layer;
1856 Double_t seed2ChargeR=hitIterD6R->CHARGE_MEASURE;
1858 Double_t seed2SizeR=hitIterD6R->clusterSize;
1861 if(quadP_2!=quadR_2)
1867 clusCountsTemp[iSeed1*4+quadR]++;
1868 clusCountsTemp[iSeed2*4+quadR_2]++;
1869 if(usedPoints.find(geoIdSeed2R)!=usedPoints.end())
1871 Float_t rD6=hitIterD6R->posR;
1878 vector<AVPoint> v_points;
1881 Double_t xD6=rD6*cos(phiD6);
1882 Double_t yD6=rD6*sin(phiD6);
1884 v_points.push_back(
AVPoint(xD1,yD1,D1Pos,rD1,phiD1,iSeed1,quadSeed1,seed1ChargeR, seed1ChargePhi, seed1SizeR, seed1SizePhi));
1885 v_points.push_back(
AVPoint(xD6,yD6,D6Pos,rD6,phiD6,iSeed2,quadSeed2,seed2ChargeR, seed2ChargePhi, seed2SizeR, seed2SizePhi));
1887 vector< pair<Int_t,Double_t> > v_x;
1888 vector< pair<Int_t,Double_t> > v_y;
1889 vector< pair<Int_t,Double_t> > v_r;
1891 vector< pair<Int_t,Double_t> > v_xFail;
1892 vector< pair<Int_t,Double_t> > v_yFail;
1893 vector< pair<Int_t,Double_t> > v_rFail;
1895 vector< pair< Int_t, Double_t> > v_rCharge;
1896 vector< pair< Int_t, Double_t> > v_phiCharge;
1898 vector<Int_t> v_clusterSizeR;
1899 vector<Int_t> v_clusterSizePhi;
1901 vector<Int_t> v_geoIDsR;
1902 vector<Int_t> v_geoIDsPhi;
1916 vector<generalCluster>::iterator iterClosestPhi;
1917 vector<generalCluster>::iterator iterClosestR;
1919 Double_t closestDist=999999;
1921 for(
int iD=0;iD<6;iD++)
1924 if(iD==iSeed1 || iD==iSeed2 || iD==m_effDisk)
1928 Bool_t foundR=
false;
1930 Double_t diskZ=getLocDiscZ(iD);
1933 Double_t xPosExp=xD1+(xD6-xD1)*(diskZ-D1Pos)/zArm;
1934 Double_t yPosExp=yD1+(yD6-yD1)*(diskZ-D1Pos)/zArm;
1938 Double_t rPosExp=rD1+(rD6-rD1)*(diskZ-D1Pos)/zArm;
1939 vector<generalCluster> &hitVec=*(pClusters[iD]);
1940 for(hitIter=hitVec.begin();hitIter!=hitVec.end();hitIter++)
1942 if(useChargeMatch && !hitIter->hasMatch)
1945 Int_t geoIdPhi=hitIter->centralStripGeoId;
1946 Short_t quad=hitIter->quad;
1947 Int_t quadTestPhi=quad;
1948 Short_t disc=hitIter->disc;
1949 Short_t strip=hitIter->strip;
1950 Char_t layer=hitIter->layer;
1952 if(usedPoints.find(geoIdPhi)!=usedPoints.end())
1956 Float_t phi=hitIter->posPhi;
1958 if(fabs(phi-phiD1)>MAX_PHI_DIFF)
1960 if(fabs(phi-phiD6)>MAX_PHI_DIFF)
1970 for(hitIter2=hitVec.begin();hitIter2!=hitVec.end();hitIter2++)
1972 if(useChargeMatch && !hitIter2->hasMatch)
1974 Int_t geoIdR=hitIter2->centralStripGeoId;
1975 StFgtGeom::decodeGeoId(geoIdR,disc, quad, layer, strip);
1977 if(usedPoints.find(geoIdR)!=usedPoints.end())
1983 if(quadTestR!=quadTestPhi)
1985 Float_t r=hitIter2->posR;
1995 Double_t dist2=(x-xPosExp)*(x-xPosExp)+(y-yPosExp)*(y-yPosExp);
2001 Double_t rCharge=hitIter2->CHARGE_MEASURE;
2002 Double_t phiCharge=hitIter->CHARGE_MEASURE;
2003 Int_t clusterSizeR=hitIter2->clusterSize;
2004 Int_t clusterSizePhi=hitIter->clusterSize;
2005 v_points.push_back(
AVPoint(x,y,diskZ,r,phi,iD,quadTestR, rCharge,phiCharge, clusterSizeR,clusterSizePhi));
2009 if(dist2<closestDist)
2012 iterClosestPhi=hitIter;
2013 iterClosestR=hitIter2;
2019 if(closestDist<1000 && closestDist<MAX_DIST2)
2022 clusCountsTemp[iD*4+quadTestR]++;
2025 double r=iterClosestR->posR;
2026 double phi=iterClosestPhi->posPhi;
2028 Int_t geoIdR=iterClosestR->centralStripGeoId;
2029 Int_t geoIdPhi=iterClosestPhi->centralStripGeoId;
2031 double x=r*cos(phi);
2032 double y=r*sin(phi);
2034 Double_t rCharge=iterClosestR->CHARGE_MEASURE;
2035 Double_t phiCharge=iterClosestPhi->CHARGE_MEASURE;
2036 Int_t clusterSizeR=iterClosestR->clusterSize;
2037 Int_t clusterSizePhi=iterClosestPhi->clusterSize;
2040 v_x.push_back(pair<Int_t,Double_t>(iD,x));
2041 v_y.push_back(pair<Int_t,Double_t>(iD,y));
2042 v_rCharge.push_back(pair<Int_t, Double_t>(iD,rCharge));
2043 v_phiCharge.push_back(pair<Int_t, Double_t>(iD,phiCharge));
2045 v_geoIDsPhi.push_back(geoIdPhi);
2046 v_geoIDsR.push_back(geoIdR);
2047 v_clusterSizeR.push_back(clusterSizeR);
2048 v_clusterSizePhi.push_back(clusterSizePhi);
2049 v_points.push_back(
AVPoint(x,y,diskZ,r,phi,iD,quadTestR, rCharge,phiCharge, clusterSizeR,clusterSizePhi));
2058 v_xFail.push_back(pair<Int_t,Double_t>(iD,xPosExp));
2059 v_yFail.push_back(pair<Int_t,Double_t>(iD,yPosExp));
2066 v_rFail.push_back(pair<Int_t, Double_t>(iD,rPosExp));
2076 if(iFound>=(MIN_NUM_POINTS-2))
2079 Bool_t validTrack=
false;
2085 validTrack=
getTrack(v_points, ipZ);
2090 for(Int_t iD=0;iD<kFgtNumDiscs;iD++){
2091 for(
int iq=0;iq<4;iq++){
2092 clusCounts[iD*4+iq]+=clusCountsTemp[iD*4+iq];
2107 for(
unsigned int i=0;i<v_x.size();i++)
2112 usedPoints.insert(geoIdSeed1);
2113 usedPoints.insert(geoIdSeed1R);
2114 usedPoints.insert(geoIdSeed2);
2115 usedPoints.insert(geoIdSeed2R);
2147 memset(clusCountsTemp,0,
sizeof(
int)*24);
2159 for(Int_t iD=0;iD<kFgtNumDiscs;iD++){
2160 for(
int iq=0;iq<4;iq++){
2163 numTrackHits[iD*4+iq]->Fill(clusCounts[iD*4+iq]);
2168 numTracks->Fill(m_tracks.size()-oldNumTracks);
2174 StFgtGenAVEMaker::StFgtGenAVEMaker(
const Char_t* name):
StFgtGeneralBase( name ),useChargeMatch(false),runningEvtNr(0),hitCounter(0),hitCounterR(0),printCounter(0),fitCounter(0)
2179 mPulseShapePtr=
new TF1(
"pulseShape",
"[0]*(x>[4])*(x-[4])**[1]*exp(-[2]*(x-[4]))+[3]",0,numTb);
2180 mPulseShapePtr->SetParName( 0,
"C" );
2181 mPulseShapePtr->SetParName( 1,
"a" );
2182 mPulseShapePtr->SetParName( 2,
"b" );
2183 mPulseShapePtr->SetParName( 3,
"ped" );
2184 mPulseShapePtr->SetParName( 4,
"t0" );
2186 mHistPtr=
new TH1F(
"tempFitHist",
"tempFitHist",numTb,0,numTb);
2187 mHistPtr2=
new TH1F(
"tempFitHist2",
"tempFitHist2",numTb,0,numTb);
2188 mHistPtr2->SetLineColor(kBlue);
2189 mHistPtr2->SetFillColor(kBlue);
2190 mHistPtr2->SetMarkerColor(kBlue);
2191 mCanvas=
new TCanvas(
"tmpCnvs",
"tmpCnvs");
2194 StFgtGenAVEMaker::~StFgtGenAVEMaker()
2202 cout <<
" closing txt file " << endl;
2203 outTxtFile->close();
2204 gStyle->SetPalette(1);
2205 cout <<
"AVE finish function " <<endl;
2209 vector<AVTrack>::iterator it=m_tracks.begin();
2210 cout <<
"we found " << m_tracks.size() <<
" tracks" <<endl;
2213 for(;it!=m_tracks.end();it++)
2215 cout <<
" looking at track " << counter <<endl;
2218 cout <<
" mx: " << it->mx <<
" my: " << it->my <<
" bx: " << it->ax <<
" by: " << it->ay <<
" chi2: " << it->chi2 <<endl;
2219 Double_t vertZ = ( -( it->mx*it->ax + it->my*it->ay )/(it->mx*it->mx+it->my*it->my));
2221 pair<double,double> dca=
getDca(it);
2223 if(it->chi2<MAX_DIST_CHI && fabs(vertZ)< VERTEX_CUT )
2226 cout <<
"looking at track with mx: " << it->mx <<
" ax: " << it->ax <<
" my: " << it->my <<
" ay: " << it->ay <<endl;
2227 hIpZ->Fill(dca.first);
2228 hIp->Fill(dca.first,dca.second);
2234 hChi2->Fill(it->chi2);
2235 tpcFgtZVertexCorr->Fill(dca.first,it->ipZEv);
2236 tpcFgtZVertexCorr2->Fill(vertZ,it->ipZEv);
2237 tpcFgtZVertexCorr3->Fill(vertZ,dca.first);
2238 hIpDca->Fill(dca.second);
2241 cout <<
" we found " << goodTracks <<
" good Tracks " <<endl;
2244 TCanvas* cRadio=
new TCanvas(
"radioPlots",
"radioPlot",1000,1500);
2245 TCanvas* cRadioLoose=
new TCanvas(
"radioPlotsLoose",
"radioPlotLoose",1000,1500);
2246 TCanvas* cRadioR=
new TCanvas(
"radioPlotsR",
"radioPlotR",1000,1500);
2247 TCanvas* cRadioPhi=
new TCanvas(
"radioPlotsPhi",
"radioPlotPhi",1000,1500);
2249 TCanvas* cRadioHits=
new TCanvas(
"radioPlotsHits",
"radioPlotHits",1000,1500);
2250 TCanvas* cRadioNonHits=
new TCanvas(
"radioPlotsNonHits",
"radioPlotNonHits",1000,1500);
2252 cRadio->Divide(2,3);
2253 cRadioR->Divide(2,3);
2254 cRadioPhi->Divide(2,3);
2255 cRadioLoose->Divide(2,3);
2256 cRadioHits->Divide(2,3);
2257 cRadioNonHits->Divide(2,3);
2258 TCanvas* cRPRatio=
new TCanvas(
"rPhiRatio",
"rPhiRatios",1000,1500);
2259 cRPRatio->Divide(2,3);
2261 TCanvas* cREff=
new TCanvas(
"crEff",
"crEff",1000,1500);
2265 for(Int_t iD=0;iD<kFgtNumDiscs;iD++)
2268 cRadioHits->cd(iD+1);
2269 radioPlotsEff[iD]->Draw(
"colz");
2270 cRadioNonHits->cd(iD+1);
2271 radioPlotsNonEff[iD]->Draw(
"colz");
2276 sprintf(buffer,
"%s/clusterPics.root",fileBase);
2277 cout <<
"setting cluster pic file to : " << buffer <<endl;
2278 TFile *fClu =
new TFile(buffer,
"recreate");
2281 for(
unsigned int i=0;i<v_hClusP.size();i++)
2283 (v_hClusP[i])->
Write();
2285 for(
unsigned int i=0;i<v_hClusR.size();i++)
2287 (v_hClusR[i])->
Write();
2291 sprintf(buffer,
"%s/signalShapes.root",fileBase);
2292 cout <<
"setting signal shapes file to : " << buffer <<endl;
2293 TFile *f1 =
new TFile(buffer,
"recreate");
2297 for(
int iB=1;iB<8;iB++)
2299 exPulseMaxAdcNormP->SetBinContent(iB,exPulseMaxAdcNormP->GetBinContent(iB)/(float)pulseCounterP);
2300 exPulseSigP->SetBinContent(iB,exPulseSigP->GetBinContent(iB)/(float)pulseCounterP);
2302 exPulseMaxAdcNormR->SetBinContent(iB,exPulseMaxAdcNormR->GetBinContent(iB)/(float)pulseCounterR);
2303 exPulseSigR->SetBinContent(iB,exPulseSigR->GetBinContent(iB)/(float)pulseCounterR);
2305 exPulseMaxAdcNormTrackP->SetBinContent(iB,exPulseMaxAdcNormTrackP->GetBinContent(iB)/(float)pulseCounterTP);
2306 exPulseSigTrackP->SetBinContent(iB,exPulseSigTrackP->GetBinContent(iB)/(float)pulseCounterTP);
2308 exPulseMaxAdcNormTrackR->SetBinContent(iB,exPulseMaxAdcNormTrackR->GetBinContent(iB)/(float)pulseCounterTR);
2309 exPulseSigTrackR->SetBinContent(iB,exPulseSigTrackR->GetBinContent(iB)/(float)pulseCounterTR);
2313 chargeCorrSum3->Write();
2314 chargeCorrMaxStrip->Write();
2315 chargeCorrMaxAdc->Write();
2317 exPulseMaxAdcNormP->Write();
2318 exPulseSigP->Write();
2320 exPulseMaxAdcNormR->Write();
2321 exPulseSigR->Write();
2323 exPulseMaxAdcNormTrackP->Write();
2324 exPulseSigTrackP->Write();
2326 exPulseMaxAdcNormTrackR->Write();
2327 exPulseSigTrackR->Write();
2331 for(
int xx=0; xx<22; xx++){
2333 disk1QuadA[xx]->Write();
2338 for(
int iD=0;iD<kFgtNumDiscs;iD++)
2343 clusterGeoId[iD]->Write();
2344 clustersR[iD]->Write();
2345 clustersP[iD]->Write();
2348 for(
int iq=0;iq<4;iq++)
2350 numClustersR[iD*4+iq]->Write();
2351 numClustersPhi[iD*4+iq]->Write();
2352 numTrackHits[iD*4+iq]->Write();
2355 maxTbCloseClusterP[iD*4+iq]->Write();
2356 maxTbCloseClusterR[iD*4+iq]->Write();
2357 maxAdcCloseClusterP[iD*4+iq]->Write();
2358 maxSigTrackClusterP[iD*4+iq]->Write();
2359 numFSigCloseClusterP[iD*4+iq]->Write();
2360 numFirstHighCloseClusterP[iD*4+iq]->Write();
2361 maxAdcCloseClusterP[iD*4+iq]->Write();
2362 maxSigCloseClusterP[iD*4+iq]->Write();
2363 secondToLastRatioCloseClusterP[iD*4+iq]->Write();
2364 maxAdcCloseClusterR[iD*4+iq]->Write();
2365 maxSigCloseClusterR[iD*4+iq]->Write();
2366 numFSigCloseClusterR[iD*4+iq]->Write();
2367 numFirstHighCloseClusterR[iD*4+iq]->Write();
2368 maxAdcCloseClusterR[iD*4+iq]->Write();
2369 maxSigCloseClusterR[iD*4+iq]->Write();
2370 secondToLastRatioCloseClusterR[iD*4+iq]->Write();
2371 firstTbSigCloseClusterR[iD*4+iq]->Write();
2372 firstTbSigCloseClusterP[iD*4+iq]->Write();
2374 maxTbTrackClusterP[iD*4+iq]->Write();
2375 maxTbTrackClusterR[iD*4+iq]->Write();
2376 maxAdcTrackClusterP[iD*4+iq]->Write();
2377 maxSigTrackClusterP[iD*4+iq]->Write();
2378 numFSigTrackClusterP[iD*4+iq]->Write();
2379 numFirstHighTrackClusterP[iD*4+iq]->Write();
2380 maxAdcTrackClusterP[iD*4+iq]->Write();
2381 maxSigTrackClusterP[iD*4+iq]->Write();
2382 secondToLastRatioTrackClusterP[iD*4+iq]->Write();
2383 maxAdcTrackClusterR[iD*4+iq]->Write();
2384 maxSigTrackClusterR[iD*4+iq]->Write();
2385 numFSigTrackClusterR[iD*4+iq]->Write();
2386 numFirstHighTrackClusterR[iD*4+iq]->Write();
2387 maxAdcTrackClusterR[iD*4+iq]->Write();
2388 maxSigTrackClusterR[iD*4+iq]->Write();
2389 secondToLastRatioTrackClusterR[iD*4+iq]->Write();
2390 firstTbSigTrackClusterR[iD*4+iq]->Write();
2391 firstTbSigTrackClusterP[iD*4+iq]->Write();
2396 for(
int iD=0;iD<6;iD++)
2398 for(
int binAPVi=0;binAPVi<40;binAPVi++)
2400 APVfitChi2P[iD*40+binAPVi]->Write();
2401 APVfitChi2R[iD*40+binAPVi]->Write();
2402 APVfitAmpP[iD*40+binAPVi]->Write();
2403 APVfitAmpR[iD*40+binAPVi]->Write();
2404 APVfitT0P[iD*40+binAPVi]->Write();
2405 APVfitT0R[iD*40+binAPVi]->Write();
2407 APVfirstTbSigCloseClusterP[iD*40+binAPVi]->Write();
2408 APVmaxAdcCloseClusterP[iD*40+binAPVi]->Write();
2409 APVmaxTbCloseClusterP[iD*40+binAPVi]->Write();
2410 APVnumFSigCloseClusterP[iD*40+binAPVi]->Write();
2411 APVnumFirstHighCloseClusterP[iD*40+binAPVi]->Write();
2412 APVmaxSigCloseClusterP[iD*40+binAPVi]->Write();
2413 APVsecondToLastRatioCloseClusterP[iD*40+binAPVi]->Write();
2414 APVfirstTbSigCloseClusterR[iD*40+binAPVi]->Write();
2415 APVmaxAdcCloseClusterR[iD*40+binAPVi]->Write();
2416 APVmaxTbCloseClusterR[iD*40+binAPVi]->Write();
2417 APVnumFSigCloseClusterR[iD*40+binAPVi]->Write();
2418 APVnumFirstHighCloseClusterR[iD*40+binAPVi]->Write();
2419 APVmaxSigCloseClusterR[iD*40+binAPVi]->Write();
2420 APVsecondToLastRatioCloseClusterR[iD*40+binAPVi]->Write();
2425 cout <<
"writen and closed " << endl;
2427 cout <<
"drawing hits2 " <<endl;
2431 TCanvas* cClusterSizeR=
new TCanvas(
"clusterSizeR",
"clusterSizeR",1000,1500);
2432 cClusterSizeR->Divide(2,3);
2433 TCanvas* cClusterSizePhi=
new TCanvas(
"clusterSizePhi",
"clusterSizePhi",1000,1500);
2434 cClusterSizePhi->Divide(2,3);
2435 TCanvas* cChargeCorr=
new TCanvas(
"chargeCorr",
"chargeCorr",1000,1500);
2436 cChargeCorr->Divide(3,4);
2438 TCanvas* cClusterChargePhi=
new TCanvas(
"clusterChargePhi",
"clusterChargePhi",1000,1500);
2439 cClusterChargePhi->Divide(2,3);
2440 TCanvas* cClusterChargeR=
new TCanvas(
"clusterChargeR",
"clusterChargeR",1000,1500);
2441 cClusterChargeR->Divide(2,3);
2492 tpcFgtZVertexCorr->Draw(
"colz");
2493 tpcFgtZVertexCorr->Write();
2496 tpcFgtZVertexCorr2->Draw(
"colz");
2497 tpcFgtZVertexCorr2->Write();
2499 tpcFgtZVertexCorr3->Draw(
"colz");
2500 tpcFgtZVertexCorr3->Write();
2504 for(Int_t iD=0;iD<kFgtNumDiscs;iD++)
2506 cClusterSizeR->cd(iD+1);
2507 h_clusterSizeR[iD]->Draw();
2508 cClusterSizePhi->cd(iD+1);
2509 h_clusterSizePhi[iD]->Draw();
2510 for(
int iq=0;iq<4;iq++)
2512 cChargeCorr->cd(iD*4+iq+1);
2513 chargeCorr[iD*4+iq]->Draw(
"colz");
2514 chargeCorr[iD*4+iq]->Write();
2515 clusterSizeR[iD*4+iq]->Write();
2516 clusterSizeP[iD*4+iq]->Write();
2518 cClusterChargeR->cd(iD+1);
2519 h_clusterChargeR[iD]->Draw();
2520 cClusterChargePhi->cd(iD+1);
2521 h_clusterChargePhi[iD]->Draw();
2522 h_clusterChargeR[iD]->Write();
2523 h_clusterChargePhi[iD]->Write();
2534 cout <<
"saving .." <<endl;
2535 doNormalize(radioPlotsEffR, radioPlotsNonEffR);
2536 doNormalize(radioPlotsEffPhi, radioPlotsNonEffPhi);
2539 for(Int_t iD=0;iD<kFgtNumDiscs;iD++)
2541 sprintf(buffer,
"allCountsLooseDisk_%d",iD+1);
2542 TH2D* tmpAllCountsLoose=(TH2D*)radioPlotsEffLoose[iD]->
Clone(buffer);
2543 tmpAllCountsLoose->Write();
2544 sprintf(buffer,
"allClusterCountsDisk_%d",iD+1);
2545 TH2D* tmpAllClusterCounts=(TH2D*)radioPlotsEff[iD]->
Clone(buffer);
2546 tmpAllClusterCounts->Write();
2549 doNormalize(radioPlotsEffLoose, radioPlotsNonEffLoose);
2552 for(Int_t iD=0;iD<kFgtNumDiscs;iD++)
2555 sprintf(buffer,
"allCountsDisk_%d",iD+1);
2556 TH2D* tmpAllCounts=(TH2D*)radioPlotsEff[iD]->
Clone(buffer);
2557 tmpAllCounts->Write();
2558 radioPlotsEff[iD]->Add(radioPlotsNonEff[iD]);
2562 for(
int nx=1;nx<radioPlotsEff[iD]->GetNbinsX()+1;nx++)
2564 for(
int ny=1;ny<radioPlotsEff[iD]->GetNbinsY()+1;ny++)
2566 Double_t denom=radioPlotsEff[iD]->GetBinContent(nx,ny);
2567 if(denom>0 && (tmpAllCounts->GetBinContent(nx,ny)/denom)<=1.0)
2570 radioPlotsEff[iD]->SetBinContent(nx,ny,tmpAllCounts->GetBinContent(nx,ny)/denom);
2574 chargeRatioInEffDisk->SetBinContent(nx,ny,chargeRatioInEffDisk->GetBinContent(nx,ny)/denom);
2575 chargeAsymInEffDisk->SetBinContent(nx,ny,chargeAsymInEffDisk->GetBinContent(nx,ny)/denom);
2581 radioPlotsEff[iD]->SetBinContent(nx,ny,0.0);
2586 radioPlotsEff[iD]->SetMaximum(1.0);
2587 radioPlotsEff[iD]->Draw(
"colz");
2589 radioPlotsEffR[iD]->SetMaximum(1.0);
2590 radioPlotsEffPhi[iD]->SetMaximum(1.0);
2591 radioPlotsEffLoose[iD]->SetMaximum(1.0);
2593 radioPlotsEffR[iD]->Draw(
"colz");
2594 radioPlotsEffR[iD]->Write();
2595 cRadioPhi->cd(iD+1);
2596 radioPlotsEffPhi[iD]->Draw(
"colz");
2597 radioPlotsEffPhi[iD]->Write();
2598 cRadioLoose->cd(iD+1);
2599 radioPlotsEffLoose[iD]->Draw(
"colz");
2600 radioPlotsEffLoose[iD]->Write();
2601 radioPlotsNonEffLoose[iD]->Write();
2602 radioPlotsNonEff[iD]->Write();
2604 rPhiRatioPlots[iD]->Draw();
2608 TH1D* tmpR=(TH1D*)rEff[iD]->
Clone(
"tmpR");
2609 rEff[iD]->Add(rNonEff[iD]);
2610 for(
int nx=0;nx<rEff[iD]->GetNbinsX();nx++)
2612 Double_t denom=rEff[iD]->GetBinContent(nx);
2614 rEff[iD]->SetBinContent(nx,tmpR->GetBinContent(nx)/denom);
2616 rEff[iD]->SetBinContent(nx,0.0);
2629 chargeRatioInEffDisk->Draw(
"colz");
2631 chargeAsymInEffDisk->Draw(
"colz");
2633 chargeCorrInEffDisk->Draw(
"colz");
2634 chargeCorrInEffDisk->Write();
2636 hChargeAsym->Draw();
2638 hChargeRatio->Draw();
2650 myRootFile->Write();
2651 myRootFile->Close();
2653 pulsePictureFile->Write();
2654 cout <<
"returning after finish" <<endl;
2663 Int_t StFgtGenAVEMaker::Init(){
2664 outTxtFile=
new ofstream;
2665 outTxtFile->open(
"clusExpectations.txt");
2666 cluNotFoundTxt=
new ofstream;
2667 cluNotFoundTxt->open(
"clusNotFound.txt");
2668 cout <<
"AVE!!" <<endl;
2669 myRootFile=
new TFile(
"clusterEff.root",
"RECREATE");
2670 pulsePictureFile=
new TFile(
"pulsePics.root",
"RECREATE");
2673 for(
int i=0;i<6;i++){
2674 for(
int iq=0;iq<4;iq++){
2675 sprintf(buffer,
"d%d_quad%d",i,iq);
2676 pulsePictureFile->mkdir(buffer);
2677 pulsePictureFile->cd(buffer);
2678 for(
int iA=0;iA<24;iA++)
2680 sprintf(buffer,
"apv%d_R",iA);
2681 gDirectory->mkdir(buffer);
2682 sprintf(buffer,
"apv%d_P",iA);
2683 gDirectory->mkdir(buffer);
2685 pulsePictureFile->cd();
2695 chargeRatioInEffDisk=
new TH2D(
"chargeRatioInEffDisk",
"chargeRatioInEffDisk",NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2696 chargeRatioInEffDisk->SetMaximum(2.0);
2697 chargeAsymInEffDisk=
new TH2D(
"chargeAsymInEffDisk",
"chargeAsymInEffDisk",NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2698 chargeAsymInEffDisk->SetMaximum(1.0);
2699 chargeCorrInEffDisk=
new TH2D(
"chargeCorrInEffDisk",
"chargeCorrInEffDisk",500,0,50000,500,0,50000);
2700 hChargeAsym=
new TH1D(
"chargeAsym",
"chargeAsym",100,0,50);
2701 hChargeRatio=
new TH1D(
"chargeRatio",
"chargeRatio",100,0,50);
2704 chargeCorrSum3=
new TH2D(
"chargeCorrSum3",
"chargeCorrSum3",500,0,50000,500,0,50000);
2705 chargeCorrMaxStrip=
new TH2D(
"chargeCorrMaxStrip",
"chargeCorrMaxStrip",500,0,20000,500,0,20000);
2706 chargeCorrMaxAdc=
new TH2D(
"chargeCorrMaxAdc",
"chargeCorrMaxAdc",500,0,5000,500,0,5000);
2709 radioPlotsEff=
new TH2D*[kFgtNumDiscs];
2710 radioPlotsNonEff=
new TH2D*[kFgtNumDiscs];
2711 radioPlotsEffR=
new TH2D*[kFgtNumDiscs];
2712 radioPlotsNonEffR=
new TH2D*[kFgtNumDiscs];
2713 radioPlotsEffPhi=
new TH2D*[kFgtNumDiscs];
2714 radioPlotsEffLoose=
new TH2D*[kFgtNumDiscs];
2715 radioPlotsNonEffPhi=
new TH2D*[kFgtNumDiscs];
2716 radioPlotsNonEffLoose=
new TH2D*[kFgtNumDiscs];
2717 rPhiRatioPlots=
new TH1D*[kFgtNumDiscs];
2720 exPulseMaxAdcNormP=
new TH1F(
"pulseMaxAdcNormP",
"pulseMaxAdcNormP",7,0,6);
2721 exPulseSigP=
new TH1F(
"pulseSigNormP",
"pulseSigNormP",7,0,6);
2723 exPulseMaxAdcNormR=
new TH1F(
"pulseMaxAdcNormR",
"pulseMaxAdcNormR",7,0,6);
2724 exPulseSigR=
new TH1F(
"pulseSigNormR",
"pulseSigNormR",7,0,6);
2726 exPulseMaxAdcNormTrackP=
new TH1F(
"pulseMaxAdcNormTrackP",
"pulseMaxAdcNormTrackP",7,0,6);
2727 exPulseSigTrackP=
new TH1F(
"pulseSigNormTrackP",
"pulseSigNormTrackP",7,0,6);
2729 exPulseMaxAdcNormTrackR=
new TH1F(
"pulseMaxAdcNormTrackR",
"pulseMaxAdcNormTrackR",7,0,6);
2730 exPulseSigTrackR=
new TH1F(
"pulseSigNormTrackR",
"pulseSigNormTrackR",7,0,6);
2739 createPlots(&numClustersR,kFgtNumDiscs*4,
"numClustersR",101,0,100);
2740 createPlots(&numClustersPhi,kFgtNumDiscs*4,
"numClustersPhi",101,0,100);
2741 createPlots(&numTrackHits,kFgtNumDiscs*4,
"numTrackHits",101,0,100);
2742 numTracks=
new TH1I(
"numTracksPerEvent",
"numTracksPerEvent",101,0,100);
2744 createPlots(&firstTbSigCloseClusterR,kFgtNumDiscs*4,
"firstTbSigCloseClusterR",100,0,20);
2745 createPlots(&firstTbSigCloseClusterP,kFgtNumDiscs*4,
"firstTbSigCloseClusterP",100,0,20);
2746 createPlots(&firstTbSigTrackClusterR,kFgtNumDiscs*4,
"firstTbSigTrackClusterR",100,0,20);
2747 createPlots(&firstTbSigTrackClusterP,kFgtNumDiscs*4,
"firstTbSigTrackClusterP",100,0,20);
2750 createPlots(&maxAdcTrackClusterR,kFgtNumDiscs*4,
"maxAdcTrackClusterR",100,0,5000);
2751 createPlots(&maxAdcCloseClusterR,kFgtNumDiscs*4,
"maxAdcCloseClusterR",100,0,5000);
2752 createPlots(&maxSigTrackClusterR,kFgtNumDiscs*4,
"maxSigTrackClusterR",100,1,200);
2753 createPlots(&maxSigCloseClusterR,kFgtNumDiscs*4,
"maxSigCloseClusterR",100,1,200);
2754 createPlots(&numFSigTrackClusterR,kFgtNumDiscs*4,
"numFSigTrackClusterR",9,1,8);
2755 createPlots(&maxTbCloseClusterR,kFgtNumDiscs*4,
"maxTbCloseClusterR",8,0,7);
2757 createPlots(&maxTbCloseClusterP,kFgtNumDiscs*4,
"maxTbCloseClusterP",8,0,7);
2759 createPlots(&maxTbTrackClusterR,kFgtNumDiscs*4,
"maxTbTrackClusterR",8,0,7);
2761 createPlots(&maxTbTrackClusterP,kFgtNumDiscs*4,
"maxTbTrackClusterP",9,0,8);
2762 createPlots(&numFSigCloseClusterR,kFgtNumDiscs*4,
"numFSigCloseClusterR",9,0,8);
2764 createPlots(&numFirstHighTrackClusterR,kFgtNumDiscs*4,
"numFirstHighTrackClusterR",8,0,7);
2765 createPlots(&numFirstHighCloseClusterR,kFgtNumDiscs*4,
"numFirstHighCloseClusterR",8,0,7);
2767 createPlots(&maxAdcTrackClusterP,kFgtNumDiscs*4,
"maxAdcTrackClusterP",100,0,5000);
2768 createPlots(&maxAdcCloseClusterP,kFgtNumDiscs*4,
"maxAdcCloseClusterP",100,0,5000);
2769 createPlots(&maxSigTrackClusterP,kFgtNumDiscs*4,
"maxSigTrackClusterP",100,1,200);
2770 createPlots(&maxSigCloseClusterP,kFgtNumDiscs*4,
"maxSigCloseClusterP",100,1,200);
2771 createPlots(&numFSigTrackClusterP,kFgtNumDiscs*4,
"numFSigTrackClusterP",9,0,8);
2772 createPlots(&numFSigCloseClusterP,kFgtNumDiscs*4,
"numFSigCloseClusterP",9,0,8);
2773 createPlots(&numFirstHighTrackClusterP,kFgtNumDiscs*4,
"numFirstHighTrackClusterP",8,0,7);
2774 createPlots(&numFirstHighCloseClusterP,kFgtNumDiscs*4,
"numFirstHighCloseClusterP",8,0,7);
2775 createPlots(&secondToLastRatioCloseClusterP,kFgtNumDiscs*4,
"secondToLastRatioClosClusterP",100,0,5);
2777 createPlots(&secondToLastRatioCloseClusterR,kFgtNumDiscs*4,
"secondToLastRatioClosClusterR",100,0,5);
2779 createPlots(&secondToLastRatioTrackClusterP,kFgtNumDiscs*4,
"secondToLastRatioTrackClusterP",100,0,5);
2781 createPlots(&secondToLastRatioTrackClusterR,kFgtNumDiscs*4,
"secondToLastRatioTrackClusterR",100,0,5);
2785 createPlots(&APVfitChi2P,kFgtNumDiscs*40,
"APVfitChi2P",100,0,30);
2786 createPlots(&APVfitChi2R,kFgtNumDiscs*40,
"APVfitChi2R",100,0,30);
2787 createPlots(&APVfitAmpP,kFgtNumDiscs*40,
"APVfitAmpP",100,0,30);
2788 createPlots(&APVfitAmpR,kFgtNumDiscs*40,
"APVfitAmpR",100,0,30);
2789 createPlots(&APVfitT0P,kFgtNumDiscs*40,
"APVfitT0P",100,0,30);
2790 createPlots(&APVfitT0R,kFgtNumDiscs*40,
"APVfitT0R",100,0,30);
2792 createPlots(&APVfirstTbSigCloseClusterP,kFgtNumDiscs*40,
"APVfirstTbSigCloseClusterP",100,0,20);
2793 createPlots(&APVfirstTbSigCloseClusterR,kFgtNumDiscs*40,
"APVfirstTbSigCloseClusterR",100,0,20);
2794 createPlots(&APVmaxAdcCloseClusterP,kFgtNumDiscs*40,
"APVmaxAdcCloseClusterP",100,0,5000);
2795 createPlots(&APVmaxAdcCloseClusterR,kFgtNumDiscs*40,
"APVmaxAdcCloseClusterR",100,0,5000);
2796 createPlots(&APVmaxTbCloseClusterP,kFgtNumDiscs*40,
"APVmaxTbCloseClusterP",8,0,7);
2797 createPlots(&APVmaxTbCloseClusterR,kFgtNumDiscs*40,
"APVmaxTbCloseClusterR",8,0,7);
2798 createPlots(&APVnumFSigCloseClusterP,kFgtNumDiscs*40,
"APVnumFSigCloseClusterP",9,0,8);
2799 createPlots(&APVnumFSigCloseClusterR,kFgtNumDiscs*40,
"APVnumFSigCloseClusterR",9,0,8);
2800 createPlots(&APVnumFirstHighCloseClusterP,kFgtNumDiscs*40,
"APVnumFirstHighCloseClusterP",8,0,7);
2801 createPlots(&APVnumFirstHighCloseClusterR,kFgtNumDiscs*40,
"APVnumFirstHighCloseClusterR",8,0,7);
2802 createPlots(&APVmaxSigCloseClusterP,kFgtNumDiscs*40,
"APVmaxSigCloseClusterP",100,1,200);
2803 createPlots(&APVmaxSigCloseClusterR,kFgtNumDiscs*40,
"APVmaxSigCloseClusterR",100,1,200);
2804 createPlots(&APVsecondToLastRatioCloseClusterP,kFgtNumDiscs*40,
"APVsecondToLastRatioCloseClusterP",100,0,5);
2805 createPlots(&APVsecondToLastRatioCloseClusterR,kFgtNumDiscs*40,
"APVsecondToLastRatioCloseClusterR",100,0,5);
2809 createPlots(&clusterGeoId, kFgtNumDiscs,
"clusterGeoId",32000,0,32000);
2810 createPlots(&clustersR, kFgtNumDiscs,
"clustersR", 500, 0, 50);
2811 createPlots(&clustersP, kFgtNumDiscs,
"clustersP", 100, -3.14159, 3.14159);
2813 for (Int_t iii=0;iii< 22;iii++)
2816 sprintf(buffer,
"%s_APV%d",
"disk1QuadA",iii);
2817 disk1QuadA[iii]=
new TH1I(buffer,buffer,128,0,128);
2820 rEff=
new TH1D*[kFgtNumDiscs];
2821 rNonEff=
new TH1D*[kFgtNumDiscs];
2824 clusterSizeP=
new TH1D*[kFgtNumDiscs*4];
2825 clusterSizeR=
new TH1D*[kFgtNumDiscs*4];
2826 chargeCorr=
new TH2D*[kFgtNumDiscs*4];
2827 h_clusterSizeR=
new TH1D*[kFgtNumDiscs];
2828 h_clusterSizePhi=
new TH1D*[kFgtNumDiscs];
2830 h_clusterChargeR=
new TH1D*[kFgtNumDiscs];
2831 h_clusterChargePhi=
new TH1D*[kFgtNumDiscs];
2834 hIp=
new TH2D(
"Proj_to_IP",
"Proj_to_Ip",50,-100,100,50,-100,100);
2835 hBx=
new TH1D(
"hBx",
"hBx",50,-100,100);
2836 hBy=
new TH1D(
"hBy",
"hBy",50,-100,100);
2837 hMx=
new TH1D(
"hMx",
"hMx",50,-100,100);
2838 hMy=
new TH1D(
"hMy",
"My",50,-0.1,0.1);
2839 hIpZ=
new TH1D(
"IP_Z",
"IP_Z",50,-100,100);
2841 hIpDca=
new TH1D(
"ipDCA",
"ipDCA",50,-100,100);
2842 hTrkZ=
new TH1D(
"z_Vtx_From_trk_fit",
"z_Vtx_From_trk_fit",50,-100,100);
2843 hResidua=
new TH1D(
"residua",
"residua",100,0,2);
2844 hResiduaX=
new TH2D(
"residuaX",
"residuaX",100,-10,10,200,0,1.0);
2845 hResiduaY=
new TH2D(
"residuaY",
"residuaY",100,-40,-20,200,0,1.0);
2846 hResiduaR=
new TH2D(
"residuaR",
"residuaR",100,12,32,200,0,1.0);
2847 hResiduaP=
new TH2D(
"residuaP",
"residuaP",100,0,0.8,200,0,1.0);
2850 hChi2=
new TH1D(
"chi2",
"chi2",50,0,2);
2851 tpcFgtZVertexCorr=
new TH2D(
"tpc_fgt_corr",
"tpc_fgt_corr",100,-120,120,100,-120,120);
2852 tpcFgtZVertexCorr2=
new TH2D(
"tpc_fgt_corr2",
"tpc_fgt_corr2",100,-120,120,100,-120,120);
2853 tpcFgtZVertexCorr3=
new TH2D(
"fgt_fgt_corr",
"fgt_fgt_corr",50,-50,50,50,-50,50);
2855 for(
int iD=0;iD<kFgtNumDiscs;iD++)
2858 sprintf(buffer,
"radioDiskEff_%d",iD);
2859 radioPlotsEff[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2861 sprintf(buffer,
"radioDiskEffR_%d",iD);
2862 radioPlotsEffR[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2864 sprintf(buffer,
"radioDiskEffPhi_%d",iD);
2865 radioPlotsEffPhi[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2867 sprintf(buffer,
"radioDiskEffLoose_%d",iD);
2868 radioPlotsEffLoose[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2870 sprintf(buffer,
"rEff_%d",iD);
2871 rEff[iD]=
new TH1D(buffer,buffer,100,0,DISK_DIM);
2872 sprintf(buffer,
"rNonEff_%d",iD);
2873 rNonEff[iD]=
new TH1D(buffer,buffer,100,0,DISK_DIM);
2874 sprintf(buffer,
"clusterSizeR_Disk_%d",iD);
2875 h_clusterSizeR[iD]=
new TH1D(buffer,buffer,20,0,20);
2876 h_clusterSizeR[iD]->SetFillColor(kYellow);
2877 sprintf(buffer,
"clusterSizePhi_Disk_%d",iD);
2878 h_clusterSizePhi[iD]=
new TH1D(buffer,buffer,20,0,20);
2879 h_clusterSizePhi[iD]->SetFillColor(kYellow);
2880 sprintf(buffer,
"clusterChargeR_Disk_%d",iD);
2881 h_clusterChargeR[iD]=
new TH1D(buffer,buffer,100,0,5000);
2882 h_clusterChargeR[iD]->SetFillColor(kYellow);
2884 sprintf(buffer,
"clusterChargePhi_Disk_%d",iD);
2885 h_clusterChargePhi[iD]=
new TH1D(buffer,buffer,100,0,5000);
2886 h_clusterChargePhi[iD]->SetFillColor(kYellow);
2888 for(
int nx=0;nx<radioPlotsEff[iD]->GetNbinsX();nx++)
2890 for(
int ny=0;ny<radioPlotsEff[iD]->GetNbinsY();ny++)
2896 for(
int iq=0;iq<4;iq++)
2898 sprintf(buffer,
"r_phi_ChargeCorrelationInDisk_%d_quad_%d",iD+1,iq);
2899 chargeCorr[iD*4+iq]=
new TH2D(buffer,buffer,200,0,70000,200,0,70000);
2900 sprintf(buffer,
"clusterSizeRInDisk_%d_quad_%d",iD+1,iq);
2901 clusterSizeR[iD*4+iq]=
new TH1D(buffer,buffer,100,0,100);
2902 sprintf(buffer,
"clusterSizePInDisk_%d_quad_%d",iD+1,iq);
2903 clusterSizeP[iD*4+iq]=
new TH1D(buffer,buffer,100,0,100);
2905 sprintf(buffer,
"radioDiskNonEff_%d",iD);
2906 radioPlotsNonEff[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2908 sprintf(buffer,
"radioDiskNonEffR_%d",iD);
2909 radioPlotsNonEffR[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2910 sprintf(buffer,
"radioDiskNonEffPhi_%d",iD);
2911 radioPlotsNonEffPhi[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2912 sprintf(buffer,
"radioDiskNonEffLoose_%d",iD);
2913 radioPlotsNonEffLoose[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2914 for(
int nx=0;nx<rEff[iD]->GetNbinsX();nx++)
2918 sprintf(buffer,
"rPhiRatio_%d",iD);
2919 rPhiRatioPlots[iD]=
new TH1D(buffer,buffer,100,-2,10);
Short_t getQuadFromCoo(Double_t x, Double_t y)
this is too naive..., assumes non-rotated quads
Double_t findClosestPoint(float mx, float bx, float my, float by, double xE, double yE, Int_t iD)
virtual TObject * Clone(const char *newname="") const
the custom implementation fo the TObject::Clone
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
void fillStripHistos(Float_t r, Float_t phi, Int_t iD, Int_t iq)
Bool_t getTrack(vector< AVPoint > &points, Double_t ipZ)
pair< double, double > getDca(vector< AVTrack >::iterator it)