StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBadDcaAnalysis.cxx
1 /***************************************************************************
2  *
3  * $Id: StBadDcaAnalysis.cxx,v 1.4 2003/04/30 20:37:30 perev Exp $
4  *
5  * Author: Bum Choi, UT Austin, Apr 2002
6  *
7  ***************************************************************************
8  *
9  * Description: Class to look at DCA information from highpt uDSTs
10  *
11  *
12  ***************************************************************************
13  *
14  * $Log: StBadDcaAnalysis.cxx,v $
15  * Revision 1.4 2003/04/30 20:37:30 perev
16  * Warnings cleanup. Modified lines marked VP
17  *
18  * Revision 1.3 2002/05/31 21:58:29 jklay
19  * Updated analysis code to use new cut class
20  *
21  * Revision 1.2 2002/04/03 00:23:27 jklay
22  * Fixed private member access bugs in analysis code
23  *
24  * Revision 1.1 2002/04/02 20:05:18 jklay
25  * Bums analysis tools for highpt uDSTs
26  *
27  *
28  **************************************************************************/
29 #include "StBadDcaAnalysis.h"
30 
31 
32 //__________________
33 
34 StBadDcaAnalysis::StBadDcaAnalysis(const char* inputDir,
35  const char* outRootName)
36  : StHiBaseAnalysis(inputDir,outRootName)
37 
38 {
39 
40 }
41 
42 //__________________
43 
44 StBadDcaAnalysis::~StBadDcaAnalysis()
45 {
46 }
47 
48 //__________________
49 //
50 // reads in all the files in the directory
51 // by default, looks for files ending in minimc.root
52 //
53 
54 Int_t
55 StBadDcaAnalysis::initMore()
56 {
57  return 0;
58 }
59 
60 
61 void
62 StBadDcaAnalysis::initHistograms()
63 {
64  cout << "StBadDcaAnalysis::initHistograms()" << endl;
65 
66  //*********************
67 
68  using namespace Bin;
69 
70  //*********************
71 
72  char name[500];
73 
74  const char* cPM[2] = {"Plus","Minus"};
75 
76  for(int ipm=0; ipm<2; ipm++){
77 
78  // dca xy, fit pts, pt
79  setName(name,"h3DcaXYGlFitPtsPtPr",cPM[ipm]);
80  pm[ipm].h3DcaXYGlFitPtsPtPr
81  = new TH3D(name,name,
82  nDcaXYGlBin,dcaXYGlMin,dcaXYGlMax,
83  nFitPtsBin,fitPtsMin,fitPtsMax,
84  nPtTinyBin,ptTinyMin,ptTinyMax);
85 
86  pm[ipm].h3DcaXYGlFitPtsPtPr->SetXTitle("dcaXYGl");
87  pm[ipm].h3DcaXYGlFitPtsPtPr->SetYTitle("fitPts");
88  pm[ipm].h3DcaXYGlFitPtsPtPr->SetZTitle("ptPr");
89 
90  // dcaxy, all pts, pt
91  setName(name,"h3DcaXYGlAllPtsPtPr",cPM[ipm]);
92  pm[ipm].h3DcaXYGlAllPtsPtPr
93  = new TH3D(name,name,
94  nDcaXYGlBin,dcaXYGlMin,dcaXYGlMax,
95  nFitPtsBin,fitPtsMin,fitPtsMax,
96  nPtTinyBin,ptTinyMin,ptTinyMax);
97 
98  pm[ipm].h3DcaXYGlAllPtsPtPr->SetXTitle("dcaXYGl");
99  pm[ipm].h3DcaXYGlAllPtsPtPr->SetYTitle("allPts");
100  pm[ipm].h3DcaXYGlAllPtsPtPr->SetZTitle("ptPr");
101 
102  // dcaxy, points ratio, pt
103  setName(name,"h3DcaXYGlRatioPtsPtPr",cPM[ipm]);
104  pm[ipm].h3DcaXYGlRatioPtsPtPr
105  = new TH3D(name,name,
106  nDcaXYGlBin,dcaXYGlMin,dcaXYGlMax,
107  100,0,1,
108  nPtTinyBin,ptTinyMin,ptTinyMax);
109 
110  pm[ipm].h3DcaXYGlRatioPtsPtPr->SetXTitle("dcaXYGl");
111  pm[ipm].h3DcaXYGlRatioPtsPtPr->SetYTitle("ratioPts");
112  pm[ipm].h3DcaXYGlRatioPtsPtPr->SetZTitle("ptPr");
113 
114  // dca xy, first hit, pt
115  setName(name,"h3DcaXYGlFirstRowPtPr",cPM[ipm]);
116  pm[ipm].h3DcaXYGlFirstRowPtPr
117  = new TH3D(name,name,
118  nDcaXYGlBin,dcaXYGlMin,dcaXYGlMax,
119  45,0.5,45.5,
120  nPtTinyBin,ptTinyMin,ptTinyMax);
121 
122  pm[ipm].h3DcaXYGlFirstRowPtPr->SetXTitle("dcaXYGl");
123  pm[ipm].h3DcaXYGlFirstRowPtPr->SetYTitle("firstRow");
124  pm[ipm].h3DcaXYGlFirstRowPtPr->SetZTitle("ptPr");
125 
126  // dca xy, last hit, pt
127  setName(name,"h3DcaXYGlLastRowPtPr",cPM[ipm]);
128  pm[ipm].h3DcaXYGlLastRowPtPr
129  = new TH3D(name,name,
130  nDcaXYGlBin,dcaXYGlMin,dcaXYGlMax,
131  45,0.5,45.5,
132  nPtTinyBin,ptTinyMin,ptTinyMax);
133 
134  pm[ipm].h3DcaXYGlLastRowPtPr->SetXTitle("dcaXYGl");
135  pm[ipm].h3DcaXYGlLastRowPtPr->SetYTitle("firstRow");
136  pm[ipm].h3DcaXYGlLastRowPtPr->SetZTitle("ptPr");
137 
138  // dca xy, local phi, pt
139  setName(name,"h3DcaXYGlLocalPhiPtPr",cPM[ipm]);
140  pm[ipm].h3DcaXYGlLocalPhiPtPr
141  = new TH3D(name,name,
142  nDcaXYGlBin,dcaXYGlMin,dcaXYGlMax,
143  30,-15,15,
144  nPtTinyBin,ptTinyMin,ptTinyMax);
145 
146  pm[ipm].h3DcaXYGlLocalPhiPtPr->SetXTitle("dcaXYGl");
147  pm[ipm].h3DcaXYGlLocalPhiPtPr->SetYTitle("localPhi");
148  pm[ipm].h3DcaXYGlLocalPhiPtPr->SetZTitle("ptPr");
149 
150 
151  }
152 
153 
154 }
155 
156 //_____________________
157 
158 void
159 StBadDcaAnalysis::trackLoop()
160 {
161  if(mDebug)
162  cout << "StBadDcaAnalysis::spectraTrackLoop()" << endl;
163 
164  Int_t nTrack = mHiMicroEvent->NTrack();
166 
167  Float_t vertexZ = mHiMicroEvent->VertexZ();
168 
169  for(Int_t i=0; i<nTrack; i++){
170  track =(StHiMicroTrack*) mHiMicroEvent->tracks()->At(i);
171 
172  //***************** spectra ***********************************
173 
174  if(!CutRc::AcceptTrackVtxZHalf(track,vertexZ)) continue;
175 
176  //**************************************************************
177  Float_t ptPr = track->PtPr();
178 //VPunused Float_t eta = track->EtaPr();
179 //VPunused Float_t ptGl = track->PtGl();
180 
181  float fitPts = track->FitPts();
182  float allPts = track->AllPts();
183  float ratioPts = float(fitPts/allPts);
184  float firstRow = track->FirstPadRow();
185  float lastRow = track->LastPadRow();
186 
187  float dcaXYGl = track->DcaXYGl();
188  float phiGlDeg = track->PhiGl()*180./M_PI;;
189  phiGlDeg = (phiGlDeg<-165) ? (phiGlDeg += 360) : phiGlDeg;
190 
191  int ic=(track->Charge()>0) ? 0 : 1;
192 
193  if(CutRc::AcceptEta(track)){
194  // dcaxy, fit pts, pt
195  pm[ic].h3DcaXYGlFitPtsPtPr->Fill(dcaXYGl,fitPts,ptPr);
196 
197  // dcaxy, all pts, pt
198  pm[ic].h3DcaXYGlAllPtsPtPr->Fill(dcaXYGl,allPts,ptPr);
199 
200  // dcaxy, ratio pts, pt
201  pm[ic].h3DcaXYGlRatioPtsPtPr->Fill(dcaXYGl,ratioPts,ptPr);
202 
203  if(CutRc::AcceptFitPts(track)){
204  // dcaxy, first row, pt
205  pm[ic].h3DcaXYGlFirstRowPtPr->Fill(dcaXYGl,firstRow,ptPr);
206 
207  // dcaxy, first row, pt
208  pm[ic].h3DcaXYGlLastRowPtPr->Fill(dcaXYGl,lastRow,ptPr);
209 
210 
211  }
212  }
213 
214 
215  }
216 }
217 
218 //_____________________
219 
220 void
221 StBadDcaAnalysis::fillEventHistograms()
222 {
223 
224 }
225 
226 
227 //______________________
228 
229 Bool_t
230 StBadDcaAnalysis::acceptEvent(StHiMicroEvent* event)
231 {
232  return CutRc::Accept(event);
233 
234 }
235 
236 
237 //______________________
238 
239 void
240 StBadDcaAnalysis::finishHistograms()
241 {
242 
243 
244 }
245 
246 
247 
248 //_____________________________________
249 
250 ClassImp(StBadDcaAnalysis)