StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHiStuff.cxx
1 /***************************************************************************
2  *
3  * $Id: StHiStuff.cxx,v 1.5 2004/01/26 22:59:41 perev Exp $
4  *
5  * Author: Bum Choi, UT Austin, Apr 2002
6  *
7  ***************************************************************************
8  *
9  * Description: Class for making highpt Analysis histograms from highpt
10  * uDST's
11  *
12  ***************************************************************************
13  *
14  * $Log: StHiStuff.cxx,v $
15  * Revision 1.5 2004/01/26 22:59:41 perev
16  * Add init of statick member
17  *
18  * Revision 1.4 2003/04/30 20:37:30 perev
19  * Warnings cleanup. Modified lines marked VP
20  *
21  * Revision 1.3 2002/05/31 21:58:30 jklay
22  * Updated analysis code to use new cut class
23  *
24  * Revision 1.2 2002/04/03 00:23:27 jklay
25  * Fixed private member access bugs in analysis code
26  *
27  * Revision 1.1 2002/04/02 20:05:18 jklay
28  * Bums analysis tools for highpt uDSTs
29  *
30  *
31  **************************************************************************/
32 #include "StHiStuff.h"
33 Float_t StHiStuff::mMinPt = 2.5;
34 
35 //__________________
36 
37 StHiStuff::StHiStuff(const char* inputDir,
38  const char* outRootName)
39  : StHiBaseAnalysis(inputDir,outRootName)
40 
41 {
42 
43 
44 }
45 
46 //__________________
47 
48 StHiStuff::~StHiStuff()
49 {
50 }
51 
52 //_____________________________
53 
54 Int_t
55 StHiStuff::initMore()
56 {
57 
58  return 0;
59 
60 }
61 
62 
63 //_____________________________
64 
65 void
66 StHiStuff::initHistograms()
67 {
68  cout << "StHiStuff::initHistograms()" << endl;
69 
70  char name[100];
71 
72  //***********************
73 
74  using namespace Bin;
75 
76  //***********************
77 
78  TString sEW[3] = {"East","West","FullTPC"};
79  TString sPM[3] = {"Plus","Minus","Charged"};
80 
81  // positive, negative
82  for(int iew=0; iew<3; iew++) {
83  for(int ipm=0; ipm<3; ipm++){
84 
85  setName(name,"h3PhiGlDcaXYGlVertexZ",sEW[iew].Data(),sPM[ipm].Data());
86  ew[iew].pm[ipm].h3PhiGlDcaXYGlVertexZ
87  = new TH3D(name,name,
88  nPhiBin,phiDegMin,phiDegMax,
89  nDcaXYGlBin,dcaXYGlMin,dcaXYGlMax,
90  nMidZBigBin,midZBigMin,midZBigMax);
91  ew[iew].pm[ipm].h3PhiGlDcaXYGlVertexZ->Sumw2();
92 
93  setName(name,"h3PhiPrDcaXYGlVertexZ",sEW[iew].Data(),sPM[ipm].Data());
94  ew[iew].pm[ipm].h3PhiPrDcaXYGlVertexZ
95  = new TH3D(name,name,
96  nPhiBin,phiDegMin,phiDegMax,
97  nDcaXYGlBin,dcaXYGlMin,dcaXYGlMax,
98  nMidZBigBin,midZBigMin,midZBigMax);
99  ew[iew].pm[ipm].h3PhiPrDcaXYGlVertexZ->Sumw2();
100 
101  setName(name,"h1PhiGlReality",sEW[iew].Data(),sPM[ipm].Data());
102  ew[iew].pm[ipm].h1PhiGlReality
103  = new TH1D(name,name,
104  nPhiBin,phiMin,phiMax);
105  ew[iew].pm[ipm].h1PhiGlReality->Sumw2();
106 
107 
108  setName(name,"h3PhiPrDcaXYGlPtPr",sEW[iew].Data(),sPM[ipm].Data());
109  ew[iew].pm[ipm].h3PhiPrDcaXYGlPtPr
110  = new TH3D(name,name,
111  nPhiBin,phiDegMin,phiDegMax,
112  nDcaXYGlWideBin,dcaXYGlMin,dcaXYGlMax,
113  nPtBin,ptMin,ptMax);
114  ew[iew].pm[ipm].h3PhiPrDcaXYGlPtPr->Sumw2();
115 
116  setName(name,"h3PhiGlDcaXYGlPtGl",sEW[iew].Data(),sPM[ipm].Data());
117  ew[iew].pm[ipm].h3PhiGlDcaXYGlPtGl
118  = new TH3D(name,name,
119  nPhiBin,phiDegMin,phiDegMax,
120  nDcaXYGlWideBin,dcaXYGlMin,dcaXYGlMax,
121  nPtBin,ptMin,ptMax);
122  ew[iew].pm[ipm].h3PhiGlDcaXYGlPtGl->Sumw2();
123 
124  setName(name,"h3SectorDcaXYGlPtPr",sEW[iew].Data(),sPM[ipm].Data());
125  ew[iew].pm[ipm].h3SectorDcaXYGlPtPr
126  = new TH3D(name,name,
127  nSectorBin,sectorMin,sectorMax,
128  nDcaXYGlWideBin,dcaXYGlMin,dcaXYGlMax,
129  nPtBin,ptMin,ptMax);
130  ew[iew].pm[ipm].h3SectorDcaXYGlPtPr->Sumw2();
131 
132  setName(name,"h3SectorDcaXYGlPtGl",sEW[iew].Data(),sPM[ipm].Data());
133  ew[iew].pm[ipm].h3SectorDcaXYGlPtGl
134  = new TH3D(name,name,
135  nSectorBin,sectorMin,sectorMax,
136  nDcaXYGlWideBin,dcaXYGlMin,dcaXYGlMax,
137  nPtBin,ptMin,ptMax);
138  ew[iew].pm[ipm].h3SectorDcaXYGlPtGl->Sumw2();
139 
140  setName(name,"h3SectorVertexZPtPr",sEW[iew].Data(),sPM[ipm].Data());
141  ew[iew].pm[ipm].h3SectorVertexZPtPr
142  = new TH3D(name,name,
143  nSectorBin,sectorMin,sectorMax,
144  nAbsZBigBin,absZBigMin,absZBigMax,
145  nPtBin,ptMin,ptMax);
146  ew[iew].pm[ipm].h3SectorVertexZPtPr->Sumw2();
147 
148  setName(name,"h3SectorVertexZPtGl",sEW[iew].Data(),sPM[ipm].Data());
149  ew[iew].pm[ipm].h3SectorVertexZPtGl
150  = new TH3D(name,name,
151  nPhiBin,sectorMin,sectorMax,
152  nAbsZBigBin,absZBigMin,absZBigMax,
153  nPtBin,ptMin,ptMax);
154  ew[iew].pm[ipm].h3SectorVertexZPtGl->Sumw2();
155 
156  setName(name,"h3PhiPrVertexZPtPr",sEW[iew].Data(),sPM[ipm].Data());
157  ew[iew].pm[ipm].h3PhiPrVertexZPtPr
158  = new TH3D(name,name,
159  nSectorBin,phiMin,phiMax,
160  nAbsZBigBin,absZBigMin,absZBigMax,
161  nPtBin,ptMin,ptMax);
162  ew[iew].pm[ipm].h3PhiPrVertexZPtPr->Sumw2();
163 
164  setName(name,"h3PhiGlVertexZPtGl",sEW[iew].Data(),sPM[ipm].Data());
165  ew[iew].pm[ipm].h3PhiGlVertexZPtGl
166  = new TH3D(name,name,
167  nPhiBin,phiMin,phiMax,
168  nAbsZBigBin,absZBigMin,absZBigMax,
169  nPtBin,ptMin,ptMax);
170  ew[iew].pm[ipm].h3PhiGlVertexZPtGl->Sumw2();
171 
172  setName(name,"h3PhiPrEtaPrMidZ",sEW[iew].Data(),sPM[ipm].Data());
173  ew[iew].pm[ipm].h3PhiPrEtaPrMidZ
174  = new TH3D(name,name,
175  nPhiBin,phiMin,phiMax,
176  nEtaBigBin,etaBigMin,etaBigMax,
177  nMidZBigBin,midZBigMin,midZBigMax);
178  ew[iew].pm[ipm].h3PhiPrEtaPrMidZ->Sumw2();
179 
180  setName(name,"h3PhiGlEtaPrMidZ",sEW[iew].Data(),sPM[ipm].Data());
181  ew[iew].pm[ipm].h3PhiGlEtaPrMidZ
182  = new TH3D(name,name,
183  nPhiBin,phiMin,phiMax,
184  nEtaBigBin,etaBigMin,etaBigMax,
185  nMidZBigBin,midZBigMin,midZBigMax);
186  ew[iew].pm[ipm].h3PhiGlEtaPrMidZ->Sumw2();
187 
188  setName(name,"h1PhiPrHighPtCut",sEW[iew].Data(),sPM[ipm].Data());
189  ew[iew].pm[ipm].h1PhiPrHighPtCut
190  = new TH1D(name,name,nPhiBin,phiMin,phiMax);
191  ew[iew].pm[ipm].h1PhiPrHighPtCut->Sumw2();
192 
193  setName(name,"h1PhiPrLowPtCut",sEW[iew].Data(),sPM[ipm].Data());
194  ew[iew].pm[ipm].h1PhiPrLowPtCut
195  = new TH1D(name,name,nPhiBin,phiMin,phiMax);
196  ew[iew].pm[ipm].h1PhiPrLowPtCut->Sumw2();
197 
198  setName(name,"h3PhiPrNFitHitPtPr",sEW[iew].Data(),sPM[ipm].Data());
199  ew[iew].pm[ipm].h3PhiPrNFitHitPtPr
200  = new TH3D(name,name,
201  nPhiBin,phiMin,phiMax,
202  nFitHitThinBin,fitHitThinMin,fitHitThinMax,
203  nPtBin,ptMin,ptMax);
204  ew[iew].pm[ipm].h3PhiPrNFitHitPtPr->Sumw2();
205 
206  setName(name,"h3PhiPrNAllHitPtPr",sEW[iew].Data(),sPM[ipm].Data());
207  ew[iew].pm[ipm].h3PhiPrNAllHitPtPr
208  = new TH3D(name,name,
209  nPhiBin,phiMin,phiMax,
210  nFitHitThinBin,fitHitThinMin,fitHitThinMax,
211  nPtBin,ptMin,ptMax);
212  ew[iew].pm[ipm].h3PhiPrNAllHitPtPr->Sumw2();
213 
214  setName(name,"h3PhiPrFracHitPtPr",sEW[iew].Data(),sPM[ipm].Data());
215  ew[iew].pm[ipm].h3PhiPrFracHitPtPr
216  = new TH3D(name,name,
217  nPhiBin,phiMin,phiMax,
218  nFracHitBin,fracHitMin,fracHitMax,
219  nPtBin,ptMin,ptMax);
220  ew[iew].pm[ipm].h3PhiPrFracHitPtPr->Sumw2();
221 
222  setName(name,"h3PhiPrSmallNFitHitPtPr",sEW[iew].Data(),sPM[ipm].Data());
223  ew[iew].pm[ipm].h3PhiPrSmallNFitHitPtPr
224  = new TH3D(name,name,
225  nPhiSmallBin,phiMin,phiMax,
226  nFitHitThinBin,fitHitThinMin,fitHitThinMax,
227  nPtBin,ptMin,ptMax);
228  ew[iew].pm[ipm].h3PhiPrSmallNFitHitPtPr->Sumw2();
229 
230  setName(name,"h3PhiPrSmallNAllHitPtPr",sEW[iew].Data(),sPM[ipm].Data());
231  ew[iew].pm[ipm].h3PhiPrSmallNAllHitPtPr
232  = new TH3D(name,name,
233  nPhiSmallBin,phiMin,phiMax,
234  nFitHitThinBin,fitHitThinMin,fitHitThinMax,
235  nPtBin,ptMin,ptMax);
236  ew[iew].pm[ipm].h3PhiPrSmallNAllHitPtPr->Sumw2();
237 
238  setName(name,"h3PhiPrSmallFracHitPtPr",sEW[iew].Data(),sPM[ipm].Data());
239  ew[iew].pm[ipm].h3PhiPrSmallFracHitPtPr
240  = new TH3D(name,name,
241  nPhiSmallBin,phiMin,phiMax,
242  nFracHitBin,fracHitMin,fracHitMax,
243  nPtBin,ptMin,ptMax);
244  ew[iew].pm[ipm].h3PhiPrSmallFracHitPtPr->Sumw2();
245 
246 
247  setName(name,"h3PhiGlNFitHitPtPr",sEW[iew].Data(),sPM[ipm].Data());
248  ew[iew].pm[ipm].h3PhiGlNFitHitPtPr
249  = new TH3D(name,name,
250  nPhiBin,phiMin,phiMax,
251  nFitHitThinBin,fitHitThinMin,fitHitThinMax,
252  nPtBin,ptMin,ptMax);
253  ew[iew].pm[ipm].h3PhiGlNFitHitPtPr->Sumw2();
254 
255  setName(name,"h3PhiGlNAllHitPtPr",sEW[iew].Data(),sPM[ipm].Data());
256  ew[iew].pm[ipm].h3PhiGlNAllHitPtPr
257  = new TH3D(name,name,
258  nPhiBin,phiMin,phiMax,
259  nFitHitThinBin,fitHitThinMin,fitHitThinMax,
260  nPtBin,ptMin,ptMax);
261  ew[iew].pm[ipm].h3PhiGlNAllHitPtPr->Sumw2();
262 
263  setName(name,"h3PhiGlFracHitPtPr",sEW[iew].Data(),sPM[ipm].Data());
264  ew[iew].pm[ipm].h3PhiGlFracHitPtPr
265  = new TH3D(name,name,
266  nPhiBin,phiMin,phiMax,
267  nFracHitBin,fracHitMin,fracHitMax,
268  nPtBin,ptMin,ptMax);
269  ew[iew].pm[ipm].h3PhiGlFracHitPtPr->Sumw2();
270 
271  // analysis cut
272  setName(name,"h3VtxZEtaPrPtPrCut",sEW[iew].Data(),sPM[ipm].Data());
273  ew[iew].pm[ipm].h3VtxZEtaPrPtPrCut
274  = new TH3D(name,name,
275  nVertexZBin,vertexZMin,vertexZMax,
276  nEtaSmallBin,etaSmallMin,etaSmallMax,
277  nPtBin,ptMin,ptMax);
278 
279  setName(name,"h3VtxZEtaGlPtGlCut",sEW[iew].Data(),sPM[ipm].Data());
280  ew[iew].pm[ipm].h3VtxZEtaGlPtGlCut
281  = new TH3D(name,name,
282  nVertexZBin,vertexZMin,vertexZMax,
283  nEtaSmallBin,etaSmallMin,etaSmallMax,
284  nPtBin,ptMin,ptMax);
285 
286  setName(name,"h3ResPtDcaXYGlPtGlEastCut",sEW[iew].Data(),sPM[ipm].Data());
287  ew[iew].pm[ipm].h3ResPtDcaXYGlPtGlEastCut
288  = new TH3D(name,name,
289  nResPtBin,resPtMin,resPtMax,
290  nDcaXYGlWideBin,dcaXYGlMin,dcaXYGlMax,
291  nPtBin,ptMin,ptMax);
292 
293  setName(name,"h3ResPtDcaXYGlPtGlWestCut",sEW[iew].Data(),sPM[ipm].Data());
294  ew[iew].pm[ipm].h3ResPtDcaXYGlPtGlWestCut
295  = new TH3D(name,name,
296  nResPtBin,resPtMin,resPtMax,
297  nDcaXYGlWideBin,dcaXYGlMin,dcaXYGlMax,
298  nPtBin,ptMin,ptMax);
299 
300  setName(name,"h3ResPtDcaXYGlPtPrEastCut",sEW[iew].Data(),sPM[ipm].Data());
301  ew[iew].pm[ipm].h3ResPtDcaXYGlPtPrEastCut
302  = new TH3D(name,name,
303  nResPtBin,resPtMin,resPtMax,
304  nDcaXYGlWideBin,dcaXYGlMin,dcaXYGlMax,
305  nPtBin,ptMin,ptMax);
306 
307  setName(name,"h3ResPtDcaXYGlPtPrWestCut",sEW[iew].Data(),sPM[ipm].Data());
308  ew[iew].pm[ipm].h3ResPtDcaXYGlPtPrWestCut
309  = new TH3D(name,name,
310  nResPtBin,resPtMin,resPtMax,
311  nDcaXYGlWideBin,dcaXYGlMin,dcaXYGlMax,
312  nPtBin,ptMin,ptMax);
313 
314  setName(name,"h3PhiGlPtPrPtGlEastCut",sEW[iew].Data(),sPM[ipm].Data());
315  ew[iew].pm[ipm].h3PhiGlPtPrPtGlEastCut
316  = new TH3D(name,name,
317  nPhiBin,phiDegMin,phiDegMax,
318  nPtBin,ptMin,ptMax,
319  nPtBin,ptMin,ptMax);
320 
321  setName(name,"h3PhiGlPtPrPtGlWestCut",sEW[iew].Data(),sPM[ipm].Data());
322  ew[iew].pm[ipm].h3PhiGlPtPrPtGlWestCut
323  = new TH3D(name,name,
324  nPhiBin,phiDegMin,phiDegMax,
325  nPtBin,ptMin,ptMax,
326  nPtBin,ptMin,ptMax);
327 
328  setName(name,"h2VtxZLastZ",sEW[iew].Data(),sPM[ipm].Data());
329  ew[iew].pm[ipm].h2VtxZLastZ
330  = new TH2D(name,name,
331  nVertexZBin,vertexZMin,vertexZMax,
332  nVertexZBin,vertexZMin,vertexZMax);
333 
334 
335  }
336  }
337 
338 }
339 
340 //_____________________
341 
342 void
343 StHiStuff::trackLoop()
344 {
345  if(mDebug)
346  cout << "StHiStuff::trackLoop()" << endl;
347 
348  //
349  // event stuff
350  //
351 //VPunused Float_t zdcSum = mHiMicroEvent->ZDCe() + mHiMicroEvent->ZDCw();
352 //VPunused Float_t ctb = mHiMicroEvent->CTB();
353 //VPunused Float_t flowCent = mHiMicroEvent->Centrality();
354 // NchCentrality zdcCent = centrality(zdcSum,ctb);
355 
356 
357  Int_t nTrack = mHiMicroEvent->NTrack();
359 
360  for(Int_t i=0; i<nTrack; i++){
361  track =(StHiMicroTrack*) mHiMicroEvent->tracks()->At(i);
362 
363  Float_t vertexZ = mHiMicroEvent->VertexZ();
364 
365  Float_t ptPr = track->PtPr();
366  Float_t ptGl = track->PtGl();
367  Float_t etaGl = track->EtaGl();
368  Float_t etaPr = track->EtaPr();
369  //Float_t curvPr = track->CurvPr();
370  //Float_t curvGl = track->CurvGl();
371  //Float_t resPt = (ptPr-ptGl)/ptPr;
372  //Float_t resCurvPrGl = (curvPr-curvGl)/curvPr;
373  //Float_t resCurvGlPr = (curvGl-curvPr)/curvGl;
374  Float_t resPtPrGlOverPr = (ptPr-ptGl)/ptPr;
375  Float_t resPtPrGl = (ptPr-ptGl)/ptGl;
376  Float_t fracPts = (Float_t) track->FitPts()/ (Float_t) track->AllPts();
377  Float_t dcaXYGl = track->DcaXYGl();
378  // Float_t dPhi = track->PhiPr() - track->PhiGl();
379  Float_t phiPr = track->PhiPr();
380  Float_t phiGl = track->PhiGl();
381  //Float_t midZ = 100*TMath::Tan(track->DipAnglePr()) + vertexZ;
382  Int_t fitPts = track->FitPts();
383  Int_t allPts = track->AllPts();
384 //VPunused Int_t charge = track->Charge();
385  Float_t phiGlDeg = phiGl*180./TMath::Pi();
386  Float_t phiPrDeg = phiPr*180./TMath::Pi();
387  Int_t firstSector = track->FirstSector();
388 
389  Int_t sector = findSector(phiGl,firstSector);
390 
391  phiGlDeg = (phiGlDeg<-165) ? (phiGlDeg += 360) : phiGlDeg;
392  phiPrDeg = (phiPrDeg<-165) ? (phiPrDeg += 360) : phiPrDeg;
393 
394  //Float_t exitZ = vtxZ+200*TMath::Tan(track->DipAnglePr());
395 
396  Int_t iCharge = (track->Charge()>0) ? 0 : 1; //plus is 0
397  //This definition of iSide only requires the track be on
398  //one half or the other and doesn't specify vertex position
399  //Need to make that cut explicitly using the cutList
400  Int_t iSide = (CutRc::AcceptEastSideTrack(track)) ? 0 : 1; //east is 0
401 
402  // ** analysis cut
403  if(CutRc::AcceptTrackVtxZHalf(track,vertexZ)){
404  // fit points
405  if(CutRc::AcceptFitPts(track)){
406  ew[iSide].pm[iCharge].h2VtxZLastZ->Fill(vertexZ,track->LastZ());
407  ew[2].pm[2].h2VtxZLastZ->Fill(vertexZ,track->LastZ());
408  ew[2].pm[iCharge].h2VtxZLastZ->Fill(vertexZ,track->LastZ());
409  ew[iSide].pm[2].h2VtxZLastZ->Fill(vertexZ,track->LastZ());
410 
411  ew[iSide].pm[iCharge].h3VtxZEtaPrPtPrCut->Fill(vertexZ,etaPr,ptPr);
412  ew[2].pm[2].h3VtxZEtaPrPtPrCut->Fill(vertexZ,etaPr,ptPr);
413  ew[2].pm[iCharge].h3VtxZEtaPrPtPrCut->Fill(vertexZ,etaPr,ptPr);
414  ew[iSide].pm[2].h3VtxZEtaPrPtPrCut->Fill(vertexZ,etaPr,ptPr);
415 
416  ew[iSide].pm[iCharge].h3VtxZEtaGlPtGlCut->Fill(vertexZ,etaGl,ptGl);
417  ew[2].pm[2].h3VtxZEtaGlPtGlCut->Fill(vertexZ,etaGl,ptGl);
418  ew[2].pm[iCharge].h3VtxZEtaGlPtGlCut->Fill(vertexZ,etaGl,ptGl);
419  ew[iSide].pm[2].h3VtxZEtaGlPtGlCut->Fill(vertexZ,etaGl,ptGl);
420 
421  if(fabs(track->EtaGl())<0.7){
422  if(track->FirstZ() < 0 ) { //east
423  ew[iSide].pm[iCharge].h3ResPtDcaXYGlPtGlEastCut->Fill(resPtPrGl,dcaXYGl,ptGl);
424  ew[2].pm[2].h3ResPtDcaXYGlPtGlEastCut->Fill(resPtPrGl,dcaXYGl,ptGl);
425  ew[2].pm[iCharge].h3ResPtDcaXYGlPtGlEastCut->Fill(resPtPrGl,dcaXYGl,ptGl);
426  ew[iSide].pm[2].h3ResPtDcaXYGlPtGlEastCut->Fill(resPtPrGl,dcaXYGl,ptGl);
427 
428  ew[iSide].pm[iCharge].h3ResPtDcaXYGlPtPrEastCut->Fill(resPtPrGlOverPr,dcaXYGl,ptPr);
429  ew[2].pm[2].h3ResPtDcaXYGlPtPrEastCut->Fill(resPtPrGlOverPr,dcaXYGl,ptPr);
430  ew[2].pm[iCharge].h3ResPtDcaXYGlPtPrEastCut->Fill(resPtPrGlOverPr,dcaXYGl,ptPr);
431  ew[iSide].pm[2].h3ResPtDcaXYGlPtPrEastCut->Fill(resPtPrGlOverPr,dcaXYGl,ptPr);
432  if(fabs(track->DcaXYGl())<1.2)
433  ew[iSide].pm[iCharge].h3PhiGlPtPrPtGlEastCut->Fill(phiGlDeg,ptPr,ptGl);
434  ew[2].pm[2].h3PhiGlPtPrPtGlEastCut->Fill(phiGlDeg,ptPr,ptGl);
435  ew[2].pm[iCharge].h3PhiGlPtPrPtGlEastCut->Fill(phiGlDeg,ptPr,ptGl);
436  ew[iSide].pm[2].h3PhiGlPtPrPtGlEastCut->Fill(phiGlDeg,ptPr,ptGl);
437  }
438  else{
439  ew[iSide].pm[iCharge].h3ResPtDcaXYGlPtGlWestCut->Fill(resPtPrGl,dcaXYGl,ptGl);
440  ew[2].pm[2].h3ResPtDcaXYGlPtGlWestCut->Fill(resPtPrGl,dcaXYGl,ptGl);
441  ew[2].pm[iCharge].h3ResPtDcaXYGlPtGlWestCut->Fill(resPtPrGl,dcaXYGl,ptGl);
442  ew[iSide].pm[2].h3ResPtDcaXYGlPtGlWestCut->Fill(resPtPrGl,dcaXYGl,ptGl);
443 
444  ew[iSide].pm[iCharge].h3ResPtDcaXYGlPtPrWestCut->Fill(resPtPrGlOverPr,dcaXYGl,ptPr);
445  ew[2].pm[2].h3ResPtDcaXYGlPtPrWestCut->Fill(resPtPrGlOverPr,dcaXYGl,ptPr);
446  ew[2].pm[iCharge].h3ResPtDcaXYGlPtPrWestCut->Fill(resPtPrGlOverPr,dcaXYGl,ptPr);
447  ew[iSide].pm[2].h3ResPtDcaXYGlPtPrWestCut->Fill(resPtPrGlOverPr,dcaXYGl,ptPr);
448  if(fabs(track->DcaXYGl())<1.2)
449  ew[iSide].pm[iCharge].h3PhiGlPtPrPtGlWestCut->Fill(phiGlDeg,ptPr,ptGl);
450  ew[2].pm[2].h3PhiGlPtPrPtGlWestCut->Fill(phiGlDeg,ptPr,ptGl);
451  ew[2].pm[iCharge].h3PhiGlPtPrPtGlWestCut->Fill(phiGlDeg,ptPr,ptGl);
452  ew[iSide].pm[2].h3PhiGlPtPrPtGlWestCut->Fill(phiGlDeg,ptPr,ptGl);
453  }
454  }
455  }
456  }
457 
458  //************ plus/minus
459  //***eta
460  //
461  if(CutRc::AcceptEta(track)){
462 
463  //
464  // reality check
465  //
466  //if(fabs(etaPr)>.5) cout << "huh?" << endl;
467 
468  // eta and fit pts
469  //
470  if(CutRc::AcceptFitPts(track)){
471  ew[iSide].pm[iCharge].h3PhiPrDcaXYGlPtPr->Fill(phiPrDeg,dcaXYGl,ptPr);
472  ew[2].pm[2].h3PhiPrDcaXYGlPtPr->Fill(phiPrDeg,dcaXYGl,ptPr);
473  ew[2].pm[iCharge].h3PhiPrDcaXYGlPtPr->Fill(phiPrDeg,dcaXYGl,ptPr);
474  ew[iSide].pm[2].h3PhiPrDcaXYGlPtPr->Fill(phiPrDeg,dcaXYGl,ptPr);
475 
476  ew[iSide].pm[iCharge].h3PhiGlDcaXYGlPtGl->Fill(phiGlDeg,dcaXYGl,ptGl);
477  ew[2].pm[2].h3PhiGlDcaXYGlPtGl->Fill(phiGlDeg,dcaXYGl,ptGl);
478  ew[2].pm[iCharge].h3PhiGlDcaXYGlPtGl->Fill(phiGlDeg,dcaXYGl,ptGl);
479  ew[iSide].pm[2].h3PhiGlDcaXYGlPtGl->Fill(phiGlDeg,dcaXYGl,ptGl);
480 
481  ew[iSide].pm[iCharge].h3SectorDcaXYGlPtPr->Fill(sector,dcaXYGl,ptPr);
482  ew[2].pm[2].h3SectorDcaXYGlPtPr->Fill(sector,dcaXYGl,ptPr);
483  ew[2].pm[iCharge].h3SectorDcaXYGlPtPr->Fill(sector,dcaXYGl,ptPr);
484  ew[iSide].pm[2].h3SectorDcaXYGlPtPr->Fill(sector,dcaXYGl,ptPr);
485 
486  ew[iSide].pm[iCharge].h3SectorDcaXYGlPtGl->Fill(sector,dcaXYGl,ptGl);
487  ew[2].pm[2].h3SectorDcaXYGlPtGl->Fill(sector,dcaXYGl,ptGl);
488  ew[2].pm[iCharge].h3SectorDcaXYGlPtGl->Fill(sector,dcaXYGl,ptGl);
489  ew[iSide].pm[2].h3SectorDcaXYGlPtGl->Fill(sector,dcaXYGl,ptGl);
490 
491  }
492 
493  // eta, sdca, and fitpts
494  //
495  if(CutRc::AcceptSDcaGl(track) && CutRc::AcceptFitPts(track)){
496  ew[iSide].pm[iCharge].h3PhiPrNFitHitPtPr->Fill(phiPr,fitPts,ptPr);
497  ew[2].pm[2].h3PhiPrNFitHitPtPr->Fill(phiPr,fitPts,ptPr);
498  ew[2].pm[iCharge].h3PhiPrNFitHitPtPr->Fill(phiPr,fitPts,ptPr);
499  ew[iSide].pm[2].h3PhiPrNFitHitPtPr->Fill(phiPr,fitPts,ptPr);
500 
501  ew[iSide].pm[iCharge].h3PhiPrSmallNFitHitPtPr->Fill(phiPr,fitPts,ptPr);
502  ew[2].pm[2].h3PhiPrSmallNFitHitPtPr->Fill(phiPr,fitPts,ptPr);
503  ew[2].pm[iCharge].h3PhiPrSmallNFitHitPtPr->Fill(phiPr,fitPts,ptPr);
504  ew[iSide].pm[2].h3PhiPrSmallNFitHitPtPr->Fill(phiPr,fitPts,ptPr);
505 
506  ew[iSide].pm[iCharge].h3PhiGlNFitHitPtPr->Fill(phiGl,fitPts,ptPr);
507  ew[2].pm[2].h3PhiGlNFitHitPtPr->Fill(phiGl,fitPts,ptPr);
508  ew[2].pm[iCharge].h3PhiGlNFitHitPtPr->Fill(phiGl,fitPts,ptPr);
509  ew[iSide].pm[2].h3PhiGlNFitHitPtPr->Fill(phiGl,fitPts,ptPr);
510 
511  ew[iSide].pm[iCharge].h3PhiPrNAllHitPtPr->Fill(phiPr,allPts,ptPr);
512  ew[2].pm[2].h3PhiPrNAllHitPtPr->Fill(phiPr,allPts,ptPr);
513  ew[2].pm[iCharge].h3PhiPrNAllHitPtPr->Fill(phiPr,allPts,ptPr);
514  ew[iSide].pm[2].h3PhiPrNAllHitPtPr->Fill(phiPr,allPts,ptPr);
515 
516  ew[iSide].pm[iCharge].h3PhiPrSmallNAllHitPtPr->Fill(phiPr,allPts,ptPr);
517  ew[2].pm[2].h3PhiPrSmallNAllHitPtPr->Fill(phiPr,allPts,ptPr);
518  ew[2].pm[iCharge].h3PhiPrSmallNAllHitPtPr->Fill(phiPr,allPts,ptPr);
519  ew[iSide].pm[2].h3PhiPrSmallNAllHitPtPr->Fill(phiPr,allPts,ptPr);
520 
521  ew[iSide].pm[iCharge].h3PhiGlNAllHitPtPr->Fill(phiGl,allPts,ptPr);
522  ew[2].pm[2].h3PhiGlNAllHitPtPr->Fill(phiGl,allPts,ptPr);
523  ew[2].pm[iCharge].h3PhiGlNAllHitPtPr->Fill(phiGl,allPts,ptPr);
524  ew[iSide].pm[2].h3PhiGlNAllHitPtPr->Fill(phiGl,allPts,ptPr);
525 
526  ew[iSide].pm[iCharge].h3PhiPrFracHitPtPr->Fill(phiPr,fracPts,ptPr);
527  ew[2].pm[2].h3PhiPrFracHitPtPr->Fill(phiPr,fracPts,ptPr);
528  ew[2].pm[iCharge].h3PhiPrFracHitPtPr->Fill(phiPr,fracPts,ptPr);
529  ew[iSide].pm[2].h3PhiPrFracHitPtPr->Fill(phiPr,fracPts,ptPr);
530 
531  ew[iSide].pm[iCharge].h3PhiPrSmallFracHitPtPr->Fill(phiPr,fracPts,ptPr);
532  ew[2].pm[2].h3PhiPrSmallFracHitPtPr->Fill(phiPr,fracPts,ptPr);
533  ew[2].pm[iCharge].h3PhiPrSmallFracHitPtPr->Fill(phiPr,fracPts,ptPr);
534  ew[iSide].pm[2].h3PhiPrSmallFracHitPtPr->Fill(phiPr,fracPts,ptPr);
535 
536  ew[iSide].pm[iCharge].h3PhiGlFracHitPtPr->Fill(phiGl,fracPts,ptPr);
537  ew[2].pm[2].h3PhiGlFracHitPtPr->Fill(phiGl,fracPts,ptPr);
538  ew[2].pm[iCharge].h3PhiGlFracHitPtPr->Fill(phiGl,fracPts,ptPr);
539  ew[iSide].pm[2].h3PhiGlFracHitPtPr->Fill(phiGl,fracPts,ptPr);
540 
541  // reality check
542  if(ptPr>2 && ptPr<6){
543  ew[iSide].pm[iCharge].h1PhiPrHighPtCut->Fill(phiPr);
544  ew[2].pm[2].h1PhiPrHighPtCut->Fill(phiPr);
545  ew[2].pm[iCharge].h1PhiPrHighPtCut->Fill(phiPr);
546  ew[iSide].pm[2].h1PhiPrHighPtCut->Fill(phiPr);
547  }
548  if(ptPr>1 && ptPr<2){
549  ew[iSide].pm[iCharge].h1PhiPrLowPtCut->Fill(phiPr);
550  ew[2].pm[2].h1PhiPrLowPtCut->Fill(phiPr);
551  ew[2].pm[iCharge].h1PhiPrLowPtCut->Fill(phiPr);
552  ew[iSide].pm[2].h1PhiPrLowPtCut->Fill(phiPr);
553  }
554  }
555 
556  }
557 
558  // sdca, fitpts, tight eta
559 
560  if(CutRc::AcceptSDcaGl(track) && CutRc::AcceptFitPts(track) &&
561  fabs(etaPr)<.1){
562  ew[iSide].pm[iCharge].h3PhiPrVertexZPtPr->Fill(phiPr,fabs(vertexZ),ptPr);
563  ew[2].pm[2].h3PhiPrVertexZPtPr->Fill(phiPr,fabs(vertexZ),ptPr);
564  ew[2].pm[iCharge].h3PhiPrVertexZPtPr->Fill(phiPr,fabs(vertexZ),ptPr);
565  ew[iSide].pm[2].h3PhiPrVertexZPtPr->Fill(phiPr,fabs(vertexZ),ptPr);
566 
567  ew[iSide].pm[iCharge].h3PhiGlVertexZPtGl->Fill(phiGl,fabs(vertexZ),ptGl);
568  ew[2].pm[2].h3PhiGlVertexZPtGl->Fill(phiGl,fabs(vertexZ),ptGl);
569  ew[2].pm[iCharge].h3PhiGlVertexZPtGl->Fill(phiGl,fabs(vertexZ),ptGl);
570  ew[iSide].pm[2].h3PhiGlVertexZPtGl->Fill(phiGl,fabs(vertexZ),ptGl);
571 
572  ew[iSide].pm[iCharge].h3SectorVertexZPtPr->Fill(sector,fabs(vertexZ),ptPr);
573  ew[2].pm[2].h3SectorVertexZPtPr->Fill(sector,fabs(vertexZ),ptPr);
574  ew[2].pm[iCharge].h3SectorVertexZPtPr->Fill(sector,fabs(vertexZ),ptPr);
575  ew[iSide].pm[2].h3SectorVertexZPtPr->Fill(sector,fabs(vertexZ),ptPr);
576 
577  ew[iSide].pm[iCharge].h3SectorVertexZPtGl->Fill(sector,fabs(vertexZ),ptGl);
578  ew[2].pm[2].h3SectorVertexZPtGl->Fill(sector,fabs(vertexZ),ptGl);
579  ew[2].pm[iCharge].h3SectorVertexZPtGl->Fill(sector,fabs(vertexZ),ptGl);
580  ew[iSide].pm[2].h3SectorVertexZPtGl->Fill(sector,fabs(vertexZ),ptGl);
581 
582 
583  }
584 
585  // fit pts, tight eta, pt
586  if(CutRc::AcceptFitPts(track) && fabs(etaPr)<0.1 &&
587  fabs(track->DcaGl())<3){
588  if(ptGl>1.5 && ptGl<6)
589  ew[iSide].pm[iCharge].h3PhiGlDcaXYGlVertexZ->Fill(phiGlDeg,dcaXYGl,vertexZ);
590  ew[2].pm[2].h3PhiGlDcaXYGlVertexZ->Fill(phiGlDeg,dcaXYGl,vertexZ);
591  ew[2].pm[iCharge].h3PhiGlDcaXYGlVertexZ->Fill(phiGlDeg,dcaXYGl,vertexZ);
592  ew[iSide].pm[2].h3PhiGlDcaXYGlVertexZ->Fill(phiGlDeg,dcaXYGl,vertexZ);
593  if(ptPr>1.5 && ptPr<6)
594  ew[iSide].pm[iCharge].h3PhiPrDcaXYGlVertexZ->Fill(phiPrDeg,dcaXYGl,vertexZ);
595  ew[2].pm[2].h3PhiPrDcaXYGlVertexZ->Fill(phiPrDeg,dcaXYGl,vertexZ);
596  ew[2].pm[iCharge].h3PhiPrDcaXYGlVertexZ->Fill(phiPrDeg,dcaXYGl,vertexZ);
597  ew[iSide].pm[2].h3PhiPrDcaXYGlVertexZ->Fill(phiPrDeg,dcaXYGl,vertexZ);
598  }
599 
600  } // tracks
601 
602  if(mDebug)
603  cout << "\ttracks : " << nTrack << endl;
604 
605 }
606 //_____________________
607 
608 void
609 StHiStuff::fillEventHistograms()
610 {
611 
612 }
613 
614 //______________________
615 
616 void
617 StHiStuff::finishHistograms()
618 {
619 
620 }
621 
622 //_______________________
623 
624 Bool_t
625 StHiStuff::acceptEvent(StHiMicroEvent* event)
626 {
627  return CutRc::Accept(event);
628 
629 }
630 
631 
632 
633 //_______________________
634 
635 // ew: east is 0, west is 1
636 
637 Int_t
638 StHiStuff::findSector(Float_t phi, Int_t firstSector)
639 {
640  Int_t sector=0;
641  Float_t pi = (Float_t) TMath::Pi();
642  Float_t sectorWidth = pi/6.;
643 
644  Int_t sectorWest[] = {8,7,6,5,4,3,2,1,12,11,10};
645  Int_t sectorEast[] = {16,17,18,19,20,21,22,23,24,13,14};
646 
647  if(phi>=(pi-sectorWidth/2.) || phi < (-pi+sectorWidth/2.)){
648  if(firstSector <= 12 ){
649  sector = 9;
650  }
651  else if(firstSector >= 13){
652  sector = 15;
653  }
654  else{
655  cerr << "wrong CutRc::Half " << ew << endl;
656  exit(1);
657  }
658  }
659  else{
660  for(int i=0; i<11; i++){
661  if(phi>=(-pi +sectorWidth*(i+1) - sectorWidth/2.) &&
662  phi<(-pi +sectorWidth*(i+1) + sectorWidth/2.)){
663 
664  if(firstSector >= 13) sector = sectorWest[i];
665  else if(firstSector <= 12) sector = sectorEast[i];
666 
667  break;
668  }
669  }
670  }
671  // if(gRandom->Rndm()<.1)
672  // cout << "phi : " << phi*180./pi << " sector : " << sector << endl;
673 
674 
675  if(!sector){
676  cerr << "Huh? phi = " << phi << endl; exit(1);
677  }
678 
679  return sector;
680 }
681 
682 //_____________________________________
683 
684 ClassImp(StHiStuff)