1 #ifndef DQMOFFLINE_TRIGGER_EGHLTDQMCUT 2 #define DQMOFFLINE_TRIGGER_EGHLTDQMCUT 46 int (
T::*cutCodeFunc_)()
const;
50 : cutsToPass_(cutsToPass), cutCodeFunc_(cutCodeFunc) {}
65 if (((obj.*cutCodeFunc_)() & cutsToPass_) == 0)
72 template <
class T,
class Key>
81 : cutCodeFunc_(cutCodeFunc), key_(key), cutsNotToMask_(cutsNotToMask) {}
88 template <
class T,
class Key>
90 if (((obj.*cutCodeFunc_)(key_)&cutsNotToMask_) == 0)
96 template <
class T,
typename varType>
105 bool pass(
const T&
obj,
const OffEvt& evt)
const override {
return (obj.*varFunc_)() > cutValue_; }
118 std::vector<const EgHLTDQMCut<T>*>
cuts_;
124 for (
size_t i = 0;
i < cuts_.size();
i++)
139 for (
size_t cutNr = 0; cutNr < rhs.
cuts_.size(); cutNr++) {
140 cuts_.push_back(rhs.
cuts_[cutNr]->clone());
146 if (
typeid(*inputCut) ==
typeid(
EgMultiCut)) {
147 edm::LogError(
"EgMultiCut") <<
" Error can not currently load an EgMultiCut inside a EgMultiCut, the practical " 148 "upshot is that the selection you think is being loaded isnt ";
149 }
else if (inputCut ==
nullptr) {
150 edm::LogError(
"EgMultiCut") <<
"Error, cut being loaded is null, ignoring";
152 cuts_.push_back(inputCut);
158 for (
size_t i = 0;
i < cuts_.size();
i++) {
159 if (!cuts_[
i]->
pass(obj, evt))
188 : bitsToPass_(bitsToPass), passLogic_(passLogic), bitsToFail_(bitsToFail), failLogic_(failLogic) {}
200 bool passResult = passLogic_ ==
AND ? passMasked == bitsToPass_ : passMasked != 0x0;
201 bool failResult = failLogic_ ==
AND ? failMasked == bitsToFail_ : failMasked != 0x0;
202 if (bitsToFail_ == 0x0)
204 return passResult && !failResult;
221 : bitsToPass_(bitsToPass), passLogic_(passLogic) {}
231 return passLogic_ ==
AND ? passMasked == bitsToPass_ : passMasked != 0x0;
259 bool pass(
const T&
obj,
const OffEvt& evt)
const override {
return obj.charge() == charge_; }
269 int (
T::*probeCutCodeFunc_)()
const;
277 int (
T::*probeCutCodeFunc)()
const,
279 int (
OffEle::*tagCutCodeFunc)()
const,
282 : probeCutCode_(probeCutCode),
283 probeCutCodeFunc_(probeCutCodeFunc),
284 tagCutCode_(tagCutCode),
285 tagCutCodeFunc_(tagCutCodeFunc),
298 const std::vector<OffEle>& eles = evt.
eles();
300 for (
const auto& ele : eles) {
301 if (((ele.*tagCutCodeFunc_)() & tagCutCode_) == 0x0) {
303 if (
reco::deltaR2(obj.eta(), obj.phi(), ele.eta(), ele.phi()) >
312 if (((obj.*probeCutCodeFunc_)() & probeCutCode_) == 0x0) {
313 float mass = (obj.p4() + tagEle->
p4()).
mag();
314 if (mass > minMass_ && mass < maxMass_)
332 : probeCutCode_(probeCutCode), probeCutCodeFunc_(probeCutCodeFunc), minDPhi_(minDPhi), maxDPhi_(
maxDPhi) {}
340 const std::vector<OffEle>& eles = evt.
eles();
341 for (
const auto& ele : eles) {
342 if (((ele.*probeCutCodeFunc_)() & probeCutCode_) == 0x0) {
347 const std::vector<reco::CaloJet>&
jets = evt.
jets();
348 for (
const auto&
jet : jets) {
352 if (dPhi > minDPhi_ && dPhi < maxDPhi_)
357 return nrProbes == 1 && b2bJet;
369 : minDPhi_(minDPhi), maxDPhi_(
maxDPhi), ptRelDiff_(ptRelDiff) {}
377 const std::vector<reco::CaloJet>&
jets = evt.
jets();
378 for (
const auto&
jet : jets) {
382 if (dPhi > minDPhi_ && dPhi < maxDPhi_ && fabs(1 -
jet.pt() / obj.pt()) < ptRelDiff_)
396 EgDiEleCut(
int cutCode,
int (
OffEle::*cutCodeFunc)()
const) : cutCode_(cutCode), cutCodeFunc_(cutCodeFunc) {}
411 : cutCodeFunc_(cutCodeFunc), key_(key), cutsNotToMask_(cutsNotToMask) {}
422 const std::vector<OffEle>& eles = evt.
eles();
423 for (
const auto& ele : eles) {
425 int diEleCutCode = (obj.*cutCodeFunc_)(key_) | (ele.*cutCodeFunc_)(key_);
426 if ((diEleCutCode & cutsNotToMask_) == 0x0)
440 EgDiPhoCut(
int cutCode,
int (
OffPho::*cutCodeFunc)()
const) : cutCode_(cutCode), cutCodeFunc_(cutCodeFunc) {}
455 : cutCodeFunc_(cutCodeFunc), key_(key), cutsNotToMask_(cutsNotToMask) {}
466 const std::vector<OffPho>& phos = evt.
phos();
467 for (
const auto& pho : phos) {
470 int diPhoCutCode = (obj.*cutCodeFunc_)(key_) | (pho.*cutCodeFunc_)(key_);
471 if ((diPhoCutCode & cutsNotToMask_) == 0x0)
493 int (
OffEle::*cutCodeFunc)()
const,
496 : bitsToPass_(bitsToPass), cutCode_(cutCode), cutCodeFunc_(cutCodeFunc), minMass_(
minMass), maxMass_(
maxMass) {}
519 int (
OffEle::*cutCodeFunc)()
const,
522 : bit1ToPass_(bit1ToPass),
523 bit2ToPass_(bit2ToPass),
525 cutCodeFunc_(cutCodeFunc),
547 int (
OffPho::*cutCodeFunc)()
const,
550 : bit1ToPass_(bit1ToPass),
551 bit2ToPass_(bit2ToPass),
553 cutCodeFunc_(cutCodeFunc),
constexpr double deltaPhi(double phi1, double phi2)
std::vector< const EgHLTDQMCut< T > * > cuts_
EgHLTDQMCut< OffEle > * clone() const override
EgHLTDQMCut< T > * clone() const override
bool pass(const T &obj, const OffEvt &evt) const override
EgHLTDQMCut< T > * clone() const
EgHLTDQMCut< OffEle > * clone() const override
EgHLTDQMCut< T > * clone() const override
bool pass(const T &obj, const OffEvt &evt) const override
TrigCodes::TrigBitSet bit1ToPass_
virtual EgHLTDQMCut< T > * clone() const =0
bool pass(const T &obj, const OffEvt &evt) const override
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
EgHLTDQMCut< OffPho > * clone() const override
EgEvtTrigCut(TrigCodes::TrigBitSet bitsToPass, CutLogic passLogic=OR)
EgHLTDQMCut & operator=(const EgHLTDQMCut &rhs)
EgHLTDQMCut< OffEle > * clone() const override
bool pass(const T &obj, const OffEvt &evt) const override
bool pass(const OffEle &obj, const OffEvt &evt) const override
EgDiEleUserCut(int(OffEle::*cutCodeFunc)(const Key &) const, const Key &key, int cutsNotToMask=~0x0)
EgHLTDQMCut< OffPho > * clone() const override
EgHLTDQMCut< T > * clone() const override
bool pass(const OffPho &obj, const OffEvt &evt) const override
EgDiPhoUserCut(int(OffPho::*cutCodeFunc)(const Key &) const, const Key &key, int cutsNotToMask=~0x0)
EgHLTDQMCut< T > * clone() const override
TrigCodes::TrigBitSet bit1ToPass_
EgHLTDQMCut< T > * clone() const override
EgMultiCut< T > & operator<<(const EgHLTDQMCut< T > *inputCut)
EgHLTDQMCut< OffEle > * clone() const override
TrigCodes::TrigBitSet evtTrigBits() const
bool pass(const T &obj, const OffEvt &evt) const
virtual bool pass(const T &obj, const OffEvt &evt) const =0
TrigCodes::TrigBitSet bit2ToPass_
EgHLTDQMCut< T > * clone() const
const std::vector< reco::CaloJet > & jets() const
TrigCodes::TrigBitSet bitsToPass_
EgJetTagProbeCut(int probeCutCode, int(T::*probeCutCodeFunc)() const, float minDPhi=-M_PI, float maxDPhi=M_PI)
TrigCodes::TrigBitSet bitsToFail_
TrigCodes::TrigBitSet bitsToPass_
const std::vector< OffPho > & phos() const
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 T &obj, const OffEvt &evt) const override
EgHLTDQMCut< T > * clone() const
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())
EgHLTDQMUserVarCut(int(T::*cutCodeFunc)(const Key &) const, const Key &key, int cutsNotToMask=~0x0)
EgHLTDQMCut< T > * clone() const override
EgHLTDQMCut< T > * clone() const override
EgGreaterCut(varType cutValue, varType(T::*varFunc)() const)
const std::vector< OffEle > & eles() const
TrigCodes::TrigBitSet bitsToPass_
bool AND(const TrackBaseRef &track, const RecoTauQualityCuts::TrackQCutFuncCollection &cuts)
EgHLTDQMCut< T > * clone() const override
EgTrigTagProbeCut(TrigCodes::TrigBitSet bitsToPass, int cutCode, int(OffEle::*cutCodeFunc)() const, float minMass=81., float maxMass=101.)
EgHLTDQMVarCut(int cutsToPass, int(T::*cutCodeFunc)() const)
bool pass(const T &obj, const OffEvt &evt) const
EgDiPhoCut(int cutCode, int(OffPho::*cutCodeFunc)() const)
EgNotCut(const EgNotCut< T > &rhs)
bool pass(const T &obj, const OffEvt &evt) const override
const math::XYZTLorentzVector & p4() const
bool pass(const T &obj, const OffEvt &evt) const override
bool pass(const T &obj, const OffEvt &evt) const override
bool pass(const T &obj, const OffEvt &evt) const
virtual ~EgHLTDQMCut()=default
EgDiEleCut(int cutCode, int(OffEle::*cutCodeFunc)() const)
std::bitset< maxNrBits_ > TrigBitSet
EgHLTDQMCut< OffPho > * clone() const override
EgTrigTagProbeCut_New(TrigCodes::TrigBitSet bit1ToPass, TrigCodes::TrigBitSet bit2ToPass, int cutCode, int(OffEle::*cutCodeFunc)() const, float minMass=81., float maxMass=101.)
TrigCodes::TrigBitSet bit2ToPass_