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  //first we check if our electron passes our id
7  if (((theEle.*cutCodeFunc_)() & cutCode_) != 0x0)
8  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()) >
19  0.1 * 0.1) { //not in a cone of 0.1 of probe electron
20  nrTags++;
21  tagEle = &ele;
22  }
23  }
24  }
25  if (nrTags ==
26  1) { //we are requiring one and only one additional tag (the theEle is automatically excluded from the tag list)
27  float mass = (theEle.p4() + tagEle->p4()).mag();
28  if (mass > minMass_ && mass < maxMass_)
29  return true; //mass requirements
30  }
31  return false;
32 }
33 
34 bool EgTrigTagProbeCut_New::pass(const OffEle& theEle, const OffEvt& evt) const {
35  //looking at only Et>20, since probe is required to pass SC17
36  //if(theEle.et()>20/* && theEle.et()<20*/){
37  //first we check if our probe electron passes WP80 and the second leg of our T&P trigger
38  if (((theEle.*cutCodeFunc_)() & cutCode_) != 0x0 || (bit2ToPass_ & theEle.trigBits()) != bit2ToPass_)
39  return false;
40 
41  //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)
42  int nrTags = 0;
43  const OffEle* tagEle = nullptr;
44  const std::vector<OffEle>& eles = evt.eles();
45  //we are looking for an *additional* tag
46  for (auto const& ele : eles) {
47  if (((ele.*cutCodeFunc_)() & cutCode_) == 0x0 && (bit1ToPass_ & ele.trigBits()) == bit1ToPass_) {
48  //now a check that the tag is not the same as the probe
49  if (reco::deltaR2(theEle.eta(), theEle.phi(), ele.eta(), ele.phi()) >
50  0.1 * 0.1) { //not in a cone of 0.1 of probe electron
51  nrTags++;
52  tagEle = &ele;
53  }
54  }
55  }
56  if (nrTags ==
57  1) { //we are requiring one and only one additional tag (the theEle is automatically excluded from the tag list)
58  float mass = (theEle.p4() + tagEle->p4()).mag();
59  if (mass > minMass_ && mass < maxMass_)
60  return true; //mass requirements
61  }
62  //}//if 10<pt<20
63  return false;
64 }
65 //same for photons
66 bool EgTrigTagProbeCut_NewPho::pass(const OffPho& thePho, const OffEvt& evt) const {
67  //looking at only Et>20, since probe is required to pass SC17
68  //if(theEle.et()>20/* && theEle.et()<20*/){
69  //first we check if our probe electron passes WP80 and the second leg of our T&P trigger
70  if (((thePho.*cutCodeFunc_)() & cutCode_) != 0x0 || (bit2ToPass_ & thePho.trigBits()) != bit2ToPass_)
71  return false;
72 
73  //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)
74  int nrTags = 0;
75  const OffPho* tagPho = nullptr;
76  const std::vector<OffPho>& phos = evt.phos();
77  //we are looking for an *additional* tag
78  for (auto const& pho : phos) {
79  if (((pho.*cutCodeFunc_)() & cutCode_) == 0x0 && (bit1ToPass_ & pho.trigBits()) == bit1ToPass_) {
80  //now a check that the tag is not the same as the probe
81  if (reco::deltaR2(thePho.eta(), thePho.phi(), pho.eta(), pho.phi()) >
82  0.1 * 0.1) { //not in a cone of 0.1 of probe "photon"
83  nrTags++;
84  tagPho = &pho;
85  }
86  }
87  }
88  if (nrTags ==
89  1) { //we are requiring one and only one additional tag (the thePho is automatically excluded from the tag list)
90  float mass = (thePho.p4() + tagPho->p4()).mag();
91  if (mass > minMass_ && mass < maxMass_)
92  return true; //mass requirements
93  }
94  //}//if 10<pt<20
95  return false;
96 }
97 
98 bool EgDiEleCut::pass(const OffEle& obj, const OffEvt& evt) const {
99  const std::vector<OffEle>& eles = evt.eles();
100  for (auto const& ele : eles) {
101  if (&ele != &obj) { //different electrons
102 
103  int diEleCutCode = (obj.*cutCodeFunc_)() | (ele.*cutCodeFunc_)();
104  if ((diEleCutCode & cutCode_) == 0x0)
105  return true;
106  }
107  }
108  return false;
109 }
110 
111 bool EgDiPhoCut::pass(const OffPho& obj, const OffEvt& evt) const {
112  const std::vector<OffPho>& phos = evt.phos();
113  for (auto const& pho : phos) {
114  if (&pho != &obj) { //different phos
115 
116  int diPhoCutCode = (obj.*cutCodeFunc_)() | (pho.*cutCodeFunc_)();
117  if ((diPhoCutCode & cutCode_) == 0x0)
118  return true;
119  }
120  }
121  return false;
122 }
float eta() const
Definition: EgHLTOffPho.h:107
float phi() const
Definition: EgHLTOffEle.h:128
bool pass(const OffPho &pho, const OffEvt &evt) const override
Definition: EgHLTDQMCut.cc:66
TrigCodes::TrigBitSet bit1ToPass_
Definition: EgHLTDQMCut.h:537
const math::XYZTLorentzVector & p4() const
Definition: EgHLTOffPho.h:116
int(OffEle::* cutCodeFunc_)() const
Definition: EgHLTDQMCut.h:512
const std::vector< OffEle > & eles() const
Definition: EgHLTOffEvt.h:48
const std::vector< OffPho > & phos() const
Definition: EgHLTOffEvt.h:50
TrigCodes::TrigBitSet bit1ToPass_
Definition: EgHLTDQMCut.h:509
TrigCodes::TrigBitSet trigBits() const
Definition: EgHLTOffEle.h:235
float phi() const
Definition: EgHLTOffPho.h:108
TrigCodes::TrigBitSet trigBits() const
Definition: EgHLTOffPho.h:158
int(OffEle::* cutCodeFunc_)() const
Definition: EgHLTDQMCut.h:394
TrigCodes::TrigBitSet bit2ToPass_
Definition: EgHLTDQMCut.h:538
bool pass(const OffEle &ele, const OffEvt &evt) const override
Definition: EgHLTDQMCut.cc:34
TrigCodes::TrigBitSet bitsToPass_
Definition: EgHLTDQMCut.h:485
float eta() const
Definition: EgHLTOffEle.h:127
bool pass(const OffPho &obj, const OffEvt &evt) const override
Definition: EgHLTDQMCut.cc:111
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const math::XYZTLorentzVector & p4() const
Definition: EgHLTOffEle.h:137
bool pass(const OffEle &ele, const OffEvt &evt) const override
Definition: EgHLTDQMCut.cc:5
int(OffEle::* cutCodeFunc_)() const
Definition: EgHLTDQMCut.h:487
int(OffPho::* cutCodeFunc_)() const
Definition: EgHLTDQMCut.h:540
TrigCodes::TrigBitSet bit2ToPass_
Definition: EgHLTDQMCut.h:510
int(OffPho::* cutCodeFunc_)() const
Definition: EgHLTDQMCut.h:438
bool pass(const OffEle &obj, const OffEvt &evt) const override
Definition: EgHLTDQMCut.cc:98