1 #include "StFgtStraightPlotter.h"
3 #include "StFgtGeneralBase.h"
4 #include "StRoot/StEvent/StFgtCollection.h"
5 #include "StRoot/StEvent/StFgtHitCollection.h"
6 #include "StRoot/StEvent/StFgtHit.h"
7 #include "StRoot/StFgtUtil/geometry/StFgtGeom.h"
8 #include "StRoot/StEvent/StEvent.h"
9 #include "StRoot/StEvent/StEventInfo.h"
10 #include "StRoot/StFgtUtil/geometry/StFgtGeom.h"
13 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
14 #include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h"
15 #include "StMuDSTMaker/COMMON/StMuDst.h"
16 #include "StMuDSTMaker/COMMON/StMuEvent.h"
17 #include "StarClassLibrary/StThreeVectorF.hh"
32 #include "StFgtCosmicAlignment.h"
34 #define MAX_DIST_STRIP_R 0.7
35 #define MAX_DIST_STRIP_PHI 0.03
36 #include "StRoot/StFgtUtil/geometry/StFgtGeom.h"
38 #define PULSE_CONDITION
42 #include "StRoot/StEvent/StEvent.h"
43 #include "StRoot/StEvent/StFgtCollection.h"
47 #define MAX_CHARGE_RATIO
48 #define MIN_CHARGE_RATIO
52 #define MY_PI 3.14159265359
56 #define MAX_DIST2_EFF 1.0
59 #define MIN_NUM_POINTS 2
62 #define NUM_EFF_BIN 30
64 Bool_t StFgtStraightPlotter::arePointsMatched(vector<generalCluster>::iterator c1, vector<generalCluster>::iterator c2)
72 if(c1->clusterCharge<20 || c2->clusterCharge<20)
74 if(c1->clusterCharge<c2->clusterCharge)
76 tCharge1=c2->clusterCharge;
77 tUncert1=c2->clusterChargeUncert;
78 tCharge2=c1->clusterCharge;
79 tUncert2=c1->clusterChargeUncert;
83 tCharge1=c1->clusterCharge;
84 tUncert1=c1->clusterChargeUncert;
85 tCharge2=c2->clusterCharge;
86 tUncert2=c2->clusterChargeUncert;
90 if(((tCharge1/tCharge2) <chargeMatchCut) ||((tCharge1-tUncert1)/(tCharge2+tUncert2))<chargeMatchCut)
97 Bool_t StFgtStraightPlotter::validPulse(
generalStrip& strip)
101 Float_t adc1=strip.adc[i];
102 Float_t adc2=strip.adc[i+1];
103 Float_t adc3=strip.adc[i+2];
104 Float_t cut=5*strip.pedErr;
105 if(adc1>cut && adc2 >cut && adc3 > cut)
107 if(adc1 <adc2 && adc2 < adc3)
114 Bool_t StFgtStraightPlotter::fitTheStrip(
generalStrip* pStrip,
generalStrip* pStripOtherLayer,
float* amp,
float* t0,
float* chi2Ndf,
int iD,
int iq,
int apvBin, Char_t layer)
120 sprintf(buffer,
"d%d_quad%d",iD,iq);
121 pulsePictureFile->cd();
123 pulsePictureFile->cd(buffer);
126 sprintf(buffer,
"apv%d_R",apvBin);
128 sprintf(buffer,
"apv%d_P",apvBin);
131 gDirectory->cd(buffer);
133 Int_t minAdcCount=100000;
135 for(Int_t tb=0;tb<7;tb++)
137 mHistPtr->SetBinContent(tb+1,0);
138 mHistPtr->SetBinError(tb+1,10000);
139 mHistPtr->SetBinContent(tb+1, pStrip->adc[tb]);
140 if(pStrip->adc[tb]<minAdcCount)
141 minAdcCount=pStrip->adc[tb]-pStrip->pedErr;
142 if(pStrip->adc[tb]>maxAdcCount)
143 maxAdcCount=pStrip->adc[tb]+pStrip->pedErr;
144 mHistPtr->SetBinError(tb+1,pStrip->pedErr);
148 (*amp)=mPulseShapePtr->GetParameter(0);
149 (*t0)=mPulseShapePtr->GetParameter(4);
150 (*chi2Ndf)=mPulseShapePtr->GetChisquare()/mPulseShapePtr->GetNDF();
151 sprintf(buffer,
"pulse histo_D%d_Q%d_APV%d_ev%d",iD,iq,apvBin,evtNr);
153 TH1F* tmpPulseHisto=(TH1F*)mHistPtr->Clone(buffer);
154 tmpPulseHisto->Write();
156 if(pStripOtherLayer!=0)
160 sprintf(buffer,
"tmpCnvsD%d_Q%d_APV%d_ev%d",iD,iq,apvBin,evtNr);
161 TCanvas* tmpCnv=(TCanvas*)mCanvas->Clone(buffer);
163 tmpCnv->SetTitle(buffer);
164 tmpCnv->SetName(buffer);
168 for(Int_t tb=0;tb<7;tb++)
170 mHistPtr2->SetBinContent(tb+1,0);
171 mHistPtr2->SetBinError(tb+1,10000);
172 mHistPtr2->SetBinContent(tb+1, pStripOtherLayer->adc[tb]);
173 mHistPtr2->SetBinError(tb+1,pStripOtherLayer->pedErr);
174 if(pStripOtherLayer->adc[tb]<minAdcCount)
175 minAdcCount=pStripOtherLayer->adc[tb]-pStripOtherLayer->pedErr;
176 if(pStripOtherLayer->adc[tb]>maxAdcCount)
177 maxAdcCount=pStripOtherLayer->adc[tb]+pStripOtherLayer->pedErr;
180 tmpPulseHisto->GetYaxis()->SetRangeUser(minAdcCount-10,maxAdcCount+10);
181 mHistPtr2->GetYaxis()->SetRangeUser(minAdcCount-10,maxAdcCount+10);
182 tmpPulseHisto->Draw();
183 mHistPtr2->Draw(
"SAME");
187 pulsePictureFile->cd();
195 template<
class T>
void StFgtStraightPlotter::createPlots(T*** pH,
int numH,
const char* nameBase,
int numBin,
int first,
int last)
200 sprintf(bufferNB,
"%s_%s",nameBase,mFileName);
205 for(
int iD=0;iD<numH;iD++)
207 sprintf(buffer,
"%s_APV%d", bufferNB, iD);
208 (*pH)[iD]=
new T(buffer,buffer,numBin, first, last);
212 if ((numH == kFgtNumDiscs*4)&&(numH!=22))
215 for(
int iD=0;iD<kFgtNumDiscs;iD++)
217 for(
int iQ=0;iQ<4;iQ++)
219 sprintf(buffer,
"%s_disc%d_quad%d",bufferNB,iD+1,iQ);
220 (*pH)[iD*4+iQ]=
new T(buffer,buffer,numBin,first,last);
226 for(
int iD=0;iD<kFgtNumDiscs;iD++)
229 if (numH==kFgtNumDiscs)
231 sprintf(buffer,
"%s_disc%d", bufferNB, iD+1);
232 (*pH)[iD]=
new T(buffer, buffer,numBin, first, last);
236 for(
int binAPVi=0;binAPVi<40;binAPVi++)
239 if((binAPVi>= 0) && (binAPVi<= 9)) iQ=0;
240 if((binAPVi>=10) && (binAPVi<=19)) iQ=1;
241 if((binAPVi>=20) && (binAPVi<=29)) iQ=2;
242 if((binAPVi>=30) && (binAPVi<=39)) iQ=3;
243 sprintf(buffer,
"%s_disc%d_quad%d_apvBIN%d",bufferNB,iD+1,iQ,binAPVi);
244 (*pH)[iD*40+binAPVi]=
new T(buffer,buffer,numBin,first,last);
252 template void StFgtStraightPlotter::createPlots(TH1I*** pH,
int numH,
const char* nameBase,
int numBin,
int first,
int last);
253 template void StFgtStraightPlotter::createPlots(TH1F*** pH,
int numH,
const char* nameBase,
int numBin,
int first,
int last);
254 template void StFgtStraightPlotter::createPlots(TH1D*** pH,
int numH,
const char* nameBase,
int numBin,
int first,
int last);
256 void StFgtStraightPlotter::doNormalize(TH2D** hEff, TH2D** hNonEff)
258 for(Int_t iD=0;iD<kFgtNumDiscs;iD++)
260 TH2D* tmpAllCounts=(TH2D*)hEff[iD]->
Clone(
"tmp");
261 hEff[iD]->Add(hNonEff[iD]);
262 for(
int nx=1;nx<hEff[iD]->GetNbinsX()+1;nx++)
264 for(
int ny=1;ny<hEff[iD]->GetNbinsY()+1;ny++)
266 Double_t denom=hEff[iD]->GetBinContent(nx,ny);
267 if(denom>0 && (tmpAllCounts->GetBinContent(nx,ny)/denom)<=1.0)
269 hEff[iD]->SetBinContent(nx,ny,tmpAllCounts->GetBinContent(nx,ny)/denom);
273 hEff[iD]->SetBinContent(nx,ny,0.0);
283 void StFgtStraightPlotter::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)
286 int uniqueId=rand() % 1000;
287 sprintf(buffer,
"Sig_Disc%d_quad%d_Phi_Evt_%d_R_%f_Phi_%f_%d_%s",discId,quad,evtNr,r,phi,uniqueId,mFileName);
289 TH2D* histoP=
new TH2D(buffer,buffer,7,0,6,maxPhi,0,maxPhi-1);
290 for(
int i=0;i<maxPhi;i++)
294 histoP->SetBinContent(j+1,i+1,sigP[i*7+j]);
298 v_hClusP.push_back(histoP);
299 sprintf(buffer,
"Sig_Disc%d_quad%d_R_Evt_%d_R_%f_Phi_%f_%d_%s",discId,quad,evtNr,r,phi,uniqueId,mFileName);
301 TH2D* histoR=
new TH2D(buffer,buffer,7,0,6,maxR,0,maxR-1);
302 for(
int i=0;i<maxR;i++)
306 histoR->SetBinContent(j+1,i+1,sigR[i*7+j]);
310 v_hClusR.push_back(histoR);
316 float oldDist=100000;
320 for(
float z=-100;z<100;z=z+zStep)
322 float x=it->mx*z+it->ax;
323 float y=it->my*z+it->ay;
335 return pair<double,double>(optZ,sqrt(dist));
339 Double_t StFgtStraightPlotter::findClosestStrip(Char_t layer,
double ord, Int_t iD, Int_t iQ)
345 vector<generalCluster> &hitVec=*(pClusters[iD]);
347 for(vector<generalCluster>::iterator it=hitVec.begin();it!=hitVec.end();it++)
349 if(useChargeMatch && !it->hasMatch)
356 mDist=fabs(it->posPhi-ord);
359 mDist=fabs(it->posR-ord);
374 bool partOfClusterP=
false;
375 bool partOfClusterR=
false;
376 Double_t clusterChargeR=-9999;
377 Double_t clusterChargeP=-9999;
379 Double_t mClusterSizeP=-9999;
380 Double_t mClusterSizeR=-9999;
382 Double_t maxRCharge=-9999;
383 Double_t maxPhiCharge=-9999;
384 Double_t maxRChargeUncert=-9999;
385 Double_t maxPhiChargeUncert=-9999;
392 Double_t maxSigAdcR=-1;
393 Double_t maxSigAdcP=-1;
396 Int_t firstFSigTbP=0;
397 Int_t firstFSigTbR=0;
399 Float_t secondToLastRatioP=0;
400 Float_t secondToLastRatioR=0;
402 Float_t firstTbSigR=-1;
403 Float_t firstTbSigP=-1;
406 Double_t ordinate, lowerSpan, upperSpan;
407 Short_t disc, quadrant,strip;
410 Int_t APVmaxRCharge=-9999;
411 Int_t APVmaxPhiCharge=-9999;
420 Int_t APVmaxSigAdcR=-1;
421 Int_t APVmaxSigAdcP=-1;
424 Int_t APVfirstFSigTbP=0;
425 Int_t APVfirstFSigTbR=0;
427 Int_t APVsecondToLastRatioP=0;
428 Int_t APVsecondToLastRatioR=0;
430 Int_t APVfirstTbSigR=-1;
431 Int_t APVfirstTbSigP=-1;
435 for(
unsigned int i=0;i< pStrips[iD*4+iq].size();i++)
437 Int_t geoId=pStrips[iD*4+iq][i].geoId;
440 Int_t rdo, arm, apv, chan;
441 mDb->getElecCoordFromGeoId(geoId, rdo,arm,apv,chan);
443 Int_t binAPV = (iq*10)+(apv%12);
445 StFgtGeom::getPhysicalCoordinate(geoId,disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
446 StFgtGeom::decodeGeoId(geoId,disc, quadrant, layer, strip);
450 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)))
454 if(pStrip.charge>maxPhiCharge)
456 if((pStrip.seedType>=kFgtSeedType1 && pStrip.seedType<=kFgtSeedTypeMax)|| pStrip.seedType==kFgtClusterPart || pStrip.seedType==kFgtClusterEndUp ||pStrip.seedType==kFgtClusterEndDown)
459 pair<Double_t, Double_t> cluSize=findCluChargeSize(iD,
'P',ordinate);
460 clusterChargeP=cluSize.first;
461 mClusterSizeP=cluSize.second;
465 partOfClusterP=
false;
466 clusterChargeP=-9999;
468 maxPhiCharge=pStrip.charge;
469 maxPhiChargeUncert=pStrip.chargeUncert;
486 secondToLastRatioP=pStrip.adc[5]/(float)pStrip.adc[6];
487 APVsecondToLastRatioP=binAPV;
491 firstTbSigP=pStrip.adc[0]/(float)pStrip.pedErr;
492 APVfirstTbSigP=binAPV;
494 for(
int iAdc=0;iAdc<7;iAdc++)
496 if(pStrip.adc[iAdc]>5*pStrip.pedErr)
503 APVfirstFSigTbP=binAPV;
506 if(pStrip.adc[iAdc]>maxPAdc)
508 maxPAdc=pStrip.adc[iAdc];
514 maxSigAdcP=(Double_t)maxPAdc/pStrip.pedErr;
515 APVmaxSigAdcP=binAPV;
523 if(pStrip.charge>maxRCharge)
525 if((pStrip.seedType>=kFgtSeedType1 && pStrip.seedType<=kFgtSeedTypeMax)|| pStrip.seedType==kFgtClusterPart || pStrip.seedType==kFgtClusterEndUp ||pStrip.seedType==kFgtClusterEndDown)
528 pair<Double_t, Double_t> cluSize=findCluChargeSize(iD,
'R',ordinate);
529 clusterChargeR=cluSize.first;
530 mClusterSizeR=cluSize.second;
534 clusterChargeR=-9999;
535 partOfClusterR=
false;
538 maxRCharge=pStrip.charge;
540 maxRChargeUncert=pStrip.chargeUncert;
556 secondToLastRatioR=pStrip.adc[5]/(float)pStrip.adc[6];
557 APVsecondToLastRatioR=binAPV;
561 firstTbSigR=pStrip.adc[0]/(float)pStrip.pedErr;
562 APVfirstTbSigR=binAPV;
564 for(
int iAdc=0;iAdc<7;iAdc++)
567 if(pStrip.adc[iAdc]>5*pStrip.pedErr)
574 APVfirstFSigTbR=binAPV;
577 if(pStrip.adc[iAdc]>maxRAdc)
579 maxRAdc=pStrip.adc[iAdc];
585 maxSigAdcR=(Double_t)maxRAdc/pStrip.pedErr;
586 APVmaxSigAdcR=binAPV;
600 firstTbSigCloseClusterP[iD*4+iq]->Fill(firstTbSigP);
601 maxAdcCloseClusterP[iD*4+iq]->Fill(maxPAdc);
603 maxTbCloseClusterP[iD*4+iq]->Fill(maxPTb);
604 numFSigCloseClusterP[iD*4+iq]->Fill(numFSigP);
605 numFirstHighCloseClusterP[iD*4+iq]->Fill(firstFSigTbP);
607 maxSigCloseClusterP[iD*4+iq]->Fill(maxSigAdcP);
610 secondToLastRatioCloseClusterP[iD*4+iq]->Fill(secondToLastRatioP);
615 if(r>InnerRad&& APVfirstTbSigP>-1 && APVmaxPAdc>-1 && APVmaxPTb>-1 && APVnumFSigP>-1 && APVfirstFSigTbP>-1 && APVmaxSigAdcP>-1 && APVsecondToLastRatioP>-1)
617 APVfirstTbSigCloseClusterP[iD*40+APVfirstTbSigP]->Fill(firstTbSigP);
618 APVmaxAdcCloseClusterP[iD*40+APVmaxPAdc]->Fill(maxPAdc);
619 APVmaxTbCloseClusterP[iD*40+APVmaxPTb]->Fill(maxPTb);
620 APVnumFSigCloseClusterP[iD*40+APVnumFSigP]->Fill(numFSigP);
621 APVnumFirstHighCloseClusterP[iD*40+APVfirstFSigTbP]->Fill(firstFSigTbP);
622 APVmaxSigCloseClusterP[iD*40+APVmaxSigAdcP]->Fill(maxSigAdcP);
623 APVsecondToLastRatioCloseClusterP[iD*40+APVsecondToLastRatioP]->Fill(secondToLastRatioP);
626 if(iD==2 && iq==1 && (
float)pStrips[iD*4+iq][maxPInd].pedErr>0)
629 for(
int iB=0;iB<7;iB++)
631 exPulseMaxAdcNormP->SetBinContent(iB+1,exPulseMaxAdcNormP->GetBinContent(iB+1)+pStrips[iD*4+iq][maxPInd].adc[iB]/(float)maxPAdc);
632 exPulseSigP->SetBinContent(iB+1,exPulseSigP->GetBinContent(iB+1)+pStrips[iD*4+iq][maxPInd].adc[iB]/(float)pStrips[iD*4+iq][maxPInd].pedErr);
639 firstTbSigCloseClusterR[iD*4+iq]->Fill(firstTbSigR);
640 maxTbCloseClusterR[iD*4+iq]->Fill(maxRTb);
641 maxAdcCloseClusterR[iD*4+iq]->Fill(maxRAdc);
642 numFSigCloseClusterR[iD*4+iq]->Fill(numFSigR);
643 numFirstHighCloseClusterR[iD*4+iq]->Fill(firstFSigTbR);
645 maxSigCloseClusterR[iD*4+iq]->Fill(maxSigAdcR);
647 secondToLastRatioCloseClusterR[iD*4+iq]->Fill(secondToLastRatioR);
649 if(r> InnerRad && APVfirstTbSigR>-1 && APVmaxRAdc>-1 && APVmaxRTb>-1 && APVnumFSigR>-1 && APVfirstFSigTbR>-1 && APVmaxSigAdcR>-1 && APVsecondToLastRatioR>-1)
651 APVfirstTbSigCloseClusterR[iD*40+APVfirstTbSigR]->Fill(firstTbSigR);
652 APVmaxTbCloseClusterR[iD*40+APVmaxRTb]->Fill(maxRTb);
653 APVmaxAdcCloseClusterR[iD*40+APVmaxRAdc]->Fill(maxRAdc);
654 APVnumFSigCloseClusterR[iD*40+APVnumFSigR]->Fill(numFSigR);
655 APVnumFirstHighCloseClusterR[iD*40+APVfirstFSigTbR]->Fill(firstFSigTbR);
656 APVmaxSigCloseClusterR[iD*40+APVmaxSigAdcR]->Fill(maxSigAdcR);
657 APVsecondToLastRatioCloseClusterR[iD*40+APVsecondToLastRatioR]->Fill(secondToLastRatioR);
660 if(iD==2 && iq==1 && (
float)pStrips[iD*4+iq][maxRInd].pedErr>0)
663 for(
int iB=0;iB<7;iB++)
665 exPulseMaxAdcNormR->SetBinContent(iB+1,exPulseMaxAdcNormR->GetBinContent(iB+1)+pStrips[iD*4+iq][maxRInd].adc[iB]/(float)maxRAdc);
666 exPulseSigR->SetBinContent(iB+1,exPulseSigR->GetBinContent(iB+1)+pStrips[iD*4+iq][maxRInd].adc[iB]/(float)pStrips[iD*4+iq][maxRInd].pedErr);
672 if(maxRCharge> 200 && maxPhiCharge>200 && iD==m_effDisk)
674 StFgtGeom::getPhysicalCoordinate((
float)pStrips[iD*4+iq][maxRInd].geoId,disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
677 chargeCorrMaxStrip->Fill(maxRCharge,maxPhiCharge);
678 chargeCorrMaxAdc->Fill(maxRAdc,maxPAdc);
687 if(partOfClusterR&& partOfClusterP && iD==m_effDisk)
689 chargeCorrInEffDisk->Fill(clusterChargeR,clusterChargeP);
690 StFgtGeom::getPhysicalCoordinate((
float)pStrips[iD*4+iq][maxRInd].geoId,disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
694 if(partOfClusterR&& partOfClusterP)
696 chargeCorr[iD*4+iq]->Fill(clusterChargeR,clusterChargeP);
704 clusterSizeR[iD*4+iq]->Fill(mClusterSizeR);
705 clusterSizeP[iD*4+iq]->Fill(mClusterSizeP);
713 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;
719 fitTheStrip(&(pStrips[iD*4+iq][maxPInd]),&(pStrips[iD*4+iq][maxRInd]),&,&t0,&chi2Ndf,iD,iq,APVmaxPAdc,
'P');
721 fitTheStrip(&(pStrips[iD*4+iq][maxPInd]),0,&,&t0,&chi2Ndf,iD,iq,APVmaxPAdc,
'P');
723 APVfitChi2P[iD*40+APVmaxPAdc]->Fill(chi2Ndf);
725 firstTbSigTrackClusterP[iD*4+iq]->Fill(firstTbSigP);
726 maxAdcTrackClusterP[iD*4+iq]->Fill(maxPAdc);
727 maxSigTrackClusterP[iD*4+iq]->Fill(maxSigAdcP);
728 maxTbTrackClusterP[iD*4+iq]->Fill(maxPTb);
729 numFSigTrackClusterP[iD*4+iq]->Fill(numFSigP);
730 numFirstHighTrackClusterP[iD*4+iq]->Fill(firstFSigTbP);
731 secondToLastRatioTrackClusterP[iD*4+iq]->Fill(secondToLastRatioP);
733 if(iD==2 && iq==1 && (
float)pStrips[iD*4+iq][maxPInd].pedErr>0)
736 for(
int iB=0;iB<7;iB++)
738 exPulseMaxAdcNormTrackP->SetBinContent(iB+1,exPulseMaxAdcNormTrackP->GetBinContent(iB+1)+pStrips[iD*4+iq][maxPInd].adc[iB]/(float)maxPAdc);
740 exPulseSigTrackP->SetBinContent(iB+1,exPulseSigTrackP->GetBinContent(iB+1)+pStrips[iD*4+iq][maxPInd].adc[iB]/(float)pStrips[iD*4+iq][maxPInd].pedErr);
750 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;
756 fitTheStrip(&(pStrips[iD*4+iq][maxRInd]),&pStrips[iD*4+iq][maxPInd],&,&t0,&chi2Ndf, iD, iq, APVmaxRAdc,
'R');
758 fitTheStrip(&(pStrips[iD*4+iq][maxRInd]),0,&,&t0,&chi2Ndf, iD, iq, APVmaxRAdc,
'R');
759 APVfitChi2R[iD*40+APVmaxRAdc]->Fill(chi2Ndf);
762 firstTbSigTrackClusterR[iD*4+iq]->Fill(firstTbSigR);
763 maxTbTrackClusterR[iD*4+iq]->Fill(maxRTb);
764 maxAdcTrackClusterR[iD*4+iq]->Fill(maxRAdc);
765 maxSigTrackClusterR[iD*4+iq]->Fill(maxSigAdcR);
766 numFSigTrackClusterR[iD*4+iq]->Fill(numFSigR);
767 numFirstHighTrackClusterR[iD*4+iq]->Fill(firstFSigTbR);
768 secondToLastRatioTrackClusterR[iD*4+iq]->Fill(secondToLastRatioR);
770 if(iD==2 && iq==1 && (
float)pStrips[iD*4+iq][maxRInd].pedErr>0)
773 for(
int iB=0;iB<7;iB++)
775 exPulseMaxAdcNormTrackR->SetBinContent(iB+1,exPulseMaxAdcNormTrackR->GetBinContent(iB+1)+pStrips[iD*4+iq][maxRInd].adc[iB]/(float)maxRAdc);
776 exPulseSigTrackR->SetBinContent(iB+1,exPulseSigTrackR->GetBinContent(iB+1)+pStrips[iD*4+iq][maxRInd].adc[iB]/(float)pStrips[iD*4+iq][maxRInd].pedErr);
787 Bool_t StFgtStraightPlotter::isSomewhatEff(Float_t r, Float_t phi, Int_t iD, Int_t iq)
789 Double_t maxRCharge=-9999;
790 Double_t maxPhiCharge=-9999;
791 Double_t maxRChargeUncert=-9999;
792 Double_t maxPhiChargeUncert=-9999;
795 Bool_t validPhiPulse=
false;
796 Bool_t validRPulse=
false;
797 for(
unsigned int i=0;i< pStrips[iD*4+iq].size();i++)
799 Int_t geoId=pStrips[iD*4+iq][i].geoId;
801 Short_t disc, quadrant,strip;
803 Double_t ordinate, lowerSpan, upperSpan;
804 StFgtGeom::getPhysicalCoordinate(geoId,disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
805 StFgtGeom::decodeGeoId(geoId,disc, quadrant, layer, strip);
808 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)))
812 if(validPulse(pStrip))
815 if(pStrip.charge>maxPhiCharge)
817 maxPhiCharge=pStrip.charge;
818 maxPhiChargeUncert=pStrip.chargeUncert;
824 if(validPulse(pStrip))
827 if(pStrip.charge>maxRCharge)
829 maxRCharge=pStrip.charge;
831 maxRChargeUncert=pStrip.chargeUncert;
836 #ifdef PULSE_CONDITION
837 if(validPhiPulse && validRPulse)
842 if(maxRInd>=0 && maxPInd>=0)
845 if(maxRCharge>1000 && maxPhiCharge>1000)
851 maxRCharge+=pStrips[iD*4+iq][maxRInd-1].charge;
852 if(maxRInd< (
int)(pStrips[iD*4+iq].size()-1))
853 maxRCharge+=pStrips[iD*4+iq][maxRInd+1].charge;
855 maxPhiCharge+=pStrips[iD*4+iq][maxPInd-1].charge;
856 if(maxPInd< (
int)(pStrips[iD*4+iq].size()-1))
857 maxPhiCharge+=pStrips[iD*4+iq][maxPInd+1].charge;
861 if(maxRCharge>3*maxRChargeUncert && maxPhiCharge>3*maxPhiChargeUncert)
865 if(maxRCharge>maxPhiCharge)
867 if(maxRCharge/maxPhiCharge<4)
874 if(maxPhiCharge/maxPhiCharge<4)
886 pair<Double_t,Double_t> StFgtStraightPlotter::findCluChargeSize(Int_t iD,Char_t layer, Double_t ordinate)
890 return pair<Double_t,Double_t>(-99999,-99999);
892 vector<generalCluster> &hitVec=*(pClusters[iD]);
893 Double_t charge=-99999;
894 Double_t cluSize=-9999;
895 Double_t minDist=99999;
896 for(vector<generalCluster>::iterator it=hitVec.begin();it!=hitVec.end();it++)
908 if(fabs(ordinate-(ord+MY_PI))<fabs(ord-ordinate))
910 if(fabs(ordinate-(ord-MY_PI))<fabs(ord-ordinate))
914 if((fabs(ordinate-ord)<minDist) && (!useChargeMatch || it->hasMatch))
916 charge=it->clusterCharge;
917 cluSize=it->clusterSize;
918 minDist=fabs(ordinate-ord);
921 return pair<Double_t,Double_t>(charge,cluSize);
931 vector<generalCluster> &hitVec=*(pClusters[iD]);
932 Double_t dist2=99999;
933 for(vector<generalCluster>::iterator it=hitVec.begin();it!=hitVec.end();it++)
935 for(vector<generalCluster>::iterator it2=hitVec.begin();it2!=hitVec.end();it2++)
938 if(useChargeMatch && !arePointsMatched(it,it2))
941 if(it->layer==it2->layer)
944 Float_t phi=it2->posPhi;
951 Float_t x=r*cos(phi);
952 Float_t y=r*sin(phi);
954 Double_t mDist=(x-xE)*(x-xE)+(y-yE)*(y-yE);
959 float tmpX, tmpY,tmpZ,tmpP,tmpR;
962 getAlign(iD,phi,r,tmpX,tmpY,tmpZ,tmpP,tmpR);
965 Double_t xExpUpdate=mx*tmpZ+bx;
966 Double_t yExpUpdate=my*tmpZ+by;
969 mDist=(tmpX-xExpUpdate)*(tmpX-xExpUpdate)+(tmpY-yExpUpdate)*(tmpY-yExpUpdate);
988 cout <<
"do not use this function!!!" <<endl;
1002 Bool_t StFgtStraightPlotter::printArea1D(Int_t iD,Int_t iq, Int_t centerGeoId)
1005 for(
unsigned int i=0;i<pStrips[iD*4+iq].size();i++)
1007 Int_t geoId=pStrips[iD*4+iq][i].geoId;
1009 Short_t disc, quadrant,strip;
1011 Double_t ordinate, lowerSpan, upperSpan;
1012 StFgtGeom::getPhysicalCoordinate(geoId,disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
1013 StFgtGeom::decodeGeoId(geoId,disc, quadrant, layer, strip);
1015 switch(pStrip.seedType)
1017 case kFgtSeedTypeNo:
1018 sprintf(buffer,
"No Seed");
1021 sprintf(buffer,
"Seed1");
1024 sprintf(buffer,
"Seed2");
1027 sprintf(buffer,
"Seed3");
1030 sprintf(buffer,
"Seed4");
1033 sprintf(buffer,
"Seed5");
1035 case kFgtClusterPart:
1036 sprintf(buffer,
"PartOfCluster");
1038 case kFgtClusterEndUp:
1039 sprintf(buffer,
"EoC");
1041 case kFgtClusterEndDown:
1042 sprintf(buffer,
"BoC");
1045 sprintf(buffer,
"DeadStrip");
1047 case kFgtClusterTooBig:
1048 sprintf(buffer,
"cluster too big");
1050 case kFgtClusterSeedInSeaOfNoise:
1051 sprintf(buffer,
"seed in noise");
1054 sprintf(buffer,
"somethingWrong: %d", pStrip.seedType);
1059 if(abs(geoId-centerGeoId)<8)
1062 (*outTxtFile) <<StFgtGeom::encodeGeoName(iD,iq,layer,strip)<<
"geo: " << geoId<<
" ord: " << ordinate <<
" layer: " <<layer<<
" ped: " << pStrip.ped <<
" pedErr: " << pStrip.pedErr <<
" seedType: " <<buffer<<
" ";
1063 for(
int iT=0;iT<7;iT++)
1065 if(pStrip.adc[iT]<pStrip.pedErr)
1066 (*outTxtFile) << setw(4) <<
" . "<<
" ";
1068 (*outTxtFile) << setw(4) <<pStrip.adc[iT] <<
" ";
1070 (*outTxtFile) <<endl;
1078 Bool_t StFgtStraightPlotter::printArea(Float_t r, Float_t phi, Int_t iD, Int_t iq)
1083 if(printCounter>1000)
1087 Double_t signalsP[900];
1088 Double_t signalsR[900];
1093 for(
unsigned int i=0;i<pStrips[iD*4+iq].size();i++)
1095 Int_t geoId=pStrips[iD*4+iq][i].geoId;
1097 Short_t disc, quadrant,strip;
1099 Double_t ordinate, lowerSpan, upperSpan;
1100 StFgtGeom::getPhysicalCoordinate(geoId,disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
1101 StFgtGeom::decodeGeoId(geoId,disc, quadrant, layer, strip);
1103 switch(pStrip.seedType)
1105 case kFgtSeedTypeNo:
1106 sprintf(buffer,
"No Seed");
1109 sprintf(buffer,
"Seed1");
1112 sprintf(buffer,
"Seed2");
1115 sprintf(buffer,
"Seed3");
1118 sprintf(buffer,
"Seed4");
1121 sprintf(buffer,
"Seed5");
1123 case kFgtClusterPart:
1124 sprintf(buffer,
"PartOfCluster");
1126 case kFgtClusterEndUp:
1127 sprintf(buffer,
"EoC");
1129 case kFgtClusterEndDown:
1130 sprintf(buffer,
"BoC");
1133 sprintf(buffer,
"DeadStrip");
1135 case kFgtClusterTooBig:
1136 sprintf(buffer,
"cluster too big");
1138 case kFgtClusterSeedInSeaOfNoise:
1139 sprintf(buffer,
"seed in noise");
1142 sprintf(buffer,
"somethingWrong: %d", pStrip.seedType);
1149 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)))
1152 (*outTxtFile) <<
"Id: " << geoId<<
" "<<StFgtGeom::encodeGeoName(iD,iq,layer,strip)<<
" ord: " << ordinate <<
" layer: " <<layer<<
" ped: " << pStrip.ped <<
" pedErr: " << pStrip.pedErr <<
" seedType: " <<buffer<<
" ";
1153 for(
int iT=0;iT<7;iT++)
1155 if(pStrip.adc[iT]<pStrip.pedErr)
1156 (*outTxtFile) << setw(4) <<
" . "<<
" ";
1158 (*outTxtFile) << setw(4) <<pStrip.adc[iT] <<
" ";
1161 if(layer==
'P'&& counterP<40)
1163 signalsP[counterP*7+iT]=pStrip.adc[iT];
1168 if(layer==
'R'&& counterR<40)
1170 signalsR[counterR*7+iT]=pStrip.adc[iT];
1176 (*outTxtFile) <<endl;
1180 saveSigs(signalsR,signalsP,r,phi,counterR,counterP, iD, iq);
1187 pair<Double_t,Double_t> StFgtStraightPlotter::getChargeRatio(Float_t r, Float_t phi, Int_t iD, Int_t iq)
1190 Double_t maxRCharge=-9999;
1191 Double_t maxPhiCharge=-9999;
1194 for(
unsigned int i=0;i< pStrips[iD*4+iq].size();i++)
1196 Int_t geoId=pStrips[iD*4+iq][i].geoId;
1198 Short_t disc, quadrant,strip;
1200 Double_t ordinate, lowerSpan, upperSpan;
1201 StFgtGeom::getPhysicalCoordinate(geoId,disc,quadrant,layer,ordinate,lowerSpan,upperSpan);
1202 StFgtGeom::decodeGeoId(geoId,disc, quadrant, layer, strip);
1205 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)))
1209 if(pStrip.charge>maxPhiCharge)
1211 maxPhiCharge=pStrip.charge;
1217 if(pStrip.charge>maxRCharge)
1219 maxRCharge=pStrip.charge;
1225 if(maxRInd>=0 && maxPInd>=0)
1227 if(maxRCharge>1000 && maxPhiCharge>1000)
1231 maxRCharge+=pStrips[iD*4+iq][maxRInd-1].charge;
1232 if(maxRInd< (
int)(pStrips[iD*4+iq].size()-1))
1233 maxRCharge+=pStrips[iD*4+iq][maxRInd+1].charge;
1235 maxPhiCharge+=pStrips[iD*4+iq][maxPInd-1].charge;
1236 if(maxPInd< (
int)(pStrips[iD*4+iq].size()-1))
1237 maxPhiCharge+=pStrips[iD*4+iq][maxPInd+1].charge;
1239 return pair<Double_t,Double_t>(maxRCharge,maxPhiCharge);
1243 return pair<Double_t,Double_t>(-9999,-9999);
1247 Double_t StFgtStraightPlotter::getRPhiRatio(vector<generalCluster>::iterator hitIterBegin, vector<generalCluster>::iterator hitIterEnd)
1253 vector<generalCluster>::iterator hitIter=hitIterBegin;
1254 for(;hitIter!=hitIterEnd;hitIter++)
1257 layer=hitIter->layer;
1266 return (numR-numPhi)/((Double_t)(numR+numPhi));
1277 Int_t numTracksInCurrEv=0;
1279 pClusters=fgtGenMkr->getClusters();
1280 pStrips=fgtGenMkr->getStrips();
1281 Int_t tmpCluCount[6*4*2];
1282 memset(tmpCluCount,0,6*4*2*
sizeof(Int_t));
1283 for(
int iD=0;iD<6;iD++)
1285 vector<generalCluster> &hitVec=*(pClusters[iD]);
1286 for( vector<generalCluster>::iterator hitIter=hitVec.begin();hitIter != hitVec.end();hitIter++)
1289 Int_t iq=hitIter->quad;
1290 if(hitIter->layer==
'R')
1292 tmpCluCount[iD*4+iq]++;
1293 h_clusterChargeR[iD]->Fill(hitIter->clusterCharge);
1297 tmpCluCount[6*4+iD*4+iq]++;
1298 h_clusterChargePhi[iD]->Fill(hitIter->clusterCharge);
1303 for(
int iD=0;iD<6;iD++)
1305 for(
int iq=0;iq<4;iq++)
1307 numClustersR[iD*4+iq]->Fill(tmpCluCount[iD*4+iq]);
1308 numClustersPhi[iD*4+iq]->Fill(tmpCluCount[6*4+iD*4+iq]);
1314 (*outTxtFile) <<
"----------------------------- Event Nr: " << evtNr<<
" -----------------" <<endl;
1318 vector<AVTrack>& tracks=fgtSTracker->getTracks();
1321 for(vector<AVTrack>::iterator it=tracks.begin();it!=tracks.end();it++)
1324 if(it->chi2>maxDistChi || fabs(it->trkZ)> vertexCut || it->dca> dcaCut )
1330 numTracksInCurrEv++;
1331 numPointsPerTrack->Fill(it->points->size());
1332 for(
int i=0;i<it->points->size();i++)
1334 Int_t iD=(*(it->points))[i].dID;
1335 Int_t iq=(*(it->points))[i].quadID;
1336 if(iD<6 && iD>=0 && iq<4 && iq>=0)
1339 Float_t rCharge=(*(it->points))[i].rCharge;
1340 Float_t phiCharge=(*(it->points))[i].phiCharge;
1341 Float_t rPos=(*(it->points))[i].r;
1342 Float_t phiPos=(*(it->points))[i].phi;
1345 phiPos+=2*TMath::Pi();
1346 chargeTrackClusterRvsP[iD*4+iq]->Fill(phiPos,(*(it->points))[i].rCharge);
1347 chargeTrackClusterPvsR[iD*4+iq]->Fill(rPos,(*(it->points))[i].phiCharge);
1348 chargeTrackClusterR[iD*4+iq]->Fill((*(it->points))[i].rCharge);
1349 chargeTrackClusterP[iD*4+iq]->Fill((*(it->points))[i].phiCharge);
1350 numTrackClusterR[iD*4+iq]->Fill(rPos);
1351 numTrackClusterP[iD*4+iq]->Fill(phiPos);
1352 if(fabs((rCharge-phiCharge)/(rCharge+phiCharge))<0.1)
1355 numTrackSymCutClusterR[iD*4+iq]->Fill(rPos);
1356 numTrackSymCutClusterP[iD*4+iq]->Fill(phiPos);
1358 chargeTrackSymCutClusterR[iD*4+iq]->Fill((*(it->points))[i].rCharge);
1359 chargeTrackSymCutClusterP[iD*4+iq]->Fill((*(it->points))[i].phiCharge);
1361 radioPlotsTrackHits[iD]->Fill((*(it->points))[i].x,(*(it->points))[i].y);
1362 radioPlotsClusChargeR[iD]->Fill((*(it->points))[i].x,(*(it->points))[i].y,(*(it->points))[i].rCharge);
1363 radioPlotsClusChargeP[iD]->Fill((*(it->points))[i].x,(*(it->points))[i].y,(*(it->points))[i].phiCharge);
1364 radioPlotsClusSizeR[iD]->Fill((*(it->points))[i].x,(*(it->points))[i].y,(*(it->points))[i].rSize);
1365 radioPlotsClusSizeP[iD]->Fill((*(it->points))[i].x,(*(it->points))[i].y,(*(it->points))[i].phiSize);
1366 chargeCorrTracks[iD*4+iq]->Fill((*(it->points))[i].rCharge,(*(it->points))[i].phiCharge);
1369 trkPhiProj[iD]->Fill((*(it->points))[i].phi);
1371 if((*(it->points))[i].r>19)
1373 chargeCorrTracksRCut[iD*4+iq]->Fill((*(it->points))[i].rCharge,(*(it->points))[i].phiCharge);
1389 for(
int i=0;i<6;i++)
1392 Double_t xExp=mx*StFgtGeneralBase::getLocDiscZ(i)+bx;
1393 Double_t yExp=my*StFgtGeneralBase::getLocDiscZ(i)+by;
1398 Double_t r=sqrt(xExp*xExp+yExp*yExp);
1400 Double_t phi=atan(yExp/xExp);
1401 if(xExp <0 && yExp <0)
1412 quad=StFgtGeom::getQuad(phi);
1416 phi-=StFgtGeom::phiQuadXaxis(quad);
1419 phi-=(2*TMath::Pi());
1420 if(phi<((-1)*TMath::Pi()))
1421 phi+=(2*TMath::Pi());
1427 if(isSomewhatEff(r,phi,i,quad))
1430 radioPlotsEffLoose[i]->Fill(xExp,yExp);
1435 radioPlotsNonEffLoose[i]->Fill(xExp,yExp);
1438 if(i==m_effDisk && quad==QUAD_EFF)
1441 if(findClosestStrip(
'R',r,i,quad)<MAX_DIST_STRIP_R)
1442 radioPlotsEffR[i]->Fill(xExp,yExp);
1444 radioPlotsNonEffR[i]->Fill(xExp,yExp);
1446 if(findClosestStrip(
'P',phi+StFgtGeom::phiQuadXaxis(quad),i,quad)<MAX_DIST_STRIP_PHI)
1449 radioPlotsEffPhi[i]->Fill(xExp,yExp);
1454 radioPlotsNonEffPhi[i]->Fill(xExp,yExp);
1467 radioPlotsEff[i]->Fill(xExp,yExp);
1471 hResidua->Fill(sqrt(closestPoint));
1472 hResiduaX->Fill(xExp,sqrt(closestPoint));
1473 hResiduaY->Fill(yExp,sqrt(closestPoint));
1474 hResiduaR->Fill(r,sqrt(closestPoint));
1475 hResiduaP->Fill(phi,sqrt(closestPoint));
1478 (*outTxtFile) <<
"***** found hit in disk " <<i <<
" quad: " << quad <<
" at " << xExp<<
", " << yExp<<
" r: " << r <<
" phi: " <<phi << endl;
1482 printArea(r,phi,i,quad);
1489 radioPlotsNonEff[i]->Fill(xExp,yExp);
1491 (*outTxtFile) <<
"expected (but haven't found) point on disk " << i <<
", x: " << xExp <<
" y: " << yExp <<
" r: " << r <<
" phi: " << phi <<
" quad:: " << quad << endl;
1495 printArea(r,phi,i,quad);
1498 pair<Double_t,Double_t> rPhiRatio=getChargeRatio(r,phi,i,quad);
1500 if(rPhiRatio.first>0 && rPhiRatio.second>0)
1502 double asym=fabs((Double_t)1-rPhiRatio.first/rPhiRatio.second);
1503 double ratio=rPhiRatio.first/rPhiRatio.second;
1506 if(asym<2 && ratio <2)
1508 hChargeAsym->Fill(asym);
1509 hChargeRatio->Fill(ratio);
1510 chargeRatioInEffDisk->Fill(xExp,yExp,ratio);
1511 chargeAsymInEffDisk->Fill(xExp,yExp,asym);
1517 for(vector<AVTrack>::iterator it=tracks.begin();it!=tracks.end();it++)
1523 Double_t vertZ = ( -( it->mx*it->ax + it->my*it->ay )/(it->mx*it->mx+it->my*it->my));
1525 pair<double,double> dca=
getDca(it);
1527 if(it->chi2<maxDistChi && fabs(vertZ)< vertexCut )
1529 hIpZ->Fill(dca.first);
1530 hIp->Fill(dca.first,dca.second);
1536 hChi2->Fill(it->chi2);
1539 tpcFgtZVertexCorr->Fill(dca.first,it->ipZEv);
1540 tpcFgtZVertexCorr2->Fill(vertZ,it->ipZEv);
1541 tpcFgtZVtxDiff->Fill(dca.first-it->ipZEv);
1542 tpcFgtZVtxDiff->Fill(vertZ-it->ipZEv);
1546 tpcFgtZVertexCorr3->Fill(vertZ,dca.first);
1548 hIpDca->Fill(dca.second);
1551 numTracks->Fill(numTracksInCurrEv);
1556 StFgtStraightPlotter::StFgtStraightPlotter(
const Char_t* name,
const Char_t* trackerName):
StMaker( name ),intNumTracks(0),useChargeMatch(false),runningEvtNr(0),hitCounter(0),hitCounterR(0),printCounter(0),fitCounter(0)
1559 sprintf(mTrackerName,
"%s",trackerName);
1563 LOG_FATAL <<
"StFgtDb not provided and error finding StFgtDbMaker" << endm;
1565 mDb = fgtDbMkr->getDbTables();
1567 LOG_FATAL <<
"StFgtDb not provided and error retrieving pointer from StFgtDbMaker '"
1568 << fgtDbMkr->
GetName() << endm;
1572 sprintf(mFileBase,
"%s",
".");
1573 pulseCondition=
true;
1576 maxDistStrip_Phi=0.03;
1580 isCosmic=fgtGenMkr->isCosmic();
1585 vertexCut=100000000;
1598 StFgtStraightPlotter::~StFgtStraightPlotter()
1603 void StFgtStraightPlotter::SetFileBase(
const Char_t* filebase,
const Char_t* filename )
1605 cout <<
"setting file base to " << filebase <<endl;
1606 sprintf(mFileBase,
"%s",filebase);
1607 sprintf(mFileName,
"%s",filename);
1613 outTxtFile->close();
1614 gStyle->SetPalette(1);
1619 vector<AVTrack>& tracks=fgtSTracker->getTracks();
1624 sprintf(buffer,
"radioPlots_%s",mFileName);
1625 TCanvas* cRadio=
new TCanvas(buffer,buffer,1000,1500);
1626 sprintf(buffer,
"radioPlotsLoose_%s",mFileName);
1627 TCanvas* cRadioLoose=
new TCanvas(buffer,buffer,1000,1500);
1628 sprintf(buffer,
"radioPlotsR_%s",mFileName);
1629 TCanvas* cRadioR=
new TCanvas(buffer,buffer,1000,1500);
1630 sprintf(buffer,
"radioPlotsPhi_%s",mFileName);
1631 TCanvas* cRadioPhi=
new TCanvas(buffer,buffer,1000,1500);
1632 sprintf(buffer,
"radioPlotsHits_%s",mFileName);
1633 TCanvas* cRadioHits=
new TCanvas(buffer,buffer,1000,1500);
1634 sprintf(buffer,
"radioPlotsNonHits_%s",mFileName);
1635 TCanvas* cRadioNonHits=
new TCanvas(buffer,buffer,1000,1500);
1637 cRadio->Divide(2,3);
1638 cRadioR->Divide(2,3);
1639 cRadioPhi->Divide(2,3);
1640 cRadioLoose->Divide(2,3);
1641 cRadioHits->Divide(2,3);
1642 cRadioNonHits->Divide(2,3);
1643 sprintf(buffer,
"rPhiRatios_%s",mFileName);
1644 TCanvas* cRPRatio=
new TCanvas(buffer,buffer,1000,1500);
1645 cRPRatio->Divide(2,3);
1646 sprintf(buffer,
"crEff_%s",mFileName);
1647 TCanvas* cREff=
new TCanvas(buffer,buffer,1000,1500);
1651 for(Int_t iD=0;iD<kFgtNumDiscs;iD++)
1654 cRadioHits->cd(iD+1);
1655 radioPlotsEff[iD]->Draw(
"colz");
1656 cRadioNonHits->cd(iD+1);
1657 radioPlotsNonEff[iD]->Draw(
"colz");
1660 sprintf(buffer,
"%s/clusterPics%s.root",mFileBase,mFileName);
1661 cout <<
"setting cluster pic file to : " << buffer <<endl;
1662 TFile *fClu =
new TFile(buffer,
"recreate");
1663 cout <<
" 1 " << endl;
1665 cout <<
" 2 " << endl;
1666 for(
unsigned int i=0;i<v_hClusP.size();i++)
1670 cout <<
" 3 " << endl;
1671 for(
unsigned int i=0;i<v_hClusR.size();i++)
1675 cout <<
" 4 " << endl;
1677 cout <<
" 5 " << endl;
1679 cout <<
"about to open signal shapes file... "<<endl;
1680 sprintf(buffer,
"%s/signalShapes%s.root",mFileBase,mFileName);
1681 cout <<
"setting signal shapes file to : " << buffer <<endl;
1682 TFile *f1 =
new TFile(buffer,
"recreate");
1684 cout <<
"writing hip..."<<endl;
1689 for(
int iD=0;iD<6;iD++)
1691 radioPlotsTrackHits[iD]->Write();
1692 radioPlotsClusSizeR[iD]->Write();
1693 radioPlotsClusSizeP[iD]->Write();
1694 radioPlotsClusChargeR[iD]->Write();
1695 radioPlotsClusChargeP[iD]->Write();
1696 trkPhiProj[iD]->Write();
1702 for(
int iB=1;iB<8;iB++)
1704 exPulseMaxAdcNormP->SetBinContent(iB,exPulseMaxAdcNormP->GetBinContent(iB)/(float)pulseCounterP);
1705 exPulseSigP->SetBinContent(iB,exPulseSigP->GetBinContent(iB)/(float)pulseCounterP);
1707 exPulseMaxAdcNormR->SetBinContent(iB,exPulseMaxAdcNormR->GetBinContent(iB)/(float)pulseCounterR);
1708 exPulseSigR->SetBinContent(iB,exPulseSigR->GetBinContent(iB)/(float)pulseCounterR);
1710 exPulseMaxAdcNormTrackP->SetBinContent(iB,exPulseMaxAdcNormTrackP->GetBinContent(iB)/(float)pulseCounterTP);
1711 exPulseSigTrackP->SetBinContent(iB,exPulseSigTrackP->GetBinContent(iB)/(float)pulseCounterTP);
1713 exPulseMaxAdcNormTrackR->SetBinContent(iB,exPulseMaxAdcNormTrackR->GetBinContent(iB)/(float)pulseCounterTR);
1714 exPulseSigTrackR->SetBinContent(iB,exPulseSigTrackR->GetBinContent(iB)/(float)pulseCounterTR);
1717 chargeCorrSum3->Write();
1718 chargeCorrMaxStrip->Write();
1719 chargeCorrMaxAdc->Write();
1721 exPulseMaxAdcNormP->Write();
1722 exPulseSigP->Write();
1724 exPulseMaxAdcNormR->Write();
1725 exPulseSigR->Write();
1727 exPulseMaxAdcNormTrackP->Write();
1728 exPulseSigTrackP->Write();
1729 exPulseMaxAdcNormTrackR->Write();
1730 exPulseSigTrackR->Write();
1732 numPointsPerTrack->Write();
1734 for(
int xx=0; xx<22; xx++){
1736 disk1QuadA[xx]->Write();
1740 for(
int iD=0;iD<kFgtNumDiscs;iD++)
1745 clusterGeoId[iD]->Write();
1746 clustersR[iD]->Write();
1747 clustersP[iD]->Write();
1750 for(
int iq=0;iq<4;iq++)
1752 numClustersR[iD*4+iq]->Write();
1753 numClustersPhi[iD*4+iq]->Write();
1754 numTrackHits[iD*4+iq]->Write();
1757 maxTbCloseClusterP[iD*4+iq]->Write();
1758 maxTbCloseClusterR[iD*4+iq]->Write();
1759 maxAdcCloseClusterP[iD*4+iq]->Write();
1760 maxSigTrackClusterP[iD*4+iq]->Write();
1761 numFSigCloseClusterP[iD*4+iq]->Write();
1762 numFirstHighCloseClusterP[iD*4+iq]->Write();
1763 maxAdcCloseClusterP[iD*4+iq]->Write();
1764 maxSigCloseClusterP[iD*4+iq]->Write();
1765 secondToLastRatioCloseClusterP[iD*4+iq]->Write();
1766 maxAdcCloseClusterR[iD*4+iq]->Write();
1767 maxSigCloseClusterR[iD*4+iq]->Write();
1768 numFSigCloseClusterR[iD*4+iq]->Write();
1769 numFirstHighCloseClusterR[iD*4+iq]->Write();
1770 maxAdcCloseClusterR[iD*4+iq]->Write();
1771 maxSigCloseClusterR[iD*4+iq]->Write();
1772 secondToLastRatioCloseClusterR[iD*4+iq]->Write();
1773 firstTbSigCloseClusterR[iD*4+iq]->Write();
1774 firstTbSigCloseClusterP[iD*4+iq]->Write();
1776 chargeTrackClusterR[iD*4+iq]->Write();
1777 chargeTrackClusterP[iD*4+iq]->Write();
1778 chargeTrackClusterRvsP[iD*4+iq]->Write();
1779 chargeTrackClusterPvsR[iD*4+iq]->Write();
1780 numTrackClusterR[iD*4+iq]->Write();
1781 numTrackClusterP[iD*4+iq]->Write();
1782 numTrackSymCutClusterR[iD*4+iq]->Write();
1783 numTrackSymCutClusterP[iD*4+iq]->Write();
1784 chargeCorrTracks[iD*4+iq]->Write();
1785 chargeCorrTracksRCut[iD*4+iq]->Write();
1786 chargeTrackSymCutClusterR[iD*4+iq]->Write();
1787 chargeTrackSymCutClusterP[iD*4+iq]->Write();
1788 maxTbTrackClusterP[iD*4+iq]->Write();
1789 maxTbTrackClusterR[iD*4+iq]->Write();
1790 maxAdcTrackClusterP[iD*4+iq]->Write();
1791 maxSigTrackClusterP[iD*4+iq]->Write();
1792 numFSigTrackClusterP[iD*4+iq]->Write();
1793 numFirstHighTrackClusterP[iD*4+iq]->Write();
1794 maxAdcTrackClusterP[iD*4+iq]->Write();
1795 maxSigTrackClusterP[iD*4+iq]->Write();
1796 secondToLastRatioTrackClusterP[iD*4+iq]->Write();
1797 maxAdcTrackClusterR[iD*4+iq]->Write();
1798 maxSigTrackClusterR[iD*4+iq]->Write();
1799 numFSigTrackClusterR[iD*4+iq]->Write();
1800 numFirstHighTrackClusterR[iD*4+iq]->Write();
1801 maxAdcTrackClusterR[iD*4+iq]->Write();
1802 maxSigTrackClusterR[iD*4+iq]->Write();
1803 secondToLastRatioTrackClusterR[iD*4+iq]->Write();
1804 firstTbSigTrackClusterR[iD*4+iq]->Write();
1805 firstTbSigTrackClusterP[iD*4+iq]->Write();
1810 for(
int iD=0;iD<6;iD++)
1812 for(
int binAPVi=0;binAPVi<40;binAPVi++)
1814 APVfitChi2P[iD*40+binAPVi]->Write();
1815 APVfitChi2R[iD*40+binAPVi]->Write();
1816 APVfitAmpP[iD*40+binAPVi]->Write();
1817 APVfitAmpR[iD*40+binAPVi]->Write();
1818 APVfitT0P[iD*40+binAPVi]->Write();
1819 APVfitT0R[iD*40+binAPVi]->Write();
1821 APVfirstTbSigCloseClusterP[iD*40+binAPVi]->Write();
1822 APVmaxAdcCloseClusterP[iD*40+binAPVi]->Write();
1823 APVmaxTbCloseClusterP[iD*40+binAPVi]->Write();
1824 APVnumFSigCloseClusterP[iD*40+binAPVi]->Write();
1825 APVnumFirstHighCloseClusterP[iD*40+binAPVi]->Write();
1826 APVmaxSigCloseClusterP[iD*40+binAPVi]->Write();
1827 APVsecondToLastRatioCloseClusterP[iD*40+binAPVi]->Write();
1828 APVfirstTbSigCloseClusterR[iD*40+binAPVi]->Write();
1829 APVmaxAdcCloseClusterR[iD*40+binAPVi]->Write();
1830 APVmaxTbCloseClusterR[iD*40+binAPVi]->Write();
1831 APVnumFSigCloseClusterR[iD*40+binAPVi]->Write();
1832 APVnumFirstHighCloseClusterR[iD*40+binAPVi]->Write();
1833 APVmaxSigCloseClusterR[iD*40+binAPVi]->Write();
1834 APVsecondToLastRatioCloseClusterR[iD*40+binAPVi]->Write();
1839 cout <<
"writen and closed " << endl;
1846 sprintf(buffer,
"clusterSizeR_%s",mFileName);
1847 TCanvas* cClusterSizeR=
new TCanvas(buffer,buffer,1000,1500);
1849 cClusterSizeR->Divide(2,3);
1850 sprintf(buffer,
"clusterSizePhi_%s",mFileName);
1851 TCanvas* cClusterSizePhi=
new TCanvas(buffer,buffer,1000,1500);
1852 cClusterSizePhi->Divide(2,3);
1853 sprintf(buffer,
"chargeCorr_%s",mFileName);
1854 TCanvas* cChargeCorr=
new TCanvas(buffer,buffer,1000,1500);
1855 cChargeCorr->Divide(3,4);
1856 sprintf(buffer,
"clusterChargePhi_%s",mFileName);
1857 TCanvas* cClusterChargePhi=
new TCanvas(buffer,buffer,1000,1500);
1858 cClusterChargePhi->Divide(2,3);
1859 sprintf(buffer,
"clusterChargeR_%s",mFileName);
1860 TCanvas* cClusterChargeR=
new TCanvas(buffer,buffer,1000,1500);
1861 cClusterChargeR->Divide(2,3);
1911 tpcFgtZVertexCorr->Draw(
"colz");
1912 tpcFgtZVertexCorr->Write();
1915 tpcFgtZVertexCorr2->Draw(
"colz");
1916 tpcFgtZVertexCorr2->Write();
1918 tpcFgtZVtxDiff->Write();
1919 tpcFgtZVtxDiff2->Write();
1921 tpcFgtZVertexCorr3->Draw(
"colz");
1922 tpcFgtZVertexCorr3->Write();
1926 for(Int_t iD=0;iD<kFgtNumDiscs;iD++)
1928 cClusterSizeR->cd(iD+1);
1929 h_clusterSizeR[iD]->Draw();
1930 cClusterSizePhi->cd(iD+1);
1931 h_clusterSizePhi[iD]->Draw();
1932 for(
int iq=0;iq<4;iq++)
1934 cChargeCorr->cd(iD*4+iq+1);
1935 chargeCorr[iD*4+iq]->Draw(
"colz");
1936 chargeCorr[iD*4+iq]->Write();
1937 clusterSizeR[iD*4+iq]->Write();
1938 clusterSizeP[iD*4+iq]->Write();
1940 cClusterChargeR->cd(iD+1);
1941 h_clusterChargeR[iD]->Draw();
1942 cClusterChargePhi->cd(iD+1);
1943 h_clusterChargePhi[iD]->Draw();
1944 h_clusterChargeR[iD]->Write();
1945 h_clusterChargePhi[iD]->Write();
1956 cout <<
"saving .." <<endl;
1957 doNormalize(radioPlotsEffR, radioPlotsNonEffR);
1958 doNormalize(radioPlotsEffPhi, radioPlotsNonEffPhi);
1961 for(Int_t iD=0;iD<kFgtNumDiscs;iD++)
1963 sprintf(buffer,
"allCountsLooseDisk_%d",iD+1);
1964 TH2D* tmpAllCountsLoose=(TH2D*)radioPlotsEffLoose[iD]->
Clone(buffer);
1965 tmpAllCountsLoose->Write();
1966 sprintf(buffer,
"allClusterCountsDisk_%d",iD+1);
1967 TH2D* tmpAllClusterCounts=(TH2D*)radioPlotsEff[iD]->
Clone(buffer);
1968 tmpAllClusterCounts->Write();
1971 doNormalize(radioPlotsEffLoose, radioPlotsNonEffLoose);
1974 for(Int_t iD=0;iD<kFgtNumDiscs;iD++)
1977 sprintf(buffer,
"allCountsDisk_%d",iD+1);
1978 TH2D* tmpAllCounts=(TH2D*)radioPlotsEff[iD]->
Clone(buffer);
1979 tmpAllCounts->Write();
1980 radioPlotsEff[iD]->Add(radioPlotsNonEff[iD]);
1984 for(
int nx=1;nx<radioPlotsEff[iD]->GetNbinsX()+1;nx++)
1986 for(
int ny=1;ny<radioPlotsEff[iD]->GetNbinsY()+1;ny++)
1988 Double_t denom=radioPlotsEff[iD]->GetBinContent(nx,ny);
1989 if(denom>0 && (tmpAllCounts->GetBinContent(nx,ny)/denom)<=1.0)
1992 radioPlotsEff[iD]->SetBinContent(nx,ny,tmpAllCounts->GetBinContent(nx,ny)/denom);
1996 chargeRatioInEffDisk->SetBinContent(nx,ny,chargeRatioInEffDisk->GetBinContent(nx,ny)/denom);
1997 chargeAsymInEffDisk->SetBinContent(nx,ny,chargeAsymInEffDisk->GetBinContent(nx,ny)/denom);
2003 radioPlotsEff[iD]->SetBinContent(nx,ny,0.0);
2008 radioPlotsEff[iD]->SetMaximum(1.0);
2009 radioPlotsEff[iD]->Draw(
"colz");
2011 radioPlotsEffR[iD]->SetMaximum(1.0);
2012 radioPlotsEffPhi[iD]->SetMaximum(1.0);
2013 radioPlotsEffLoose[iD]->SetMaximum(1.0);
2015 radioPlotsEffR[iD]->Draw(
"colz");
2016 radioPlotsEffR[iD]->Write();
2017 cRadioPhi->cd(iD+1);
2018 radioPlotsEffPhi[iD]->Draw(
"colz");
2019 radioPlotsEffPhi[iD]->Write();
2020 cRadioLoose->cd(iD+1);
2021 radioPlotsEffLoose[iD]->Draw(
"colz");
2022 radioPlotsEffLoose[iD]->Write();
2023 radioPlotsNonEffLoose[iD]->Write();
2024 radioPlotsNonEff[iD]->Write();
2026 rPhiRatioPlots[iD]->Draw();
2030 TH1D* tmpR=(TH1D*)rEff[iD]->
Clone(
"tmpR");
2031 rEff[iD]->Add(rNonEff[iD]);
2032 for(
int nx=0;nx<rEff[iD]->GetNbinsX();nx++)
2034 Double_t denom=rEff[iD]->GetBinContent(nx);
2036 rEff[iD]->SetBinContent(nx,tmpR->GetBinContent(nx)/denom);
2038 rEff[iD]->SetBinContent(nx,0.0);
2051 chargeRatioInEffDisk->Draw(
"colz");
2053 chargeAsymInEffDisk->Draw(
"colz");
2055 chargeCorrInEffDisk->Draw(
"colz");
2056 chargeCorrInEffDisk->Write();
2058 hChargeAsym->Draw();
2060 hChargeRatio->Draw();
2072 myRootFile->Write();
2073 myRootFile->Close();
2075 pulsePictureFile->Write();
2076 cout <<
"returning after finish" <<endl;
2085 Int_t StFgtStraightPlotter::Init(){
2086 cout <<
"init file name is " << mFileName<<endl;
2087 outTxtFile=
new ofstream;
2088 outTxtFile->open(
"clusExpectations.txt");
2089 cluNotFoundTxt=
new ofstream;
2090 cluNotFoundTxt->open(
"clusNotFound.txt");
2093 sprintf(buffer,
"tmpCnvs%s",mFileName);
2094 mCanvas=
new TCanvas(buffer,buffer);
2095 cout <<
"made canvas with name " << buffer <<
" pointer: " << mCanvas <<endl;
2096 sprintf(buffer,
"%s/clusterEff%s.root",mFileBase,mFileName);
2098 myRootFile=
new TFile(buffer,
"RECREATE");
2099 sprintf(buffer,
"%s/pulsePic%s.root",mFileBase,mFileName);
2101 pulsePictureFile=
new TFile(buffer,
"RECREATE");
2102 cout <<
"making dirs.." <<endl;
2103 for(
int i=0;i<6;i++){
2104 for(
int iq=0;iq<4;iq++){
2105 sprintf(buffer,
"d%d_quad%d",i,iq);
2106 pulsePictureFile->mkdir(buffer);
2107 pulsePictureFile->cd(buffer);
2108 for(
int iA=0;iA<24;iA++)
2110 sprintf(buffer,
"apv%d_R",iA);
2111 gDirectory->mkdir(buffer);
2112 sprintf(buffer,
"apv%d_P",iA);
2113 gDirectory->mkdir(buffer);
2115 pulsePictureFile->cd();
2118 cout <<
"done " << endl;
2122 sprintf(buffer,
"pulseShape_%s",mFileName);
2124 mPulseShapePtr=
new TF1(buffer,
"[0]*(x>[4])*(x-[4])**[1]*exp(-[2]*(x-[4]))+[3]",0,numTb);
2125 mPulseShapePtr->SetParName( 0,
"C" );
2126 mPulseShapePtr->SetParName( 1,
"a" );
2127 mPulseShapePtr->SetParName( 2,
"b" );
2128 mPulseShapePtr->SetParName( 3,
"ped" );
2129 mPulseShapePtr->SetParName( 4,
"t0" );
2131 sprintf(buffer,
"tempFitHist_%s",mFileName);
2132 mHistPtr=
new TH1F(buffer,buffer,numTb,0,numTb);
2133 sprintf(buffer,
"tempFitHist2_%s",mFileName);
2134 mHistPtr2=
new TH1F(buffer,buffer,numTb,0,numTb);
2135 mHistPtr2->SetLineColor(kBlue);
2136 mHistPtr2->SetFillColor(kBlue);
2137 mHistPtr2->SetMarkerColor(kBlue);
2138 cout <<
"producing my canvas... "<<endl;
2146 sprintf(buffer,
"chargeRatioInEffDisk_%s",mFileName);
2147 chargeRatioInEffDisk=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2148 chargeRatioInEffDisk->SetMaximum(2.0);
2149 sprintf(buffer,
"chargeAsymInEffDisk_%s",mFileName);
2150 chargeAsymInEffDisk=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2151 chargeAsymInEffDisk->SetMaximum(1.0);
2152 sprintf(buffer,
"chargeCorrInEffDisk_%s",mFileName);
2153 chargeCorrInEffDisk=
new TH2D(buffer,buffer,500,0,50000,500,0,50000);
2154 sprintf(buffer,
"chargeAsym_%s",mFileName);
2155 hChargeAsym=
new TH1D(buffer,buffer,100,0,50);
2156 sprintf(buffer,
"chargeRatio_%s",mFileName);
2157 hChargeRatio=
new TH1D(buffer,buffer,100,0,50);
2159 sprintf(buffer,
"chargeCorrSum3_%s",mFileName);
2160 chargeCorrSum3=
new TH2D(buffer,buffer,500,0,50000,500,0,50000);
2161 sprintf(buffer,
"chargeCorrMaxStrip_%s",mFileName);
2162 chargeCorrMaxStrip=
new TH2D(buffer,buffer,500,0,20000,500,0,20000);
2163 sprintf(buffer,
"chargeCorrMaxAdc_%s",mFileName);
2164 chargeCorrMaxAdc=
new TH2D(buffer,buffer,500,0,5000,500,0,5000);
2165 chargeCorrTracks=
new TH2D*[kFgtNumDiscs*4];
2166 chargeCorrTracksRCut=
new TH2D*[kFgtNumDiscs*4];
2168 trkPhiProj=
new TH1D*[kFgtNumDiscs];
2170 radioPlotsTrackHits=
new TH2D*[kFgtNumDiscs];
2171 radioPlotsClusChargeR=
new TH2D*[kFgtNumDiscs];
2172 radioPlotsClusSizeR=
new TH2D*[kFgtNumDiscs];
2173 radioPlotsClusChargeP=
new TH2D*[kFgtNumDiscs];
2174 radioPlotsClusSizeP=
new TH2D*[kFgtNumDiscs];
2176 radioPlotsEff=
new TH2D*[kFgtNumDiscs];
2177 radioPlotsNonEff=
new TH2D*[kFgtNumDiscs];
2178 radioPlotsEffR=
new TH2D*[kFgtNumDiscs];
2179 radioPlotsNonEffR=
new TH2D*[kFgtNumDiscs];
2180 radioPlotsEffPhi=
new TH2D*[kFgtNumDiscs];
2181 radioPlotsEffLoose=
new TH2D*[kFgtNumDiscs];
2182 radioPlotsNonEffPhi=
new TH2D*[kFgtNumDiscs];
2183 radioPlotsNonEffLoose=
new TH2D*[kFgtNumDiscs];
2184 rPhiRatioPlots=
new TH1D*[kFgtNumDiscs];
2186 sprintf(buffer,
"pulseMaxAdcNormP_%s",mFileName);
2187 exPulseMaxAdcNormP=
new TH1F(buffer,buffer,7,0,6);
2188 sprintf(buffer,
"pulseSigNormP_%s",mFileName);
2189 exPulseSigP=
new TH1F(buffer,buffer,7,0,6);
2190 sprintf(buffer,
"pulseMaxAdcNormR_%s",mFileName);
2191 exPulseMaxAdcNormR=
new TH1F(buffer,buffer,7,0,6);
2192 sprintf(buffer,
"pulseSigNormR_%s",mFileName);
2193 exPulseSigR=
new TH1F(buffer,buffer,7,0,6);
2195 sprintf(buffer,
"pulseMaxAdcNormTrackP_%s",mFileName);
2196 exPulseMaxAdcNormTrackP=
new TH1F(buffer,buffer,7,0,6);
2197 sprintf(buffer,
"pulseSigNormTrackP_%s",mFileName);
2198 exPulseSigTrackP=
new TH1F(buffer,buffer,7,0,6);
2200 sprintf(buffer,
"pulseMaxAdcNormTrackR_%s",mFileName);
2201 exPulseMaxAdcNormTrackR=
new TH1F(buffer,buffer,7,0,6);
2202 sprintf(buffer,
"pulseSigNormTrackR_%s",mFileName);
2203 exPulseSigTrackR=
new TH1F(buffer,buffer,7,0,6);
2215 createPlots(&numClustersR,kFgtNumDiscs*4,
"numClustersR",101,0,100);
2216 createPlots(&numClustersPhi,kFgtNumDiscs*4,
"numClustersPhi",101,0,100);
2217 createPlots(&numTrackHits,kFgtNumDiscs*4,
"numTrackHits",101,0,100);
2218 sprintf(buffer,
"numTracksPerEvent_%s",mFileName);
2219 numTracks=
new TH1I(buffer,buffer,10,0,9);
2220 sprintf(buffer,
"numPointsPerTrack_%s",mFileName);
2221 numPointsPerTrack=
new TH1I(buffer,buffer,7,0,6);
2223 createPlots(&firstTbSigCloseClusterR,kFgtNumDiscs*4,
"firstTbSigCloseClusterR",100,0,20);
2224 createPlots(&firstTbSigCloseClusterP,kFgtNumDiscs*4,
"firstTbSigCloseClusterP",100,0,20);
2225 createPlots(&firstTbSigTrackClusterR,kFgtNumDiscs*4,
"firstTbSigTrackClusterR",100,0,20);
2226 createPlots(&firstTbSigTrackClusterP,kFgtNumDiscs*4,
"firstTbSigTrackClusterP",100,0,20);
2228 createPlots(&chargeTrackSymCutClusterR,kFgtNumDiscs*4,
"chargeTrackSymCutClusterR",100,0,10000);
2229 createPlots(&chargeTrackSymCutClusterP,kFgtNumDiscs*4,
"chargeTrackSymCutClusterP",100,0,10000);
2231 createPlots(&numTrackSymCutClusterR,kFgtNumDiscs*4,
"numTrackSymCutClusterR",100,0,10000);
2232 createPlots(&numTrackSymCutClusterP,kFgtNumDiscs*4,
"numTrackSymCutClusterP",100,0,10000);
2234 createPlots(&numTrackClusterR,kFgtNumDiscs*4,
"numTrackClusterR",100,10,40);
2235 createPlots(&numTrackClusterP,kFgtNumDiscs*4,
"numTrackClusterP",100,0,7);
2237 createPlots(&chargeTrackClusterR,kFgtNumDiscs*4,
"chargeTrackClusterR",100,0,10000);
2238 createPlots(&chargeTrackClusterP,kFgtNumDiscs*4,
"chargeTrackClusterP",100,0,10000);
2240 createPlots(&chargeTrackClusterRvsP,kFgtNumDiscs*4,
"chargeTrackClusterRvsP",100,0,7);
2241 createPlots(&chargeTrackClusterPvsR,kFgtNumDiscs*4,
"chargeTrackClusterPvsR",100,10,40);
2243 createPlots(&maxAdcTrackClusterR,kFgtNumDiscs*4,
"maxAdcTrackClusterR",100,0,5000);
2244 createPlots(&maxAdcCloseClusterR,kFgtNumDiscs*4,
"maxAdcCloseClusterR",100,0,5000);
2245 createPlots(&maxSigTrackClusterR,kFgtNumDiscs*4,
"maxSigTrackClusterR",100,1,200);
2246 createPlots(&maxSigCloseClusterR,kFgtNumDiscs*4,
"maxSigCloseClusterR",100,1,200);
2247 createPlots(&numFSigTrackClusterR,kFgtNumDiscs*4,
"numFSigTrackClusterR",9,1,8);
2248 createPlots(&maxTbCloseClusterR,kFgtNumDiscs*4,
"maxTbCloseClusterR",8,0,7);
2250 createPlots(&maxTbCloseClusterP,kFgtNumDiscs*4,
"maxTbCloseClusterP",8,0,7);
2252 createPlots(&maxTbTrackClusterR,kFgtNumDiscs*4,
"maxTbTrackClusterR",8,0,7);
2254 createPlots(&maxTbTrackClusterP,kFgtNumDiscs*4,
"maxTbTrackClusterP",9,0,8);
2255 createPlots(&numFSigCloseClusterR,kFgtNumDiscs*4,
"numFSigCloseClusterR",9,0,8);
2257 createPlots(&numFirstHighTrackClusterR,kFgtNumDiscs*4,
"numFirstHighTrackClusterR",8,0,7);
2258 createPlots(&numFirstHighCloseClusterR,kFgtNumDiscs*4,
"numFirstHighCloseClusterR",8,0,7);
2260 createPlots(&maxAdcTrackClusterP,kFgtNumDiscs*4,
"maxAdcTrackClusterP",100,0,5000);
2261 createPlots(&maxAdcCloseClusterP,kFgtNumDiscs*4,
"maxAdcCloseClusterP",100,0,5000);
2262 createPlots(&maxSigTrackClusterP,kFgtNumDiscs*4,
"maxSigTrackClusterP",100,1,200);
2263 createPlots(&maxSigCloseClusterP,kFgtNumDiscs*4,
"maxSigCloseClusterP",100,1,200);
2264 createPlots(&numFSigTrackClusterP,kFgtNumDiscs*4,
"numFSigTrackClusterP",9,0,8);
2265 createPlots(&numFSigCloseClusterP,kFgtNumDiscs*4,
"numFSigCloseClusterP",9,0,8);
2266 createPlots(&numFirstHighTrackClusterP,kFgtNumDiscs*4,
"numFirstHighTrackClusterP",8,0,7);
2267 createPlots(&numFirstHighCloseClusterP,kFgtNumDiscs*4,
"numFirstHighCloseClusterP",8,0,7);
2268 createPlots(&secondToLastRatioCloseClusterP,kFgtNumDiscs*4,
"secondToLastRatioClosClusterP",100,0,5);
2270 createPlots(&secondToLastRatioCloseClusterR,kFgtNumDiscs*4,
"secondToLastRatioClosClusterR",100,0,5);
2272 createPlots(&secondToLastRatioTrackClusterP,kFgtNumDiscs*4,
"secondToLastRatioTrackClusterP",100,0,5);
2274 createPlots(&secondToLastRatioTrackClusterR,kFgtNumDiscs*4,
"secondToLastRatioTrackClusterR",100,0,5);
2278 createPlots(&APVfitChi2P,kFgtNumDiscs*40,
"APVfitChi2P",100,0,30);
2279 createPlots(&APVfitChi2R,kFgtNumDiscs*40,
"APVfitChi2R",100,0,30);
2280 createPlots(&APVfitAmpP,kFgtNumDiscs*40,
"APVfitAmpP",100,0,30);
2281 createPlots(&APVfitAmpR,kFgtNumDiscs*40,
"APVfitAmpR",100,0,30);
2282 createPlots(&APVfitT0P,kFgtNumDiscs*40,
"APVfitT0P",100,0,30);
2283 createPlots(&APVfitT0R,kFgtNumDiscs*40,
"APVfitT0R",100,0,30);
2285 createPlots(&APVfirstTbSigCloseClusterP,kFgtNumDiscs*40,
"APVfirstTbSigCloseClusterP",100,0,20);
2286 createPlots(&APVfirstTbSigCloseClusterR,kFgtNumDiscs*40,
"APVfirstTbSigCloseClusterR",100,0,20);
2287 createPlots(&APVmaxAdcCloseClusterP,kFgtNumDiscs*40,
"APVmaxAdcCloseClusterP",100,0,5000);
2288 createPlots(&APVmaxAdcCloseClusterR,kFgtNumDiscs*40,
"APVmaxAdcCloseClusterR",100,0,5000);
2289 createPlots(&APVmaxTbCloseClusterP,kFgtNumDiscs*40,
"APVmaxTbCloseClusterP",8,0,7);
2290 createPlots(&APVmaxTbCloseClusterR,kFgtNumDiscs*40,
"APVmaxTbCloseClusterR",8,0,7);
2291 createPlots(&APVnumFSigCloseClusterP,kFgtNumDiscs*40,
"APVnumFSigCloseClusterP",9,0,8);
2292 createPlots(&APVnumFSigCloseClusterR,kFgtNumDiscs*40,
"APVnumFSigCloseClusterR",9,0,8);
2293 createPlots(&APVnumFirstHighCloseClusterP,kFgtNumDiscs*40,
"APVnumFirstHighCloseClusterP",8,0,7);
2294 createPlots(&APVnumFirstHighCloseClusterR,kFgtNumDiscs*40,
"APVnumFirstHighCloseClusterR",8,0,7);
2295 createPlots(&APVmaxSigCloseClusterP,kFgtNumDiscs*40,
"APVmaxSigCloseClusterP",100,1,200);
2296 createPlots(&APVmaxSigCloseClusterR,kFgtNumDiscs*40,
"APVmaxSigCloseClusterR",100,1,200);
2297 createPlots(&APVsecondToLastRatioCloseClusterP,kFgtNumDiscs*40,
"APVsecondToLastRatioCloseClusterP",100,0,5);
2298 createPlots(&APVsecondToLastRatioCloseClusterR,kFgtNumDiscs*40,
"APVsecondToLastRatioCloseClusterR",100,0,5);
2302 createPlots(&clusterGeoId, kFgtNumDiscs,
"clusterGeoId",32000,0,32000);
2303 createPlots(&clustersR, kFgtNumDiscs,
"clustersR", 500, 0, 50);
2304 createPlots(&clustersP, kFgtNumDiscs,
"clustersP", 100, -3.14159, 3.14159);
2306 for (Int_t iii=0;iii< 22;iii++)
2309 sprintf(buffer,
"%s_APV%d",
"disk1QuadA_%s",iii,mFileName);
2310 disk1QuadA[iii]=
new TH1I(buffer,buffer,128,0,128);
2313 rEff=
new TH1D*[kFgtNumDiscs];
2314 rNonEff=
new TH1D*[kFgtNumDiscs];
2317 clusterSizeP=
new TH1D*[kFgtNumDiscs*4];
2318 clusterSizeR=
new TH1D*[kFgtNumDiscs*4];
2319 chargeCorr=
new TH2D*[kFgtNumDiscs*4];
2321 h_clusterSizeR=
new TH1D*[kFgtNumDiscs];
2322 h_clusterSizePhi=
new TH1D*[kFgtNumDiscs];
2324 h_clusterChargeR=
new TH1D*[kFgtNumDiscs];
2325 h_clusterChargePhi=
new TH1D*[kFgtNumDiscs];
2327 sprintf(buffer,
"ProjToIP_%s",mFileName);
2328 hIp=
new TH2D(buffer,buffer,50,-100,100,50,0,10);
2329 sprintf(buffer,
"hBx_%s",mFileName);
2330 hBx=
new TH1D(buffer,buffer,50,-100,100);
2331 sprintf(buffer,
"hBy_%s",mFileName);
2332 hBy=
new TH1D(buffer,buffer,50,-100,100);
2333 sprintf(buffer,
"hMx_%s",mFileName);
2334 hMx=
new TH1D(buffer,buffer,50,-100,100);
2335 sprintf(buffer,
"hMy_%s",mFileName);
2336 hMy=
new TH1D(buffer,buffer,50,-0.1,0.1);
2337 sprintf(buffer,
"IP_Z_%s",mFileName);
2338 hIpZ=
new TH1D(buffer,buffer,50,-100,100);
2340 sprintf(buffer,
"ipDCA_%s",mFileName);
2341 hIpDca=
new TH1D(buffer,buffer,50,-100,100);
2342 sprintf(buffer,
"z_Vtx_From_trk_fit_%s",mFileName);
2343 hTrkZ=
new TH1D(buffer,buffer,50,-100,100);
2344 sprintf(buffer,
"residua_%s",mFileName);
2345 hResidua=
new TH1D(buffer,buffer,100,0,2);
2346 sprintf(buffer,
"residuaX_%s",mFileName);
2347 hResiduaX=
new TH2D(buffer,buffer,100,-10,10,200,0,1.0);
2348 sprintf(buffer,
"residuaY_%s",mFileName);
2349 hResiduaY=
new TH2D(buffer,buffer,100,-40,-20,200,0,1.0);
2350 sprintf(buffer,
"residuaR_%s",mFileName);
2351 hResiduaR=
new TH2D(buffer,buffer,100,12,32,200,0,1.0);
2352 sprintf(buffer,
"residuaP_%s",mFileName);
2353 hResiduaP=
new TH2D(buffer,buffer,100,0,0.8,200,0,1.0);
2355 sprintf(buffer,
"chi2_%s",mFileName);
2356 hChi2=
new TH1D(buffer,buffer,50,0,2);
2357 sprintf(buffer,
"tpc_fgt_corr_%s",mFileName);
2358 tpcFgtZVertexCorr=
new TH2D(buffer,buffer,100,-120,120,100,-120,120);
2359 sprintf(buffer,
"tpc_fgt_corr2_%s",mFileName);
2360 tpcFgtZVertexCorr2=
new TH2D(buffer,buffer,100,-120,120,100,-120,120);
2361 sprintf(buffer,
"tpc_fgt_corr3_%s",mFileName);
2362 tpcFgtZVertexCorr3=
new TH2D(buffer,buffer,50,-50,50,50,-50,50);
2364 sprintf(buffer,
"tpc_fgt_diff%s",mFileName);
2365 tpcFgtZVtxDiff=
new TH1D(buffer,buffer,1000,-50,50);
2366 sprintf(buffer,
"tpc_fgt_diff2%s",mFileName);
2367 tpcFgtZVtxDiff2=
new TH1D(buffer, buffer,1000,-50,50);
2369 for(
int iD=0;iD<kFgtNumDiscs;iD++)
2372 for(
int iq=0;iq<4;iq++)
2374 sprintf(buffer,
"chargeCorrTracks_disk_%d_quad_%d_%s",iD,iq,mFileName);
2375 chargeCorrTracks[iD*4+iq]=
new TH2D(buffer,buffer,200,0,10000,200,0,10000);
2376 sprintf(buffer,
"chargeCorrTracksRCut_disk_%d_quad_%d_%s",iD,iq,mFileName);
2377 chargeCorrTracksRCut[iD*4+iq]=
new TH2D(buffer,buffer,200,0,10000,200,0,10000);
2380 sprintf(buffer,
"radioTrackHits_%d_%s",iD,mFileName);
2381 radioPlotsTrackHits[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2383 sprintf(buffer,
"trkPhiProj_%d_%s",iD,mFileName);
2384 trkPhiProj[iD]=
new TH1D(buffer,buffer,100,-3.5,3.5);
2386 sprintf(buffer,
"radioClusterChargeR_%d_%s",iD,mFileName);
2387 radioPlotsClusChargeR[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2389 sprintf(buffer,
"radioClusterSizeR_%d_%s",iD,mFileName);
2390 radioPlotsClusSizeR[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2392 sprintf(buffer,
"radioClusterChargeP_%d_%s",iD,mFileName);
2393 radioPlotsClusChargeP[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2395 sprintf(buffer,
"radioClusterSizeP_%d_%s",iD,mFileName);
2396 radioPlotsClusSizeP[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2398 sprintf(buffer,
"radioDiskEff_%d_%s",iD,mFileName);
2399 radioPlotsEff[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2401 sprintf(buffer,
"radioDiskEffR_%d_%s",iD,mFileName);
2402 radioPlotsEffR[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2404 sprintf(buffer,
"radioDiskEffPhi_%d_%s",iD,mFileName);
2405 radioPlotsEffPhi[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2407 sprintf(buffer,
"radioDiskEffLoose_%d_%s",iD,mFileName);
2408 radioPlotsEffLoose[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2410 sprintf(buffer,
"rEff_%d_%s",iD,mFileName);
2411 rEff[iD]=
new TH1D(buffer,buffer,100,0,DISK_DIM);
2412 sprintf(buffer,
"rNonEff_%d_%s",iD,mFileName);
2413 rNonEff[iD]=
new TH1D(buffer,buffer,100,0,DISK_DIM);
2414 sprintf(buffer,
"clusterSizeR_Disk_%d_%s",iD,mFileName);
2415 h_clusterSizeR[iD]=
new TH1D(buffer,buffer,20,0,20);
2416 h_clusterSizeR[iD]->SetFillColor(kYellow);
2417 sprintf(buffer,
"clusterSizePhi_Disk_%d_%s",iD,mFileName);
2418 h_clusterSizePhi[iD]=
new TH1D(buffer,buffer,20,0,20);
2419 h_clusterSizePhi[iD]->SetFillColor(kYellow);
2420 sprintf(buffer,
"clusterChargeR_Disk_%d_%s",iD,mFileName);
2421 h_clusterChargeR[iD]=
new TH1D(buffer,buffer,100,0,5000);
2422 h_clusterChargeR[iD]->SetFillColor(kYellow);
2424 sprintf(buffer,
"clusterChargePhi_Disk_%d_%s",iD,mFileName);
2425 h_clusterChargePhi[iD]=
new TH1D(buffer,buffer,100,0,5000);
2426 h_clusterChargePhi[iD]->SetFillColor(kYellow);
2428 for(
int nx=0;nx<radioPlotsEff[iD]->GetNbinsX();nx++)
2430 for(
int ny=0;ny<radioPlotsEff[iD]->GetNbinsY();ny++)
2436 for(
int iq=0;iq<4;iq++)
2438 sprintf(buffer,
"r_phi_ChargeCorrelationInDisk_%d_quad_%d_%s",iD+1,iq,mFileName);
2439 chargeCorr[iD*4+iq]=
new TH2D(buffer,buffer,200,0,70000,200,0,70000);
2440 sprintf(buffer,
"clusterSizeRInDisk_%d_quad_%d_%s",iD+1,iq,mFileName);
2441 clusterSizeR[iD*4+iq]=
new TH1D(buffer,buffer,100,0,100);
2442 sprintf(buffer,
"clusterSizePInDisk_%d_quad_%d_%d",iD+1,iq,mFileName);
2443 clusterSizeP[iD*4+iq]=
new TH1D(buffer,buffer,100,0,100);
2445 sprintf(buffer,
"radioDiskNonEff_%d_%s",iD,mFileName);
2446 radioPlotsNonEff[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2448 sprintf(buffer,
"radioDiskNonEffR_%d_%s",iD,mFileName);
2449 radioPlotsNonEffR[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2450 sprintf(buffer,
"radioDiskNonEffPhi_%d_%s",iD,mFileName);
2451 radioPlotsNonEffPhi[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2452 sprintf(buffer,
"radioDiskNonEffLoose_%d_%s",iD,mFileName);
2453 radioPlotsNonEffLoose[iD]=
new TH2D(buffer,buffer,NUM_EFF_BIN,-DISK_DIM,DISK_DIM,NUM_EFF_BIN,-DISK_DIM,DISK_DIM);
2454 for(
int nx=0;nx<rEff[iD]->GetNbinsX();nx++)
2458 sprintf(buffer,
"rPhiRatio_%d_%s",iD,mFileName);
2459 rPhiRatioPlots[iD]=
new TH1D(buffer,buffer,100,-2,10);
virtual TObject * Clone(const char *newname="") const
the custom implementation fo the TObject::Clone
pair< double, double > getDca(vector< AVTrack >::iterator it)
virtual const char * GetName() const
special overload
void fillStripHistos(Float_t r, Float_t phi, Int_t iD, Int_t iq)
Double_t findClosestPoint(float mx, float bx, float my, float by, double xE, double yE, Int_t iD)
Short_t getQuadFromCoo(Double_t x, Double_t y)
this is too naive..., assumes non-rotated quads