Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-25 02:14:14

0001 #ifndef RecoTracker_MkFitCore_standalone_RntDumper_RntConversions_h
0002 #define RecoTracker_MkFitCore_standalone_RntDumper_RRntConversions_h
0003 
0004 #include "RecoTracker/MkFitCore/standalone/RntDumper/RntStructs.h"
0005 
0006 #include "RecoTracker/MkFitCore/interface/Track.h"
0007 #include "RecoTracker/MkFitCore/src/Matrix.h"
0008 #include "RecoTracker/MkFitCore/src/MiniPropagators.h"
0009 
0010 namespace mkfit {
0011   namespace miprops = mkfit::mini_propagators;
0012 
0013   RVec state2pos(const miprops::State &s) { return {s.x, s.y, s.z}; }
0014   RVec state2mom(const miprops::State &s) { return {s.px, s.py, s.pz}; }
0015   State state2state(const miprops::State &s) { return {state2pos(s), state2mom(s)}; }
0016 
0017   RVec statep2pos(const miprops::StatePlex &s, int i) { return {s.x[i], s.y[i], s.z[i]}; }
0018   RVec statep2mom(const miprops::StatePlex &s, int i) { return {s.px[i], s.py[i], s.pz[i]}; }
0019   State statep2state(const miprops::StatePlex &s, int i) { return {statep2pos(s, i), statep2mom(s, i)}; }
0020   PropState statep2propstate(const miprops::StatePlex &s, int i) {
0021     return {statep2state(s, i), s.dalpha[i], s.fail_flag[i]};
0022   }
0023 
0024   RVec hit2pos(const Hit &h) { return {h.x(), h.y(), h.z()}; }
0025   RVec track2pos(const TrackBase &s) { return {s.x(), s.y(), s.z()}; }
0026   RVec track2mom(const TrackBase &s) { return {s.px(), s.py(), s.pz()}; }
0027   State track2state(const TrackBase &s) { return {track2pos(s), track2mom(s)}; }
0028 
0029   SimSeedInfo evsi2ssinfo(const Event *ev, int seed_idx) {
0030     SimSeedInfo ssi;
0031     Event::SimLabelFromHits slfh = ev->simLabelForCurrentSeed(seed_idx);
0032     if (slfh.is_set()) {
0033       ssi.s_sim = track2state(ev->simTracks_[slfh.label]);
0034       ssi.sim_lbl = slfh.label;
0035       ssi.n_hits = slfh.n_hits;
0036       ssi.n_match = slfh.n_match;
0037       ssi.has_sim = true;
0038     }
0039     auto seed = ev->currentSeed(seed_idx);
0040     ssi.s_seed = track2state(seed);
0041     ssi.seed_lbl = seed.label();
0042     ssi.seed_idx = seed_idx;
0043     return ssi;
0044   }
0045 }  // namespace mkfit
0046 
0047 #endif