CMS 3D CMS Logo

APVGainHelpers.h
Go to the documentation of this file.
1 #ifndef CALIBTRACKER_SISTRIPCHANNELGAIN_APVGAINHELPERS_H
2 #define CALIBTRACKER_SISTRIPCHANNELGAIN_APVGAINHELPERS_H
3 
8 
9 #include <string>
10 #include <vector>
11 #include <utility>
12 #include <cstdint>
13 #include <unordered_map>
14 
15 namespace APVGain {
16 
18 
19  int subdetectorId(uint32_t);
20  int subdetectorId(const std::string&);
21  int subdetectorSide(uint32_t, const TrackerTopology*);
22  int thickness(uint32_t);
23  int thickness(const std::string& tag);
24  int subdetectorSide(const std::string&);
25  int subdetectorPlane(uint32_t, const TrackerTopology*);
26  int subdetectorPlane(const std::string&);
27 
28  std::vector<std::pair<std::string, std::string>> monHnames(std::vector<std::string>, bool, const char* tag);
29 
30  struct APVmon {
31  public:
32  APVmon(int v0, int v1, int v2, int v3, MonitorElement* v4)
34 
36 
38 
40 
41  int getThickness() { return m_thickness; }
42 
44 
45  void printAll() {
46  LogDebug("APVGainHelpers") << "subDetectorID:" << m_subdetectorId << std::endl;
47  LogDebug("APVGainHelpers") << "subDetectorSide:" << m_subdetectorSide << std::endl;
48  LogDebug("APVGainHelpers") << "subDetectorPlane:" << m_subdetectorPlane << std::endl;
49  LogDebug("APVGainHelpers") << "thickness:" << m_thickness << std::endl;
50  LogDebug("APVGainHelpers") << "histoName:" << m_monitor->getName() << std::endl;
51  return;
52  }
53 
54  private:
60  };
61 
63  public:
65  : EventStats(),
66  Charge_Vs_Index(7),
67  Charge_1(),
68  Charge_2(),
69  Charge_3(),
70  Charge_4(),
79  NStripAPVs(0),
80  NPixelDets(0),
82  APVsColl() {}
83 
85  std::vector<dqm::reco::MonitorElement*> Charge_Vs_Index;
86  std::array<std::vector<dqm::reco::MonitorElement*>, 7> Charge_1;
87  std::array<std::vector<dqm::reco::MonitorElement*>, 7> Charge_2;
88  std::array<std::vector<dqm::reco::MonitorElement*>, 7> Charge_3;
89  std::array<std::vector<dqm::reco::MonitorElement*>, 7>
92  std::vector<dqm::reco::MonitorElement*> Charge_Vs_PathlengthTIB;
93  std::vector<dqm::reco::MonitorElement*> Charge_Vs_PathlengthTOB;
94  std::vector<dqm::reco::MonitorElement*> Charge_Vs_PathlengthTIDP;
95  std::vector<dqm::reco::MonitorElement*> Charge_Vs_PathlengthTIDM;
96  std::vector<dqm::reco::MonitorElement*> Charge_Vs_PathlengthTECP1;
97  std::vector<dqm::reco::MonitorElement*> Charge_Vs_PathlengthTECP2;
98  std::vector<dqm::reco::MonitorElement*> Charge_Vs_PathlengthTECM1;
99  std::vector<dqm::reco::MonitorElement*> Charge_Vs_PathlengthTECM2;
100  mutable std::atomic<unsigned int> NStripAPVs;
101  mutable std::atomic<unsigned int> NPixelDets;
102  std::vector<std::shared_ptr<stAPVGain>> APVsCollOrdered;
103  std::unordered_map<unsigned int, std::shared_ptr<stAPVGain>> APVsColl;
104  };
105 
106  std::vector<MonitorElement*> FetchMonitor(std::vector<APVmon>, uint32_t, const TrackerTopology* topo = nullptr);
107  std::vector<unsigned int> FetchIndices(std::map<unsigned int, APVloc>,
108  uint32_t,
109  const TrackerTopology* topo = nullptr);
110 
111 }; // namespace APVGain
112 
113 #endif
std::array< std::vector< dqm::reco::MonitorElement * >, 7 > Charge_4
std::vector< unsigned int > FetchIndices(std::map< unsigned int, APVloc >, uint32_t, const TrackerTopology *topo=nullptr)
std::vector< dqm::reco::MonitorElement * > Charge_Vs_Index
std::vector< dqm::reco::MonitorElement * > Charge_Vs_PathlengthTOB
MonitorElement * m_monitor
int subdetectorPlane(uint32_t, const TrackerTopology *)
std::vector< dqm::reco::MonitorElement * > Charge_Vs_PathlengthTIDP
std::vector< dqm::reco::MonitorElement * > Charge_Vs_PathlengthTIDM
int getSubdetectorSide()
std::vector< dqm::reco::MonitorElement * > Charge_Vs_PathlengthTECP2
dqm::legacy::MonitorElement MonitorElement
std::atomic< unsigned int > NPixelDets
std::array< std::vector< dqm::reco::MonitorElement * >, 7 > Charge_3
std::atomic< unsigned int > NStripAPVs
std::vector< std::shared_ptr< stAPVGain > > APVsCollOrdered
std::vector< MonitorElement * > FetchMonitor(std::vector< APVmon >, uint32_t, const TrackerTopology *topo=nullptr)
int subdetectorSide(uint32_t, const TrackerTopology *)
int thickness(uint32_t)
std::unordered_map< unsigned int, std::shared_ptr< stAPVGain > > APVsColl
const std::string & getName() const
get name of ME
dqm::reco::MonitorElement * EventStats
APVmon(int v0, int v1, int v2, int v3, MonitorElement *v4)
std::array< std::vector< dqm::reco::MonitorElement * >, 7 > Charge_1
std::vector< dqm::reco::MonitorElement * > Charge_Vs_PathlengthTECM2
int getSubdetectorPlane()
MonitorElement * getMonitor()
std::array< std::vector< dqm::reco::MonitorElement * >, 7 > Charge_2
std::vector< dqm::reco::MonitorElement * > Charge_Vs_PathlengthTECM1
std::vector< std::pair< std::string, std::string > > monHnames(std::vector< std::string >, bool, const char *tag)
std::vector< dqm::reco::MonitorElement * > Charge_Vs_PathlengthTIB
int subdetectorId(uint32_t)
std::vector< dqm::reco::MonitorElement * > Charge_Vs_PathlengthTECP1
#define LogDebug(id)