Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef RecoTracker_MkFitCMS_standalone_Shell_h
0002 #define RecoTracker_MkFitCMS_standalone_Shell_h
0003 
0004 #include "RecoTracker/MkFitCore/interface/Hit.h"
0005 #include "RecoTracker/MkFitCore/interface/Track.h"
0006 
0007 #include <map>
0008 
0009 namespace mkfit {
0010 
0011   class DataFile;
0012   class Event;
0013   class EventOfHits;
0014   class MkBuilder;
0015 
0016   class Shell {
0017   public:
0018     enum SeedSelect_e { SS_UseAll = 0, SS_Label, SS_IndexPreCleaning, SS_IndexPostCleaning };
0019 
0020     Shell(std::vector<DeadVec> &dv, const std::string &in_file, int start_ev);
0021     void Run();
0022 
0023     void Status();
0024 
0025     void GoToEvent(int eid);
0026     void NextEvent(int skip = 1);
0027     void ProcessEvent(SeedSelect_e seed_select = SS_UseAll, int selected_seed = -1, int count = 1);
0028 
0029     void SelectIterationIndex(int itidx);
0030     void SelectIterationAlgo(int algo);
0031     void PrintIterations();
0032 
0033     void SetDebug(bool b);
0034     void SetCleanSeeds(bool b);
0035     void SetBackwardFit(bool b);
0036     void SetRemoveDuplicates(bool b);
0037     void SetUseDeadModules(bool b);
0038 
0039     Event *event() { return m_event; }
0040     EventOfHits *eoh() { return m_eoh; }
0041     MkBuilder *builder() { return m_builder; }
0042 
0043     const TrackVec &seeds() const { return m_seeds; }
0044     const TrackVec &tracks() const { return m_tracks; }
0045 
0046     // --------------------------------------------------------
0047     // Analysis helpers
0048 
0049     int LabelFromHits(Track &t, bool replace, float good_frac);
0050     void FillByLabelMaps_CkfBase();
0051 
0052     bool CheckMkFitLayerPlanVsReferenceHits(const Track &mkft, const Track &reft, const std::string &name);
0053 
0054     // --------------------------------------------------------
0055     // Analysis drivers / main functions / Comparators
0056 
0057     void Compare();
0058 
0059   private:
0060     std::vector<DeadVec> &m_deadvectors;
0061     DataFile *m_data_file = nullptr;
0062     Event *m_event = nullptr;
0063     EventOfHits *m_eoh = nullptr;
0064     MkBuilder *m_builder = nullptr;
0065     int m_evs_in_file = -1;
0066     int m_it_index = 0;
0067     bool m_clean_seeds = true;
0068     bool m_backward_fit = true;
0069     bool m_remove_duplicates = true;
0070 
0071     TrackVec m_seeds;
0072     TrackVec m_tracks;
0073 
0074     using map_t = std::map<int, Track *>;
0075     using map_i = map_t::iterator;
0076 
0077     std::map<int, Track *> m_ckf_map, m_sim_map, m_seed_map, m_mkf_map;
0078   };
0079 
0080 }  // namespace mkfit
0081 
0082 #endif