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{
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==
NULL){
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;
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){}
273 const std::vector<OffEle>& eles = evt.
eles();
275 for(
size_t eleNr=0;eleNr<eles.size();eleNr++){
276 if( ((eles[eleNr].*tagCutCodeFunc_)() & tagCutCode_)==0x0){
278 if(
reco::deltaR2(obj.eta(),obj.phi(),eles[eleNr].eta(),eles[eleNr].phi())>0.1*0.1){
280 tagEle = &eles[eleNr];
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(
size_t eleNr=0;eleNr<eles.size();eleNr++){
314 if( ((eles[eleNr].*probeCutCodeFunc_)() & probeCutCode_)==0x0){
319 const std::vector<reco::CaloJet>&
jets =evt.
jets();
320 for(
size_t jetNr=0;jetNr<jets.size();jetNr++){
321 if(
reco::deltaR2(obj.eta(),obj.phi(),jets[jetNr].eta(),jets[jetNr].phi())>0.1*0.1){
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(
size_t jetNr=0;jetNr<jets.size();jetNr++){
354 if(
reco::deltaR2(obj.eta(),obj.phi(),jets[jetNr].eta(),jets[jetNr].phi())>0.1*0.1){
356 if(dPhi>minDPhi_ && dPhi<maxDPhi_ && fabs(1-jets[jetNr].
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(
size_t eleNr=0;eleNr<eles.size();eleNr++){
395 if(&eles[eleNr]!=&obj){
396 int diEleCutCode = (obj.*cutCodeFunc_)(key_) | (eles[eleNr].*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(
size_t phoNr=0;phoNr<phos.size();phoNr++){
436 if(&phos[phoNr]!=&obj){
438 int diPhoCutCode = (obj.*cutCodeFunc_)(key_) | (phos[phoNr].*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){}
std::vector< const EgHLTDQMCut< T > * > cuts_
EgHLTDQMCut< T > * clone() const
bool pass(const T &obj, const OffEvt &evt) const
bool pass(const T &obj, const OffEvt &evt) const
TrigCodes::TrigBitSet bit1ToPass_
EgHLTDQMCut< T > * clone() const
virtual EgHLTDQMCut< T > * clone() const =0
EgHLTDQMCut< OffEle > * clone() const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
bool pass(const T &obj, const OffEvt &evt) const
EgEvtTrigCut(TrigCodes::TrigBitSet bitsToPass, CutLogic passLogic=OR)
EgHLTDQMCut & operator=(const EgHLTDQMCut &rhs)
EgHLTDQMCut< T > * clone() const
EgHLTDQMCut< T > * clone() const
bool pass(const T &obj, const OffEvt &evt) const
EgDiEleUserCut(int(OffEle::*cutCodeFunc)(const Key &) const, const Key &key, int cutsNotToMask=~0x0)
bool pass(const T &obj, const OffEvt &evt) const
EgDiPhoUserCut(int(OffPho::*cutCodeFunc)(const Key &) const, const Key &key, int cutsNotToMask=~0x0)
TrigCodes::TrigBitSet bit1ToPass_
EgHLTDQMCut< T > * clone() const
EgMultiCut< T > & operator<<(const EgHLTDQMCut< T > *inputCut)
TrigCodes::TrigBitSet evtTrigBits() const
double dPhi(double phi1, double phi2)
bool pass(const T &obj, const OffEvt &evt) const
bool pass(const OffEle &obj, const OffEvt &evt) const
virtual bool pass(const T &obj, const OffEvt &evt) const =0
EgHLTDQMCut< OffEle > * clone() const
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)
EgHLTDQMCut< OffPho > * clone() const
EgHLTDQMCut< OffPho > * clone() const
TrigCodes::TrigBitSet bitsToFail_
EgHLTDQMCut(const EgHLTDQMCut &rhs)
TrigCodes::TrigBitSet bitsToPass_
const std::vector< OffPho > & phos() const
EgNotCut(EgHLTDQMCut< T > *cut)
double deltaPhi(double phi1, double phi2)
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.)
~EgTrigTagProbeCut_NewPho()
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)
bool pass(const T &obj, const OffEvt &evt) const
EgHLTDQMCut< T > * clone() const
EgHLTDQMUserVarCut(int(T::*cutCodeFunc)(const Key &) const, const Key &key, int cutsNotToMask=~0x0)
bool pass(const T &obj, const OffEvt &evt) const
EgHLTDQMCut< OffEle > * clone() const
EgHLTDQMCut< T > * clone() const
EgHLTDQMCut< T > * clone() const
EgGreaterCut(varType cutValue, varType(T::*varFunc)() const)
EgHLTDQMCut< T > * clone() const
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
const std::vector< OffEle > & eles() const
TrigCodes::TrigBitSet bitsToPass_
bool AND(const TrackBaseRef &track, const RecoTauQualityCuts::TrackQCutFuncCollection &cuts)
bool pass(const T &obj, const OffEvt &evt) 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)
EgNotCut(const EgNotCut< T > &rhs)
const math::XYZTLorentzVector & p4() const
bool pass(const T &obj, const OffEvt &evt) const
EgDiEleCut(int cutCode, int(OffEle::*cutCodeFunc)() const)
EgTrigTagProbeCut_New(TrigCodes::TrigBitSet bit1ToPass, TrigCodes::TrigBitSet bit2ToPass, int cutCode, int(OffEle::*cutCodeFunc)() const, float minMass=81., float maxMass=101.)
bool pass(const OffPho &obj, const OffEvt &evt) const
EgHLTDQMCut< OffEle > * clone() const
TrigCodes::TrigBitSet bit2ToPass_
std::bitset< maxNrBits_ > TrigBitSet
EgHLTDQMCut< OffPho > * clone() const