CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Globals.h
Go to the documentation of this file.
1 // Globals: holds "global" variables such as the IMATH_TrackletCalculators
2 #ifndef L1Trigger_TrackFindingTracklet_interface_Globals_h
3 #define L1Trigger_TrackFindingTracklet_interface_Globals_h
4 
5 #include <memory>
6 #include <map>
7 #include <string>
8 #include <vector>
9 #include <array>
10 #include <fstream>
11 #include <unordered_map>
12 
13 #ifdef USEHYBRID
16 #endif
17 
18 namespace trklet {
19 
20  class TrackDerTable;
21  class SLHCEvent;
22  class HistBase;
23  class Settings;
24  class TrackletLUT;
25  struct imathGlobals;
26  class IMATH_TrackletCalculator;
27  class IMATH_TrackletCalculatorDisk;
28  class IMATH_TrackletCalculatorOverlap;
29 
30  class Globals {
31  public:
32  Globals(Settings const& settings);
33 
34  ~Globals();
35 
36  SLHCEvent*& event() { return theEvent_; }
37 
39 
41 
42  TrackletLUT*& phiCorr(unsigned int layer) { return thePhiCorr_[layer]; }
43 
44  std::map<std::string, std::vector<int> >& ILindex() { return ILindex_; }
45 
46  std::map<std::string, int>& layerdiskmap() { return layerdiskmap_; }
47 
52 
57 
62 
63  std::ofstream& ofstream(std::string fname);
64 
65 #ifdef USEHYBRID
66  std::unique_ptr<tmtt::Settings>& tmttSettings() { return tmttSettings_; }
67  std::unique_ptr<tmtt::KFParamsComb>& tmttKFParamsComb() { return tmttKFParamsComb_; }
68 #endif
69 
70  private:
71  std::unordered_map<std::string, std::ofstream*> ofstreams_;
72 
73  std::unique_ptr<imathGlobals> imathGlobals_;
74 
75  // tracklet calculators
76  std::unique_ptr<IMATH_TrackletCalculator> ITC_L1L2_;
77  std::unique_ptr<IMATH_TrackletCalculator> ITC_L2L3_;
78  std::unique_ptr<IMATH_TrackletCalculator> ITC_L3L4_;
79  std::unique_ptr<IMATH_TrackletCalculator> ITC_L5L6_;
80 
81  std::unique_ptr<IMATH_TrackletCalculatorDisk> ITC_F1F2_;
82  std::unique_ptr<IMATH_TrackletCalculatorDisk> ITC_F3F4_;
83  std::unique_ptr<IMATH_TrackletCalculatorDisk> ITC_B1B2_;
84  std::unique_ptr<IMATH_TrackletCalculatorDisk> ITC_B3B4_;
85 
86  std::unique_ptr<IMATH_TrackletCalculatorOverlap> ITC_L1F1_;
87  std::unique_ptr<IMATH_TrackletCalculatorOverlap> ITC_L2F1_;
88  std::unique_ptr<IMATH_TrackletCalculatorOverlap> ITC_L1B1_;
89  std::unique_ptr<IMATH_TrackletCalculatorOverlap> ITC_L2B1_;
90 
91  SLHCEvent* theEvent_{nullptr};
92 
94 
96 
97 #ifdef USEHYBRID
98  std::unique_ptr<tmtt::Settings> tmttSettings_;
99  std::unique_ptr<tmtt::KFParamsComb> tmttKFParamsComb_;
100 #endif
101 
102  std::array<TrackletLUT*, 6> thePhiCorr_{{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}};
103 
104  std::map<std::string, std::vector<int> > ILindex_;
105 
106  std::map<std::string, int> layerdiskmap_;
107  };
108 }; // namespace trklet
109 
110 #endif
std::map< std::string, int > layerdiskmap_
Definition: Globals.h:106
std::unique_ptr< IMATH_TrackletCalculatorOverlap > ITC_L2B1_
Definition: Globals.h:89
std::unique_ptr< IMATH_TrackletCalculatorDisk > ITC_F1F2_
Definition: Globals.h:81
Globals(Settings const &settings)
Definition: Globals.cc:14
IMATH_TrackletCalculator * ITC_L2L3()
Definition: Globals.h:49
std::unique_ptr< IMATH_TrackletCalculatorOverlap > ITC_L1B1_
Definition: Globals.h:88
std::unique_ptr< IMATH_TrackletCalculatorDisk > ITC_B3B4_
Definition: Globals.h:84
std::unique_ptr< IMATH_TrackletCalculator > ITC_L3L4_
Definition: Globals.h:78
std::map< std::string, std::vector< int > > & ILindex()
Definition: Globals.h:44
std::unique_ptr< IMATH_TrackletCalculator > ITC_L2L3_
Definition: Globals.h:77
std::unique_ptr< IMATH_TrackletCalculatorOverlap > ITC_L1F1_
Definition: Globals.h:86
IMATH_TrackletCalculatorOverlap * ITC_L2B1()
Definition: Globals.h:61
IMATH_TrackletCalculatorDisk * ITC_B1B2()
Definition: Globals.h:55
TrackDerTable * trackDerTable_
Definition: Globals.h:95
std::unique_ptr< IMATH_TrackletCalculatorDisk > ITC_B1B2_
Definition: Globals.h:83
constexpr std::array< uint8_t, layerIndexSize > layer
std::map< std::string, std::vector< int > > ILindex_
Definition: Globals.h:104
IMATH_TrackletCalculatorDisk * ITC_F3F4()
Definition: Globals.h:54
IMATH_TrackletCalculatorOverlap * ITC_L1F1()
Definition: Globals.h:58
std::unique_ptr< IMATH_TrackletCalculatorOverlap > ITC_L2F1_
Definition: Globals.h:87
IMATH_TrackletCalculator * ITC_L1L2()
Definition: Globals.h:48
TrackletLUT *& phiCorr(unsigned int layer)
Definition: Globals.h:42
std::unique_ptr< IMATH_TrackletCalculatorDisk > ITC_F3F4_
Definition: Globals.h:82
std::unique_ptr< imathGlobals > imathGlobals_
Definition: Globals.h:73
HistBase * theHistBase_
Definition: Globals.h:93
std::unique_ptr< IMATH_TrackletCalculator > ITC_L5L6_
Definition: Globals.h:79
IMATH_TrackletCalculatorDisk * ITC_B3B4()
Definition: Globals.h:56
std::unordered_map< std::string, std::ofstream * > ofstreams_
Definition: Globals.h:71
IMATH_TrackletCalculatorDisk * ITC_F1F2()
Definition: Globals.h:53
std::map< std::string, int > & layerdiskmap()
Definition: Globals.h:46
SLHCEvent *& event()
Definition: Globals.h:36
IMATH_TrackletCalculator * ITC_L5L6()
Definition: Globals.h:51
string fname
main script
IMATH_TrackletCalculator * ITC_L3L4()
Definition: Globals.h:50
IMATH_TrackletCalculatorOverlap * ITC_L1B1()
Definition: Globals.h:59
IMATH_TrackletCalculatorOverlap * ITC_L2F1()
Definition: Globals.h:60
std::ofstream & ofstream(std::string fname)
Definition: Globals.cc:44
SLHCEvent * theEvent_
Definition: Globals.h:91
TrackDerTable *& trackDerTable()
Definition: Globals.h:40
HistBase *& histograms()
Definition: Globals.h:38
std::array< TrackletLUT *, 6 > thePhiCorr_
Definition: Globals.h:102
std::unique_ptr< IMATH_TrackletCalculator > ITC_L1L2_
Definition: Globals.h:76