CMS 3D CMS Logo

VertexFitterResult.h
Go to the documentation of this file.
1 #ifndef VertexFitterResult_H
2 #define VertexFitterResult_H
3 
4 #include <string>
5 // #include "Vertex/VertexRecoAnalysis/interface/NumberOfSharedTracks.h"
6 // #include "CommonReco/PatternTools/interface/RefittedRecTrack.h"
14 
15 #include <vector>
16 
25 public:
26  // typedef std::vector<const TkSimTrack*> SimTrackCont;
27  typedef std::vector<reco::TransientTrack> TTrackCont;
28 
29  VertexFitterResult(const int maxTracks = 100, const MagneticField* = nullptr);
31 
32  void fill(const TransientVertex& recv,
33  const TrackingVertex* simv = nullptr,
34  reco::RecoToSimCollection* recSimColl = nullptr,
35  const float& time = 0);
36 
37  void fill(const TransientVertex& recVertex,
38  const TTrackCont& recTrackV,
39  const TrackingVertex* simv = nullptr,
40  reco::RecoToSimCollection* recSimColl = nullptr,
41  const float& time = 0);
42 
43  const float* simVertexPos() const { return simPos; }
44  const float* recVertexPos() const { return recPos; }
45  const float* recVertexErr() const { return recErr; }
46  const int* trackInformation() const { return tracks; }
47  const float* chi2Information() const { return chi; }
48  const int* vertexPresent() const { return &vertex; }
49  const float* time() const { return &fitTime; }
50  void reset();
51  const int* numberSimTracks() { return &numberOfSimTracks; }
52  const int* numberRecTracks() { return &numberOfRecTracks; }
53  // This array contains, for each SimTrack, the index of the associated RecTrack
54  const int* simTrack_recIndex() { return recIndex; }
55  // This array contains, for each RecTrack, the index of the associated simTrack
56  const int* recTrack_simIndex() { return simIndex; }
57  const float* recTrackWeight() { return trackWeight; }
58  const float* recParameters(const int i) const {
59  if (i < 0 || i >= 5)
60  return nullptr;
61  return recPars[i];
62  }
63  const float* refParameters(const int i) const {
64  if (i < 0 || i >= 5)
65  return nullptr;
66  return refPars[i];
67  }
68  const float* simParameters(const int i) const {
69  if (i < 0 || i >= 5)
70  return nullptr;
71  return simPars[i];
72  }
73  const float* recErrors(const int i) const {
74  if (i < 0 || i >= 5)
75  return nullptr;
76  return recErrs[i];
77  }
78  const float* refErrors(const int i) const {
79  if (i < 0 || i >= 5)
80  return nullptr;
81  return refErrs[i];
82  }
83 
84 private:
85  // typedef std::vector<const TkSimTrack*> SimTrkCont;
86  //
87  void fillParameters(const reco::TrackBase::ParameterVector& perigee, float* params[5], int trackNumber);
88  // void fillErrors (const reco::TrackBase::CovarianceMatrix& perigeeCov, float* errors[5],
89  // int trackNumber);
90  void fillParameters(const PerigeeTrajectoryParameters& ptp, float* params[5], int trackNumber);
91  void fillErrors(const PerigeeTrajectoryError& pte, float* errors[5], int trackNumber);
92 
93 private:
94  // class RecTrackMatch{
95  // public:
96  // RecTrackMatch(const RecTrack & aRecTrack):theRecTrack(aRecTrack){}
97  // ~RecTrackMatch(){}
98  // bool operator() (const RecTrack & theRefTrack) {
99  // const RefittedRecTrack* refTa = dynamic_cast <const RefittedRecTrack*>(theRefTrack.tTrack());
100  // return ((refTa!=0) && theRecTrack.sameAddress(refTa->originalTrack()));
101  // // return theRecTrack.sameAddress(theRefTrack);
102  // // TrackAssociator * recTa = const_cast < TrackAssociator *> (vtxAssocFact.trackAssociator());
103  // // return theRecTrack.sameAddress(theRefTrack.originalTrack());
104  // }
105  // private:
106  // const RecTrack & theRecTrack;
107  // };
108 
109  // NumberOfSharedTracks numberOfSharedTracks;
110 
112 
113  float simPos[3];
114  float recPos[3];
115  float recErr[3];
116  float chi[3];
117  int tracks[3];
118  int vertex; // 0x1 is Sim, 0x10 is Rec
119  float fitTime;
120 
122  float* simPars[5];
123  float* recPars[5];
124  float* refPars[5];
125  float* recErrs[5];
126  float* refErrs[5];
128  float* trackWeight;
130 };
131 #endif
void fill(const TransientVertex &recv, const TrackingVertex *simv=nullptr, reco::RecoToSimCollection *recSimColl=nullptr, const float &time=0)
const int * simTrack_recIndex()
const MagneticField * theMagField
void fillErrors(const PerigeeTrajectoryError &pte, float *errors[5], int trackNumber)
const int * recTrack_simIndex()
std::vector< reco::TransientTrack > TTrackCont
const float * simVertexPos() const
void fillParameters(const reco::TrackBase::ParameterVector &perigee, float *params[5], int trackNumber)
const float * refErrors(const int i) const
math::Vector< dimension >::type ParameterVector
parameter vector
Definition: TrackBase.h:71
const float * recParameters(const int i) const
const float * recTrackWeight()
const float * recErrors(const int i) const
const int * numberSimTracks()
const float * chi2Information() const
VertexFitterResult(const int maxTracks=100, const MagneticField *=nullptr)
const float * simParameters(const int i) const
const float * recVertexErr() const
const int * numberRecTracks()
const float * time() const
const float * refParameters(const int i) const
const float * recVertexPos() const
const int * trackInformation() const
maxTracks
Definition: DMR_cfg.py:158
Definition: errors.py:1
const int * vertexPresent() const