File indexing completed on 2024-04-06 12:09:50
0001 #ifndef DQMOFFLINE_TRIGGER_EGHLTMONELEMWITHCUTEBEE
0002 #define DQMOFFLINE_TRIGGER_EGHLTMONELEMWITHCUTEBEE
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
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 }
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