CMS 3D CMS Logo

RntStructs.h
Go to the documentation of this file.
1 #ifndef RecoTracker_MkFitCore_standalone_RntDumper_RntStructs_h
2 #define RecoTracker_MkFitCore_standalone_RntDumper_RntStructs_h
3 
5 
6 #include "ROOT/REveVector.hxx"
7 #include "Math/Point3D.h"
8 #include "Math/Vector3D.h"
9 
10 // From CMSSW data formats
12 typedef ROOT::Math::PositionVector3D<ROOT::Math::Cartesian3D<float> > XYZPointF;
14 typedef ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<float> > XYZVectorF;
16 typedef ROOT::Math::DisplacementVector3D<ROOT::Math::CylindricalEta3D<float> > RhoEtaPhiVectorF;
19 // typedef ROOT::Math::DisplacementVector3D<ROOT::Math::Polar3D<float> > RThetaPhiVectorF;
20 
21 using RVec = ROOT::Experimental::REveVector;
22 
23 struct HeaderLayer {
25  float qb_min, qb_max; // qbar layer limits, r for barrel, z for endcap
27 
28  HeaderLayer() = default;
29  HeaderLayer& operator=(const HeaderLayer&) = default;
30 };
31 
32 struct State {
34 
35  State() = default;
36  State& operator=(const State&) = default;
37 };
38 
39 struct PropState : public State {
40  float dalpha; // helix angle during propagation
41  int fail_flag;
42 
43  PropState() = default;
44  PropState& operator=(const PropState&) = default;
45 };
46 
47 struct SimSeedInfo {
52  bool has_sim = false;
53 
54  float good_frac() const { return (float)n_match / n_hits; }
55 
56  SimSeedInfo() = default;
57  SimSeedInfo& operator=(const SimSeedInfo&) = default;
58 };
59 
60 struct BinSearch {
61  float phi, dphi, q, dq;
62  short unsigned int p1, p2, q1, q2;
63  short int wsr;
64  bool wsr_in_gap;
65  bool has_nans = false;
66 
67  bool nan_check();
68 
69  BinSearch() = default;
70  BinSearch& operator=(const BinSearch&) = default;
71 };
72 
73 struct HitInfo {
76  int hit_lbl;
77 
78  HitInfo() = default;
79  HitInfo& operator=(const HitInfo&) = default;
80 };
81 
82 struct HitMatchInfo : public HitInfo {
84  float ddq, ddphi;
85  float chi2_true;
86  int hit_index;
87  bool match;
88  bool presel;
89  bool prop_ok;
90  bool has_ic2list{false};
92 
93  bool accept() const { return presel && prop_ok; }
94 
95  HitMatchInfo() = default;
96  HitMatchInfo& operator=(const HitMatchInfo&) = default;
97 };
98 
99 struct CandInfo {
105  std::vector<HitMatchInfo> hmi;
107  int ord_first_match = -1;
108  float dphi_first_match = -9999.0f, dq_first_match = -9999.0f;
109  bool has_nans = false;
110 
111  CandInfo(const SimSeedInfo& s, const State& c) : ssi(s), s_ctr(c) {}
112 
113  void nan_check();
116  ord_first_match = -1;
117  dphi_first_match = dq_first_match = -9999.0f;
118  }
119 
121  for (auto& hm : hmi) {
122  if (hm.hit_index == ic2l.hitIdx) {
123  hm.has_ic2list = true;
124  hm.ic2list = ic2l;
125  return true;
126  }
127  }
128  return false;
129  }
130 
131  CandInfo() = default;
132  CandInfo& operator=(const CandInfo&) = default;
133 };
134 
139  bool has_nans = false;
140 
141  FailedPropInfo(const SimSeedInfo& s, const State& p, const State& f) : ssi(s), s_prev(p), s_final(f) {}
142 
143  void nan_check();
144 
145  FailedPropInfo() = default;
146  FailedPropInfo& operator=(const FailedPropInfo&) = default;
147 };
148 
149 #endif
bool accept() const
Definition: RntStructs.h:93
int n_hits_match
Definition: RntStructs.h:106
float good_frac() const
Definition: RntStructs.h:54
RVec trk_mom
Definition: RntStructs.h:83
SimSeedInfo()=default
short unsigned int p2
Definition: RntStructs.h:62
float dq
Definition: RntStructs.h:61
float chi2_true
Definition: RntStructs.h:85
float hit_qhalflen
Definition: RntStructs.h:75
bool is_pix
Definition: RntStructs.h:26
bool prop_ok
Definition: RntStructs.h:89
float dq_first_match
Definition: RntStructs.h:108
HeaderLayer()=default
PropState ps_min
Definition: RntStructs.h:102
float phi
Definition: RntStructs.h:61
mkfit::IdxChi2List ic2list
Definition: RntStructs.h:91
bool has_nans
Definition: RntStructs.h:109
float q
Definition: RntStructs.h:61
void reset_hits_match()
Definition: RntStructs.h:114
RVec trk_pos
Definition: RntStructs.h:83
ROOT::Experimental::REveVector RVec
Definition: RntStructs.h:21
int n_hits_pass_match
Definition: RntStructs.h:106
float ddphi
Definition: RntStructs.h:84
float dalpha
Definition: RntStructs.h:40
short unsigned int p1
Definition: RntStructs.h:62
bool wsr_in_gap
Definition: RntStructs.h:64
State()=default
int iter_algo
Definition: RntStructs.h:24
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
Definition: RntStructs.h:14
HitMatchInfo & operator=(const HitMatchInfo &)=default
HitInfo()=default
Definition: HitInfo.cc:13
int n_hits_pass
Definition: RntStructs.h:106
float hit_phi
Definition: RntStructs.h:75
int ord_first_match
Definition: RntStructs.h:107
bool nan_check()
Definition: RntStructs.cc:35
void nan_check()
Definition: RntStructs.cc:50
int seed_lbl
Definition: RntStructs.h:50
SimSeedInfo ssi
Definition: RntStructs.h:136
HitMatchInfo()=default
bool has_nans
Definition: RntStructs.h:65
RVec hit_pos
Definition: RntStructs.h:74
float qb_max
Definition: RntStructs.h:25
HitInfo & operator=(const HitInfo &)=default
float qb_min
Definition: RntStructs.h:25
RVec pos
Definition: RntStructs.h:33
int fail_flag
Definition: RntStructs.h:41
int eta_region
Definition: RntStructs.h:24
PropState ps_max
Definition: RntStructs.h:102
bool has_sim
Definition: RntStructs.h:52
FailedPropInfo()=default
double f[11][100]
bool has_ic2list
Definition: RntStructs.h:90
State s_sim
Definition: RntStructs.h:48
float hit_qbar
Definition: RntStructs.h:75
short unsigned int q1
Definition: RntStructs.h:62
int n_all_hits
Definition: RntStructs.h:106
BinSearch bso
Definition: RntStructs.h:103
bool is_barrel
Definition: RntStructs.h:26
short unsigned int q2
Definition: RntStructs.h:62
short int wsr
Definition: RntStructs.h:63
RVec mom
Definition: RntStructs.h:33
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: RntStructs.h:12
SimSeedInfo & operator=(const SimSeedInfo &)=default
int iter_idx
Definition: RntStructs.h:24
int hit_lbl
Definition: RntStructs.h:76
float dphi
Definition: RntStructs.h:61
HeaderLayer & operator=(const HeaderLayer &)=default
BinSearch()=default
std::vector< HitMatchInfo > hmi
Definition: RntStructs.h:105
PropState()=default
ROOT::Math::DisplacementVector3D< ROOT::Math::CylindricalEta3D< float > > RhoEtaPhiVectorF
spatial vector with cylindrical internal representation using pseudorapidity
Definition: RntStructs.h:16
float hit_q
Definition: RntStructs.h:75
BinSearch & operator=(const BinSearch &)=default
CandInfo & operator=(const CandInfo &)=default
PropState & operator=(const PropState &)=default
FailedPropInfo(const SimSeedInfo &s, const State &p, const State &f)
Definition: RntStructs.h:141
BinSearch bsn
Definition: RntStructs.h:104
CandInfo()=default
SimSeedInfo ssi
Definition: RntStructs.h:100
float dphi_first_match
Definition: RntStructs.h:108
int seed_idx
Definition: RntStructs.h:50
FailedPropInfo & operator=(const FailedPropInfo &)=default
bool assignIdxChi2List(const mkfit::IdxChi2List &ic2l)
Definition: RntStructs.h:120
CandInfo(const SimSeedInfo &s, const State &c)
Definition: RntStructs.h:111
State s_ctr
Definition: RntStructs.h:101
State s_seed
Definition: RntStructs.h:49
State & operator=(const State &)=default
void nan_check()
Definition: RntStructs.cc:43
bool is_stereo
Definition: RntStructs.h:26