CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 
20 
21 namespace egHLT {
22  template<class T,typename varType> class MonElemMgrEBEE : public MonElemManagerBase<T>{
23  private:
26 
27  public:
28  MonElemMgrEBEE(const std::string& name,const std::string& title,int nrBins,float min,float max,varType (T::*varFunc)()const):
29  barrel_(name+"_eb","Barrel "+title,nrBins,min,max,varFunc),
30  endcap_(name+"_ee","Endcap "+title,nrBins,min,max,varFunc){}
31 
33 
34  void fill(const T& obj,float weight);
35 
36  };
37 
38  template<class T,typename varType> void MonElemMgrEBEE<T,varType>::fill(const T& obj,float weight)
39  {
40  if(fabs(obj.detEta())<1.5) barrel_.fill(obj,weight);
41  else endcap_.fill(obj,weight);
42  }
43 
44 
45 
46 
47 
48  template<class T,typename varTypeX,typename varTypeY> class MonElemMgr2DEBEE : public MonElemManagerBase<T>{
49 
50  private:
53 
54  public:
55  MonElemMgr2DEBEE(const std::string& name,const std::string& title,int nrBinsX,double xMin,double xMax,int nrBinsY,double yMin,double yMax,
56  varTypeX (T::*varFuncX)()const,varTypeY (T::*varFuncY)()const):
57  barrel_(name+"_eb","Barrel "+title,nrBinsX,xMin,xMax,nrBinsY,yMin,yMax,varFuncX,varFuncY),
58  endcap_(name+"_ee","Endcap "+title,nrBinsX,xMin,xMax,nrBinsY,yMin,yMax,varFuncX,varFuncY){}
59 
61 
62  void fill(const T& obj,float weight);
63 
64  };
65 
66  template<class T,typename varTypeX,typename varTypeY> void MonElemMgr2DEBEE<T,varTypeX,varTypeY>::fill(const T& obj,float weight)
67  {
68  if(fabs(obj.detEta())<1.5) barrel_.fill(obj,weight);
69  else endcap_.fill(obj,weight);
70  }
71 }
72 #endif
73 
MonElemManager< T, varType > barrel_
MonElemManager2D< T, varTypeX, varTypeY > barrel_
#define min(a, b)
Definition: mlp_lapack.h:161
const T & max(const T &a, const T &b)
void fill(const T &obj, float weight)
MonElemManager< T, varType > endcap_
MonElemManager2D< T, varTypeX, varTypeY > endcap_
MonElemMgr2DEBEE(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)
long double T
MonElemMgrEBEE(const std::string &name, const std::string &title, int nrBins, float min, float max, varType(T::*varFunc)() const)