CMS 3D CMS Logo

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 
19 #include <cmath>
20 
22 
23 namespace egHLT {
24  template<class T,typename varType> class MonElemWithCutEBEE : public MonElemWithCutBase<T>{
25  private:
28 
29  public:
30  MonElemWithCutEBEE(DQMStore::IBooker &iBooker,const std::string& name,const std::string& title,int nrBins,float min,float max,
31  varType (T::*varFunc)()const):
32  barrel_(iBooker,name+"_eb","Barrel "+title,nrBins,min,max,varFunc,nullptr),
33  endcap_(iBooker,name+"_ee","Endcap "+title,nrBins,min,max,varFunc,nullptr){}
34 
35  MonElemWithCutEBEE(DQMStore::IBooker &iBooker,const std::string& name,const std::string& title,int nrBins,float min,float max,
36  varType (T::*varFunc)()const,const EgHLTDQMCut<T>* cut):
37  barrel_(iBooker,name+"_eb","Barrel "+title,nrBins,min,max,varFunc,cut),
38  endcap_(iBooker,name+"_ee","Endcap "+title,nrBins,min,max,varFunc,cut ? cut->clone() : nullptr){}
39  ~MonElemWithCutEBEE() override= default;
40 
41  void fill(const T& obj,const OffEvt& evt,float weight) override;
42 
43  };
44 }
45 
46 template<class T,typename varType> void egHLT::MonElemWithCutEBEE<T,varType>::fill(const T& obj,const OffEvt& evt,float weight)
47 {
48  if(std::fabs(obj.detEta())<1.5) barrel_.fill(obj,evt,weight);
49  else endcap_.fill(obj,evt,weight);
50 }
51 
52 
53 #endif
void fill(const T &obj, const OffEvt &evt, float weight) override
Definition: weight.py:1
#define nullptr
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
void fill(const T &obj, const OffEvt &evt, float weight) override
~MonElemWithCutEBEE() override=default
MonElemWithCut< T, varType > barrel_
long double T