00001 00009 #include "StGenericVertexMaker/StGenericVertexFinder.h" 00010 00011 #include "StPhysicalHelixD.hh" // dongx 00012 class StiKalmanTrack; 00013 class TrackData; 00014 class VertexData; 00015 class TGraphErrors; 00016 class StEvent; 00017 class StiToolkit; 00018 class StEEmcDb; 00019 00020 class EEmcGeomSimple; 00021 class StBTofGeometry; // dongx 00022 00023 class BtofHitList; // dongx 00024 class CtbHitList; 00025 class BemcHitList; 00026 class EemcHitList; 00027 class Vertex3D; 00028 00029 class StPPVertexFinder: public StGenericVertexFinder { 00030 private: 00031 enum {mxH=32}; 00032 bool examinTrackDca(const StiKalmanTrack*, TrackData &t); 00033 void matchTrack2BTOF(const StiKalmanTrack*, TrackData &t, StBTofGeometry *geom); // dongx 00034 void matchTrack2CTB(const StiKalmanTrack*, TrackData &t); 00035 void matchTrack2EEMC(const StiKalmanTrack*, TrackData &t, float z); 00036 void matchTrack2BEMC(const StiKalmanTrack*, TrackData &t, float rxy); 00037 bool matchTrack2Membrane(const StiKalmanTrack*, TrackData &t); 00038 bool isPostCrossingTrack(const StiKalmanTrack* track); 00039 vector<TrackData> mTrackData; 00040 vector<VertexData> mVertexData; 00041 Vertex3D *vertex3D; // for stand alone 3D vertex reco 00042 bool buildLikelihoodZ(); 00043 bool findVertexZ(VertexData &); 00044 bool evalVertexZ(VertexData &); 00045 void exportVertices(); 00046 00047 void saveHisto(TString fname); 00048 int mTotEve; 00049 int eveID; 00050 uint mAlgoSwitches; //binary, assign 1bit per change, use enum below 00051 enum {kSwitchOneHighPT=1}; 00052 00053 // params 00054 double mMinTrkPt; //~ pT=0.16(GeV/c) == R=2 (m )in 2001 00055 double mMaxTrkDcaRxy; //DCA to nominal beam line for each track 00056 float mMaxZradius; // used in matching: tracks to zVertex 00057 int mMinMatchTr; // for valid vertex 00058 float mMaxZrange; // cut off for tracks Z_DCA 00059 float mDyBtof; // BTOF delta y cut - dongx 00060 float mMinZBtof; // BTOF local z min cut - dongx 00061 float mMaxZBtof; // BTOF local z max cut - dongx 00062 float mMinAdcBemc; // BEMC towers with MIP response 00063 float mMinAdcEemc; // EEMC towers with MIP response 00064 float mMinFitPfrac; // nFit/nPossible 00065 bool isMC; // flag minor differences between Data & M-C 00066 bool mUseCtb; // disable CTB from matching/vetoing of tracks 00067 bool mDropPostCrossingTrack; // enable/disable post crossing tarck rejection 00068 int mStoreUnqualifiedVertex; // set the max # of vertices, sorted by rank 00069 float mCut_oneTrackPT; // threshold for storing one track vertices 00070 int mBeamLineTracks; // activates writing them out + lot of QA histos, use BFC option: VtxSeedCalG to enable it, expert only 00071 00072 // beam line 00073 double mX0 ; // starting point of beam parameterization 00074 double mY0 ; // starting point of beam parameterization 00075 double mdxdz; // beam slope 00076 double mdydz; // beam slope 00077 00078 // util 00079 StiToolkit *mToolkit; 00080 BtofHitList *btofList; // dongx 00081 CtbHitList *ctbList; 00082 BemcHitList *bemcList; 00083 EemcHitList *eemcList; 00084 StBTofGeometry *btofGeom; // dongx btofGeometry 00085 StEEmcDb *eeDb; 00086 EEmcGeomSimple *geomE; 00087 00088 void dumpKalmanNodes(const StiKalmanTrack *track); 00089 // void plotVertex(VertexData *); 00090 // void plotTracksDca(); 00091 void initHisto(); 00092 00093 public: 00094 void setMC(bool x=true){isMC=x;} 00095 void useCTB(bool x=true){mUseCtb=x;} 00096 void UsePCT(bool x=true){setDropPostCrossingTrack(!x);} 00097 void setDropPostCrossingTrack(bool x=true){mDropPostCrossingTrack=x;} 00098 void Finish(); 00099 00100 TH1F *hA[mxH]; 00101 TH2F *hACorr; 00102 TH1D *hL ; // likelyhood distribution 00103 TH1D *hM, *hW ; // cumulative track mult & weight distribution, for better errZ calculation 00104 TObjArray * HList; 00105 StPPVertexFinder(); 00106 00107 // mandatory implementations 00108 virtual ~StPPVertexFinder(); 00109 int fit(StEvent*); 00110 void printInfo(ostream& = cout) const; 00111 void UseVertexConstraint(double x0, double y0, double dxdz, double dydz, double weight); 00112 00113 // over-written method 00114 virtual void Init(); 00115 virtual void InitRun (int runumber); 00116 virtual void Clear(); 00117 virtual void CalibBeamLine(); // activates saving high quality prim tracks for 3D fit of the beamLine 00118 }; 00119 00120 /*************************************************************************** 00121 * 00122 * $Log: StPPVertexFinder.h,v $ 00123 * Revision 1.15 2010/09/10 21:08:35 rjreed 00124 * Added function UseBOTF and bool mUseBtof to switch the use of the TOF on and off in vertex finding. Default value is off (false). 00125 * Added functions, and variables necessary to use the TOF in PPV for vertex finding. Includes matching tracks to the TOF and changing the track weight based on its matched status with the TOF. 00126 * 00127 * Revision 1.14 2009/07/09 21:29:03 balewski 00128 * allow export of prim tracks for 3D beam line fit (use VtxSeedCalG option), 00129 * oneTrack vertex thresholds was lowered form 15 to 10 GeV/c 00130 * 00131 * Revision 1.13 2009/04/10 22:57:14 genevb 00132 * Typo correction 00133 * 00134 * Revision 1.12 2009/02/05 21:43:59 balewski 00135 * Oleksandr renamed StEEmcDbMaker to StEEmcDb and requested this set of code corrections 00136 * 00137 * Revision 1.11 2008/12/01 22:57:46 balewski 00138 * Added capability to reco 1 high pT track vertices with positive rank. 2+ match vertices will have rank above 1e6. Sub-prime vertices (for Akio) have negative rank. More details is given at: 00139 * http://drupal.star.bnl.gov/STAR/comp/reco/vf/ppv-vertex/2009-algo-upgrade-1 00140 * 00141 * Revision 1.10 2008/10/23 20:37:32 genevb 00142 * Add switches for turning on/off use of Post-Crossing Tracks [default:off] 00143 * 00144 * Revision 1.9 2008/10/21 19:23:06 balewski 00145 * store unqualified vertices on Akio's request 00146 * 00147 * Revision 1.8 2008/08/21 22:09:31 balewski 00148 * - In matchTrack2Membrane() 00149 * - Cut on hit max R chanegd from 190 to 199cm 00150 * - Fixed logic failure of counting possible hits 00151 * - Fixed logic failure of crossing CM for certain pattern of hits 00152 * - Added a new function bool isPostCrossingTrack() 00153 * - it returns true if track have 2 or more hits in wrong z 00154 * - Use isPostCrossingTrack() in fit() 00155 * - Added switch setDropPostCrossingTrack(bool), defaulted to true 00156 * All changes tested & implemented by Akio in preparation for 2008 pp production. 00157 * The key change (removing PostCrossingTrack) is in response to the change of the TPC cluster finder 00158 * - now we use the on-line version which allows for longer range of TPC time buckets to be used. 00159 * 00160 * Revision 1.7 2006/03/12 17:01:01 jeromel 00161 * Minor change + use ppvNoCtbVertexFinder 00162 * 00163 * Revision 1.6 2006/03/11 04:12:50 balewski 00164 * 2 changes in preparation for 2006 data processing: 00165 * - CTB matching ON/OFF switch activated by m_Mode 0x8 or 0x10 00166 * - vertex enum extension depending on CTB usage - hack in the moment, Jerome needs to proviade actual new enum 00167 * - BTOW calibration wil change for 2006+ from maxt eT of ~27 --> 60 GeV 00168 * NOTE : this new code was NOT executed - it is late, I want to get it in CVS 00169 * Tomorrow I'll do some tests 00170 * Jan 00171 * 00172 * Revision 1.5 2005/08/30 22:08:43 balewski 00173 * drop '*' from declaration of mTrackData & mVertexData 00174 * 00175 * Revision 1.4 2005/08/12 18:35:28 balewski 00176 * more accurate calculation of Z-vertex error 00177 * by accounting for average weight of tracks contributing to the likelihood, 00178 * Now errZ is of 0.5-1.5 mm, was ~2x smaller 00179 * 00180 * Revision 1.3 2005/07/20 05:34:16 balewski 00181 * cleanup 00182 * 00183 * Revision 1.2 2005/07/19 22:01:59 perev 00184 * MultiVertex 00185 * 00186 * Revision 1.1 2005/07/11 20:38:12 balewski 00187 * PPV added for real 00188 * 00189 * 00190 * 00191 **************************************************************************/ 00192
1.5.9