StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPPVertexFinder.h
1 
10 #include "StGenericVertexMaker/StGenericVertexFinder.h"
11 
12 #include "StPhysicalHelixD.hh"
13 class StEventToolkit;
14 class StGlobalTrack;
15 class TGraphErrors;
16 class StEvent;
17 class StEEmcDb;
18 class EEmcGeomSimple;
19 class StBTofGeometry;
20 
21 namespace StEvPPV {
22 class VertexData;
23 class TrackData;
24 class BtofHitList;
25 class CtbHitList;
26 class BemcHitList;
27 class EemcHitList;
28 class Vertex3D;
29 
31  private:
32  enum {mxH=32};
33  bool examinTrackDca(const StGlobalTrack*, TrackData &t);
34  void matchTrack2BTOF(const StGlobalTrack*, TrackData &t, StBTofGeometry *geom);
35  void matchTrack2CTB(const StGlobalTrack*, TrackData &t);
36  void matchTrack2EEMC(const StGlobalTrack*, TrackData &t, float z);
37  void matchTrack2BEMC(const StGlobalTrack*, TrackData &t, float rxy);
38  bool matchTrack2Membrane(const StGlobalTrack*, TrackData &t);
39  bool isPostCrossingTrack(const StGlobalTrack* track);
40  vector<TrackData> mTrackData;
41  vector<VertexData> mVertexData;
42  Vertex3D *vertex3D; // for stand alone 3D vertex reco
43  bool buildLikelihoodZ();
44  bool findVertexZ(VertexData &);
45  bool evalVertexZ(VertexData &);
46  void exportVertices();
47 
48  void saveHisto(TString fname);
49  int mTotEve;
50  int eveID;
51  unsigned int mAlgoSwitches; //binary, assign 1bit per change, use enum below
52  enum {kSwitchOneHighPT=1};
53 
54  StEventToolkit *mToolkit;
55  // params
56  double mMinTrkPt; //~ pT=0.16(GeV/c) == R=2 (m )in 2001
57  double mMaxTrkDcaRxy; //DCA to nominal beam line for each track
58  float mMaxZradius; // used in matching: tracks to zVertex
59  int mMinMatchTr; // for valid vertex
60  float mMaxZrange; // cut off for tracks Z_DCA
61  float mDyBtof; // BTOF delta y cut
62  float mMinZBtof; // BTOF local z min cut
63  float mMaxZBtof; // BTOF local z max cut
64  float mMinAdcBemc; // BEMC towers with MIP response
65  float mMinAdcEemc; // EEMC towers with MIP response
66  float mMinFitPfrac; // nFit/nPossible
67  bool mFitPossWeighting; // Use nFit/nPossible in track weighting (ranking)
68  bool mDropPostCrossingTrack; // enable/disable post crossing tarck rejection
69  int mStoreUnqualifiedVertex; // set the max # of vertices, sorted by rank
70  float mCut_oneTrackPT; // threshold for storing one track vertices
71  int mBeamLineTracks; // activates writing them out + lot of QA histos,
72  // use BFC option: VtxSeedCalG to enable it, expert only
73 
74  // util
75  BtofHitList *btofList;
76  CtbHitList *ctbList;
77  BemcHitList *bemcList;
78  EemcHitList *eemcList;
79  StBTofGeometry *btofGeom;
80  StEEmcDb *eeDb;
81  EEmcGeomSimple *geomE;
82 
83  void dumpKalmanNodes(const StGlobalTrack *track);
84  // void plotVertex(VertexData *);
85  // void plotTracksDca();
86  void initHisto();
87 
88  virtual void UseVertexConstraint() {}
89 
90 public:
91  void UsePCT(bool x=true) {setDropPostCrossingTrack(!x);}
92  void setDropPostCrossingTrack(bool x=true) {mDropPostCrossingTrack=x;}
93  void Finish();
94 
95  TH1F *hA[mxH];
96  TH2F *hACorr;
97  TH1D *hL ; // likelyhood distribution
98  TH1D *hM, *hW ; // cumulative track mult & weight distribution, for better errZ calculation
99  TObjArray * HList;
101 
102  // mandatory implementations
103  virtual ~StPPVertexFinder();
104  int fit(StEvent*);
105  void printInfo(ostream& = cout) const;
106 
107  // over-written method
108  virtual void Init();
109  virtual void InitRun (int runumber);
110  virtual void Clear();
111 };
112 }// end namespace StEvPPV
113 
114 /***************************************************************************
115  *
116  * $Log: StPPVertexFinder.h,v $
117  * Revision 1.5 2017/05/10 23:16:42 smirnovd
118  * Some minor refactoring changes:
119  *
120  * See commits 6fb592df..07da3bdf on master branch
121  *
122  * StPPVertexFinder: Get rid of a temporary variable
123  *
124  * StPPVertexFinder: Get rid of extra return
125  * Zero vertices returned for unqualified event anyway
126  *
127  * StGenericVertexFinder: Removed deprecated CalibBeamLine()
128  *
129  * Revision 1.4 2017/02/14 22:00:41 smirnovd
130  * Squashed commit of the following clean-up changes:
131  *
132  * See master branch for details.
133  *
134  * - Remove commented code for debugging
135  * - Removed extra validation; it is done at construction
136  * - No need to include header for apple OS
137  * - Removed pointless assert
138  * - Use standard portable type name
139  * - Remove unused header math_constants.h
140  * - StMinuitVertexFinder: Remove abandoned member function
141  *
142  * Revision 1.3 2016/11/07 21:19:28 smirnovd
143  * Added and reworded some doxygen and other comments
144  *
145  * Also cleaned up not-so-useful comments
146  *
147  * Revision 1.2 2016/08/18 17:46:15 smirnovd
148  * Squashed commit of the following refactoring changes:
149  *
150  * Date: Wed Jul 27 18:31:18 2016 -0400
151  *
152  * Removed unused arguments in UseVertexConstraint()
153  *
154  * In StiPPVertexFinder and StvPPVertexFinder this method does nothing
155  *
156  * Date: Wed Jul 27 16:47:58 2016 -0400
157  *
158  * Make old UseVertexConstraint private virtual and call it from its public replacement in the base class
159  *
160  * also mark methods as private explicitly
161  *
162  * Date: Wed Jul 27 16:52:02 2016 -0400
163  *
164  * Removed unused private data member mWeight
165  *
166  * Date: Wed Jul 27 16:50:42 2016 -0400
167  *
168  * Prefer base class static beamline parameters rather than this class private members
169  *
170  * Date: Wed Jul 27 16:21:49 2016 -0400
171  *
172  * StPPVertexFinder: Got rid of unused private beamline parameters
173  *
174  * The equivalent measurements are available from the base class
175  * StGenericVertexFinder
176  *
177  * Date: Wed Jul 27 16:19:19 2016 -0400
178  *
179  * StPPVertexFinder: For beamline position use equivalent static methods from parent class
180  *
181  * Date: Wed Jul 27 16:05:50 2016 -0400
182  *
183  * StGenericVertexMaker: Assigning once is enough
184  *
185  * Date: Mon Aug 15 10:43:49 2016 -0400
186  *
187  * StGenericVertexFinder: Print out beamline parameters
188  *
189  * Print beamline values as extracted from the database before any modification.
190  *
191  * Date: Wed Jul 6 15:33:02 2016 -0400
192  *
193  * Stylistic changes and minor refactoring
194  *
195  * Whitespace and comments for improved readability
196  * s/track/stiKalmanTrack/
197  *
198  * Date: Wed Jul 6 15:28:16 2016 -0400
199  *
200  * StPPVertexFinder: Switched to cleaner c++11 range loop syntax
201  *
202  * Date: Wed Jul 6 15:22:14 2016 -0400
203  *
204  * StPPVertexFinder: Minor c++ refactoring
205  *
206  * - Removed unused counter
207  * - c-style array to std::array
208  *
209  * Date: Wed Jul 6 15:20:11 2016 -0400
210  *
211  * Deleted commented out code
212  *
213  * Removed unused #include's StMinuitVertexFinder
214  *
215  * Revision 1.1 2013/08/16 22:19:56 perev
216  * PPV with only StEvent dependency
217  *
218  * Revision 1.18 2013/04/09 22:37:56 genevb
219  * Remove boostEfficiency codes: DB usage implemented
220  *
221  * Revision 1.17 2013/04/05 21:00:02 jeromel
222  * Implemented and merged back to source the boostEfficiency (i.e. change of
223  * nFit /nPossible points on the track fract to consider). No DB imp yet.
224  *
225  * Fixed boostEfficiency()
226  *
227  * Changed cout to LOG_INFO
228  *
229  * Revision 1.16 2012/12/12 22:09:58 fisyak
230  * add sys/types.h include for APPLE
231  *
232  * Revision 1.15 2010/09/10 21:08:35 rjreed
233  * Added function UseBOTF and bool mUseBtof to switch the use of the TOF on and off in vertex finding. Default value is off (false).
234  * 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.
235  *
236  * Revision 1.14 2009/07/09 21:29:03 balewski
237  * allow export of prim tracks for 3D beam line fit (use VtxSeedCalG option),
238  * oneTrack vertex thresholds was lowered form 15 to 10 GeV/c
239  *
240  * Revision 1.13 2009/04/10 22:57:14 genevb
241  * Typo correction
242  *
243  * Revision 1.12 2009/02/05 21:43:59 balewski
244  * Oleksandr renamed StEEmcDbMaker to StEEmcDb and requested this set of code corrections
245  *
246  * Revision 1.11 2008/12/01 22:57:46 balewski
247  * 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:
248  * http://drupal.star.bnl.gov/STAR/comp/reco/vf/ppv-vertex/2009-algo-upgrade-1
249  *
250  * Revision 1.10 2008/10/23 20:37:32 genevb
251  * Add switches for turning on/off use of Post-Crossing Tracks [default:off]
252  *
253  * Revision 1.9 2008/10/21 19:23:06 balewski
254  * store unqualified vertices on Akio's request
255  *
256  * Revision 1.8 2008/08/21 22:09:31 balewski
257  * - In matchTrack2Membrane()
258  * - Cut on hit max R chanegd from 190 to 199cm
259  * - Fixed logic failure of counting possible hits
260  * - Fixed logic failure of crossing CM for certain pattern of hits
261  * - Added a new function bool isPostCrossingTrack()
262  * - it returns true if track have 2 or more hits in wrong z
263  * - Use isPostCrossingTrack() in fit()
264  * - Added switch setDropPostCrossingTrack(bool), defaulted to true
265  * All changes tested & implemented by Akio in preparation for 2008 pp production.
266  * The key change (removing PostCrossingTrack) is in response to the change of the TPC cluster finder
267  * - now we use the on-line version which allows for longer range of TPC time buckets to be used.
268  *
269  * Revision 1.7 2006/03/12 17:01:01 jeromel
270  * Minor change + use ppvNoCtbVertexFinder
271  *
272  * Revision 1.6 2006/03/11 04:12:50 balewski
273  * 2 changes in preparation for 2006 data processing:
274  * - CTB matching ON/OFF switch activated by m_Mode 0x8 or 0x10
275  * - vertex enum extension depending on CTB usage - hack in the moment, Jerome needs to proviade actual new enum
276  * - BTOW calibration wil change for 2006+ from maxt eT of ~27 --> 60 GeV
277  * NOTE : this new code was NOT executed - it is late, I want to get it in CVS
278  * Tomorrow I'll do some tests
279  * Jan
280  *
281  * Revision 1.5 2005/08/30 22:08:43 balewski
282  * drop '*' from declaration of mTrackData & mVertexData
283  *
284  * Revision 1.4 2005/08/12 18:35:28 balewski
285  * more accurate calculation of Z-vertex error
286  * by accounting for average weight of tracks contributing to the likelihood,
287  * Now errZ is of 0.5-1.5 mm, was ~2x smaller
288  *
289  * Revision 1.3 2005/07/20 05:34:16 balewski
290  * cleanup
291  *
292  * Revision 1.2 2005/07/19 22:01:59 perev
293  * MultiVertex
294  *
295  * Revision 1.1 2005/07/11 20:38:12 balewski
296  * PPV added for real
297  *
298  *
299  *
300  **************************************************************************/
301 
EEMC simple geometry.