StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPPVertexFinder.h
1 
10 #include <array>
11 #include <ostream>
12 #include <vector>
13 
14 #include "StGenericVertexMaker/StGenericVertexFinder.h"
15 #include "StGenericVertexMaker/StiPPVertex/TrackData.h"
16 #include "StGenericVertexMaker/StiPPVertex/VertexData.h"
17 
18 #include "StarClassLibrary/StPhysicalHelixD.hh"
19 
20 class TH1F;
21 class TH2F;
22 class TH1D;
23 
24 class StiKalmanTrack;
25 class StEvent;
26 class StiToolkit;
27 
28 class StMuDst;
29 
30 class St_db_Maker;
31 class BtofHitList;
32 class CtbHitList;
33 class BemcHitList;
34 class EemcHitList;
35 
36 
38 {
39  private:
40 
43  int fitTracksToVertex(VertexData &vertex);
44 
47  void createTrackDcas(const VertexData &vertex);
48 
51  void findSeeds_TSpectrum();
52 
55  void findSeeds_PPVLikelihood();
56 
57  enum {mxH=32};
58  bool examinTrackDca(const StiKalmanTrack*, TrackData &track);
59  void matchTrack2BTOF(const StiKalmanTrack*, TrackData &track);
60  void matchTrack2CTB(const StiKalmanTrack*, TrackData &track);
61 
62  void matchTrack2EEMC(TrackDataT<StiKalmanTrack> &track);
63  void matchTrack2EEMC(TrackDataT<StMuTrack> &track);
64  void matchTrack2EEMC(const StPhysicalHelixD& helix, TrackData &track);
65 
66  void matchTrack2BEMC(TrackDataT<StiKalmanTrack> &track);
67  void matchTrack2BEMC(TrackDataT<StMuTrack> &track);
68  void matchTrack2BEMC(const StPhysicalHelixD& helix, TrackData &track);
69 
70  bool matchTrack2Membrane(TrackDataT<StiKalmanTrack> &track);
71  void matchTrack2Membrane(TrackDataT<StMuTrack> &track);
72 
73  bool isPostCrossingTrack(const StiKalmanTrack* stiTrack);
74 
75  bool buildLikelihoodZ();
76  bool findVertexZ(VertexData &);
77  bool evalVertexZ(VertexData &);
78  void exportVertices();
79  void saveHisto(TString fname);
80 
82  std::vector<TrackData> mTrackData;
83  std::vector<VertexData> mVertexData;
84  int mTotEve;
85  int eveID;
86  int nBadVertex;
87  unsigned int mAlgoSwitches;
88  enum {kSwitchOneHighPT=1};
90 
91  TH1F *hA[mxH];
92  TH2F *hACorr;
93  TH1D *hL ; // likelyhood distribution
94  TH1D *hM, *hW ; // cumulative track mult & weight distribution, for better errZ calculation
95  TObjArray HList;
96  std::array<int, 8> ntrk;
97 
98  // params
99  double mMinTrkPt;
100  double mMaxTrkDcaRxy;
101  float mMaxZradius;
102  int mMinMatchTr;
103  float mMaxZrange;
104  float mMinZBtof;
105  float mMaxZBtof;
106  float mMinAdcBemc;
107  float mMinAdcEemc;
108  float mMinFitPfrac;
109 
114  bool mFitPossWeighting;
115 
116  bool mDropPostCrossingTrack;
117  int mStoreUnqualifiedVertex;
118  float mCut_oneTrackPT;
119  bool mUseBTOFmatchOnly;
121 
122  StiToolkit *mToolkit;
123  BtofHitList *btofList;
124  CtbHitList *ctbList;
125  BemcHitList *bemcList;
126  EemcHitList *eemcList;
127 
129  const StMuDst* mStMuDst;
130 
131  void dumpKalmanNodes(const StiKalmanTrack *stiTrack);
132  void initHisto();
133 
135  void seed_fit_export();
136 
137  virtual void UseVertexConstraint() {}
138 
139 public:
140 
141  virtual void UsePCT(bool x=true) { mDropPostCrossingTrack = !x; }
142  virtual void Finish();
143  virtual void Init();
144  virtual void InitRun(int run_number, const St_db_Maker* db_maker);
145  virtual void Clear();
146 
147  StPPVertexFinder(VertexFit_t fitMode=VertexFit_t::BeamlineNoFit);
148 
149  virtual ~StPPVertexFinder() {}
150  virtual int fit(StEvent*);
151  virtual int fit(const StMuDst& muDst);
152  virtual void SetStoreUnqualifiedVertex(int n) { mStoreUnqualifiedVertex = n; }
153  virtual void UseBTOFmatchOnly(bool useBTOFmatchOnly = true) { UseBTOF(); mUseBTOFmatchOnly = useBTOFmatchOnly; }
154  void printInfo(std::ostream& os = std::cout) const;
155 };
Definition of Kalman Track.
Definition of toolkit.
Definition: StiToolkit.h:55