CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
egHLT::EgTrigTagProbeCut Struct Reference

#include <EgHLTDQMCut.h>

Inheritance diagram for egHLT::EgTrigTagProbeCut:
egHLT::EgHLTDQMCut< OffEle >

Public Member Functions

EgHLTDQMCut< OffEle > * clone () const override
 
 EgTrigTagProbeCut (TrigCodes::TrigBitSet bitsToPass, int cutCode, int(OffEle::*cutCodeFunc)() const, float minMass=81., float maxMass=101.)
 
bool pass (const OffEle &ele, const OffEvt &evt) const override
 
 ~EgTrigTagProbeCut () override=default
 
- Public Member Functions inherited from egHLT::EgHLTDQMCut< OffEle >
 EgHLTDQMCut ()=default
 
virtual ~EgHLTDQMCut ()=default
 

Private Attributes

TrigCodes::TrigBitSet bitsToPass_
 
int cutCode_
 
int(OffEle::* cutCodeFunc_ )() const
 
float maxMass_
 
float minMass_
 

Additional Inherited Members

- Protected Member Functions inherited from egHLT::EgHLTDQMCut< OffEle >
 EgHLTDQMCut (const EgHLTDQMCut &rhs)=default
 

Detailed Description

Definition at line 449 of file EgHLTDQMCut.h.

Constructor & Destructor Documentation

egHLT::EgTrigTagProbeCut::EgTrigTagProbeCut ( TrigCodes::TrigBitSet  bitsToPass,
int  cutCode,
int(OffEle::*)() const  cutCodeFunc,
float  minMass = 81.,
float  maxMass = 101. 
)
inline
egHLT::EgTrigTagProbeCut::~EgTrigTagProbeCut ( )
overridedefault

Member Function Documentation

EgHLTDQMCut<OffEle>* egHLT::EgTrigTagProbeCut::clone ( void  ) const
inlineoverridevirtual

Implements egHLT::EgHLTDQMCut< OffEle >.

Definition at line 461 of file EgHLTDQMCut.h.

461 {return new EgTrigTagProbeCut(*this);}
EgTrigTagProbeCut(TrigCodes::TrigBitSet bitsToPass, int cutCode, int(OffEle::*cutCodeFunc)() const, float minMass=81., float maxMass=101.)
Definition: EgHLTDQMCut.h:457
bool EgTrigTagProbeCut::pass ( const OffEle ele,
const OffEvt evt 
) const
overridevirtual

Implements egHLT::EgHLTDQMCut< OffEle >.

Definition at line 5 of file EgHLTDQMCut.cc.

References bitsToPass_, cutCode_, cutCodeFunc_, reco::deltaR2(), egHLT::OffEvt::eles(), egHLT::OffEle::eta(), mag(), ResonanceBuilder::mass, maxMass_, minMass_, egHLT::OffEle::p4(), and egHLT::OffEle::phi().

6 {
7  //first we check if our electron passes our id
8  if( ((theEle.*cutCodeFunc_)() & cutCode_)!=0x0) return false;
9 
10  //new we check that there is another tag in the event (this electron may be a tag, we are not going to test this, all we care about is that another electron in the event is a tag)
11  int nrTags=0;
12  const OffEle* tagEle=nullptr;
13  const std::vector<OffEle>& eles = evt.eles();
14  //we are looking for an *additional* tag
15  for(auto const & ele : eles){
16  if( ((ele.*cutCodeFunc_)() & cutCode_)==0x0 && (bitsToPass_&ele.trigBits())==bitsToPass_){
17  //now a check that the tag is not the same as the probe
18  if(reco::deltaR2(theEle.eta(),theEle.phi(),ele.eta(),ele.phi())>0.1*0.1){//not in a cone of 0.1 of probe electron
19  nrTags++;
20  tagEle = &ele;
21  }
22  }
23  }
24  if(nrTags==1){ //we are requiring one and only one additional tag (the theEle is automatically excluded from the tag list)
25  float mass = (theEle.p4()+tagEle->p4()).mag();
26  if(mass>minMass_ && mass<maxMass_) return true; //mass requirements
27  }
28  return false;
29 }
float eta() const
Definition: EgHLTOffEle.h:120
TrigCodes::TrigBitSet trigBits() const
Definition: EgHLTOffEle.h:219
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
int(OffEle::* cutCodeFunc_)() const
Definition: EgHLTDQMCut.h:453
float phi() const
Definition: EgHLTOffEle.h:121
TrigCodes::TrigBitSet bitsToPass_
Definition: EgHLTDQMCut.h:451
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
const std::vector< OffEle > & eles() const
Definition: EgHLTOffEvt.h:48
const math::XYZTLorentzVector & p4() const
Definition: EgHLTOffEle.h:128

Member Data Documentation

TrigCodes::TrigBitSet egHLT::EgTrigTagProbeCut::bitsToPass_
private

Definition at line 451 of file EgHLTDQMCut.h.

Referenced by pass().

int egHLT::EgTrigTagProbeCut::cutCode_
private
int(OffEle::* egHLT::EgTrigTagProbeCut::cutCodeFunc_) () const
private
float egHLT::EgTrigTagProbeCut::maxMass_
private
float egHLT::EgTrigTagProbeCut::minMass_
private