82 #ifndef STMTDMATCHMAKER_H
83 #define STMTDMATCHMAKER_H
87 #ifndef ST_NO_NAMESPACES
96 #include <StPhysicalHelixD.hh>
98 #include "StThreeVectorD.hh"
99 #include "StThreeVectorF.hh"
112 #if !defined(ST_NO_TEMPLATE_DEF_ARGS) || defined(__CINT__)
113 typedef vector<Int_t> IntVec;
114 typedef vector<UInt_t> UIntVec;
115 typedef vector<Double_t> DoubleVec;
117 typedef vector<Int_t, allocator<Int_t>> IntVec;
118 typedef vector<UInt_t, allocator<UInt_t>> UIntVec;
119 typedef vector<Double_t, allocator<Double_t>> DoubleVec;
122 const Int_t mNBacklegs = 30;
123 const Int_t mNStrips = 12;
124 const Int_t mNAllTrays = 150;
129 MtdTrack():pt(-999.),eta(-999.),nFtPts(0),nDedxPts(0),flag(0),nHitsPoss(999){};
151 virtual void Clear(
const char* opt=
"");
153 virtual Int_t
Init();
157 virtual Int_t
Make();
191 Float_t
getMtdHitGlobalZ(Float_t leadingWestTime, Float_t leadingEastTime, Int_t module);
197 Bool_t doPrintMemoryInfo;
198 Bool_t doPrintCpuInfo;
201 Int_t mMinFitPointsPerTrack;
213 Double_t mVDrift[mNAllTrays][mNStrips];
218 map<Int_t, Int_t> index2Primary;
221 TH1D* mEventCounterHisto;
222 TH1D* mCellsMultInEvent;
223 TH1D* mHitsMultInEvent;
224 TH1D* mHitsPrimaryInEvent;
225 TH1D* mHitsGlobalInEvent;
226 TH1D* mHitsMultPerTrack;
228 TH1D* mDaqOccupancy[mNBacklegs];
229 TH1D* mDaqOccupancyProj[mNBacklegs];
231 TH2D* mHitCorr[mNBacklegs];
232 TH2D* mHitCorrModule[mNBacklegs];
233 TH2D* mDeltaHitFinal[mNBacklegs];
241 TH1D* mCellsPerEventMatch1;
242 TH1D* mHitsPerEventMatch1;
243 TH1D* mCellsPerTrackMatch1;
244 TH1D* mTracksPerCellMatch1;
245 TH1D* mDaqOccupancyMatch1;
246 TH2D* mDeltaHitMatch1;
248 TH1D* mCellsPerEventMatch2;
249 TH1D* mHitsPerEventMatch2;
250 TH1D* mCellsPerTrackMatch2;
251 TH1D* mTracksPerCellMatch2;
252 TH1D* mDaqOccupancyMatch2;
253 TH2D* mDeltaHitMatch2;
255 TH1D* mCellsPerEventMatch3;
256 TH1D* mHitsPerEventMatch3;
257 TH1D* mCellsPerTrackMatch3;
258 TH1D* mTracksPerCellMatch3;
259 TH1D* mDaqOccupancyMatch3;
260 TH2D* mDeltaHitMatch3;
262 TH1D* mCellsPrimaryPerEventMatch3;
269 TH2F *hMtddPhivsBackleg;
270 TH2F *hMtddZvsBackleg;
279 #ifndef ST_NO_TEMPLATE_DEF_ARGS
280 typedef vector<Int_t> idVector;
282 typedef vector<Int_t,allocator<Int_t>> idVector;
284 typedef idVector::iterator idVectorIter;
285 struct StructCellHit{
299 pair<Double_t,Double_t> tot;
300 pair<Double_t,Double_t> leadingEdgeTime;
311 #ifndef ST_NO_TEMPLATE_DEF_ARGSA
312 typedef vector<StructCellHit> mtdCellHitVector;
314 typedef vector<StructCellHit,allocator<StructCellHit>> mtdCellHitVector;
316 typedef vector<StructCellHit>::iterator mtdCellHitVectorIter;
320 void bookHistograms();
322 void cleanUpMtdPidTraits();
324 Bool_t readMtdHits(mtdCellHitVector& daqCellsHitVec,idVector& validModuleVec);
326 void project2Mtd(mtdCellHitVector daqCellsHitVec,mtdCellHitVector& allCellsHitVec,Int_t& nPrimaryHits);
328 void matchMtdHits(mtdCellHitVector& dapCellsHitVec,mtdCellHitVector& allCellsHitVec,mtdCellHitVector& matchHitCellsVec);
330 void sortSingleAndMultiHits(mtdCellHitVector& matchHitCellsVec,mtdCellHitVector& singleHitCellsVec,mtdCellHitVector& multiHitsCellsVec);
332 void finalMatchedMtdHits(mtdCellHitVector& singleHitCellsVec,mtdCellHitVector& FinalMatchedCellsVec);
334 void fillPidTraits(mtdCellHitVector& FinalMatchedCellsVec,Int_t& nValidSingleHitCells,Int_t& nValidSinglePrimHitCells);
339 bool matchTrack2Mtd(mtdCellHitVector daqCellsHitVec,
const StPhysicalHelixD &helix, Int_t gq, mtdCellHitVector& allCellsHitVec,
unsigned int iNode,
StThreeVectorD pVtx);
341 virtual const char *GetCVS()
const
342 {
static const char cvs[]=
"Tag $Name: $ $Id: StMtdMatchMaker.h,v 1.20 2018/12/06 18:11:13 marr Exp $ built " __DATE__
" " __TIME__ ;
return cvs;}
void setMatNeighbors(Bool_t val)
set matching neighbor modules
void setMindEdxFitPoints(Int_t val)
set minimum ndEdx fit points
void setEtaRange(Float_t etaMin, Float_t etaMax)
set pseudo rapidity range
virtual Int_t Init()
initialize drifting velocity and histograms.
Float_t mMinFitPointsOverMax
minimum dE/dx fit points per track
void setNExtraCells(Int_t val)
set n extra cells
void setELossFlag(const Bool_t val)
set energy loss in MTD
void setGeomTag(const char *tag)
set geometry tag, only use this option in reading mudst mode
bool validTrack(StTrack *track)
check track quality
Float_t mMinEta
minimum ratio
StMtdMatchMaker(const char *name="MtdMatch")
Default constructor.
Muon Telescope Detector (MTD) Match Maker.
void setMinPt(Float_t val)
set minimum nHitsFit
Int_t getProjModule(Float_t local_z, Float_t global_z)
calculate module of projected position
Float_t mMinPt
maximum pseudorapidity
Float_t mMaxEta
minimum pseudorapidity
virtual Int_t Make()
associate tracks with mtd hits
void setHisto(const Bool_t val)
save QA histogram or not
Int_t InitRun(int runnumber)
InitRun: initialize geometries (retrieve beam line constraint from database)
void setMinFitPoints(Int_t val)
set minimum nHitsFit
void setLockBField(Bool_t val)
set BField to FF, only use this option in simulation
virtual Int_t Finish()
write QA histograms
Int_t mMindEdxFitPoints
minimum fit points per track
Float_t getMtdHitGlobalZ(Float_t leadingWestTime, Float_t leadingEastTime, Int_t module)
calculate global z of the MTD hits based on its timing information
void setCosmicEvent(const Bool_t val)
set event trigger comsmic ray event has a reversed direction from outer to inner for tracks in upper ...
Int_t FinishRun(int runnumber)
FinishRun: clean up BeamHelix (will be reinitialized at the next initRun)