69 #ifndef STTOFRMATCHMAKER_HH
70 #define STTOFRMATCHMAKER_HH
72 #include "StThreeVectorD.hh"
74 #define VHRBIN2PS 24.4140625 // Very High resolution mode, pico-second per bin
76 #define HRBIN2PS 97.65625 // High resolution mode, pico-second per bin
81 #ifndef ST_NO_NAMESPACES
90 #include "StThreeVectorD.hh"
93 #include "StTofUtil/StSortTofRawData.h"
100 class StSPtrVecTofData;
106 #if !defined(ST_NO_TEMPLATE_DEF_ARGS) || defined(__CINT__)
107 typedef vector<Int_t> IntVec;
108 typedef vector<Double_t> DoubleVec;
110 typedef vector<Int_t, allocator<Int_t>> IntVec;
111 typedef vector<Double_t, allocator<Double_t>> DoubleVec;
121 Int_t InitRun(Int_t);
122 Int_t FinishRun(Int_t);
126 void setCreateHistoFlag(Bool_t histos=kTRUE);
127 void setCreateTreeFlag(Bool_t tree=kTRUE);
128 void setOuterTrackGeometry();
129 void setStandardTrackGeometry();
130 void setValidAdcRange(Int_t, Int_t);
131 void setValidTdcRange(Int_t, Int_t);
132 void setMinHitsPerTrack(Int_t);
133 void setMinFitPointsPerTrack(Int_t);
134 void setMinFitPointsOverMax(Float_t);
135 void setMaxDCA(Float_t);
136 void setHistoFileName(
const Char_t*);
137 void setNtupleFileName(Char_t*);
138 void setSaveGeometry(Bool_t geomSave=kFALSE);
140 Int_t processEventYear2to4();
141 Int_t processEventYear5();
142 Int_t processEventYear8();
149 Bool_t strobeEvent(StSPtrVecTofData&);
150 void bookHistograms();
151 void writeHistogramsToFile();
153 Bool_t validAdc(Float_t);
154 Bool_t validTdc(Float_t);
158 Bool_t validTofTrack(
StTrack*);
165 float getINLCorr(
int boardId,
int tdcChanId);
168 Bool_t doPrintMemoryInfo;
169 Bool_t doPrintCpuInfo;
172 static const Int_t mDAQOVERFLOW;
173 static const Int_t mNTOFP;
174 static const Int_t mNPVPD;
175 static const Int_t mNTOFR;
176 static const Int_t mNTOFR5;
179 static const Int_t mNTOF;
180 static const Int_t mNModule;
181 static const Int_t mNCell;
182 static const Int_t mNVPD;
184 static const Int_t mEastVpdTrayId;
185 static const Int_t mWestVpdTrayId;
187 static const Int_t mNValidTrays_Run3;
188 static const Int_t mNValidTrays_Run4;
189 static const Int_t mNValidTrays_Run5;
190 static const Int_t mNValidTrays_Run6;
191 static const Int_t mNValidTrays_Run7;
192 static const Int_t mNValidTrays_Run8;
195 static const Int_t mTdigBoard;
196 static const Int_t mTdcOnBoard;
197 static const Int_t mTdcChannel;
200 vector<Float_t> mTofrAdc;
201 vector<Float_t> mTofrTdc;
202 vector<Float_t> mPvpdAdc;
203 vector<Float_t> mPvpdAdcLoRes;
204 vector<Float_t> mPvpdTdc;
206 vector<Float_t> mPvpdToT;
211 vector<Float_t> mTofr5Tdc;
212 vector<Float_t> mTofr5ToT;
218 IntVec mStrobeTdcMin;
219 IntVec mStrobeTdcMax;
239 Bool_t mOuterTrackGeometry;
240 Bool_t mGeometrySave;
242 string mHistoFileName;
246 Int_t mAcceptedEventCounter;
247 Int_t mTofEventCounter;
248 Int_t mTofStrobeEventCounter;
249 Int_t mAcceptAndStrobe;
250 Int_t mAcceptAndBeam;
253 Float_t mMinValidTdc;
254 Float_t mMaxValidTdc;
255 Float_t mMinValidAdc;
256 Float_t mMaxValidAdc;
257 unsigned int mMinHitsPerTrack;
258 unsigned int mMinFitPointsPerTrack;
259 Float_t mMinFitPointsOverMax;
265 TH2D* mADCTDCCorelation;
267 TH1D* mEventCounterHisto;
268 TH1D* mCellsMultInEvent;
269 TH1D* mHitsMultInEvent;
270 TH1D* mHitsMultPerTrack;
272 TH1D* mDaqOccupancyValid;
273 TH1D* mDaqOccupancyProj;
276 TH1D* mDaqOccupancyValidAll;
277 TH1D* mDaqOccupancyProjAll;
278 TH1D* mDaqOccupancyVpd;
279 TH1D* mDaqOccupancyValidVpd;
281 vector<TH2D*> mHitCorr;
282 vector<TH2D*> mHitCorrModule;
294 TH1D* mCellsPerEventMatch1;
295 TH1D* mHitsPerEventMatch1;
296 TH1D* mCellsPerTrackMatch1;
297 TH1D* mTracksPerCellMatch1;
298 TH1D* mDaqOccupancyMatch1;
299 TH2D* mDeltaHitMatch1;
301 TH1D* mCellsPerEventMatch2;
302 TH1D* mHitsPerEventMatch2;
303 TH1D* mCellsPerTrackMatch2;
304 TH1D* mTracksPerCellMatch2;
305 TH1D* mDaqOccupancyMatch2;
306 TH2D* mDeltaHitMatch2;
308 TH1D* mCellsPerEventMatch3;
309 TH1D* mHitsPerEventMatch3;
310 TH1D* mCellsPerTrackMatch3;
311 TH1D* mTracksPerCellMatch3;
312 TH1D* mDaqOccupancyMatch3;
313 TH2D* mDeltaHitMatch3;
315 #ifndef ST_NO_TEMPLATE_DEF_ARGS
316 typedef vector<Int_t> idVector;
318 typedef vector<Int_t,allocator<Int_t>> idVector;
320 typedef idVector::iterator idVectorIter;
322 struct StructCellHit{
349 #ifndef ST_NO_TEMPLATE_DEF_ARGS
350 typedef vector<StructCellHit> tofCellHitVector;
352 typedef vector<StructCellHit,allocator<StructCellHit>> tofCellHitVector;
354 typedef vector<StructCellHit>::iterator tofCellHitVectorIter;
357 virtual const char *GetCVS()
const
358 {
static const char cvs[]=
"Tag $Name: $ $Id: StTofrMatchMaker.h,v 1.17 2014/08/06 11:43:49 jeromel Exp $ built " __DATE__
" " __TIME__ ;
return cvs;}
363 inline void StTofrMatchMaker::setValidAdcRange(Int_t min, Int_t max){
368 inline void StTofrMatchMaker::setValidTdcRange(Int_t min, Int_t max){
373 inline void StTofrMatchMaker::setOuterTrackGeometry(){mOuterTrackGeometry=
true;}
375 inline void StTofrMatchMaker::setStandardTrackGeometry(){mOuterTrackGeometry=
false;}
377 inline void StTofrMatchMaker::setMinHitsPerTrack(Int_t nhits){mMinHitsPerTrack=nhits;}
379 inline void StTofrMatchMaker::setMinFitPointsPerTrack(Int_t nfitpnts){mMinFitPointsPerTrack=nfitpnts;}
381 inline void StTofrMatchMaker::setMinFitPointsOverMax(Float_t ratio) {mMinFitPointsOverMax=ratio;}
383 inline void StTofrMatchMaker::setMaxDCA(Float_t maxdca){mMaxDCA=maxdca;}
385 inline void StTofrMatchMaker::setHistoFileName(
const Char_t* filename){mHistoFileName=filename;}
387 inline void StTofrMatchMaker::setCreateHistoFlag(Bool_t histos){mHisto = histos;}
389 inline void StTofrMatchMaker::setCreateTreeFlag(Bool_t tree){mSaveTree = tree;}
391 inline void StTofrMatchMaker::setSaveGeometry(Bool_t geomSave){mGeometrySave = geomSave; }
393 inline Bool_t StTofrMatchMaker::validAdc(Float_t adc){
return((adc>=mMinValidAdc) && (adc<=mMaxValidAdc));}
395 inline Bool_t StTofrMatchMaker::validTdc(Float_t tdc){
return((tdc>=mMinValidTdc) && (tdc<=mMaxValidTdc));}