StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTofpMatchMaker.h
1 
14 /* -------------------------------------------------------------------------
15  * $Log: StTofpMatchMaker.h,v $
16  * Revision 1.9 2014/08/06 11:43:49 jeromel
17  * Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
18  *
19  * Revision 1.8 2005/07/06 22:12:09 fisyak
20  * Use templated StThreeVectorD
21  *
22  * Revision 1.7 2005/04/12 17:32:45 dongx
23  * update for year 5 data. Tofp removed, so do nothing in this maker from now on.
24  *
25  * Revision 1.6 2004/06/09 21:28:05 dongx
26  * update matching : checking before projecting track, improve the speed by around an order of magnitude
27  *
28  * Revision 1.5 2004/03/11 22:29:32 dongx
29  * -remove assert()
30  * -add member mYear4
31  * -use m_Mode to control the output root file
32  *
33  * Revision 1.4 2003/09/15 22:38:11 geurts
34  * dBase updates:
35  * - removed initLocalDb option
36  * - introduced dBase parameters for strobe event definitions
37  *
38  * Revision 1.3 2003/09/13 19:15:52 geurts
39  * Changed passing of StSPtrVecTofData for strobeEvent (see bugtracker ticket #172)
40  *
41  * Revision 1.2 2003/09/10 19:47:38 perev
42  * ansi corrs
43  *
44  * Revision 1.1 2003/08/08 18:31:26 geurts
45  * first release
46  *
47  *
48  * -------------------------------------------------------------------------
49  */
50 #ifndef STTOFPMATCHMAKER_HH
51 #define STTOFPMATCHMAKER_HH
52 #include "StMaker.h"
53 #include <string>
54 
55 class StEvent;
56 class StTrack;
57 class StHelix;
58 #include "StThreeVectorD.hh"
59 class StTrackGeometry;
60 class StTofGeometry;
61 class StTofCollection;
63 class StSPtrVecTofData;
64 class TOrdCollection;
65 class TH1D;
66 class TH2D;
67 
68 
69 
70 class StTofpMatchMaker : public StMaker {
71  static const Int_t NTOFP = 41;
72  static const Int_t NPVPD = 6;
73 public:
74  StTofpMatchMaker(const Char_t *name="tofpMatch");
76 
77  void Clear(Option_t *option="");
78  Int_t Init();
79  Int_t InitRun(int);
80  Int_t FinishRun(int);
81  Int_t Make();
82  Int_t Finish();
83 
84  void createHistograms(Bool_t histos=kTRUE);
85  void setOuterTrackGeometry();
86  void setStandardTrackGeometry();
87  void setValidAdcRange(Int_t, Int_t);
88  void setValidTdcRange(Int_t, Int_t);
89  void setMinHitsPerTrack(Int_t);
90  void setMinFitPointsPerTrack(Int_t);
91  void setMaxDCA(Float_t);
92  void setHistoFileName(const Char_t*);
93 
94  Bool_t doPrintMemoryInfo;
95  Bool_t doPrintCpuInfo;
96 
97 protected:
99  Float_t slatPropagationTime(StThreeVectorD*); // calculate hit position correction
100  Float_t startTime(const float); // calculated pvpd startTime
101  Int_t getTofData(StTofCollection*); // check, remap and fill local arrays with tof and pvpd data
103  Float_t mTofpAdc[NTOFP];
104  Float_t mTofpTdc[NTOFP];
105  Float_t mPvpdAdc[NPVPD];
106  Float_t mPvpdAdcLoRes[NPVPD];
107  Float_t mPvpdTdc[NPVPD];
108 
109 
110 private:
111  Bool_t strobeEvent(StSPtrVecTofData&);// check pVPD data for strobe event
112  Int_t mStrobeTdcMin[NPVPD];
113  Int_t mStrobeTdcMax[NPVPD];
114 
115  void bookHistograms();
116  void writeHistogramsToFile();
117  StTofGeometry *mTofGeom;
118 
119  static const Int_t mTofpTrayId = 93; // tofp tray id number in year 4
120  Bool_t mHisto;
121  //Bool_t mInitLocalDb; //! initialize from local (true) dbase or STAR dbase (false)
122  Bool_t mYear2;
123  Bool_t mYear3;
124  Bool_t mYear4;
125  Bool_t mYear5;
126  Bool_t mOuterTrackGeometry;
127  string mHistoFileName;
128 
129  Bool_t validAdc(float);
130  Bool_t validTdc(float);
131  Bool_t validEvent(StEvent *);
132  Bool_t validTrack(StTrack*);
133  Bool_t validTofTrack(StTrack*);
134 
135  // event counters
136  Int_t mEventCounter;
137  Int_t mAcceptedEventCounter;
138  Int_t mTofEventCounter;
139  Int_t mTofStrobeEventCounter;
140  Int_t mAcceptAndStrobe;
141  Int_t mAcceptAndBeam;
142 
143  // various cut-offs and ranges
144  Float_t mMinValidTdc;
145  Float_t mMaxValidTdc;
146  Float_t mMinValidAdc;
147  Float_t mMaxValidAdc;
148  UInt_t mMinHitsPerTrack;
149  UInt_t mMinFitPointsPerTrack;
150  Float_t mMaxDCA;
151 
152 
153  // TOFp histogram collections
154  TOrdCollection* mHitPosHistNames;
155  TOrdCollection* mTrackHistNames;
156  TOrdCollection* mOccupancyHistNames;
157 
158  TH2D *hTofpHitMap1;
159  TH2D *hTofpHitMap2;
160  TH2D *hTofpHitMap3;
161  TH2D *hTofpHitMap4;
162  TH1D *hTofpSlatIdA0;
163  TH1D *hTofpSlatIdA1;
164  TH1D *hTofpSlatIdB1;
165  TH1D *hTofpSlatIdD1;
166  TH1D *hTofpSlatIdD2;
167  TH1D *hTofpSlatIdE1;
168  TH1D *hTofpSlatIdE2;
169  TH1D *hTofpSlatIdE3;
170  TH1D *hTofpSlatIdE4;
171  TH1D *hTofpSlatIdE5;
172  TH1D *hTofpSlatIdF1;
173  TH1D *hTofpSlatHitVecSize;
174 
175  TH1D *hTofpNumberOfTrackHits;
176  TH1D *hTofpPtTrack;
177  TH1D *hTofpDCATrackprimVertex;
178 
179 
180  // Occupancy plots
181  TH1D *hTofpNumberOfValidAdc;
182  TH1D *hTofpNumberOfValidTdc;
183  TH1D *hTofpNumberOfValidSlats;
184  TH1D *hTofpNumberOfGlobalTracks;
185  TH1D *hTofpNumberOfHitSlats;
186  TH1D *hTofpNumberOfSingleHitTracks;
187  TH1D *hTofpNumberOfSingleValidHitTracks;
188 
189  // track matching plots
190  TOrdCollection* mMatchHistNames;
191  TH2D *hTofpMatchHit[NTOFP];
192  TH2D *hTofpMatchNoHit[NTOFP];
193 
194  virtual const char *GetCVS() const
195  {static const char cvs[]="Tag $Name: $ $Id: StTofpMatchMaker.h,v 1.9 2014/08/06 11:43:49 jeromel Exp $ built " __DATE__ " " __TIME__ ; return cvs;}
196 
197  ClassDef(StTofpMatchMaker,0)
198 };
199 
200 inline void StTofpMatchMaker::setValidAdcRange(Int_t min, Int_t max){mMinValidAdc=min; mMaxValidAdc=max;}
201 inline void StTofpMatchMaker::setValidTdcRange(Int_t min, Int_t max){mMinValidTdc=min; mMaxValidTdc=max;}
202 inline void StTofpMatchMaker::setOuterTrackGeometry(){mOuterTrackGeometry=true;}
203 inline void StTofpMatchMaker::setStandardTrackGeometry(){mOuterTrackGeometry=false;}
204 inline void StTofpMatchMaker::setMinHitsPerTrack(Int_t nhits){mMinHitsPerTrack=nhits;}
205 inline void StTofpMatchMaker::setMinFitPointsPerTrack(Int_t nfitpnts){mMinFitPointsPerTrack=nfitpnts;}
206 inline void StTofpMatchMaker::setMaxDCA(Float_t maxdca){mMaxDCA=maxdca;}
207 inline void StTofpMatchMaker::setHistoFileName(const Char_t* filename){mHistoFileName=filename;}
208 inline void StTofpMatchMaker::createHistograms(Bool_t histos){mHisto = histos;}
209 inline bool StTofpMatchMaker::validAdc(float adc){return((adc>=mMinValidAdc) && (adc<=mMaxValidAdc));}
210 inline bool StTofpMatchMaker::validTdc(float tdc){return((tdc>=mMinValidTdc) && (tdc<=mMaxValidTdc));}
211 
212 #endif
Int_t storeMatchData(StTofSlatCollection *, StTofCollection *)
store local slat collection in StEvent&#39;s tofCollection
Int_t FinishRun(int)
FinishRun: clean up tofp geometry.
void Clear(Option_t *option="")
User defined functions.
StTofpMatchMaker(const Char_t *name="tofpMatch")
default constructor, set default values
Time-of-Flight Geometry Utilities.
Int_t getTofData(StTofCollection *)
create a local copy of the raw tofp data tofData in StEvent&#39;s tofCollection
Int_t Finish()
Finish: dump usage statistics and write histograms to file.
Int_t Init()
Init: inform user of parameter settings and book histograms.
Int_t InitRun(int)
InitRun: (re-)initialize the tofp geometry.
StTrackGeometry * trackGeometry(StTrack *)
returns the proper track geometry, based on a global user setting
TOFp Match Maker.
Int_t Make()
Make: match extrapolated TPC tracks to TOFp slats.