1 #ifndef DQMOFFLINE_TRIGGER_EGHLTDQMCUT 2 #define DQMOFFLINE_TRIGGER_EGHLTDQMCUT 66 if (((
obj.*cutCodeFunc_)() & cutsToPass_) == 0)
73 template <
class T,
class Key>
89 template <
class T,
class Key>
91 if (((
obj.*cutCodeFunc_)(key_)&cutsNotToMask_) == 0)
97 template <
class T,
typename varType>
119 std::vector<const EgHLTDQMCut<T>*>
cuts_;
125 for (
size_t i = 0;
i <
cuts_.size();
i++)
140 for (
size_t cutNr = 0; cutNr < rhs.
cuts_.size(); cutNr++) {
141 cuts_.push_back(rhs.
cuts_[cutNr]->clone());
147 if (
typeid(*inputCut) ==
typeid(
EgMultiCut)) {
148 edm::LogError(
"EgMultiCut") <<
" Error can not currently load an EgMultiCut inside a EgMultiCut, the practical " 149 "upshot is that the selection you think is being loaded isnt ";
150 }
else if (inputCut ==
nullptr) {
151 edm::LogError(
"EgMultiCut") <<
"Error, cut being loaded is null, ignoring";
153 cuts_.push_back(inputCut);
159 for (
size_t i = 0;
i < cuts_.size();
i++) {
160 if (!cuts_[
i]->pass(
obj, evt))
201 bool passResult = passLogic_ ==
AND ? passMasked == bitsToPass_ : passMasked != 0x0;
202 bool failResult = failLogic_ ==
AND ? failMasked == bitsToFail_ : failMasked != 0x0;
203 if (bitsToFail_ == 0x0)
205 return passResult && !failResult;
232 return passLogic_ ==
AND ? passMasked == bitsToPass_ : passMasked != 0x0;
278 int (
T::*probeCutCodeFunc)()
const,
280 int (
OffEle::*tagCutCodeFunc)()
const,
299 const std::vector<OffEle>&
eles = evt.
eles();
301 for (
const auto& ele :
eles) {
302 if (((ele.*tagCutCodeFunc_)() & tagCutCode_) == 0x0) {
313 if (((
obj.*probeCutCodeFunc_)() & probeCutCode_) == 0x0) {
315 if (
mass > minMass_ &&
mass < maxMass_)
341 const std::vector<OffEle>&
eles = evt.
eles();
342 for (
const auto& ele :
eles) {
343 if (((ele.*probeCutCodeFunc_)() & probeCutCode_) == 0x0) {
348 const std::vector<reco::CaloJet>&
jets = evt.
jets();
353 if (dPhi > minDPhi_ && dPhi < maxDPhi_)
358 return nrProbes == 1 && b2bJet;
378 const std::vector<reco::CaloJet>&
jets = evt.
jets();
383 if (dPhi > minDPhi_ && dPhi < maxDPhi_ && fabs(1 -
jet.pt() /
obj.pt()) < ptRelDiff_)
423 const std::vector<OffEle>&
eles = evt.
eles();
424 for (
const auto& ele :
eles) {
426 int diEleCutCode = (
obj.*cutCodeFunc_)(key_) | (ele.*cutCodeFunc_)(key_);
427 if ((diEleCutCode & cutsNotToMask_) == 0x0)
467 const std::vector<OffPho>& phos = evt.
phos();
468 for (
const auto& pho : phos) {
471 int diPhoCutCode = (
obj.*cutCodeFunc_)(key_) | (pho.*cutCodeFunc_)(key_);
472 if ((diPhoCutCode & cutsNotToMask_) == 0x0)
494 int (
OffEle::*cutCodeFunc)()
const,
520 int (
OffEle::*cutCodeFunc)()
const,
548 int (
OffPho::*cutCodeFunc)()
const,
constexpr double deltaPhi(double phi1, double phi2)
std::vector< const EgHLTDQMCut< T > * > cuts_
EgHLTDQMCut< T > * clone() const override
EgHLTDQMCut< OffPho > * clone() const override
bool pass(const OffPho &pho, const OffEvt &evt) const override
bool pass(const T &obj, const OffEvt &evt) const
~EgObjTrigCut() override=default
const std::vector< reco::CaloJet > & jets() const
int(OffEle::* probeCutCodeFunc_)() const
EgHLTDQMCut< T > * clone() const
TrigCodes::TrigBitSet bit1ToPass_
EgHLTDQMCut< T > * clone() const override
bool pass(const T &obj, const OffEvt &evt) const override
virtual bool pass(const T &obj, const OffEvt &evt) const =0
EgHLTDQMCut< OffPho > * clone() const override
EgEvtTrigCut(TrigCodes::TrigBitSet bitsToPass, CutLogic passLogic=OR)
int(OffEle::* cutCodeFunc_)() const
bool pass(const T &obj, const OffEvt &evt) const override
int(T::* probeCutCodeFunc_)() const
EgHLTDQMCut & operator=(const EgHLTDQMCut &rhs)
const std::vector< OffEle > & eles() const
EgHLTDQMCut< T > * clone() const override
~EgDiPhoUserCut() override=default
const std::vector< OffPho > & phos() const
EgHLTDQMCut< T > * clone() const override
~EgHLTDQMUserVarCut() override=default
Log< level::Error, false > LogError
EgDiEleUserCut(int(OffEle::*cutCodeFunc)(const Key &) const, const Key &key, int cutsNotToMask=~0x0)
bool pass(const T &obj, const OffEvt &evt) const override
EgDiPhoUserCut(int(OffPho::*cutCodeFunc)(const Key &) const, const Key &key, int cutsNotToMask=~0x0)
EgHLTDQMCut< OffEle > * clone() const override
TrigCodes::TrigBitSet bit1ToPass_
EgMultiCut< T > & operator<<(const EgHLTDQMCut< T > *inputCut)
int(OffPho::* cutCodeFunc_)(const Key &) const
int(OffEle::* cutCodeFunc_)() const
EgHLTDQMCut< OffEle > * clone() const override
~ChargeCut() override=default
bool pass(const OffPho &obj, const OffEvt &evt) const override
TrigCodes::TrigBitSet bit2ToPass_
EgHLTDQMCut< T > * clone() const override
EgHLTDQMCut< T > * clone() const override
bool pass(const T &obj, const OffEvt &evt) const
TrigCodes::TrigBitSet bitsToPass_
EgJetTagProbeCut(int probeCutCode, int(T::*probeCutCodeFunc)() const, float minDPhi=-M_PI, float maxDPhi=M_PI)
virtual EgHLTDQMCut< T > * clone() const =0
bool pass(const T &obj, const OffEvt &evt) const override
~EgDiEleUserCut() override=default
~EgTrigTagProbeCut_NewPho() override=default
EgHLTDQMCut< T > * clone() const override
bool pass(const OffEle &ele, const OffEvt &evt) const override
bool pass(const OffEle &obj, const OffEvt &evt) const override
int(OffEle::* cutCodeFunc_)(const Key &) const
TrigCodes::TrigBitSet bitsToFail_
EgHLTDQMCut< OffPho > * clone() const override
bool pass(const T &obj, const OffEvt &evt) const
int(OffEle::* tagCutCodeFunc_)() const
TrigCodes::TrigBitSet bitsToPass_
EgNotCut(EgHLTDQMCut< T > *cut)
EgJetB2BCut(float minDPhi=-M_PI, float maxDPhi=M_PI, float ptRelDiff=999)
EgTrigTagProbeCut_NewPho(TrigCodes::TrigBitSet bit1ToPass, TrigCodes::TrigBitSet bit2ToPass, int cutCode, int(OffPho::*cutCodeFunc)() const, float minMass=81., float maxMass=101.)
bool pass(const OffPho &obj, const OffEvt &evt) const override
EgTagProbeCut(int probeCutCode, int(T::*probeCutCodeFunc)() const, int tagCutCode, int(OffEle::*tagCutCodeFunc)() const, float minMass=81., float maxMass=101.)
EgObjTrigCut(TrigCodes::TrigBitSet bitsToPass, CutLogic passLogic=OR, TrigCodes::TrigBitSet bitsToFail=TrigCodes::TrigBitSet(), CutLogic failLogic=AND)
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
EgHLTDQMUserVarCut(int(T::*cutCodeFunc)(const Key &) const, const Key &key, int cutsNotToMask=~0x0)
bool pass(const T &obj, const OffEvt &evt) const override
bool pass(const T &obj, const OffEvt &evt) const override
EgHLTDQMCut< T > * clone() const override
bool pass(const OffEle &ele, const OffEvt &evt) const override
EgGreaterCut(varType cutValue, varType(T::*varFunc)() const)
TrigCodes::TrigBitSet bitsToPass_
EgHLTDQMCut< OffEle > * clone() const override
int(OffEle::* cutCodeFunc_)() const
EgHLTDQMCut< T > * clone() const
EgTrigTagProbeCut(TrigCodes::TrigBitSet bitsToPass, int cutCode, int(OffEle::*cutCodeFunc)() const, float minMass=81., float maxMass=101.)
EgHLTDQMVarCut(int cutsToPass, int(T::*cutCodeFunc)() const)
int(OffPho::* cutCodeFunc_)() const
EgDiPhoCut(int cutCode, int(OffPho::*cutCodeFunc)() const)
~EgTrigTagProbeCut() override=default
EgNotCut(const EgNotCut< T > &rhs)
bool pass(const T &obj, const OffEvt &evt) const override
EgHLTDQMCut< T > * clone() const
~EgTrigTagProbeCut_New() override=default
virtual ~EgHLTDQMCut()=default
TrigCodes::TrigBitSet evtTrigBits() const
varType(T::* varFunc_)() const
~EgHLTDQMVarCut() override=default
int(T::* cutCodeFunc_)() const
EgDiEleCut(int cutCode, int(OffEle::*cutCodeFunc)() const)
~EgTagProbeCut() override=default
std::bitset< maxNrBits_ > TrigBitSet
EgTrigTagProbeCut_New(TrigCodes::TrigBitSet bit1ToPass, TrigCodes::TrigBitSet bit2ToPass, int cutCode, int(OffEle::*cutCodeFunc)() const, float minMass=81., float maxMass=101.)
EgHLTDQMCut< OffEle > * clone() const override
bool pass(const T &obj, const OffEvt &evt) const override
int(T::* cutCodeFunc_)(const Key &) const
TrigCodes::TrigBitSet bit2ToPass_
int(OffPho::* cutCodeFunc_)() const
bool pass(const OffEle &obj, const OffEvt &evt) const override