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 
6 
7 #include <map>
8 
9 namespace mkfit {
10 
11  class DataFile;
12  class Event;
13  class EventOfHits;
14  class MkBuilder;
15 
16  class Shell {
17  public:
19 
20  Shell(std::vector<DeadVec> &dv, const std::string &in_file, int start_ev);
21  void Run();
22 
23  void Status();
24 
25  void GoToEvent(int eid);
26  void NextEvent(int skip = 1);
27  void ProcessEvent(SeedSelect_e seed_select = SS_UseAll, int selected_seed = -1, int count = 1);
28 
29  void SelectIterationIndex(int itidx);
30  void SelectIterationAlgo(int algo);
31  void PrintIterations();
32 
33  void SetDebug(bool b);
34  void SetCleanSeeds(bool b);
35  void SetBackwardFit(bool b);
36  void SetRemoveDuplicates(bool b);
37  void SetUseDeadModules(bool b);
38 
39  Event *event() { return m_event; }
40  EventOfHits *eoh() { return m_eoh; }
41  MkBuilder *builder() { return m_builder; }
42 
43  const TrackVec &seeds() const { return m_seeds; }
44  const TrackVec &tracks() const { return m_tracks; }
45 
46  // --------------------------------------------------------
47  // Analysis helpers
48 
49  int LabelFromHits(Track &t, bool replace, float good_frac);
51 
52  bool CheckMkFitLayerPlanVsReferenceHits(const Track &mkft, const Track &reft, const std::string &name);
53 
54  // --------------------------------------------------------
55  // Analysis drivers / main functions / Comparators
56 
57  void Compare();
58 
59  private:
60  std::vector<DeadVec> &m_deadvectors;
61  DataFile *m_data_file = nullptr;
62  Event *m_event = nullptr;
63  EventOfHits *m_eoh = nullptr;
64  MkBuilder *m_builder = nullptr;
65  int m_evs_in_file = -1;
66  int m_it_index = 0;
67  bool m_clean_seeds = true;
68  bool m_backward_fit = true;
69  bool m_remove_duplicates = true;
70 
73 
74  using map_t = std::map<int, Track *>;
75  using map_i = map_t::iterator;
76 
77  std::map<int, Track *> m_ckf_map, m_sim_map, m_seed_map, m_mkf_map;
78  };
79 
80 } // namespace mkfit
81 
82 #endif
std::map< int, Track * > m_sim_map
Definition: Shell.h:77
void ProcessEvent(SeedSelect_e seed_select=SS_UseAll, int selected_seed=-1, int count=1)
Definition: Shell.cc:121
Shell(std::vector< DeadVec > &dv, const std::string &in_file, int start_ev)
Definition: Shell.cc:40
TrackVec m_seeds
Definition: Shell.h:71
Event * event()
Definition: Shell.h:39
void PrintIterations()
Definition: Shell.cc:314
bool m_remove_duplicates
Definition: Shell.h:69
DataFile * m_data_file
Definition: Shell.h:61
def replace(string, replacements)
std::map< int, Track * > m_mkf_map
Definition: Shell.h:77
bool CheckMkFitLayerPlanVsReferenceHits(const Track &mkft, const Track &reft, const std::string &name)
Definition: Shell.cc:437
bool m_clean_seeds
Definition: Shell.h:67
void SetDebug(bool b)
Definition: Shell.cc:325
void Status()
Definition: Shell.cc:74
void SelectIterationIndex(int itidx)
Definition: Shell.cc:295
EventOfHits * eoh()
Definition: Shell.h:40
void Run()
Definition: Shell.cc:55
MkBuilder * m_builder
Definition: Shell.h:64
std::vector< DeadVec > & m_deadvectors
Definition: Shell.h:60
void FillByLabelMaps_CkfBase()
Definition: Shell.cc:372
EventOfHits * m_eoh
Definition: Shell.h:63
const TrackVec & tracks() const
Definition: Shell.h:44
const TrackVec & seeds() const
Definition: Shell.h:43
void SetCleanSeeds(bool b)
Definition: Shell.cc:326
void GoToEvent(int eid)
Definition: Shell.cc:87
bool m_backward_fit
Definition: Shell.h:68
void SetRemoveDuplicates(bool b)
Definition: Shell.cc:328
MkBuilder * builder()
Definition: Shell.h:41
void NextEvent(int skip=1)
Definition: Shell.cc:117
TrackVec m_tracks
Definition: Shell.h:72
std::vector< Track > TrackVec
double b
Definition: hdecay.h:120
map_t::iterator map_i
Definition: Shell.h:75
Event * m_event
Definition: Shell.h:62
void SetBackwardFit(bool b)
Definition: Shell.cc:327
int m_it_index
Definition: Shell.h:66
int LabelFromHits(Track &t, bool replace, float good_frac)
Definition: Shell.cc:345
void Compare()
Definition: Shell.cc:460
std::map< int, Track * > map_t
Definition: Shell.h:74
void SetUseDeadModules(bool b)
Definition: Shell.cc:329
void SelectIterationAlgo(int algo)
Definition: Shell.cc:303
std::map< int, Track * > m_ckf_map
Definition: Shell.h:77
int m_evs_in_file
Definition: Shell.h:65
SeedSelect_e
Definition: Shell.h:18
std::map< int, Track * > m_seed_map
Definition: Shell.h:77