Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:09:50

0001 #ifndef DQMOFFLINE_TRIGGER_EGHLTMONELEMWITHCUTEBEE
0002 #define DQMOFFLINE_TRIGGER_EGHLTMONELEMWITHCUTEBEE
0003 
0004 //struct: MonElemWithEBEE (Monitor Element Manger With Cut Barrel and Endcap)
0005 //
0006 //author: Sam Harper (July 2008)
0007 //
0008 //WARNING: interface is NOT final, please dont use this class for now without clearing it with me
0009 //         as I will change it and possibly break all your code
0010 //
0011 //aim:  a monitor element which seperates transparently the objects into barrel and endcap
0012 //
0013 //implimentation: class simply has two MonElemWithCuts, one for endcap electrons, one for barrel electrons
0014 //                and fills them approprately. It assumes that the class passed in has a detEta function
0015 //                and uses 1.5 as the barrel,endcap descriminate
0016 //
0017 //
0018 
0019 #include <cmath>
0020 
0021 #include "DQMOffline/Trigger/interface/EgHLTMonElemWithCut.h"
0022 
0023 namespace egHLT {
0024   template <class T, typename varType>
0025   class MonElemWithCutEBEE : public MonElemWithCutBase<T> {
0026   private:
0027     MonElemWithCut<T, varType> barrel_;
0028     MonElemWithCut<T, varType> endcap_;
0029 
0030   public:
0031     MonElemWithCutEBEE(DQMStore::IBooker& iBooker,
0032                        const std::string& name,
0033                        const std::string& title,
0034                        int nrBins,
0035                        float min,
0036                        float max,
0037                        varType (T::*varFunc)() const)
0038         : barrel_(iBooker, name + "_eb", "Barrel " + title, nrBins, min, max, varFunc, nullptr),
0039           endcap_(iBooker, name + "_ee", "Endcap " + title, nrBins, min, max, varFunc, nullptr) {}
0040 
0041     MonElemWithCutEBEE(DQMStore::IBooker& iBooker,
0042                        const std::string& name,
0043                        const std::string& title,
0044                        int nrBins,
0045                        float min,
0046                        float max,
0047                        varType (T::*varFunc)() const,
0048                        const EgHLTDQMCut<T>* cut)
0049         : barrel_(iBooker, name + "_eb", "Barrel " + title, nrBins, min, max, varFunc, cut),
0050           endcap_(iBooker, name + "_ee", "Endcap " + title, nrBins, min, max, varFunc, cut ? cut->clone() : nullptr) {}
0051     ~MonElemWithCutEBEE() override = default;
0052 
0053     void fill(const T& obj, const OffEvt& evt, float weight) override;
0054   };
0055 }  // namespace egHLT
0056 
0057 template <class T, typename varType>
0058 void egHLT::MonElemWithCutEBEE<T, varType>::fill(const T& obj, const OffEvt& evt, float weight) {
0059   if (std::fabs(obj.detEta()) < 1.5)
0060     barrel_.fill(obj, evt, weight);
0061   else
0062     endcap_.fill(obj, evt, weight);
0063 }
0064 
0065 #endif