test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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=NULL;
13  const std::vector<OffEle>& eles = evt.eles();
14  //we are looking for an *additional* tag
15  for(size_t eleNr=0;eleNr<eles.size();eleNr++){
16  if( ((eles[eleNr].*cutCodeFunc_)() & cutCode_)==0x0 && (bitsToPass_&eles[eleNr].trigBits())==bitsToPass_){
17  //now a check that the tag is not the same as the probe
18  if(reco::deltaR2(theEle.eta(),theEle.phi(),eles[eleNr].eta(),eles[eleNr].phi())>0.1*0.1){//not in a cone of 0.1 of probe electron
19  nrTags++;
20  tagEle = &eles[eleNr];
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=NULL;
41  const std::vector<OffEle>& eles = evt.eles();
42  //we are looking for an *additional* tag
43  for(size_t eleNr=0;eleNr<eles.size();eleNr++){
44  if( ((eles[eleNr].*cutCodeFunc_)() & cutCode_)==0x0 && (bit1ToPass_&eles[eleNr].trigBits())==bit1ToPass_){
45  //now a check that the tag is not the same as the probe
46  if(reco::deltaR2(theEle.eta(),theEle.phi(),eles[eleNr].eta(),eles[eleNr].phi())>0.1*0.1){//not in a cone of 0.1 of probe electron
47  nrTags++;
48  tagEle = &eles[eleNr];
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=NULL;
70  const std::vector<OffPho>& phos = evt.phos();
71  //we are looking for an *additional* tag
72  for(size_t phoNr=0;phoNr<phos.size();phoNr++){
73  if( ((phos[phoNr].*cutCodeFunc_)() & cutCode_)==0x0 && (bit1ToPass_&phos[phoNr].trigBits())==bit1ToPass_){
74  //now a check that the tag is not the same as the probe
75  if(reco::deltaR2(thePho.eta(),thePho.phi(),phos[phoNr].eta(),phos[phoNr].phi())>0.1*0.1){//not in a cone of 0.1 of probe "photon"
76  nrTags++;
77  tagPho = &phos[phoNr];
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(size_t eleNr=0;eleNr<eles.size();eleNr++){
93  if(&eles[eleNr]!=&obj){ //different electrons
94 
95  int diEleCutCode = (obj.*cutCodeFunc_)() | (eles[eleNr].*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(size_t phoNr=0;phoNr<phos.size();phoNr++){
108  if(&phos[phoNr]!=&obj){ //different phos
109 
110  int diPhoCutCode = (obj.*cutCodeFunc_)() | (phos[phoNr].*cutCodeFunc_)();
111  if( (diPhoCutCode & cutCode_)==0x0) return true;
112  }
113  }
114  return false;
115 }
bool pass(const OffPho &pho, const OffEvt &evt) const
Definition: EgHLTDQMCut.cc:60
float eta() const
Definition: EgHLTOffEle.h:120
TrigCodes::TrigBitSet bit1ToPass_
Definition: EgHLTDQMCut.h:487
TrigCodes::TrigBitSet trigBits() const
Definition: EgHLTOffEle.h:219
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
#define NULL
Definition: scimark2.h:8
float eta() const
Definition: EgHLTOffPho.h:104
TrigCodes::TrigBitSet bit1ToPass_
Definition: EgHLTDQMCut.h:470
TrigCodes::TrigBitSet trigBits() const
Definition: EgHLTOffPho.h:155
float phi() const
Definition: EgHLTOffEle.h:121
int(OffEle::* cutCodeFunc_)() const
Definition: EgHLTDQMCut.h:453
TrigCodes::TrigBitSet bit2ToPass_
Definition: EgHLTDQMCut.h:488
bool pass(const OffEle &obj, const OffEvt &evt) const
Definition: EgHLTDQMCut.cc:89
bool pass(const OffEle &ele, const OffEvt &evt) const
Definition: EgHLTDQMCut.cc:5
TrigCodes::TrigBitSet bitsToPass_
Definition: EgHLTDQMCut.h:451
const std::vector< OffPho > & phos() const
Definition: EgHLTOffEvt.h:48
bool pass(const OffEle &ele, const OffEvt &evt) const
Definition: EgHLTDQMCut.cc:31
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36
const std::vector< OffEle > & eles() const
Definition: EgHLTOffEvt.h:46
bool pass(const OffPho &obj, const OffEvt &evt) const
Definition: EgHLTDQMCut.cc:104
float phi() const
Definition: EgHLTOffPho.h:105
int(OffEle::* cutCodeFunc_)() const
Definition: EgHLTDQMCut.h:368
const math::XYZTLorentzVector & p4() const
Definition: EgHLTOffEle.h:128
int(OffPho::* cutCodeFunc_)() const
Definition: EgHLTDQMCut.h:408
const math::XYZTLorentzVector & p4() const
Definition: EgHLTOffPho.h:111
int(OffEle::* cutCodeFunc_)() const
Definition: EgHLTDQMCut.h:473
int(OffPho::* cutCodeFunc_)() const
Definition: EgHLTDQMCut.h:490
TrigCodes::TrigBitSet bit2ToPass_
Definition: EgHLTDQMCut.h:471