StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StiStEventFiller.h
1 //StiStEventFiller.h
2 /***************************************************************************
3  *
4  * $Id: StiStEventFiller.h,v 2.28 2015/03/27 20:12:58 perev Exp $
5  *
6  * Author: Manuel Calderon de la Barca Sanchez, Mar 2002
7  ***************************************************************************
8  *
9  * $Log: StiStEventFiller.h,v $
10  * Revision 2.28 2015/03/27 20:12:58 perev
11  * Add printout of good track hits
12  *
13  * Revision 2.27 2015/03/21 02:16:53 perev
14  * By Lidia request, addet printing number of used hits detector by detector
15  * No any modification of any algorithmes
16  *
17  * Revision 2.26 2012/11/09 18:28:06 perev
18  * fillpull development
19  *
20  * Revision 2.25 2012/05/07 14:56:14 fisyak
21  * Add StKFVertexMaker
22  *
23  * Revision 2.24 2006/12/18 01:30:52 perev
24  * fillPulls reorganized
25  *
26  * Revision 2.23 2006/08/29 22:18:37 fisyak
27  * move filling of StTrackDetectorInfo into fillTrack
28  *
29  * Revision 2.22 2006/08/28 17:02:23 fisyak
30  * Add +x11 short tracks pointing to EEMC, clean up StiDedxCalculator
31  *
32  * Revision 2.21 2006/06/16 21:29:17 perev
33  * FillStHitErr method added and called
34  *
35  * Revision 2.20 2006/05/31 03:59:04 fisyak
36  * Add Victor's dca track parameters, clean up
37  *
38  * Revision 2.19 2006/04/07 18:00:30 perev
39  * Back to the latest Sti
40  *
41  * Revision 2.17 2005/12/08 00:03:07 perev
42  * StiAux* mAux added
43  *
44  * Revision 2.16 2005/08/17 22:04:42 perev
45  * PoinCount cleanup
46  *
47  * Revision 2.15 2005/07/20 17:34:29 perev
48  * MultiVertex
49  *
50  * Revision 2.14 2005/04/11 17:42:53 perev
51  * Temporary residuals saving added
52  *
53  * Revision 2.13 2005/02/07 18:34:17 fisyak
54  * Add VMC dead material
55  *
56  * Revision 2.12 2004/10/26 06:45:41 perev
57  * version V2V
58  *
59  * Revision 2.11 2004/10/14 02:21:35 calderon
60  * Updated code in StTrackDetectorInfo, now only increment the reference count
61  * for globals, not for primaries. So fillTrackDetectorInfo changed to reflect
62  * this.
63  *
64  * Revision 2.10 2004/08/06 22:23:29 calderon
65  * Modified the code to use the setNumberOfxxxPoints(unsigned char,StDetectorId)
66  * methods of StTrack, StTrackDetectorInfo, StTrackFitTraits, and to use
67  * the maxPointCount(unsigned int detId) method of StiKalmanTrack.
68  *
69  * Revision 2.9 2004/07/07 19:33:48 calderon
70  * Added method fillFlags. Flags tpc, tpc+svt (globals and primaries) and flags -x02 tracks with less than 5 total fit points
71  *
72  * Revision 2.8 2004/03/31 00:27:29 calderon
73  * Modifications for setting the fit points based on the chi2<chi2Max algorithm.
74  * -Distinguish between points and fit points, so I added a function for each.
75  * -Points is done as it was before, just counting the stHits for a given
76  * detector id.
77  * -Fit points is done the same with the additional condition that each
78  * StiKalmanTrackNode has to satisfy the chi2 criterion.
79  *
80  * Revision 2.7 2004/03/23 23:12:36 calderon
81  * Added an "accept" function to filter unwanted tracks from Sti into StEvent.
82  * The current method just looks for tracks with a negative length, since
83  * these were causing problems for the vertex finder (length was nan). The
84  * nan's have been trapped (one hopes!) in StiKalmanTrack, and for these
85  * cases the return value is negative, so we can filter them out with a
86  * simple length>0 condition.
87  *
88  * Revision 2.6 2004/01/27 23:40:47 calderon
89  * The filling of the impactParameter() for global tracks is done now
90  * only after finding the vertex. The StPhysicalHelix::distance(StThreeVectorD)
91  * method is used for both globals and primaries, the only difference is
92  * where the helix is obtained:
93  * - globals - helix from StTrack::geometry(), which was filled from the innermost
94  * hit node, which should be a hit at the time.
95  * - primaries, helix from innermost hit node, which should be the vertex at the
96  * time it is called.
97  *
98  * Revision 2.5 2003/07/01 20:25:28 calderon
99  * fillGeometry() - use node->getX(), as it should have been since the beginning
100  * impactParameter() - always use the innermos hit node, not just for globals
101  * removed extra variables which are no longer used.
102  *
103  * Revision 2.4 2003/04/25 21:41:18 andrewar
104  * Added data memebers.
105  *
106  * Revision 2.3 2003/03/14 19:02:56 pruneau
107  * various updates - DCA is a bitch
108  *
109  * Revision 2.2 2003/03/13 18:59:45 pruneau
110  * various updates
111  *
112  * Revision 2.1 2003/01/22 21:12:16 calderon
113  * Restored encoded method, uses enums but stores the value in constructor
114  * as a data member so bit operations are only done once.
115  * Fixed warnings.
116  *
117  * Revision 2.0 2002/12/04 16:51:01 pruneau
118  * introducing version 2.0
119  *
120  * Revision 1.7 2002/08/22 21:46:00 pruneau
121  * Made a fix to StiStEventFiller to remove calls to StHelix and StPhysicalHelix.
122  * Currently there is one instance of StHelix used a calculation broker to
123  * get helix parameters such as the distance of closest approach to the main
124  * vertex.
125  *
126  * Revision 1.6 2002/08/19 19:33:01 pruneau
127  * eliminated cout when unnecessary, made helix member of the EventFiller
128  *
129  * Revision 1.5 2002/08/12 21:39:57 calderon
130  * Introduced fillPidTraits, which uses the values obtained from
131  * Andrews brand new dEdxCalculator to create two instances of an
132  * StTrackPidTraits object and pass it to the track being filled.
133  *
134  * Revision 1.4 2002/08/12 15:29:21 andrewar
135  * Added dedx calculators
136  *
137  * Revision 1.3 2002/05/29 19:14:45 calderon
138  * Filling of primaries, in
139  * StiStEventFiller::fillEventPrimaries()
140  *
141  * Revision 1.2 2002/03/28 04:29:49 calderon
142  * First test version of Filler
143  * Currently fills only global tracks with the following characteristics
144  * -Flag is set to 101, as most current global tracks are. This is not strictly correct, as
145  * this flag is supposed to mean a tpc only track, so really need to check if the track has
146  * svt hits and then set it to the appropriate flag (501 or 601).
147  * -Encoded method is set with bits 15 and 1 (starting from bit 0). Bit 1 means Kalman fit.
148  * Bit 15 is an as-yet unused track-finding bit, which Thomas said ITTF could grab.
149  * -Impact Parameter calculation is done using StHelix and the primary vertex from StEvent
150  * -length is set using getTrackLength, which might still need tweaking
151  * -possible points is currently set from getMaxPointCount which returns the total, and it is not
152  * what we need for StEvent, so this needs to be modified
153  * -inner geometry (using the innermostHitNode -> Ben's transformer -> StPhysicalHelix -> StHelixModel)
154  * -outer geometry, needs inside-out pass to obtain good parameters at outermostHitNode
155  * -fit traits, still missing the probability of chi2
156  * -topology map, filled from StuFixTopoMap once StDetectorInfo is properly set
157  *
158  * This version prints out lots of messages for debugging, should be more quiet
159  * when we make progress.
160  *
161  **************************************************************************/
162 #ifndef StiStEventFiller_HH
163 #define StiStEventFiller_HH
164 #include <map>
165 using std::map;
166 #include "StDetectorId.h"
167 class StEvent;
168 class StTrackNode;
169 class StTrackDetectorInfo;
170 class StTrack;
171 class StiTrackContainer;
172 class StiTrack;
173 class StiKalmanTrack;
174 class StHelix;
175 class StHelixModel;
176 #include "StPhysicalHelixD.hh"
185 class StiAux;
186 class StiPullEvent;
188 {
189 public:
191  void setUseAux(int aux=1) {mUseAux=aux;}
192  virtual ~StiStEventFiller();
193  static StiStEventFiller *instance() {return fgStiStEventFiller;}
194  void fillEvent(StEvent* e, StiTrackContainer* t);
195  void fillEventPrimaries();
196  void fillDetectorInfo(StTrackDetectorInfo* detInfo, StiKalmanTrack* kTrack,bool refCountIncr);
197  void fillGeometry(StTrack* track, StiKalmanTrack* kTrack, bool outer);
198  //void fillTopologyMap(StTrack* track, StiKalmanTrack* kTrack);
199  void fillFitTraits(StTrack* track, StiKalmanTrack* kTrack);
200  void fillTrack(StTrack* track, StiKalmanTrack* kTrack,StTrackDetectorInfo* detInfo );
201  void fillDca(StTrack* track, StiKalmanTrack* kTrack);
202  void fillFlags(StTrack* track);
203  double impactParameter(StiKalmanTrack* kTrack, StThreeVectorD &vertexPosition);
204  double impactParameter(StTrack* strack, StThreeVectorD &vertexPosition);
205  void setPullEvent(StiPullEvent *pe) {mPullEvent=pe;}
206  static map<StiKalmanTrack*, StTrackNode*> *Track2NodeMap() {return &mTrkNodeMap;}
207  static map<StTrackNode*, StiKalmanTrack*> *Node2TrackMap() {return &mNodeTrkMap;}
208 private:
209  void fillResHack(StHit *hh,const StiHit *stiHit, const StiKalmanTrackNode *node);
210  void fillPulls (StHit *hh,const StiHit *stiHit
211  ,const StiKalmanTrackNode *node
212  ,const StiKalmanTrack *track
213  ,int dets[1][3],int gloPri);
214  void fillPulls (StiKalmanTrack *ktrack,const StGlobalTrack *gTrack,int gloPri);
215  bool accept(StiKalmanTrack* kTrack);
216  void FillStHitErr(StHit *hh,const StiKalmanTrackNode *node);
217  void FillTpcdX(const StiKalmanTrack* track, const StiKalmanTrackNode *node, StHit *hh);
218 private:
219  StEvent* mEvent;
220  StiTrackContainer* mTrackStore;
221  StiAux* mAux;
222  StiPullEvent *mPullEvent;
223  int mUseAux;
224  int mGloPri; //0=filing global,1=filing primary
225  int mTrackNumber;
226  int mUsedHits[100];
227  int mUsedGits[100];
228  static map<StiKalmanTrack*, StTrackNode*> mTrkNodeMap;
229  static map<StTrackNode*, StiKalmanTrack*> mNodeTrkMap;
230  unsigned short mStiEncoded;
231  //helix parameters
232  StThreeVectorD *originD;
233  StPhysicalHelixD * physicalHelix;
234  StTrack2FastDetectorMatcher *mFastDetectorMatcher;
235  static StiStEventFiller* fgStiStEventFiller;
236 };
237 
238 #endif
Definition of Kalman Track.
void fillFlags(StTrack *track)
Definition: StHit.h:125
Abstract definition of a Track.
Definition: StiTrack.h:59
Definition: StiHit.h:51
void fillEvent(StEvent *e, StiTrackContainer *t)
void fillDetectorInfo(StTrackDetectorInfo *detInfo, StiKalmanTrack *kTrack, bool refCountIncr)