CMS 3D CMS Logo

EgHLTDQMCut.cc
Go to the documentation of this file.
2 
3 using namespace egHLT;
4 
5 bool EgTrigTagProbeCut::pass(const OffEle& theEle,const OffEvt& evt)const
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 }
30 
31 bool EgTrigTagProbeCut_New::pass(const OffEle& theEle,const OffEvt& evt)const
32 {
33  //looking at only Et>20, since probe is required to pass SC17
34  //if(theEle.et()>20/* && theEle.et()<20*/){
35  //first we check if our probe electron passes WP80 and the second leg of our T&P trigger
36  if( ((theEle.*cutCodeFunc_)() & cutCode_)!=0x0 || (bit2ToPass_&theEle.trigBits())!=bit2ToPass_) return false;
37 
38  //now we check that there is a WP80 tag electron that passes the first leg of the trigger(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)
39  int nrTags=0;
40  const OffEle* tagEle=nullptr;
41  const std::vector<OffEle>& eles = evt.eles();
42  //we are looking for an *additional* tag
43  for(auto const & ele : eles){
44  if( ((ele.*cutCodeFunc_)() & cutCode_)==0x0 && (bit1ToPass_&ele.trigBits())==bit1ToPass_){
45  //now a check that the tag is not the same as the probe
46  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
47  nrTags++;
48  tagEle = &ele;
49  }
50  }
51  }
52  if(nrTags==1){ //we are requiring one and only one additional tag (the theEle is automatically excluded from the tag list)
53  float mass = (theEle.p4()+tagEle->p4()).mag();
54  if(mass>minMass_ && mass<maxMass_) return true; //mass requirements
55  }
56  //}//if 10<pt<20
57  return false;
58 }
59 //same for photons
60 bool EgTrigTagProbeCut_NewPho::pass(const OffPho& thePho,const OffEvt& evt)const
61 {
62  //looking at only Et>20, since probe is required to pass SC17
63  //if(theEle.et()>20/* && theEle.et()<20*/){
64  //first we check if our probe electron passes WP80 and the second leg of our T&P trigger
65  if( ((thePho.*cutCodeFunc_)() & cutCode_)!=0x0 || (bit2ToPass_&thePho.trigBits())!=bit2ToPass_) return false;
66 
67  //now we check that there is a WP80 tag electron that passes the first leg of the trigger(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)
68  int nrTags=0;
69  const OffPho* tagPho=nullptr;
70  const std::vector<OffPho>& phos = evt.phos();
71  //we are looking for an *additional* tag
72  for(auto const & pho : phos){
73  if( ((pho.*cutCodeFunc_)() & cutCode_)==0x0 && (bit1ToPass_&pho.trigBits())==bit1ToPass_){
74  //now a check that the tag is not the same as the probe
75  if(reco::deltaR2(thePho.eta(),thePho.phi(),pho.eta(),pho.phi())>0.1*0.1){//not in a cone of 0.1 of probe "photon"
76  nrTags++;
77  tagPho = &pho;
78  }
79  }
80  }
81  if(nrTags==1){ //we are requiring one and only one additional tag (the thePho is automatically excluded from the tag list)
82  float mass = (thePho.p4()+tagPho->p4()).mag();
83  if(mass>minMass_ && mass<maxMass_) return true; //mass requirements
84  }
85  //}//if 10<pt<20
86  return false;
87 }
88 
89 bool EgDiEleCut::pass(const OffEle& obj,const OffEvt& evt)const
90 {
91  const std::vector<OffEle>& eles = evt.eles();
92  for(auto const & ele : eles){
93  if(&ele!=&obj){ //different electrons
94 
95  int diEleCutCode = (obj.*cutCodeFunc_)() | (ele.*cutCodeFunc_)();
96  if( (diEleCutCode & cutCode_)==0x0) return true;
97  }
98  }
99  return false;
100 }
101 
102 
103 
104 bool EgDiPhoCut::pass(const OffPho& obj,const OffEvt& evt)const
105 {
106  const std::vector<OffPho>& phos = evt.phos();
107  for(auto const & pho : phos){
108  if(&pho!=&obj){ //different phos
109 
110  int diPhoCutCode = (obj.*cutCodeFunc_)() | (pho.*cutCodeFunc_)();
111  if( (diPhoCutCode & cutCode_)==0x0) return true;
112  }
113  }
114  return false;
115 }
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())
bool pass(const OffEle &obj, const OffEvt &evt) const override
Definition: EgHLTDQMCut.cc:89
bool pass(const OffEle &ele, const OffEvt &evt) const override
Definition: EgHLTDQMCut.cc:5
int(OffEle::* cutCodeFunc_)() const
Definition: EgHLTDQMCut.h:453
bool pass(const OffEle &ele, const OffEvt &evt) const override
Definition: EgHLTDQMCut.cc:31
float eta() const
Definition: EgHLTOffPho.h:104
TrigCodes::TrigBitSet trigBits() const
Definition: EgHLTOffPho.h:155
float phi() const
Definition: EgHLTOffEle.h:121
bool pass(const OffPho &obj, const OffEvt &evt) const override
Definition: EgHLTDQMCut.cc:104
TrigCodes::TrigBitSet bitsToPass_
Definition: EgHLTDQMCut.h:451
const std::vector< OffPho > & phos() const
Definition: EgHLTOffEvt.h:50
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
float phi() const
Definition: EgHLTOffPho.h:105
const math::XYZTLorentzVector & p4() const
Definition: EgHLTOffEle.h:128
const math::XYZTLorentzVector & p4() const
Definition: EgHLTOffPho.h:111
bool pass(const OffPho &pho, const OffEvt &evt) const override
Definition: EgHLTDQMCut.cc:60