CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EgHLTMonElemWithCutEBEE.h
Go to the documentation of this file.
1 #ifndef DQMOFFLINE_TRIGGER_EGHLTMONELEMWITHCUTEBEE
2 #define DQMOFFLINE_TRIGGER_EGHLTMONELEMWITHCUTEBEE
3 
4 //struct: MonElemWithEBEE (Monitor Element Manger With Cut 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 MonElemWithCuts, 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>
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, nullptr),
39  endcap_(iBooker, name + "_ee", "Endcap " + title, nrBins, min, max, varFunc, nullptr) {}
40 
42  const std::string& name,
43  const std::string& title,
44  int nrBins,
45  float min,
46  float max,
47  varType (T::*varFunc)() const,
48  const EgHLTDQMCut<T>* cut)
49  : barrel_(iBooker, name + "_eb", "Barrel " + title, nrBins, min, max, varFunc, cut),
50  endcap_(iBooker, name + "_ee", "Endcap " + title, nrBins, min, max, varFunc, cut ? cut->clone() : nullptr) {}
51  ~MonElemWithCutEBEE() override = default;
52 
53  void fill(const T& obj, const OffEvt& evt, float weight) override;
54  };
55 } // namespace egHLT
56 
57 template <class T, typename varType>
59  if (std::fabs(obj.detEta()) < 1.5)
60  barrel_.fill(obj, evt, weight);
61  else
62  endcap_.fill(obj, evt, weight);
63 }
64 
65 #endif
MonElemWithCut< T, varType > barrel_
MonElemWithCut< T, varType > endcap_
MonElemWithCutEBEE(DQMStore::IBooker &iBooker, const std::string &name, const std::string &title, int nrBins, float min, float max, varType(T::*varFunc)() const, const EgHLTDQMCut< T > *cut)
T min(T a, T b)
Definition: MathUtil.h:58
MonElemWithCutEBEE(DQMStore::IBooker &iBooker, const std::string &name, const std::string &title, int nrBins, float min, float max, varType(T::*varFunc)() const)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
void fill(const T &obj, const OffEvt &evt, float weight) override
~MonElemWithCutEBEE() override=default
int weight
Definition: histoStyle.py:51
long double T