26 #include "StDcaAnalysis.h"
28 enum TYPE { MEAN=0,RMS,NUM,SKEW};
32 StDcaAnalysis::StDcaAnalysis(
const char* inputDir,
33 const char* outRootName)
43 StDcaAnalysis::~StDcaAnalysis()
51 StDcaAnalysis::initHistograms()
53 cout <<
"StDcaAnalysis::initHistograms()" << endl;
77 const char* type[] = {
"Mean",
"Rms",
"Num" };
79 for(
int i=0; i<3; i++){
81 sprintf(name,
"h%sPosDcaXYGlPtZFD",type[i]);
84 nVertexZWideBin,vertexZWideMin,vertexZWideMax,
85 nPhiBin,phiDegMin,phiDegMax,
86 nDcaXYGlBin,dcaXYGlMin,dcaXYGlMax);
88 sprintf(name,
"h%sNegDcaXYGlPtZFD",type[i]);
91 nVertexZWideBin,vertexZWideMin,vertexZWideMax,
92 nPhiBin,phiDegMin,phiDegMax,
93 nDcaXYGlBin,dcaXYGlMin,dcaXYGlMax);
95 sprintf(name,
"h%sPosPlusNegDcaXYGlPtZFD",type[i]);
96 dca[i].hPosPlusNegGlPtZFD =
98 nVertexZWideBin,vertexZWideMin,vertexZWideMax,
99 nPhiBin,phiDegMin,phiDegMax,
100 nDcaXYGlBin,dcaXYGlMin,dcaXYGlMax);
102 sprintf(name,
"h%sPosMinusNegDcaXYGlPtZFD",type[i]);
103 dca[i].hPosMinusNegGlPtZFD =
105 nVertexZWideBin,vertexZWideMin,vertexZWideMax,
106 nPhiBin,phiDegMin,phiDegMax,
107 nDcaXYGlBin,dcaXYGlMin,dcaXYGlMax);
109 sprintf(name,
"h%sPosDcaXYPrPtZFD",type[i]);
112 nVertexZWideBin,vertexZWideMin,vertexZWideMax,
113 nPhiBin,phiDegMin,phiDegMax,
114 nDcaXYGlBin,dcaXYGlMin,dcaXYGlMax);
116 sprintf(name,
"h%sNegDcaXYPrPtZFD",type[i]);
119 nVertexZWideBin,vertexZWideMin,vertexZWideMax,
120 nPhiBin,phiDegMin,phiDegMax,
121 nDcaXYGlBin,dcaXYGlMin,dcaXYGlMax);
123 sprintf(name,
"h%sPosPlusNegDcaXYPrPtZFD",type[i]);
124 dca[i].hPosPlusNegPrPtZFD =
126 nVertexZWideBin,vertexZWideMin,vertexZWideMax,
127 nPhiBin,phiDegMin,phiDegMax,
128 nDcaXYGlBin,dcaXYGlMin,dcaXYGlMax);
130 sprintf(name,
"h%sPosMinusNegDcaXYPrPtZFD",type[i]);
131 dca[i].hPosMinusNegPrPtZFD =
133 nVertexZWideBin,vertexZWideMin,vertexZWideMax,
134 nPhiBin,phiDegMin,phiDegMax,
135 nDcaXYGlBin,dcaXYGlMin,dcaXYGlMax);
143 StDcaAnalysis::trackLoop()
146 cout <<
"StDcaAnalysis::trackLoop()" << endl;
158 Int_t nTrack = mHiMicroEvent->NTrack();
161 for(Int_t i=0; i<nTrack; i++){
164 Float_t vertexZ = mHiMicroEvent->VertexZ();
165 Float_t dcaXYGl = track->DcaXYGl();
166 Int_t charge = track->Charge();
167 Float_t phiGlDeg = track->PhiGl()*180./M_PI;
168 phiGlDeg = (phiGlDeg<-165) ? (phiGlDeg += 360) : phiGlDeg;
169 Float_t eta = track->EtaPr();
175 if(!CutRc::AcceptTrackVtxZHalf(track,vertexZ))
continue;
177 if(!CutRc::AcceptFitPts(track))
continue;
178 if(fabs(eta)>.1)
continue;
182 if(track->PtGl() >1.7 && track->PtGl()<6){
184 dca[MEAN].hPosGlPtZFD->Fill(z,phiGlDeg,dcaXYGl,dcaXYGl);
185 dca[RMS].hPosGlPtZFD->Fill(z,phiGlDeg,dcaXYGl,dcaXYGl*dcaXYGl);
186 dca[NUM].hPosGlPtZFD->Fill(z,phiGlDeg,dcaXYGl);
189 dca[MEAN].hNegGlPtZFD->Fill(z,phiGlDeg,dcaXYGl,dcaXYGl);
190 dca[RMS].hNegGlPtZFD->Fill(z,phiGlDeg,dcaXYGl,dcaXYGl*dcaXYGl);
191 dca[NUM].hNegGlPtZFD->Fill(z,phiGlDeg,dcaXYGl);
195 dca[MEAN].hPosPlusNegGlPtZFD->Fill(z,phiGlDeg,dcaXYGl,dcaXYGl);
196 dca[RMS].hPosPlusNegGlPtZFD->Fill(z,phiGlDeg,dcaXYGl,dcaXYGl*dcaXYGl);
197 dca[NUM].hPosPlusNegGlPtZFD->Fill(z,phiGlDeg,dcaXYGl);
199 dca[MEAN].hPosMinusNegGlPtZFD->Fill(z,phiGlDeg,dcaXYGl,dcaXYGl*charge);
200 dca[RMS].hPosMinusNegGlPtZFD->Fill(z,phiGlDeg,dcaXYGl,dcaXYGl*dcaXYGl);
201 dca[NUM].hPosMinusNegGlPtZFD->Fill(z,phiGlDeg,dcaXYGl);
203 if(track->PtPr()>1.7 && track->PtPr()<6){
205 dca[MEAN].hPosPrPtZFD->Fill(z,phiGlDeg,dcaXYGl,dcaXYGl);
206 dca[RMS].hPosPrPtZFD->Fill(z,phiGlDeg,dcaXYGl,dcaXYGl*dcaXYGl);
207 dca[NUM].hPosPrPtZFD->Fill(z,phiGlDeg,dcaXYGl);
210 dca[MEAN].hNegPrPtZFD->Fill(z,phiGlDeg,dcaXYGl,dcaXYGl);
211 dca[RMS].hNegPrPtZFD->Fill(z,phiGlDeg,dcaXYGl,dcaXYGl*dcaXYGl);
212 dca[NUM].hNegPrPtZFD->Fill(z,phiGlDeg,dcaXYGl);
216 dca[MEAN].hPosPlusNegPrPtZFD->Fill(z,phiGlDeg,dcaXYGl,dcaXYGl);
217 dca[RMS].hPosPlusNegPrPtZFD->Fill(z,phiGlDeg,dcaXYGl,dcaXYGl*dcaXYGl);
218 dca[NUM].hPosPlusNegPrPtZFD->Fill(z,phiGlDeg,dcaXYGl);
220 dca[MEAN].hPosMinusNegPrPtZFD->Fill(z,phiGlDeg,dcaXYGl,dcaXYGl*charge);
221 dca[RMS].hPosMinusNegPrPtZFD->Fill(z,phiGlDeg,dcaXYGl,dcaXYGl*dcaXYGl);
222 dca[NUM].hPosMinusNegPrPtZFD->Fill(z,phiGlDeg,dcaXYGl);
230 cout <<
"\ttracks : " << nTrack << endl;
240 return CutRc::Accept(event);
251 StDcaAnalysis::findSector(Float_t phi, Char_t ew)
254 Float_t pi = (Float_t) TMath::Pi();
255 Float_t sectorWidth = pi/6.;
257 Int_t sectorWest[] = {8,7,6,5,4,3,2,1,12,11,10};
258 Int_t sectorEast[] = {16,17,18,19,20,21,22,23,24,13,14};
260 if(phi>=(pi-sectorWidth/2.) || phi < (-pi+sectorWidth/2.)){
268 cerr <<
"wrong CutRc::Half " << ew << endl;
273 for(
int i=0; i<11; i++){
274 if(phi>=(-pi +sectorWidth*(i+1) - sectorWidth/2.) &&
275 phi<(-pi +sectorWidth*(i+1) + sectorWidth/2.)){
277 if(ew==
'w') sector = sectorWest[i];
278 else if(ew==
'e') sector = sectorEast[i];
289 cerr <<
"Huh? phi = " << phi << endl; exit(1);