StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFgtGenAVEMaker.h
1 #ifndef _ST_FGT_GEN_AGV_EFF_MAKER_
3 #define _ST_FGT_GEN_AGV_EFF_MAKER_
4 
5 #include "StMaker.h"
6 //#include "StFgtQaMaker.h"
7 #include <TH2D.h>
8 #include <TROOT.h>
9 #include <TStyle.h>
10 #include <TCanvas.h>
11 #include <TFile.h>
12 #include <TF1.h>
13 #include "StFgtGeneralBase.h"
14 //#include "StRoot/StEvent/StFgtCollection.h"
15 
16 class StFgtHit;
17 
18 
19 struct AVPoint
20 {
21  Double_t x;
22  Double_t y;
23  Double_t z;
24  Double_t r;
25  Double_t phi;
26  Double_t rCharge;
27  Double_t phiCharge;
28  Double_t rSize;
29  Double_t phiSize;
30  Int_t rMaxAdc;
31  Int_t phiMaxAdc;
32  Int_t rMaxAdcInt;
33  Int_t phiMaxAdcInt;
34  Int_t geoIdR;
35  Int_t geoIdPhi;
36  Int_t dID;
37  Int_t quadID;
38  StFgtHit* fgtHitR;
39  StFgtHit* fgtHitPhi;
40 
41  AVPoint(){};
42  AVPoint(Double_t mx, Double_t my, Double_t mz, Double_t mr, Double_t mPhi, Int_t mdID,Int_t mQuad, Double_t mRCharge, Double_t mPhiCharge, Double_t mRSize, Double_t mPhiSize)
43  {
44  geoIdR=-1;
45  geoIdPhi=-1;
46  x=mx;
47  y=my;
48  z=mz;
49  r=mr;
50  phi=mPhi;
51  dID=mdID;
52  quadID=mQuad;
53  rCharge=mRCharge;
54  phiCharge=mPhiCharge;
55  rSize=mRSize;
56  phiSize=mPhiSize;
57  rMaxAdc=-1;
58  phiMaxAdc=-1;
59  rMaxAdcInt=-1;
60  phiMaxAdcInt=-1;
61 
62 
63  }
64 };
65 
66 struct AVTrack
67 {
68  Double_t mx;
69  Double_t my;
70  Double_t ax;
71  Double_t ay;
72  Double_t ipZEv;
73  Double_t ipZ;
74  Int_t vtxRank;
75  Double_t chi2;
76  Double_t dca;
77  Double_t trkZ;
78  vector<AVPoint>* points;
79  AVTrack(){};
80  AVTrack(Double_t m_mx, Double_t m_my, Double_t m_ax, Double_t m_ay, Double_t m_ipZ=0.0,Double_t m_chi2=0.0)
81  {
82  mx=m_mx;
83  my=m_my;
84  ax=m_ax;
85  ay=m_ay;
86  ipZEv=m_ipZ;
87  chi2=m_chi2;
88  dca=-9999;
89  trkZ=-9999;
90  ipZ=-9999;
91  }
92 };
93 
94 class StFgtCollection;
95 
97  public:
98  StFgtGenAVEMaker(const Char_t* name="FgtGenAVEMaker");
99  pair<Double_t,Double_t> findCluChargeSize(Int_t iD,Char_t layer, Double_t ordinate);
100  virtual ~StFgtGenAVEMaker();
101  Int_t Init();
102  Int_t Make();
103  Int_t Finish();
104  void setUseChargeMatch(Bool_t use=true);
105  // Bool_t checkPulse(StFgtHit* pClus);
106  virtual const char *GetCVS() const
107  {static const char cvs[]="Tag $Name: $ $Id: StFgtGenAVEMaker.h,v 1.22 2014/08/06 11:43:10 jeromel Exp $ built " __DATE__ " " __TIME__ ; return cvs;}
108  protected:
109  vector<TH2D*> v_hClusP;
110  vector<TH2D*> v_hClusR;
111  Bool_t useChargeMatch;
112  Int_t printCounter;
113  Int_t fitCounter;
114  ofstream* outTxtFile;
115  ofstream* cluNotFoundTxt;
116  Short_t getQuadFromCoo(Double_t x, Double_t y);
117  pair<Double_t,Double_t> getChargeRatio(Float_t r, Float_t phi, Int_t iD, Int_t iq);
118  Bool_t printArea(Float_t r, Float_t phi, Int_t iD, Int_t iq);
119  Bool_t printArea1D(Int_t iD, Int_t iq,Int_t centerGeoId);
120  Bool_t getTrack(vector<AVPoint>& points, Double_t ipZ);
121  pair<double,double> getDca( vector<AVTrack>::iterator it);
122  vector<AVTrack> m_tracks;
123  // for accessing the data
124  StFgtCollection *mFgtCollectionPtr;
125  void doNormalize(TH2D** hEff, TH2D** hNonEff);
126  void 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);
127  Double_t getRPhiRatio(vector<generalCluster>::iterator hitIterBegin, vector<generalCluster>::iterator hitIterEnd);
128  Double_t findClosestPoint(float mx, float bx, float my, float by, double xE, double yE, Int_t iD);
129  Bool_t isSomewhatEff(Float_t r, Float_t phi, Int_t iD, Int_t iq);
130  void fillStripHistos(Float_t r, Float_t phi, Int_t iD, Int_t iq);
131  Double_t findClosestStrip(Char_t layer, double ord, Int_t iD, Int_t iQ);
132  // for knowing what & how to plot
133  Bool_t fitTheStrip(generalStrip* pStrip, generalStrip* pStripOtherLayer, float* amp, float* t0, float* chi2Ndf, int iD, int iq, int apvBin, Char_t layer);
134 
135  // threshold, in units of # sigma above average
136  Float_t mPedThres;
137  // Double_t getRPhiRatio(StSPtrVecFgtHitConstIterator hitIterBegin, StSPtrVecFgtHitConstIterator hitIterEnd);
138  // Double_t getRPhiRatio();
139 
140  TF1* mPulseShapePtr;
141  TH1F* mHistPtr;
142  TH1F* mHistPtr2;
143  TCanvas* mCanvas;
144  TH2D** radioPlotsEff;
145  TH2D** radioPlotsNonEff;
146 
147  TH2D** radioPlotsEffR;
148  TH2D** radioPlotsNonEffR;
149 
150  TH2D** radioPlotsEffPhi;
151  TH2D** radioPlotsNonEffPhi;
152 
153  TH2D** radioPlotsEffLoose;
154  TH2D** radioPlotsNonEffLoose;
155 
156 
157  TH2D* chargeCorrSum3;
158  // TH2D* chargeCorrCluster;
159  TH2D* chargeCorrMaxStrip;
160  TH2D* chargeCorrMaxAdc;
161 
162 
163  TH1F** firstTbSigCloseClusterR;
164  TH1F** firstTbSigCloseClusterP;
165  TH1F** firstTbSigTrackClusterR;
166  TH1F** firstTbSigTrackClusterP;
167 
168 
169  TH1I** maxTbCloseClusterR;
170  TH1I** maxTbCloseClusterP;
171 
172  TH1I** maxTbTrackClusterR;
173  TH1I** maxTbTrackClusterP;
174 
175  TH1I** maxAdcTrackClusterR;
176  TH1I** maxAdcCloseClusterR;
177 
178  TH1I** maxSigTrackClusterR;
179  TH1I** maxSigCloseClusterR;
180 
181 
182  TH1I** numClustersR;
183  TH1I** numClustersPhi;
184 
185  TH1I** numTrackHits;
186  TH1I* numTracks;
187 
188 
189  TH1I** numFSigTrackClusterR;
190  TH1I** numFSigCloseClusterR;
191 
192  TH1I** numFirstHighTrackClusterR;
193  TH1I** numFirstHighCloseClusterR;
194 
195  TH1I** maxAdcTrackClusterP;
196  TH1I** maxAdcCloseClusterP;
197 
198  TH1F** maxSigTrackClusterP;
199  TH1F** maxSigCloseClusterP;
200 
201  TH1I** numFSigTrackClusterP;
202  TH1I** numFSigCloseClusterP;
203 
204  TH1I** numFirstHighTrackClusterP;
205  TH1I** numFirstHighCloseClusterP;
206 
207  TH1F** secondToLastRatioCloseClusterP;
208  TH1F** secondToLastRatioCloseClusterR;
209 
210  TH1F** secondToLastRatioTrackClusterP;
211  TH1F** secondToLastRatioTrackClusterR;
212 
213  TH1F** APVfitChi2P;
214  TH1F** APVfitChi2R;
215 
216  TH1F** APVfitAmpP;
217  TH1F** APVfitAmpR;
218 
219  TH1F** APVfitT0P;
220  TH1F** APVfitT0R;
221 
222  TH1F** APVfirstTbSigCloseClusterP;
223  TH1F** APVfirstTbSigCloseClusterR;
224  TH1I** APVmaxAdcCloseClusterP;
225  TH1I** APVmaxAdcCloseClusterR;
226  TH1I** APVmaxTbCloseClusterP;
227  TH1I** APVmaxTbCloseClusterR;
228  TH1I** APVnumFSigCloseClusterP;
229  TH1I** APVnumFSigCloseClusterR;
230  TH1I** APVnumFirstHighCloseClusterP;
231  TH1I** APVnumFirstHighCloseClusterR;
232  TH1F** APVmaxSigCloseClusterP;
233  TH1F** APVmaxSigCloseClusterR;
234  TH1F** APVsecondToLastRatioCloseClusterP;
235  TH1F** APVsecondToLastRatioCloseClusterR;
236 
237  TH1F* exPulseMaxAdcNormR;
238  TH1F* exPulseSigR;
239  TH1F* exPulseMaxAdcNormP;
240  TH1F* exPulseSigP;
241 
242  TH1F* exPulseMaxAdcNormTrackR;
243  TH1F* exPulseSigTrackR;
244  TH1F* exPulseMaxAdcNormTrackP;
245  TH1F* exPulseSigTrackP;
246 
247  //joe's histograms added
248  TH1I** clusterGeoId;
249  TH1I** clustersR;
250  TH1I** clustersP;
251  TH1I*disk1QuadA[22];
252 
253  int pulseCounterP;
254  int pulseCounterR;
255 
256  int pulseCounterTP;
257  int pulseCounterTR;
258 
259 
260  TH1D** rPhiRatioPlots;
261  TH1D** rEff;
262  TH1D* hChargeAsym;
263  TH1D* hChargeRatio;
264  TH1D** rNonEff;
265  TH2D* chargeRatioInEffDisk;
266  TH2D* chargeAsymInEffDisk;
267  TH2D* chargeCorrInEffDisk;
268  TH2D* tpcFgtZVertexCorr;
269  TH2D* tpcFgtZVertexCorr2;
270  TH2D* tpcFgtZVertexCorr3;
271 
272  TH2D** chargeCorr;
273  TH1D** clusterSizeR;
274  TH1D** clusterSizeP;
275  TH1D** h_clusterSizeR;
276  TH1D** h_clusterSizePhi;
277  TH1D** h_clusterChargeR;
278  TH1D** h_clusterChargePhi;
279 
280  TH2D* hIp;
281  TH1D* hIpZ;
282  TH1D* hIpDca;
283 
284 
285  TH1D* hTrkZ;
286  TH1D* hChi2;
287  TH1D* hBx;
288  TH1D* hBy;
289  TH1D* hResidua;
290  TH2D* hResiduaX;
291  TH2D* hResiduaY;
292  TH2D* hResiduaR;
293  TH2D* hResiduaP;
294 
295 
296  TH1D* hMx;
297  TH1D* hMy;
298 
299  TFile* pulsePictureFile;
300  TFile* myRootFile;
301  int runningEvtNr;
302  int hitCounter;
303  int hitCounterR;
304  //THD2**
305 
306 
307  private:
308  ClassDef(StFgtGenAVEMaker,1);
309 
310 };
311 inline void StFgtGenAVEMaker::setUseChargeMatch(Bool_t use){useChargeMatch=use;};
312 #endif
313 
Short_t getQuadFromCoo(Double_t x, Double_t y)
this is too naive..., assumes non-rotated quads
Double_t findClosestPoint(float mx, float bx, float my, float by, double xE, double yE, Int_t iD)
void fillStripHistos(Float_t r, Float_t phi, Int_t iD, Int_t iq)
Bool_t getTrack(vector< AVPoint > &points, Double_t ipZ)
pair< double, double > getDca(vector< AVTrack >::iterator it)