CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/DQMOffline/Trigger/interface/EgHLTMonElemWithCutEBEE.h

Go to the documentation of this file.
00001 #ifndef DQMOFFLINE_TRIGGER_EGHLTMONELEMWITHCUTEBEE
00002 #define DQMOFFLINE_TRIGGER_EGHLTMONELEMWITHCUTEBEE
00003 
00004 //struct: MonElemWithEBEE (Monitor Element Manger With Cut 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 MonElemWithCuts, 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/EgHLTMonElemWithCut.h"
00020 
00021 namespace egHLT {
00022   template<class T,typename varType> class MonElemWithCutEBEE : public MonElemWithCutBase<T>{
00023   private:
00024     MonElemWithCut<T,varType> barrel_;
00025     MonElemWithCut<T,varType> endcap_;
00026     
00027   public: 
00028     MonElemWithCutEBEE(const std::string& name,const std::string& title,int nrBins,float min,float max,
00029                        varType (T::*varFunc)()const):
00030       barrel_(name+"_eb","Barrel "+title,nrBins,min,max,varFunc,NULL),
00031       endcap_(name+"_ee","Endcap "+title,nrBins,min,max,varFunc,NULL){}
00032     
00033     MonElemWithCutEBEE(const std::string& name,const std::string& title,int nrBins,float min,float max,
00034                        varType (T::*varFunc)()const,const EgHLTDQMCut<T>* cut):
00035       barrel_(name+"_eb","Barrel "+title,nrBins,min,max,varFunc,cut),
00036       endcap_(name+"_ee","Endcap "+title,nrBins,min,max,varFunc,cut ? cut->clone() : NULL){}
00037     ~MonElemWithCutEBEE(){}
00038     
00039     void fill(const T& obj,const OffEvt& evt,float weight);
00040     
00041   };
00042 }
00043 
00044 template<class T,typename varType> void egHLT::MonElemWithCutEBEE<T,varType>::fill(const T& obj,const OffEvt& evt,float weight)
00045 {
00046   if(fabs(obj.detEta())<1.5) barrel_.fill(obj,evt,weight);
00047   else endcap_.fill(obj,evt,weight);
00048 }
00049 
00050 
00051 #endif