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 }
egHLT::OffEle::eta
float eta() const
Definition: EgHLTOffEle.h:127
egHLT::EgDiPhoCut::pass
bool pass(const OffPho &obj, const OffEvt &evt) const override
Definition: EgHLTDQMCut.cc:111
egHLT::OffEle::trigBits
TrigCodes::TrigBitSet trigBits() const
Definition: EgHLTOffEle.h:235
egHLT::EgTrigTagProbeCut::bitsToPass_
TrigCodes::TrigBitSet bitsToPass_
Definition: EgHLTDQMCut.h:485
egHLT::EgTrigTagProbeCut_New::cutCode_
int cutCode_
Definition: EgHLTDQMCut.h:511
egHLT::OffEvt::phos
const std::vector< OffPho > & phos() const
Definition: EgHLTOffEvt.h:50
egHLT::EgTrigTagProbeCut_NewPho::bit1ToPass_
TrigCodes::TrigBitSet bit1ToPass_
Definition: EgHLTDQMCut.h:537
egHLT::EgTrigTagProbeCut::cutCode_
int cutCode_
Definition: EgHLTDQMCut.h:486
egHLT::OffEvt
Definition: EgHLTOffEvt.h:29
egHLT::OffEle
Definition: EgHLTOffEle.h:29
egHLT::OffPho::trigBits
TrigCodes::TrigBitSet trigBits() const
Definition: EgHLTOffPho.h:158
egHLT::OffPho::p4
const math::XYZTLorentzVector & p4() const
Definition: EgHLTOffPho.h:116
egHLT::OffEle::phi
float phi() const
Definition: EgHLTOffEle.h:128
egHLT::EgDiEleCut::cutCodeFunc_
int(OffEle::* cutCodeFunc_)() const
Definition: EgHLTDQMCut.h:394
egHLT::EgTrigTagProbeCut_New::bit2ToPass_
TrigCodes::TrigBitSet bit2ToPass_
Definition: EgHLTDQMCut.h:510
egHLT::EgDiPhoCut::cutCodeFunc_
int(OffPho::* cutCodeFunc_)() const
Definition: EgHLTDQMCut.h:438
egHLT::EgTrigTagProbeCut_New::maxMass_
float maxMass_
Definition: EgHLTDQMCut.h:514
egHLT::OffPho
Definition: EgHLTOffPho.h:26
egHLT::EgTrigTagProbeCut_New::cutCodeFunc_
int(OffEle::* cutCodeFunc_)() const
Definition: EgHLTDQMCut.h:512
egHLT::EgTrigTagProbeCut_New::pass
bool pass(const OffEle &ele, const OffEvt &evt) const override
Definition: EgHLTDQMCut.cc:34
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
egHLT::EgTrigTagProbeCut::cutCodeFunc_
int(OffEle::* cutCodeFunc_)() const
Definition: EgHLTDQMCut.h:487
egHLT::EgTrigTagProbeCut_NewPho::bit2ToPass_
TrigCodes::TrigBitSet bit2ToPass_
Definition: EgHLTDQMCut.h:538
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
EgHLTOfflineSource_cfi.tagEle
tagEle
Definition: EgHLTOfflineSource_cfi.py:75
egHLT::EgTrigTagProbeCut_NewPho::cutCode_
int cutCode_
Definition: EgHLTDQMCut.h:539
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
egHLT::OffPho::phi
float phi() const
Definition: EgHLTOffPho.h:108
egHLT::OffPho::eta
float eta() const
Definition: EgHLTOffPho.h:107
egHLT::EgTrigTagProbeCut_NewPho::minMass_
float minMass_
Definition: EgHLTDQMCut.h:541
egHLT::EgTrigTagProbeCut_NewPho::cutCodeFunc_
int(OffPho::* cutCodeFunc_)() const
Definition: EgHLTDQMCut.h:540
egHLT::EgTrigTagProbeCut_NewPho::maxMass_
float maxMass_
Definition: EgHLTDQMCut.h:542
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
EgHLTDQMCut.h
egHLT::EgDiPhoCut::cutCode_
int cutCode_
Definition: EgHLTDQMCut.h:437
egHLT::EgTrigTagProbeCut::maxMass_
float maxMass_
Definition: EgHLTDQMCut.h:489
egHLT::OffEle::p4
const math::XYZTLorentzVector & p4() const
Definition: EgHLTOffEle.h:137
egHLT::EgDiEleCut::pass
bool pass(const OffEle &obj, const OffEvt &evt) const override
Definition: EgHLTDQMCut.cc:98
egHLT::EgTrigTagProbeCut_New::minMass_
float minMass_
Definition: EgHLTDQMCut.h:513
egHLT::OffEvt::eles
const std::vector< OffEle > & eles() const
Definition: EgHLTOffEvt.h:48
egHLT::EgTrigTagProbeCut::pass
bool pass(const OffEle &ele, const OffEvt &evt) const override
Definition: EgHLTDQMCut.cc:5
egHLT
Definition: EgHLTBinData.h:10
egHLT::EgDiEleCut::cutCode_
int cutCode_
Definition: EgHLTDQMCut.h:393
egHLT::EgTrigTagProbeCut_New::bit1ToPass_
TrigCodes::TrigBitSet bit1ToPass_
Definition: EgHLTDQMCut.h:509
egHLT::EgTrigTagProbeCut_NewPho::pass
bool pass(const OffPho &pho, const OffEvt &evt) const override
Definition: EgHLTDQMCut.cc:66
egHLT::EgTrigTagProbeCut::minMass_
float minMass_
Definition: EgHLTDQMCut.h:488