00001 00096 #include <vector> 00097 #include "StThreeVectorD.hh" 00098 #include "StPhysicalHelixD.hh" 00099 #include "StGenericVertexFinder.h" 00100 00101 class StEvent; 00102 class StTrack; 00103 class TMinuit; 00104 class StDcaGeometry; 00105 class StMinuitVertexFinder: public StGenericVertexFinder { 00106 public: 00107 StMinuitVertexFinder(); 00108 00109 // mandatory implementations 00110 virtual ~StMinuitVertexFinder(); 00111 Int_t fit(StEvent*); 00112 void printInfo(ostream& = cout) const; 00113 void UseVertexConstraint(Double_t x0, Double_t y0, Double_t dxdz, Double_t dydz, Double_t weight); 00114 virtual void InitRun (Int_t runumber); 00115 void Clear(); 00116 00117 00118 // Added, not part of base-class and used by the Minuit vertex finder 00119 Int_t NCtbMatches(); // returns the number of tracks matched to CTB 00120 Int_t NCtbSlats(); // returns the number of CTB slats above threshold 00121 void CTBforSeed(){ mRequireCTB = kTRUE;} 00122 void NoCTBforSeed(){ mRequireCTB = kFALSE;} 00123 void setExternalSeed(const StThreeVectorD&); 00124 00125 void setPrintLevel(Int_t = 0); 00126 Int_t statusMin() const {return mStatusMin;} // Minuit status flag 00127 void DoUseITTF(){ mUseITTF = kTRUE; } 00128 void DoNotUseITTF(){ mUseITTF = kFALSE;} 00129 void useOldBEMCRank() { mUseOldBEMCRank = kTRUE; } 00130 void lowerSplitVtxRank() { mLowerSplitVtxRank = kTRUE; } 00131 void setFlagBase(); 00132 void SetFitPointsCut(Int_t fitpoints) {mMinNumberOfFitPointsOnTrack = fitpoints;} 00133 void SetMinimumTracks(Int_t n) {mMinTrack = n;} 00134 00135 private: 00136 enum {kFlagDcaz = 1, kFlagCTBMatch = 2, kFlagBEMCMatch = 4, kFlagCrossMembrane = 8}; 00137 00138 bool accept(StTrack*) const; // track filter 00139 void fillBemcHits(StEvent *); 00140 Int_t matchTrack2BEMC(const StTrack *); 00141 Int_t checkCrossMembrane(const StTrack *); 00142 void calculateRanks(); 00143 Int_t findSeeds(); 00144 00145 static void fcn(Int_t&, Double_t*, Double_t&, Double_t*, Int_t); // fit function 00146 static void fcn1D(Int_t&, Double_t*, Double_t&, Double_t*, Int_t); // fit function 00147 static Double_t Chi2atVertex(StThreeVectorD &vtx); 00148 00149 bool mUseITTF; // Use only tracks with ITTF encoded method 00150 bool mUseOldBEMCRank; // Use old BEMC rank calculation (Cu+Cu production) 00151 bool mLowerSplitVtxRank;// Use lower rank for split vertices 00152 UInt_t mFlagBase; // ITTF track flag 00153 bool mRequireCTB; // Set maker to use CTB 00154 UInt_t mMinNumberOfFitPointsOnTrack; 00155 Float_t mDcaZMax; 00156 Double_t mWeight ; // Weight in fit for vertex contraint 00157 Double_t mRImpactMax; // Max distance between helix and nominal beamline (0,0,z) 00158 Int_t mMinTrack; // Min number of tracks 00159 00160 StPhysicalHelixD* mBeamHelix; // Beam Line helix 00161 00162 enum {maxSeed=500}; 00163 Int_t mNSeed; 00164 Float_t mSeedZ[maxSeed]; 00165 Int_t mBemcHit[120][20][2]; // modules, eta, sub 00166 static vector<StDcaGeometry*> mDCAs; 00167 static vector<StPhysicalHelixD> mHelices; 00168 static vector<UShort_t> mHelixFlags; 00169 static vector<Double_t> mSigma; 00170 static vector<Double_t> mZImpact; 00171 //static vector<Bool_t> mCTB; 00172 static Bool_t requireCTB; 00173 static Int_t nCTBHits; 00174 static Double_t mWidthScale; 00175 static Double_t mX0 ; // starting point of beam parameterization 00176 static Double_t mY0 ; // starting point of beam parameterization 00177 static Double_t mdxdz; // beam slope 00178 static Double_t mdydz; // beam slope 00179 static Double_t beamX(Double_t z); // beamline parameterization 00180 static Double_t beamY(Double_t z); // beamline parameterization 00181 Int_t mStatusMin; // Minuit status flag 00182 StThreeVectorD mExternalSeed; 00183 Bool_t mExternalSeedPresent; 00184 StPrimaryVertex *mBestVtx; // pointer to best vertex of this event 00185 Float_t mBestRank; // store rank of best vertex 00186 Float_t mCTBSum; 00187 TMinuit* mMinuit; 00188 }; 00189 /*************************************************************************** 00190 * 00191 * $Log: StMinuitVertexFinder.h,v $ 00192 * Revision 1.12 2010/12/06 20:07:23 fisyak 00193 * Increase maximum number of possible seeds 00194 * 00195 * Revision 1.11 2010/01/26 21:01:49 fisyak 00196 * Clean up, switch from bit mask to attributes 00197 * 00198 * Revision 1.10 2008/07/31 18:11:10 genevb 00199 * VFMinuit3 chain option for lower ranking of split vertices 00200 * 00201 * Revision 1.9 2008/04/12 10:53:20 mvl 00202 * Changed calculation of BEMC matches based ranking to fix problems with run-7 Au+Au. 00203 * See also: http://www.star.bnl.gov/protected/highpt/mvl/multi_vertex/update_R7.html 00204 * Old calculation can be selected with UseOldBEMCRank() 00205 * 00206 * Revision 1.8 2007/10/23 05:29:44 genevb 00207 * Replace minimum 1 track vertex code with minimum N tracks 00208 * 00209 * Revision 1.7 2007/05/17 01:50:35 fisyak 00210 * Use PrimaryVertexCuts table 00211 * 00212 * Revision 1.6 2006/05/31 04:09:52 fisyak 00213 * Use dca track parameters for primary vertex fit 00214 * 00215 * Revision 1.5 2006/05/10 17:16:21 mvl 00216 * Added some comments to describe changes for multiple veretx finding (most importantly: ranking system) 00217 * 00218 * Revision 1.4 2006/05/09 17:51:05 mvl 00219 * Added protection against event->emcCollection()==0 00220 * 00221 * Revision 1.3 2006/04/25 13:06:44 mvl 00222 * Seed-finding range extended to -200<vtx_z<200 00223 * 00224 * Revision 1.2 2006/04/08 19:06:29 mvl 00225 * Update for multiple vertex finding and rank calculation for identifying the 00226 * triggered vertex. Ranks are based on mean dip angle of tracks, BEMC matches 00227 * and tracks crossing the central membrane and optimised for Cu+Cu. 00228 * The track cuts are now bit tighter (dca<2 in transverse direction and 00229 * nfitpoints > 15) to suppress 'fake' vertices. 00230 * In addition, a lower multiplicity cut of 5 tracks is implemented. 00231 * 00232 * Revision 1.9 2005/07/19 21:53:27 perev 00233 * MultiVertex 00234 * 00235 * Revision 1.8 2005/06/21 02:16:36 balewski 00236 * multiple prim vertices are stored in StEvent 00237 * 00238 * Revision 1.7 2004/08/04 21:57:56 balewski 00239 * toward smarter ppLMV5 00240 * 00241 * Revision 1.6 2004/07/23 02:24:39 jeromel 00242 * Oops ... Worng swithc (had twice Minuit). Now corrected. 00243 * 00244 * Revision 1.5 2004/07/23 00:59:36 jeromel 00245 * Removed methods (moved in base class) + doxygenized 00246 * 00247 * Revision 1.4 2004/04/06 02:43:43 lbarnby 00248 * Fixed identification of bad seeds (no z~0 problem now). Better flagging. Message manager used. 00249 * 00250 * Revision 1.3 2003/05/12 21:10:06 lbarnby 00251 * Made destructor virtual 00252 * 00253 * Revision 1.2 2003/05/09 22:19:51 lbarnby 00254 * Now also calculates and reports error on vertex. Corrected filter to use ITTF tracks. Some temporary protections against inf/Nan. Skip delete of TMinuit class since causing seg. fault. 00255 * 00256 * Revision 1.1 2002/12/05 23:42:46 hardtke 00257 * Initial Version for development and integration 00258 * 00259 **************************************************************************/
1.5.9