CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/DQMOffline/Trigger/interface/EgHLTMonElemMgrEBEE.h

Go to the documentation of this file.
00001 #ifndef DQMOFFLINE_TRIGGER_EGHLTMONELEMMGREBEE
00002 #define DQMOFFLINE_TRIGGER_EGHLTMONELEMMGREBEE
00003 
00004 //struct: MonElemMgrEBEE (Monitor Element Manger Barrel and Endcap)
00005 //
00006 //author: Sam Harper (July 2008)
00007 //
00008 //WARNING: interface is NOT final, please dont use this class for now without clearing it with me
00009 //         as I will change it and possibly break all your code
00010 //
00011 //aim:  a monitor element which seperates transparently the objects into barrel and endcap
00012 //
00013 //implimentation: class simply has two MonElemMangers, one for endcap electrons, one for barrel electrons
00014 //                and fills them approprately. It assumes that the class passed in has a detEta function 
00015 //                and uses 1.5 as the barrel,endcap descriminate
00016 //       
00017 //      
00018 
00019 #include "DQMOffline/Trigger/interface/EgHLTMonElemManager.h"
00020 
00021 namespace egHLT {
00022   template<class T,typename varType> class MonElemMgrEBEE : public MonElemManagerBase<T>{
00023   private:
00024     MonElemManager<T,varType> barrel_;
00025     MonElemManager<T,varType> endcap_;
00026     
00027   public: 
00028     MonElemMgrEBEE(const std::string& name,const std::string& title,int nrBins,float min,float max,varType (T::*varFunc)()const):
00029       barrel_(name+"_eb","Barrel "+title,nrBins,min,max,varFunc),
00030       endcap_(name+"_ee","Endcap "+title,nrBins,min,max,varFunc){}
00031     
00032     ~MonElemMgrEBEE(){}
00033     
00034     void fill(const T& obj,float weight);
00035     
00036   };
00037   
00038   template<class T,typename varType> void MonElemMgrEBEE<T,varType>::fill(const T& obj,float weight)
00039   {
00040     if(fabs(obj.detEta())<1.5) barrel_.fill(obj,weight);
00041     else endcap_.fill(obj,weight);
00042   }
00043   
00044 
00045 
00046 
00047 
00048   template<class T,typename varTypeX,typename varTypeY> class MonElemMgr2DEBEE : public MonElemManagerBase<T>{
00049     
00050   private:
00051     MonElemManager2D<T,varTypeX,varTypeY> barrel_;
00052     MonElemManager2D<T,varTypeX,varTypeY> endcap_;
00053     
00054   public:
00055     MonElemMgr2DEBEE(const std::string& name,const std::string& title,int nrBinsX,double xMin,double xMax,int nrBinsY,double yMin,double yMax,
00056                      varTypeX (T::*varFuncX)()const,varTypeY (T::*varFuncY)()const):
00057       barrel_(name+"_eb","Barrel "+title,nrBinsX,xMin,xMax,nrBinsY,yMin,yMax,varFuncX,varFuncY),
00058       endcap_(name+"_ee","Endcap "+title,nrBinsX,xMin,xMax,nrBinsY,yMin,yMax,varFuncX,varFuncY){}
00059     
00060     ~MonElemMgr2DEBEE(){}
00061     
00062     void fill(const T& obj,float weight);
00063     
00064   };
00065   
00066   template<class T,typename varTypeX,typename varTypeY> void MonElemMgr2DEBEE<T,varTypeX,varTypeY>::fill(const T& obj,float weight)
00067   {
00068     if(fabs(obj.detEta())<1.5) barrel_.fill(obj,weight);
00069     else endcap_.fill(obj,weight);
00070   }
00071 }
00072 #endif
00073