CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EgHLTMonElemMgrEBEE.h
Go to the documentation of this file.
1 #ifndef DQMOFFLINE_TRIGGER_EGHLTMONELEMMGREBEE
2 #define DQMOFFLINE_TRIGGER_EGHLTMONELEMMGREBEE
3 
4 //struct: MonElemMgrEBEE (Monitor Element Manger Barrel and Endcap)
5 //
6 //author: Sam Harper (July 2008)
7 //
8 //WARNING: interface is NOT final, please dont use this class for now without clearing it with me
9 // as I will change it and possibly break all your code
10 //
11 //aim: a monitor element which seperates transparently the objects into barrel and endcap
12 //
13 //implimentation: class simply has two MonElemMangers, one for endcap electrons, one for barrel electrons
14 // and fills them approprately. It assumes that the class passed in has a detEta function
15 // and uses 1.5 as the barrel,endcap descriminate
16 //
17 //
18 
19 #include <cmath>
20 
22 
23 namespace egHLT {
24  template <class T, typename varType>
25  class MonElemMgrEBEE : public MonElemManagerBase<T> {
26  private:
29 
30  public:
32  const std::string& name,
33  const std::string& title,
34  int nrBins,
35  float min,
36  float max,
37  varType (T::*varFunc)() const)
38  : barrel_(iBooker, name + "_eb", "Barrel " + title, nrBins, min, max, varFunc),
39  endcap_(iBooker, name + "_ee", "Endcap " + title, nrBins, min, max, varFunc) {}
40 
41  ~MonElemMgrEBEE() override = default;
42 
43  void fill(const T& obj, float weight) override;
44  };
45 
46  template <class T, typename varType>
48  if (std::fabs(obj.detEta()) < 1.5)
49  barrel_.fill(obj, weight);
50  else
51  endcap_.fill(obj, weight);
52  }
53 
54  template <class T, typename varTypeX, typename varTypeY>
56  private:
59 
60  public:
62  const std::string& name,
63  const std::string& title,
64  int nrBinsX,
65  double xMin,
66  double xMax,
67  int nrBinsY,
68  double yMin,
69  double yMax,
70  varTypeX (T::*varFuncX)() const,
71  varTypeY (T::*varFuncY)() const)
72  : barrel_(
73  iBooker, name + "_eb", "Barrel " + title, nrBinsX, xMin, xMax, nrBinsY, yMin, yMax, varFuncX, varFuncY),
74  endcap_(
75  iBooker, name + "_ee", "Endcap " + title, nrBinsX, xMin, xMax, nrBinsY, yMin, yMax, varFuncX, varFuncY) {}
76 
77  ~MonElemMgr2DEBEE() = default;
78 
79  void fill(const T& obj, float weight);
80  };
81 
82  template <class T, typename varTypeX, typename varTypeY>
84  if (fabs(obj.detEta()) < 1.5)
85  barrel_.fill(obj, weight);
86  else
87  endcap_.fill(obj, weight);
88  }
89 } // namespace egHLT
90 #endif
MonElemManager2D< T, varTypeX, varTypeY > barrel_
MonElemManager2D< T, varTypeX, varTypeY > endcap_
~MonElemMgrEBEE() override=default
MonElemManager< T, varType > endcap_
void fill(const T &obj, float weight) override
MonElemMgrEBEE(DQMStore::IBooker &iBooker, const std::string &name, const std::string &title, int nrBins, float min, float max, varType(T::*varFunc)() const)
void fill(const T &obj, float weight)
MonElemMgr2DEBEE(DQMStore::IBooker &iBooker, const std::string &name, const std::string &title, int nrBinsX, double xMin, double xMax, int nrBinsY, double yMin, double yMax, varTypeX(T::*varFuncX)() const, varTypeY(T::*varFuncY)() const)
int weight
Definition: histoStyle.py:51
long double T
MonElemManager< T, varType > barrel_