StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFgtStraightPlotter.h
1 #ifndef _ST_FGT_STRAIGHT_PLOTTER__
3 #define _ST_FGT_STRAIGHT_PLOTTER__
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 "StFgtStraightTrackMaker.h"
14 //#include "StRoot/StEvent/StFgtCollection.h"
15 
16 
17 
18 class StFgtCollection;
19 
20 class StFgtStraightPlotter : public StMaker {
21  public:
22  template<class T> void createPlots(T*** pH, int numH, const char* nameBase, int numBin, int first, int last);
23  StFgtStraightPlotter(const Char_t* name="FgtStraightPlotter", const Char_t* trackerName="fgtStraightTracker");
24  pair<Double_t,Double_t> findCluChargeSize(Int_t iD,Char_t layer, Double_t ordinate);
25  virtual ~StFgtStraightPlotter();
26  void setMaxDistChi(Float_t maxDChi);
27  Int_t Init();
28  Int_t Make();
29  Int_t Finish();
30  void setUseChargeMatch(Bool_t use=true);
31  void setPrint(Bool_t print);
32  void setDcaCut(Int_t dca_in_cm);
33  // Bool_t checkPulse(StFgtHit* pClus);
34  virtual const char *GetCVS() const
35  {static const char cvs[]="Tag $Name: $ $Id: StFgtStraightPlotter.h,v 1.10 2014/08/06 11:43:10 jeromel Exp $ built " __DATE__ " " __TIME__ ; return cvs;}
36  void SetEffDisk(Int_t disk)
37  {
38  m_effDisk=disk;
39  }
40  void SetFileBase(const Char_t* filebase, const Char_t* filename="");
41  protected:
42  Int_t intNumTracks;
43  Bool_t isCosmic;
44  Float_t vertexCut;
45  Float_t dcaCut;
46  Bool_t pulseCondition;
47  Bool_t lenCondition;
48  Float_t maxDistStrip_R;
49  Float_t maxDistStrip_Phi;
50  Float_t maxDist2Eff;
51  Bool_t doPrint;
52 
53  Char_t mFileBase[300];
54  Char_t mFileName[200];
55  Char_t mTrackerName[200];
56 
57  StFgtDb* mDb;
58  Int_t m_effDisk;
59  Float_t maxDistChi;
60  vector<TH2D*> v_hClusP;
61  vector<TH2D*> v_hClusR;
62  Bool_t useChargeMatch;
63  Int_t printCounter;
64  Int_t fitCounter;
65  ofstream* outTxtFile;
66  ofstream* cluNotFoundTxt;
67  Float_t chargeMatchCut;
68  vector<generalCluster>** pClusters;
69  vector<generalStrip>* pStrips;
70  void setChargeMatchCut(Float_t cut);
71  Bool_t arePointsMatched(vector<generalCluster>::iterator c1, vector<generalCluster>::iterator c2);
72  Short_t getQuadFromCoo(Double_t x, Double_t y);
73  pair<Double_t,Double_t> getChargeRatio(Float_t r, Float_t phi, Int_t iD, Int_t iq);
74  Bool_t printArea(Float_t r, Float_t phi, Int_t iD, Int_t iq);
75  Bool_t printArea1D(Int_t iD, Int_t iq,Int_t centerGeoId);
76  Bool_t getTrack(vector<AVPoint>& points, Double_t ipZ);
77  pair<double,double> getDca( vector<AVTrack>::iterator it);
78 
79  // for accessing the data
80  StFgtCollection *mFgtCollectionPtr;
81  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);
82  void doNormalize(TH2D** hEff, TH2D** hNonEff);
83  Double_t getRPhiRatio(vector<generalCluster>::iterator hitIterBegin, vector<generalCluster>::iterator hitIterEnd);
84  Double_t findClosestPoint(float mx, float bx, float my, float by, double xE, double yE, Int_t iD);
85  Bool_t isSomewhatEff(Float_t r, Float_t phi, Int_t iD, Int_t iq);
86  void fillStripHistos(Float_t r, Float_t phi, Int_t iD, Int_t iq);
87  Double_t findClosestStrip(Char_t layer, double ord, Int_t iD, Int_t iQ);
88  // for knowing what & how to plot
89  Bool_t fitTheStrip(generalStrip* pStrip, generalStrip* pStripOtherLayer, float* amp, float* t0, float* chi2Ndf, int iD, int iq, int apvBin, Char_t layer);
90  Bool_t validPulse(generalStrip& strip);
91  // threshold, in units of # sigma above average
92  Float_t mPedThres;
93  // Double_t getRPhiRatio(StSPtrVecFgtHitConstIterator hitIterBegin, StSPtrVecFgtHitConstIterator hitIterEnd);
94  // Double_t getRPhiRatio();
95 
96  TF1* mPulseShapePtr;
97  TH1F* mHistPtr;
98  TH1F* mHistPtr2;
99 
100  TCanvas* mCanvas;
101  TH2D** radioPlotsEff;
102  TH2D** radioPlotsNonEff;
103 
104 
105  TH1D** trkPhiProj;
106 
107  TH2D** radioPlotsTrackHits;
108  TH2D** radioPlotsClusChargeR;
109  TH2D** radioPlotsClusSizeR;
110  TH2D** radioPlotsClusChargeP;
111  TH2D** radioPlotsClusSizeP;
112 
113  TH2D** chargeCorrTracks;
114  TH2D** chargeCorrTracksRCut;
115 
116 
117  TH1D** clusChargeR;
118  TH1D** clusSizeR;
119 
120 
121 
122  TH2D** radioPlotsEffR;
123  TH2D** radioPlotsNonEffR;
124 
125  TH2D** radioPlotsEffPhi;
126  TH2D** radioPlotsNonEffPhi;
127 
128  TH2D** radioPlotsEffLoose;
129  TH2D** radioPlotsNonEffLoose;
130 
131 
132  TH2D* chargeCorrSum3;
133  // TH2D* chargeCorrCluster;
134  TH2D* chargeCorrMaxStrip;
135  TH2D* chargeCorrMaxAdc;
136 
137 
138  TH1F** firstTbSigCloseClusterR;
139  TH1F** firstTbSigCloseClusterP;
140  TH1F** firstTbSigTrackClusterR;
141  TH1F** firstTbSigTrackClusterP;
142 
143 
144  TH1I** maxTbCloseClusterR;
145  TH1I** maxTbCloseClusterP;
146 
147  TH1I** maxTbTrackClusterR;
148  TH1I** maxTbTrackClusterP;
149 
150  TH1I** maxAdcTrackClusterR;
151  TH1I** maxAdcCloseClusterR;
152 
153  TH1I** maxSigTrackClusterR;
154  TH1I** maxSigCloseClusterR;
155 
156 
157  TH1I** numClustersR;
158  TH1I** numClustersPhi;
159 
160  TH1I** numTrackHits;
161  TH1I* numTracks;
162  TH1I* numPointsPerTrack;
163 
164  TH1I** numFSigTrackClusterR;
165  TH1I** numFSigCloseClusterR;
166 
167  TH1I** numFirstHighTrackClusterR;
168  TH1I** numFirstHighCloseClusterR;
169 
170  TH1I** maxAdcTrackClusterP;
171  TH1I** maxAdcCloseClusterP;
172 
173  TH1F** chargeTrackClusterR;
174  TH1F** chargeTrackClusterP;
175  TH1F** chargeTrackClusterRvsP;
176  TH1F** chargeTrackClusterPvsR;
177  TH1F** numTrackClusterR;
178  TH1F** numTrackClusterP;
179  TH1F** numTrackSymCutClusterR;
180  TH1F** numTrackSymCutClusterP;
181 
182 
183  // TH2D* chargeCorrCluster;
184 
185 
186 
187 
188 
189 
190 
191  TH1F** chargeTrackSymCutClusterR;
192  TH1F** chargeTrackSymCutClusterP;
193 
194  TH1F** maxSigTrackClusterP;
195  TH1F** maxSigCloseClusterP;
196 
197  TH1I** numFSigTrackClusterP;
198  TH1I** numFSigCloseClusterP;
199 
200  TH1I** numFirstHighTrackClusterP;
201  TH1I** numFirstHighCloseClusterP;
202 
203  TH1F** secondToLastRatioCloseClusterP;
204  TH1F** secondToLastRatioCloseClusterR;
205 
206  TH1F** secondToLastRatioTrackClusterP;
207  TH1F** secondToLastRatioTrackClusterR;
208 
209  TH1F** APVfitChi2P;
210  TH1F** APVfitChi2R;
211 
212  TH1F** APVfitAmpP;
213  TH1F** APVfitAmpR;
214 
215  TH1F** APVfitT0P;
216  TH1F** APVfitT0R;
217 
218  TH1F** APVfirstTbSigCloseClusterP;
219  TH1F** APVfirstTbSigCloseClusterR;
220  TH1I** APVmaxAdcCloseClusterP;
221  TH1I** APVmaxAdcCloseClusterR;
222  TH1I** APVmaxTbCloseClusterP;
223  TH1I** APVmaxTbCloseClusterR;
224  TH1I** APVnumFSigCloseClusterP;
225  TH1I** APVnumFSigCloseClusterR;
226  TH1I** APVnumFirstHighCloseClusterP;
227  TH1I** APVnumFirstHighCloseClusterR;
228  TH1F** APVmaxSigCloseClusterP;
229  TH1F** APVmaxSigCloseClusterR;
230  TH1F** APVsecondToLastRatioCloseClusterP;
231  TH1F** APVsecondToLastRatioCloseClusterR;
232 
233  TH1F* exPulseMaxAdcNormR;
234  TH1F* exPulseSigR;
235  TH1F* exPulseMaxAdcNormP;
236  TH1F* exPulseSigP;
237 
238  TH1F* exPulseMaxAdcNormTrackR;
239  TH1F* exPulseSigTrackR;
240  TH1F* exPulseMaxAdcNormTrackP;
241  TH1F* exPulseSigTrackP;
242 
243  //joe's histograms added
244  TH1I** clusterGeoId;
245  TH1I** clustersR;
246  TH1I** clustersP;
247  TH1I*disk1QuadA[22];
248 
249  int pulseCounterP;
250  int pulseCounterR;
251 
252  int pulseCounterTP;
253  int pulseCounterTR;
254 
255 
256  TH1D** rPhiRatioPlots;
257  TH1D** rEff;
258  TH1D* hChargeAsym;
259  TH1D* hChargeRatio;
260  TH1D** rNonEff;
261  TH2D* chargeRatioInEffDisk;
262  TH2D* chargeAsymInEffDisk;
263  TH2D* chargeCorrInEffDisk;
264  TH2D* tpcFgtZVertexCorr;
265  TH2D* tpcFgtZVertexCorr2;
266  TH2D* tpcFgtZVertexCorr3;
267 
268  TH1D* tpcFgtZVtxDiff;
269  TH1D* tpcFgtZVtxDiff2;
270 
271  TH2D** chargeCorr;
272  TH1D** clusterSizeR;
273  TH1D** clusterSizeP;
274  TH1D** h_clusterSizeR;
275  TH1D** h_clusterSizePhi;
276  TH1D** h_clusterChargeR;
277  TH1D** h_clusterChargePhi;
278 
279  TH2D* hIp;
280  TH1D* hIpZ;
281  TH1D* hIpDca;
282 
283 
284  TH1D* hTrkZ;
285  TH1D* hChi2;
286  TH1D* hBx;
287  TH1D* hBy;
288  TH1D* hResidua;
289  TH2D* hResiduaX;
290  TH2D* hResiduaY;
291  TH2D* hResiduaR;
292  TH2D* hResiduaP;
293 
294 
295  TH1D* hMx;
296  TH1D* hMy;
297 
298  TFile* pulsePictureFile;
299  TFile* myRootFile;
300  int runningEvtNr;
301  Int_t evtNr;
302  int hitCounter;
303  int hitCounterR;
304  //THD2**
305 
306 
307  private:
308  ClassDef(StFgtStraightPlotter,1);
309 
310 };
311 inline void StFgtStraightPlotter::setUseChargeMatch(Bool_t use){useChargeMatch=use;};
312 inline void StFgtStraightPlotter::setChargeMatchCut(Float_t cut)
313 {chargeMatchCut=cut;};
314 inline void StFgtStraightPlotter::setMaxDistChi(Float_t maxDChi)
315 {
316  maxDistChi=maxDChi;
317 }
318 inline void StFgtStraightPlotter::setPrint(Bool_t print)
319 {
320  doPrint=print;
321 }
322 inline void StFgtStraightPlotter::setDcaCut(Int_t dca_in_cm)
323 {
324  dcaCut=dca_in_cm;
325 };
326 #endif
327 
pair< double, double > getDca(vector< AVTrack >::iterator it)
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