CMS 3D CMS Logo

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> class MonElemMgrEBEE : public MonElemManagerBase<T>{
25  private:
28 
29  public:
30  MonElemMgrEBEE(DQMStore::IBooker &iBooker, const std::string& name,const std::string& title,int nrBins,float min,float max,varType (T::*varFunc)()const):
31  barrel_(iBooker, name+"_eb","Barrel "+title,nrBins,min,max,varFunc),
32  endcap_(iBooker, name+"_ee","Endcap "+title,nrBins,min,max,varFunc){}
33 
34  ~MonElemMgrEBEE() override= default;
35 
36  void fill(const T& obj,float weight) override;
37 
38  };
39 
40  template<class T,typename varType> void MonElemMgrEBEE<T,varType>::fill(const T& obj,float weight)
41  {
42  if(std::fabs(obj.detEta())<1.5) barrel_.fill(obj,weight);
43  else endcap_.fill(obj,weight);
44  }
45 
46 
47 
48 
49 
50  template<class T,typename varTypeX,typename varTypeY> class MonElemMgr2DEBEE : public MonElemManagerBase<T>{
51 
52  private:
55 
56  public:
57  MonElemMgr2DEBEE(DQMStore::IBooker &iBooker, const std::string& name,const std::string& title,int nrBinsX,double xMin,double xMax,int nrBinsY,double yMin,double yMax,
58  varTypeX (T::*varFuncX)()const,varTypeY (T::*varFuncY)()const):
59  barrel_(iBooker, name+"_eb","Barrel "+title,nrBinsX,xMin,xMax,nrBinsY,yMin,yMax,varFuncX,varFuncY),
60  endcap_(iBooker, name+"_ee","Endcap "+title,nrBinsX,xMin,xMax,nrBinsY,yMin,yMax,varFuncX,varFuncY){}
61 
62  ~MonElemMgr2DEBEE()= default;
63 
64  void fill(const T& obj,float weight);
65 
66  };
67 
68  template<class T,typename varTypeX,typename varTypeY> void MonElemMgr2DEBEE<T,varTypeX,varTypeY>::fill(const T& obj,float weight)
69  {
70  if(fabs(obj.detEta())<1.5) barrel_.fill(obj,weight);
71  else endcap_.fill(obj,weight);
72  }
73 }
74 #endif
75 
MonElemManager< T, varType > barrel_
void fill(const T &obj, float weight) override
~MonElemMgrEBEE() override=default
MonElemManager2D< T, varTypeX, varTypeY > barrel_
Definition: weight.py:1
void fill(const T &obj, float weight) override
T min(T a, T b)
Definition: MathUtil.h:58
MonElemManager< T, varType > endcap_
MonElemMgrEBEE(DQMStore::IBooker &iBooker, const std::string &name, const std::string &title, int nrBins, float min, float max, varType(T::*varFunc)() const)
MonElemManager2D< T, varTypeX, varTypeY > endcap_
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)
void fill(const T &obj, float weight) override
long double T