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,
298 const OffEle* tagEle =
nullptr;
299 const std::vector<OffEle>& eles = evt.
eles();
301 for (
const auto& ele : eles) {
302 if (((ele.*tagCutCodeFunc_)() & tagCutCode_) == 0x0) {
304 if (
reco::deltaR2(obj.eta(), obj.phi(), ele.eta(), ele.phi()) >
313 if (((obj.*probeCutCodeFunc_)() & probeCutCode_) == 0x0) {
314 float mass = (obj.p4() + tagEle->
p4()).
mag();
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();
349 for (
const auto&
jet : jets) {
353 if (dPhi > minDPhi_ && dPhi < maxDPhi_)
358 return nrProbes == 1 && b2bJet;
378 const std::vector<reco::CaloJet>&
jets = evt.
jets();
379 for (
const auto&
jet : 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
EgHLTDQMCut< T > * clone() const
~EgObjTrigCut() override=default
TrigCodes::TrigBitSet bit1ToPass_
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
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)
bool pass(const T &obj, const OffEvt &evt) const override
EgHLTDQMCut & operator=(const EgHLTDQMCut &rhs)
EgHLTDQMCut< T > * clone() const override
~EgDiPhoUserCut() override=default
int(OffEle::* tagCutCodeFunc_)() const
EgHLTDQMCut< T > * clone() const override
int(T::* probeCutCodeFunc_)() const
~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)
varType(T::* varFunc_)() const
TrigCodes::TrigBitSet evtTrigBits() const
EgHLTDQMCut< OffEle > * clone() const override
bool pass(const T &obj, const OffEvt &evt) const
int(T::* cutCodeFunc_)(const Key &) const
int(OffEle::* cutCodeFunc_)() const
~ChargeCut() override=default
bool pass(const OffPho &obj, const OffEvt &evt) const override
TrigCodes::TrigBitSet bit2ToPass_
EgHLTDQMCut< T > * clone() const
EgHLTDQMCut< T > * clone() const override
tuple key
prepare the HTCondor submission files and eventually submit them
EgHLTDQMCut< T > * clone() const override
const std::vector< reco::CaloJet > & jets() const
TrigCodes::TrigBitSet bitsToPass_
int(OffEle::* probeCutCodeFunc_)() const
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
TrigCodes::TrigBitSet bitsToFail_
EgHLTDQMCut< OffPho > * clone() const override
TrigCodes::TrigBitSet bitsToPass_
const std::vector< OffPho > & phos() const
EgNotCut(EgHLTDQMCut< T > *cut)
int(OffPho::* cutCodeFunc_)(const Key &) const
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
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)
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)
const std::vector< OffEle > & eles() const
int(OffEle::* cutCodeFunc_)(const Key &) const
TrigCodes::TrigBitSet bitsToPass_
EgHLTDQMCut< OffEle > * clone() const override
int(OffEle::* cutCodeFunc_)() const
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)
~EgTrigTagProbeCut() override=default
EgNotCut(const EgNotCut< T > &rhs)
bool pass(const T &obj, const OffEvt &evt) const override
const math::XYZTLorentzVector & p4() const
~EgTrigTagProbeCut_New() override=default
bool pass(const T &obj, const OffEvt &evt) const
int(T::* cutCodeFunc_)() const
virtual ~EgHLTDQMCut()=default
~EgHLTDQMVarCut() override=default
int(OffPho::* cutCodeFunc_)() const
int(OffEle::* cutCodeFunc_)() const
EgDiEleCut(int cutCode, int(OffEle::*cutCodeFunc)() const)
~EgTagProbeCut() override=default
std::bitset< maxNrBits_ > TrigBitSet
int(OffPho::* cutCodeFunc_)() const
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
TrigCodes::TrigBitSet bit2ToPass_
bool pass(const OffEle &obj, const OffEvt &evt) const override