CMS 3D CMS Logo

MonElemMgrEBEE.h

Go to the documentation of this file.
00001 #ifndef DQMOFFLINE_TRIGGER_MONELEMMGREBEE
00002 #define DQMOFFLINE_TRIGGER_MONELEMMGREBEE
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/MonElemManager.h"
00020 
00021 template<class T,typename varType> class MonElemMgrEBEE : public MonElemManagerBase<T>{
00022 private:
00023   MonElemManager<T,varType> barrel_;
00024   MonElemManager<T,varType> endcap_;
00025 
00026 public: 
00027   MonElemMgrEBEE(const std::string& name,const std::string& title,int nrBins,float min,float max,varType (T::*varFunc)()const):
00028     barrel_(name+"_eb","Barrel "+title,nrBins,min,max,varFunc),
00029     endcap_(name+"_ee","Endcap "+title,nrBins,min,max,varFunc){}
00030   
00031   ~MonElemMgrEBEE(){}
00032 
00033   void fill(const T& obj,float weight);
00034 
00035 };
00036 
00037 template<class T,typename varType> void MonElemMgrEBEE<T,varType>::fill(const T& obj,float weight)
00038 {
00039   if(fabs(obj.detEta())<1.5) barrel_.fill(obj,weight);
00040   else endcap_.fill(obj,weight);
00041 }
00042 
00043 
00044 
00045 
00046 
00047 template<class T,typename varTypeX,typename varTypeY> class MonElemMgr2DEBEE : public MonElemManagerBase<T>{
00048 
00049 private:
00050   MonElemManager2D<T,varTypeX,varTypeY> barrel_;
00051   MonElemManager2D<T,varTypeX,varTypeY> endcap_;
00052 
00053 public:
00054   MonElemMgr2DEBEE(const std::string& name,const std::string& title,int nrBinsX,double xMin,double xMax,int nrBinsY,double yMin,double yMax,
00055                  varTypeX (T::*varFuncX)()const,varTypeY (T::*varFuncY)()const):
00056     barrel_(name+"_eb","Barrel "+title,nrBinsX,xMin,xMax,nrBinsY,yMin,yMax,varFuncX,varFuncY),
00057     endcap_(name+"_ee","Endcap "+title,nrBinsX,xMin,xMax,nrBinsY,yMin,yMax,varFuncX,varFuncY){}
00058   
00059   ~MonElemMgr2DEBEE(){}
00060 
00061   void fill(const T& obj,float weight);
00062 
00063 };
00064 
00065 template<class T,typename varTypeX,typename varTypeY> void MonElemMgr2DEBEE<T,varTypeX,varTypeY>::fill(const T& obj,float weight)
00066 {
00067   if(fabs(obj.detEta())<1.5) barrel_.fill(obj,weight);
00068   else endcap_.fill(obj,weight);
00069 }
00070 
00071 #endif

Generated on Tue Jun 9 17:34:09 2009 for CMSSW by  doxygen 1.5.4