File indexing completed on 2024-04-06 12:10:03
0001 #include "DQMOffline/Trigger/interface/EgHLTDQMCut.h"
0002
0003 using namespace egHLT;
0004
0005 bool EgTrigTagProbeCut::pass(const OffEle& theEle, const OffEvt& evt) const {
0006
0007 if (((theEle.*cutCodeFunc_)() & cutCode_) != 0x0)
0008 return false;
0009
0010
0011 int nrTags = 0;
0012 const OffEle* tagEle = nullptr;
0013 const std::vector<OffEle>& eles = evt.eles();
0014
0015 for (auto const& ele : eles) {
0016 if (((ele.*cutCodeFunc_)() & cutCode_) == 0x0 && (bitsToPass_ & ele.trigBits()) == bitsToPass_) {
0017
0018 if (reco::deltaR2(theEle.eta(), theEle.phi(), ele.eta(), ele.phi()) >
0019 0.1 * 0.1) {
0020 nrTags++;
0021 tagEle = &ele;
0022 }
0023 }
0024 }
0025 if (nrTags ==
0026 1) {
0027 float mass = (theEle.p4() + tagEle->p4()).mag();
0028 if (mass > minMass_ && mass < maxMass_)
0029 return true;
0030 }
0031 return false;
0032 }
0033
0034 bool EgTrigTagProbeCut_New::pass(const OffEle& theEle, const OffEvt& evt) const {
0035
0036
0037
0038 if (((theEle.*cutCodeFunc_)() & cutCode_) != 0x0 || (bit2ToPass_ & theEle.trigBits()) != bit2ToPass_)
0039 return false;
0040
0041
0042 int nrTags = 0;
0043 const OffEle* tagEle = nullptr;
0044 const std::vector<OffEle>& eles = evt.eles();
0045
0046 for (auto const& ele : eles) {
0047 if (((ele.*cutCodeFunc_)() & cutCode_) == 0x0 && (bit1ToPass_ & ele.trigBits()) == bit1ToPass_) {
0048
0049 if (reco::deltaR2(theEle.eta(), theEle.phi(), ele.eta(), ele.phi()) >
0050 0.1 * 0.1) {
0051 nrTags++;
0052 tagEle = &ele;
0053 }
0054 }
0055 }
0056 if (nrTags ==
0057 1) {
0058 float mass = (theEle.p4() + tagEle->p4()).mag();
0059 if (mass > minMass_ && mass < maxMass_)
0060 return true;
0061 }
0062
0063 return false;
0064 }
0065
0066 bool EgTrigTagProbeCut_NewPho::pass(const OffPho& thePho, const OffEvt& evt) const {
0067
0068
0069
0070 if (((thePho.*cutCodeFunc_)() & cutCode_) != 0x0 || (bit2ToPass_ & thePho.trigBits()) != bit2ToPass_)
0071 return false;
0072
0073
0074 int nrTags = 0;
0075 const OffPho* tagPho = nullptr;
0076 const std::vector<OffPho>& phos = evt.phos();
0077
0078 for (auto const& pho : phos) {
0079 if (((pho.*cutCodeFunc_)() & cutCode_) == 0x0 && (bit1ToPass_ & pho.trigBits()) == bit1ToPass_) {
0080
0081 if (reco::deltaR2(thePho.eta(), thePho.phi(), pho.eta(), pho.phi()) >
0082 0.1 * 0.1) {
0083 nrTags++;
0084 tagPho = &pho;
0085 }
0086 }
0087 }
0088 if (nrTags ==
0089 1) {
0090 float mass = (thePho.p4() + tagPho->p4()).mag();
0091 if (mass > minMass_ && mass < maxMass_)
0092 return true;
0093 }
0094
0095 return false;
0096 }
0097
0098 bool EgDiEleCut::pass(const OffEle& obj, const OffEvt& evt) const {
0099 const std::vector<OffEle>& eles = evt.eles();
0100 for (auto const& ele : eles) {
0101 if (&ele != &obj) {
0102
0103 int diEleCutCode = (obj.*cutCodeFunc_)() | (ele.*cutCodeFunc_)();
0104 if ((diEleCutCode & cutCode_) == 0x0)
0105 return true;
0106 }
0107 }
0108 return false;
0109 }
0110
0111 bool EgDiPhoCut::pass(const OffPho& obj, const OffEvt& evt) const {
0112 const std::vector<OffPho>& phos = evt.phos();
0113 for (auto const& pho : phos) {
0114 if (&pho != &obj) {
0115
0116 int diPhoCutCode = (obj.*cutCodeFunc_)() | (pho.*cutCodeFunc_)();
0117 if ((diPhoCutCode & cutCode_) == 0x0)
0118 return true;
0119 }
0120 }
0121 return false;
0122 }