00001 //StiStEventFiller.h 00002 /*************************************************************************** 00003 * 00004 * $Id: StiStEventFiller.h,v 2.25 2012/05/07 14:56:14 fisyak Exp $ 00005 * 00006 * Author: Manuel Calderon de la Barca Sanchez, Mar 2002 00007 *************************************************************************** 00008 * 00009 * $Log: StiStEventFiller.h,v $ 00010 * Revision 2.25 2012/05/07 14:56:14 fisyak 00011 * Add StKFVertexMaker 00012 * 00013 * Revision 2.24 2006/12/18 01:30:52 perev 00014 * fillPulls reorganized 00015 * 00016 * Revision 2.23 2006/08/29 22:18:37 fisyak 00017 * move filling of StTrackDetectorInfo into fillTrack 00018 * 00019 * Revision 2.22 2006/08/28 17:02:23 fisyak 00020 * Add +x11 short tracks pointing to EEMC, clean up StiDedxCalculator 00021 * 00022 * Revision 2.21 2006/06/16 21:29:17 perev 00023 * FillStHitErr method added and called 00024 * 00025 * Revision 2.20 2006/05/31 03:59:04 fisyak 00026 * Add Victor's dca track parameters, clean up 00027 * 00028 * Revision 2.19 2006/04/07 18:00:30 perev 00029 * Back to the latest Sti 00030 * 00031 * Revision 2.17 2005/12/08 00:03:07 perev 00032 * StiAux* mAux added 00033 * 00034 * Revision 2.16 2005/08/17 22:04:42 perev 00035 * PoinCount cleanup 00036 * 00037 * Revision 2.15 2005/07/20 17:34:29 perev 00038 * MultiVertex 00039 * 00040 * Revision 2.14 2005/04/11 17:42:53 perev 00041 * Temporary residuals saving added 00042 * 00043 * Revision 2.13 2005/02/07 18:34:17 fisyak 00044 * Add VMC dead material 00045 * 00046 * Revision 2.12 2004/10/26 06:45:41 perev 00047 * version V2V 00048 * 00049 * Revision 2.11 2004/10/14 02:21:35 calderon 00050 * Updated code in StTrackDetectorInfo, now only increment the reference count 00051 * for globals, not for primaries. So fillTrackDetectorInfo changed to reflect 00052 * this. 00053 * 00054 * Revision 2.10 2004/08/06 22:23:29 calderon 00055 * Modified the code to use the setNumberOfxxxPoints(unsigned char,StDetectorId) 00056 * methods of StTrack, StTrackDetectorInfo, StTrackFitTraits, and to use 00057 * the maxPointCount(unsigned int detId) method of StiKalmanTrack. 00058 * 00059 * Revision 2.9 2004/07/07 19:33:48 calderon 00060 * Added method fillFlags. Flags tpc, tpc+svt (globals and primaries) and flags -x02 tracks with less than 5 total fit points 00061 * 00062 * Revision 2.8 2004/03/31 00:27:29 calderon 00063 * Modifications for setting the fit points based on the chi2<chi2Max algorithm. 00064 * -Distinguish between points and fit points, so I added a function for each. 00065 * -Points is done as it was before, just counting the stHits for a given 00066 * detector id. 00067 * -Fit points is done the same with the additional condition that each 00068 * StiKalmanTrackNode has to satisfy the chi2 criterion. 00069 * 00070 * Revision 2.7 2004/03/23 23:12:36 calderon 00071 * Added an "accept" function to filter unwanted tracks from Sti into StEvent. 00072 * The current method just looks for tracks with a negative length, since 00073 * these were causing problems for the vertex finder (length was nan). The 00074 * nan's have been trapped (one hopes!) in StiKalmanTrack, and for these 00075 * cases the return value is negative, so we can filter them out with a 00076 * simple length>0 condition. 00077 * 00078 * Revision 2.6 2004/01/27 23:40:47 calderon 00079 * The filling of the impactParameter() for global tracks is done now 00080 * only after finding the vertex. The StPhysicalHelix::distance(StThreeVectorD) 00081 * method is used for both globals and primaries, the only difference is 00082 * where the helix is obtained: 00083 * - globals - helix from StTrack::geometry(), which was filled from the innermost 00084 * hit node, which should be a hit at the time. 00085 * - primaries, helix from innermost hit node, which should be the vertex at the 00086 * time it is called. 00087 * 00088 * Revision 2.5 2003/07/01 20:25:28 calderon 00089 * fillGeometry() - use node->getX(), as it should have been since the beginning 00090 * impactParameter() - always use the innermos hit node, not just for globals 00091 * removed extra variables which are no longer used. 00092 * 00093 * Revision 2.4 2003/04/25 21:41:18 andrewar 00094 * Added data memebers. 00095 * 00096 * Revision 2.3 2003/03/14 19:02:56 pruneau 00097 * various updates - DCA is a bitch 00098 * 00099 * Revision 2.2 2003/03/13 18:59:45 pruneau 00100 * various updates 00101 * 00102 * Revision 2.1 2003/01/22 21:12:16 calderon 00103 * Restored encoded method, uses enums but stores the value in constructor 00104 * as a data member so bit operations are only done once. 00105 * Fixed warnings. 00106 * 00107 * Revision 2.0 2002/12/04 16:51:01 pruneau 00108 * introducing version 2.0 00109 * 00110 * Revision 1.7 2002/08/22 21:46:00 pruneau 00111 * Made a fix to StiStEventFiller to remove calls to StHelix and StPhysicalHelix. 00112 * Currently there is one instance of StHelix used a calculation broker to 00113 * get helix parameters such as the distance of closest approach to the main 00114 * vertex. 00115 * 00116 * Revision 1.6 2002/08/19 19:33:01 pruneau 00117 * eliminated cout when unnecessary, made helix member of the EventFiller 00118 * 00119 * Revision 1.5 2002/08/12 21:39:57 calderon 00120 * Introduced fillPidTraits, which uses the values obtained from 00121 * Andrews brand new dEdxCalculator to create two instances of an 00122 * StTrackPidTraits object and pass it to the track being filled. 00123 * 00124 * Revision 1.4 2002/08/12 15:29:21 andrewar 00125 * Added dedx calculators 00126 * 00127 * Revision 1.3 2002/05/29 19:14:45 calderon 00128 * Filling of primaries, in 00129 * StiStEventFiller::fillEventPrimaries() 00130 * 00131 * Revision 1.2 2002/03/28 04:29:49 calderon 00132 * First test version of Filler 00133 * Currently fills only global tracks with the following characteristics 00134 * -Flag is set to 101, as most current global tracks are. This is not strictly correct, as 00135 * this flag is supposed to mean a tpc only track, so really need to check if the track has 00136 * svt hits and then set it to the appropriate flag (501 or 601). 00137 * -Encoded method is set with bits 15 and 1 (starting from bit 0). Bit 1 means Kalman fit. 00138 * Bit 15 is an as-yet unused track-finding bit, which Thomas said ITTF could grab. 00139 * -Impact Parameter calculation is done using StHelix and the primary vertex from StEvent 00140 * -length is set using getTrackLength, which might still need tweaking 00141 * -possible points is currently set from getMaxPointCount which returns the total, and it is not 00142 * what we need for StEvent, so this needs to be modified 00143 * -inner geometry (using the innermostHitNode -> Ben's transformer -> StPhysicalHelix -> StHelixModel) 00144 * -outer geometry, needs inside-out pass to obtain good parameters at outermostHitNode 00145 * -fit traits, still missing the probability of chi2 00146 * -topology map, filled from StuFixTopoMap once StDetectorInfo is properly set 00147 * 00148 * This version prints out lots of messages for debugging, should be more quiet 00149 * when we make progress. 00150 * 00151 **************************************************************************/ 00152 #ifndef StiStEventFiller_HH 00153 #define StiStEventFiller_HH 00154 #include <map> 00155 using std::map; 00156 #include "StDetectorId.h" 00157 class StEvent; 00158 class StTrackNode; 00159 class StTrackDetectorInfo; 00160 class StTrack; 00161 class StiTrackContainer; 00162 class StiTrack; 00163 class StiKalmanTrack; 00164 class StHelix; 00165 class StHelixModel; 00166 #include "StPhysicalHelixD.hh" 00167 class StTrack2FastDetectorMatcher; 00175 class StiAux; 00176 class StiPullEvent; 00177 class StiStEventFiller 00178 { 00179 public: 00180 StiStEventFiller(); 00181 void setUseAux(int aux=1) {mUseAux=aux;} 00182 virtual ~StiStEventFiller(); 00183 static StiStEventFiller *instance() {return fgStiStEventFiller;} 00184 void fillEvent(StEvent* e, StiTrackContainer* t); 00185 void fillEventPrimaries(); 00186 void fillDetectorInfo(StTrackDetectorInfo* detInfo, StiKalmanTrack* kTrack,bool refCountIncr); 00187 void fillGeometry(StTrack* track, StiKalmanTrack* kTrack, bool outer); 00188 //void fillTopologyMap(StTrack* track, StiKalmanTrack* kTrack); 00189 void fillFitTraits(StTrack* track, StiKalmanTrack* kTrack); 00190 void fillTrack(StTrack* track, StiKalmanTrack* kTrack,StTrackDetectorInfo* detInfo ); 00191 void fillDca(StTrack* track, StiKalmanTrack* kTrack); 00192 void fillFlags(StTrack* track); 00193 double impactParameter(StiKalmanTrack* kTrack, StThreeVectorD &vertexPosition); 00194 double impactParameter(StTrack* strack, StThreeVectorD &vertexPosition); 00195 void setPullEvent(StiPullEvent *pe) {mPullEvent=pe;} 00196 static map<StiKalmanTrack*, StTrackNode*> *Track2NodeMap() {return &mTrkNodeMap;} 00197 static map<StTrackNode*, StiKalmanTrack*> *Node2TrackMap() {return &mNodeTrkMap;} 00198 private: 00199 void fillResHack(StHit *hh,const StiHit *stiHit, const StiKalmanTrackNode *node); 00200 void fillPulls (StHit *hh,const StiHit *stiHit 00201 ,const StiKalmanTrackNode *node 00202 ,const StiKalmanTrack *track 00203 ,int dets[1][3],int gloPri); 00204 void fillPulls (StiKalmanTrack *ktrack,int gloPri); 00205 bool accept(StiKalmanTrack* kTrack); 00206 void FillStHitErr(StHit *hh,const StiKalmanTrackNode *node); 00207 private: 00208 StEvent* mEvent; 00209 StiTrackContainer* mTrackStore; 00210 StiAux* mAux; 00211 StiPullEvent *mPullEvent; 00212 int mUseAux; 00213 int mGloPri; //0=filing global,1=filing primary 00214 int mTrackNumber; 00215 static map<StiKalmanTrack*, StTrackNode*> mTrkNodeMap; 00216 static map<StTrackNode*, StiKalmanTrack*> mNodeTrkMap; 00217 unsigned short mStiEncoded; 00218 //helix parameters 00219 StThreeVectorD *originD; 00220 StPhysicalHelixD * physicalHelix; 00221 StTrack2FastDetectorMatcher *mFastDetectorMatcher; 00222 static StiStEventFiller* fgStiStEventFiller; 00223 }; 00224 00225 #endif
1.5.9