CMS 3D CMS Logo

Shell.h
Go to the documentation of this file.
1 #ifndef RecoTracker_MkFitCMS_standalone_Shell_h
2 #define RecoTracker_MkFitCMS_standalone_Shell_h
3 
7 
8 #include <map>
9 
10 namespace mkfit {
11 
12  class DataFile;
13  class Event;
14  class EventOfHits;
15  class MkBuilder;
16  class TrackerInfo;
17 
18  class Shell {
19  public:
21 
22  Shell(std::vector<DeadVec> &dv, const std::string &in_file, int start_ev);
23  ~Shell();
24  void Run();
25 
26  void Status();
27 
28  void GoToEvent(int eid);
29  void NextEvent(int skip = 1);
30  void ProcessEvent(SeedSelect_e seed_select = SS_UseAll, int selected_seed = -1, int count = 1);
31 
32  void SelectIterationIndex(int itidx);
33  void SelectIterationAlgo(int algo);
34  void PrintIterations();
35 
36  void SetDebug(bool b);
37  void SetCleanSeeds(bool b);
38  void SetBackwardFit(bool b);
39  void SetRemoveDuplicates(bool b);
40  void SetUseDeadModules(bool b);
41 
42  Event *event() { return m_event; }
43  EventOfHits *eoh() { return m_eoh; }
44  MkBuilder *builder() { return m_builder; }
46 
47  const TrackVec &seeds() const { return m_seeds; }
48  const TrackVec &tracks() const { return m_tracks; }
49 
50  // --------------------------------------------------------
51  // Analysis helpers
52 
53  int LabelFromHits(Track &t, bool replace, float good_frac);
55 
56  bool CheckMkFitLayerPlanVsReferenceHits(const Track &mkft, const Track &reft, const std::string &name);
57 
58  // --------------------------------------------------------
59  // Analysis drivers / main functions / Comparators
60 
61  void Compare();
62 
63  // --------------------------------------------------------
64  // Visualization stuff
65 #ifdef WITH_REVE
66  void ShowTracker();
67 #endif
68 
69  private:
70  std::vector<DeadVec> &m_deadvectors;
71  DataFile *m_data_file = nullptr;
72  Event *m_event = nullptr;
73  EventOfHits *m_eoh = nullptr;
74  MkBuilder *m_builder = nullptr;
75  int m_evs_in_file = -1;
76  int m_it_index = 0;
77  bool m_clean_seeds = true;
78  bool m_backward_fit = true;
79  bool m_remove_duplicates = true;
80 
83 
84  using map_t = std::map<int, Track *>;
85  using map_i = map_t::iterator;
86 
87  std::map<int, Track *> m_ckf_map, m_sim_map, m_seed_map, m_mkf_map;
88  };
89 
90 } // namespace mkfit
91 
92 #endif
std::map< int, Track * > m_sim_map
Definition: Shell.h:87
void ProcessEvent(SeedSelect_e seed_select=SS_UseAll, int selected_seed=-1, int count=1)
Definition: Shell.cc:140
Shell(std::vector< DeadVec > &dv, const std::string &in_file, int start_ev)
Definition: Shell.cc:48
TrackVec m_seeds
Definition: Shell.h:81
Event * event()
Definition: Shell.h:42
void PrintIterations()
Definition: Shell.cc:334
bool m_remove_duplicates
Definition: Shell.h:79
DataFile * m_data_file
Definition: Shell.h:71
def replace(string, replacements)
std::map< int, Track * > m_mkf_map
Definition: Shell.h:87
bool CheckMkFitLayerPlanVsReferenceHits(const Track &mkft, const Track &reft, const std::string &name)
Definition: Shell.cc:457
bool m_clean_seeds
Definition: Shell.h:77
void SetDebug(bool b)
Definition: Shell.cc:345
void Status()
Definition: Shell.cc:91
void SelectIterationIndex(int itidx)
Definition: Shell.cc:315
EventOfHits * eoh()
Definition: Shell.h:43
void Run()
Definition: Shell.cc:76
MkBuilder * m_builder
Definition: Shell.h:74
std::vector< DeadVec > & m_deadvectors
Definition: Shell.h:70
void FillByLabelMaps_CkfBase()
Definition: Shell.cc:392
EventOfHits * m_eoh
Definition: Shell.h:73
const TrackVec & tracks() const
Definition: Shell.h:48
const TrackVec & seeds() const
Definition: Shell.h:47
void SetCleanSeeds(bool b)
Definition: Shell.cc:346
void GoToEvent(int eid)
Definition: Shell.cc:106
bool m_backward_fit
Definition: Shell.h:78
void SetRemoveDuplicates(bool b)
Definition: Shell.cc:348
MkBuilder * builder()
Definition: Shell.h:44
void NextEvent(int skip=1)
Definition: Shell.cc:136
TrackVec m_tracks
Definition: Shell.h:82
std::vector< Track > TrackVec
double b
Definition: hdecay.h:120
map_t::iterator map_i
Definition: Shell.h:85
Event * m_event
Definition: Shell.h:72
void SetBackwardFit(bool b)
Definition: Shell.cc:347
int m_it_index
Definition: Shell.h:76
int LabelFromHits(Track &t, bool replace, float good_frac)
Definition: Shell.cc:365
void Compare()
Definition: Shell.cc:480
std::map< int, Track * > map_t
Definition: Shell.h:84
void SetUseDeadModules(bool b)
Definition: Shell.cc:349
void SelectIterationAlgo(int algo)
Definition: Shell.cc:323
std::map< int, Track * > m_ckf_map
Definition: Shell.h:87
int m_evs_in_file
Definition: Shell.h:75
SeedSelect_e
Definition: Shell.h:20
std::map< int, Track * > m_seed_map
Definition: Shell.h:87
TrackerInfo * tracker_info()
Definition: Shell.cc:100