CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EgHLTMonElemWithCutEBEE.h
Go to the documentation of this file.
1 #ifndef DQMOFFLINE_TRIGGER_EGHLTMONELEMWITHCUTEBEE
2 #define DQMOFFLINE_TRIGGER_EGHLTMONELEMWITHCUTEBEE
3 
4 //struct: MonElemWithEBEE (Monitor Element Manger With Cut 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 MonElemWithCuts, 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 MonElemWithCutEBEE : public MonElemWithCutBase<T>{
23  private:
26 
27  public:
28  MonElemWithCutEBEE(DQMStore::IBooker &iBooker,const std::string& name,const std::string& title,int nrBins,float min,float max,
29  varType (T::*varFunc)()const):
30  barrel_(iBooker,name+"_eb","Barrel "+title,nrBins,min,max,varFunc,NULL),
31  endcap_(iBooker,name+"_ee","Endcap "+title,nrBins,min,max,varFunc,NULL){}
32 
33  MonElemWithCutEBEE(DQMStore::IBooker &iBooker,const std::string& name,const std::string& title,int nrBins,float min,float max,
34  varType (T::*varFunc)()const,const EgHLTDQMCut<T>* cut):
35  barrel_(iBooker,name+"_eb","Barrel "+title,nrBins,min,max,varFunc,cut),
36  endcap_(iBooker,name+"_ee","Endcap "+title,nrBins,min,max,varFunc,cut ? cut->clone() : NULL){}
38 
39  void fill(const T& obj,const OffEvt& evt,float weight);
40 
41  };
42 }
43 
44 template<class T,typename varType> void egHLT::MonElemWithCutEBEE<T,varType>::fill(const T& obj,const OffEvt& evt,float weight)
45 {
46  if(fabs(obj.detEta())<1.5) barrel_.fill(obj,evt,weight);
47  else endcap_.fill(obj,evt,weight);
48 }
49 
50 
51 #endif
void fill(const T &obj, const OffEvt &evt, float weight)
#define NULL
Definition: scimark2.h:8
MonElemWithCutEBEE(DQMStore::IBooker &iBooker, const std::string &name, const std::string &title, int nrBins, float min, float max, varType(T::*varFunc)() const, const EgHLTDQMCut< T > *cut)
T min(T a, T b)
Definition: MathUtil.h:58
MonElemWithCutEBEE(DQMStore::IBooker &iBooker, const std::string &name, const std::string &title, int nrBins, float min, float max, varType(T::*varFunc)() const)
MonElemWithCut< T, varType > endcap_
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
MonElemWithCut< T, varType > barrel_
int weight
Definition: histoStyle.py:50
long double T