CMS 3D CMS Logo

RntConversions.h
Go to the documentation of this file.
1 #ifndef RecoTracker_MkFitCore_standalone_RntDumper_RntConversions_h
2 #define RecoTracker_MkFitCore_standalone_RntDumper_RRntConversions_h
3 
5 
9 
10 namespace mkfit {
11  namespace miprops = mkfit::mini_propagators;
12 
13  RVec state2pos(const miprops::State &s) { return {s.x, s.y, s.z}; }
14  RVec state2mom(const miprops::State &s) { return {s.px, s.py, s.pz}; }
16 
17  RVec statep2pos(const miprops::StatePlex &s, int i) { return {s.x[i], s.y[i], s.z[i]}; }
18  RVec statep2mom(const miprops::StatePlex &s, int i) { return {s.px[i], s.py[i], s.pz[i]}; }
19  State statep2state(const miprops::StatePlex &s, int i) { return {statep2pos(s, i), statep2mom(s, i)}; }
21  return {statep2state(s, i), s.dalpha[i], s.fail_flag[i]};
22  }
23 
24  RVec hit2pos(const Hit &h) { return {h.x(), h.y(), h.z()}; }
25  RVec track2pos(const TrackBase &s) { return {s.x(), s.y(), s.z()}; }
26  RVec track2mom(const TrackBase &s) { return {s.px(), s.py(), s.pz()}; }
27  State track2state(const TrackBase &s) { return {track2pos(s), track2mom(s)}; }
28 
29  SimSeedInfo evsi2ssinfo(const Event *ev, int seed_idx) {
30  SimSeedInfo ssi;
31  Event::SimLabelFromHits slfh = ev->simLabelForCurrentSeed(seed_idx);
32  if (slfh.is_set()) {
33  ssi.s_sim = track2state(ev->simTracks_[slfh.label]);
34  ssi.sim_lbl = slfh.label;
35  ssi.n_hits = slfh.n_hits;
36  ssi.n_match = slfh.n_match;
37  ssi.has_sim = true;
38  }
39  auto seed = ev->currentSeed(seed_idx);
40  ssi.s_seed = track2state(seed);
41  ssi.seed_lbl = seed.label();
42  ssi.seed_idx = seed_idx;
43  return ssi;
44  }
45 } // namespace mkfit
46 
47 #endif
RVec statep2mom(const miprops::StatePlex &s, int i)
RVec state2mom(const miprops::State &s)
ROOT::Experimental::REveVector RVec
Definition: RntStructs.h:21
PropState statep2propstate(const miprops::StatePlex &s, int i)
int seed_lbl
Definition: RntStructs.h:50
RVec state2pos(const miprops::State &s)
RVec hit2pos(const Hit &h)
bool has_sim
Definition: RntStructs.h:52
State track2state(const TrackBase &s)
State s_sim
Definition: RntStructs.h:48
SimSeedInfo evsi2ssinfo(const Event *ev, int seed_idx)
RVec track2pos(const TrackBase &s)
RVec track2mom(const TrackBase &s)
RVec statep2pos(const miprops::StatePlex &s, int i)
State state2state(const miprops::State &s)
State statep2state(const miprops::StatePlex &s, int i)
int seed_idx
Definition: RntStructs.h:50
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
State s_seed
Definition: RntStructs.h:49