1 #ifndef DQMOFFLINE_TRIGGER_EGHLTDQMCUT 2 #define DQMOFFLINE_TRIGGER_EGHLTDQMCUT 47 int (
T::*cutCodeFunc_)()
const;
50 EgHLTDQMVarCut(
int cutsToPass,
int (
T::*cutCodeFunc)()
const):cutsToPass_(cutsToPass),cutCodeFunc_(cutCodeFunc){}
66 if(((obj.*cutCodeFunc_)() & cutsToPass_)==0)
return true;
80 EgHLTDQMUserVarCut(
int (
T::*cutCodeFunc)(
const Key&)
const,
const Key&
key,
int cutsNotToMask=~0x0):cutCodeFunc_(cutCodeFunc),key_(key),cutsNotToMask_(cutsNotToMask){}
90 if(((obj.*cutCodeFunc_)(key_) & cutsNotToMask_)==0)
return true;
97 varType (
T::*varFunc_)()
const;
102 cutValue_(cutValue),varFunc_(varFunc){}
104 bool pass(
const T&
obj,
const OffEvt& evt)
const override{
return (obj.*varFunc_)()>cutValue_;}
116 std::vector<const EgHLTDQMCut<T>*>
cuts_;
135 for(
size_t cutNr=0;cutNr<rhs.
cuts_.size();cutNr++){
136 cuts_.push_back(rhs.
cuts_[cutNr]->clone());
144 edm::LogError(
"EgMultiCut") <<
" Error can not currently load an EgMultiCut inside a EgMultiCut, the practical upshot is that the selection you think is being loaded isnt ";
145 }
else if(inputCut==
nullptr){
146 edm::LogError(
"EgMultiCut") <<
"Error, cut being loaded is null, ignoring";
147 }
else cuts_.push_back(inputCut);
153 for(
size_t i=0;
i<cuts_.size();
i++){
154 if(!cuts_[
i]->
pass(obj,evt))
return false;
179 bitsToPass_(bitsToPass),passLogic_(passLogic),bitsToFail_(bitsToFail),failLogic_(failLogic){}
191 bool passResult = passLogic_==
AND ? passMasked==bitsToPass_ : passMasked!=0x0;
192 bool failResult = failLogic_==
AND ? failMasked==bitsToFail_ : failMasked!=0x0;
193 if(bitsToFail_==0x0) failResult=
false;
194 return passResult && !failResult;
221 return passLogic_==
AND ? passMasked==bitsToPass_ : passMasked!=0x0;
247 bool pass(
const T&
obj,
const OffEvt& evt)
const override{
return obj.charge()==charge_;}
256 int (
T::*probeCutCodeFunc_)()
const;
262 EgTagProbeCut(
int probeCutCode,
int (
T::*probeCutCodeFunc)()
const,
int tagCutCode,
int (
OffEle::*tagCutCodeFunc)()
const,
float minMass=81.,
float maxMass=101.):probeCutCode_(probeCutCode),probeCutCodeFunc_(probeCutCodeFunc),tagCutCode_(tagCutCode),tagCutCodeFunc_(tagCutCodeFunc),minMass_(
minMass),maxMass_(
maxMass){}
272 const OffEle* tagEle=
nullptr;
273 const std::vector<OffEle>& eles = evt.
eles();
275 for(
const auto & ele : eles){
276 if( ((ele.*tagCutCodeFunc_)() & tagCutCode_)==0x0){
278 if(
reco::deltaR2(obj.eta(),obj.phi(),ele.eta(),ele.phi())>0.1*0.1){
285 if(((obj.*probeCutCodeFunc_)() & probeCutCode_)==0x0){
286 float mass = (obj.p4()+tagEle->
p4()).
mag();
287 if(mass>minMass_ && mass<maxMass_)
return true;
302 probeCutCode_(probeCutCode),probeCutCodeFunc_(probeCutCodeFunc),minDPhi_(minDPhi),maxDPhi_(
maxDPhi){}
312 const std::vector<OffEle>& eles = evt.
eles();
313 for(
const auto & ele : eles){
314 if( ((ele.*probeCutCodeFunc_)() & probeCutCode_)==0x0){
319 const std::vector<reco::CaloJet>&
jets =evt.
jets();
320 for(
const auto &
jet : jets){
323 if(dPhi>minDPhi_ && dPhi<maxDPhi_) b2bJet=
true;
327 return nrProbes==1 && b2bJet;
341 minDPhi_(minDPhi),maxDPhi_(
maxDPhi),ptRelDiff_(ptRelDiff){}
352 const std::vector<reco::CaloJet>&
jets =evt.
jets();
353 for(
const auto &
jet : jets){
356 if(dPhi>minDPhi_ && dPhi<maxDPhi_ && fabs(1-
jet.pt()/obj.pt()) < ptRelDiff_) b2bJet=
true;
371 EgDiEleCut(
int cutCode,
int (
OffEle::*cutCodeFunc)()
const):cutCode_(cutCode),cutCodeFunc_(cutCodeFunc){}
383 EgDiEleUserCut(
int (
OffEle::*cutCodeFunc)(
const Key&)
const,
const Key&
key,
int cutsNotToMask=~0x0):cutCodeFunc_(cutCodeFunc),key_(key),cutsNotToMask_(cutsNotToMask){}
393 const std::vector<OffEle>& eles = evt.
eles();
394 for(
const auto & ele : eles){
396 int diEleCutCode = (obj.*cutCodeFunc_)(key_) | (ele.*cutCodeFunc_)(key_);
397 if( (diEleCutCode & cutsNotToMask_)==0x0)
return true;
411 EgDiPhoCut(
int cutCode,
int (
OffPho::*cutCodeFunc)()
const):cutCode_(cutCode),cutCodeFunc_(cutCodeFunc){}
424 EgDiPhoUserCut(
int (
OffPho::*cutCodeFunc)(
const Key&)
const,
const Key&
key,
int cutsNotToMask=~0x0):cutCodeFunc_(cutCodeFunc),key_(key),cutsNotToMask_(cutsNotToMask){}
434 const std::vector<OffPho>& phos = evt.
phos();
435 for(
const auto & pho : phos){
438 int diPhoCutCode = (obj.*cutCodeFunc_)(key_) | (pho.*cutCodeFunc_)(key_);
439 if( (diPhoCutCode & cutsNotToMask_)==0x0)
return true;
477 EgTrigTagProbeCut_New(
TrigCodes::TrigBitSet bit1ToPass,
TrigCodes::TrigBitSet bit2ToPass,
int cutCode,
int (
OffEle::*cutCodeFunc)()
const,
float minMass=81.,
float maxMass=101.):bit1ToPass_(bit1ToPass),bit2ToPass_(bit2ToPass),cutCode_(cutCode),cutCodeFunc_(cutCodeFunc),minMass_(
minMass),maxMass_(
maxMass){}
494 EgTrigTagProbeCut_NewPho(
TrigCodes::TrigBitSet bit1ToPass,
TrigCodes::TrigBitSet bit2ToPass,
int cutCode,
int (
OffPho::*cutCodeFunc)()
const,
float minMass=81.,
float maxMass=101.):bit1ToPass_(bit1ToPass),bit2ToPass_(bit2ToPass),cutCode_(cutCode),cutCodeFunc_(cutCodeFunc),minMass_(
minMass),maxMass_(
maxMass){}
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_