Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:13:37

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   //first we check if our electron passes our id
0007   if (((theEle.*cutCodeFunc_)() & cutCode_) != 0x0)
0008     return false;
0009 
0010   //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)
0011   int nrTags = 0;
0012   const OffEle* tagEle = nullptr;
0013   const std::vector<OffEle>& eles = evt.eles();
0014   //we are looking for an *additional* tag
0015   for (auto const& ele : eles) {
0016     if (((ele.*cutCodeFunc_)() & cutCode_) == 0x0 && (bitsToPass_ & ele.trigBits()) == bitsToPass_) {
0017       //now a check that the tag is not the same as the probe
0018       if (reco::deltaR2(theEle.eta(), theEle.phi(), ele.eta(), ele.phi()) >
0019           0.1 * 0.1) {  //not in a cone of 0.1 of probe electron
0020         nrTags++;
0021         tagEle = &ele;
0022       }
0023     }
0024   }
0025   if (nrTags ==
0026       1) {  //we are requiring one and only one additional tag (the theEle is automatically excluded from the tag list)
0027     float mass = (theEle.p4() + tagEle->p4()).mag();
0028     if (mass > minMass_ && mass < maxMass_)
0029       return true;  //mass requirements
0030   }
0031   return false;
0032 }
0033 
0034 bool EgTrigTagProbeCut_New::pass(const OffEle& theEle, const OffEvt& evt) const {
0035   //looking at only Et>20, since probe is required to pass SC17
0036   //if(theEle.et()>20/* && theEle.et()<20*/){
0037   //first we check if our probe electron passes WP80 and the second leg of our T&P trigger
0038   if (((theEle.*cutCodeFunc_)() & cutCode_) != 0x0 || (bit2ToPass_ & theEle.trigBits()) != bit2ToPass_)
0039     return false;
0040 
0041   //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)
0042   int nrTags = 0;
0043   const OffEle* tagEle = nullptr;
0044   const std::vector<OffEle>& eles = evt.eles();
0045   //we are looking for an *additional* tag
0046   for (auto const& ele : eles) {
0047     if (((ele.*cutCodeFunc_)() & cutCode_) == 0x0 && (bit1ToPass_ & ele.trigBits()) == bit1ToPass_) {
0048       //now a check that the tag is not the same as the probe
0049       if (reco::deltaR2(theEle.eta(), theEle.phi(), ele.eta(), ele.phi()) >
0050           0.1 * 0.1) {  //not in a cone of 0.1 of probe electron
0051         nrTags++;
0052         tagEle = &ele;
0053       }
0054     }
0055   }
0056   if (nrTags ==
0057       1) {  //we are requiring one and only one additional tag (the theEle is automatically excluded from the tag list)
0058     float mass = (theEle.p4() + tagEle->p4()).mag();
0059     if (mass > minMass_ && mass < maxMass_)
0060       return true;  //mass requirements
0061   }
0062   //}//if 10<pt<20
0063   return false;
0064 }
0065 //same for photons
0066 bool EgTrigTagProbeCut_NewPho::pass(const OffPho& thePho, const OffEvt& evt) const {
0067   //looking at only Et>20, since probe is required to pass SC17
0068   //if(theEle.et()>20/* && theEle.et()<20*/){
0069   //first we check if our probe electron passes WP80 and the second leg of our T&P trigger
0070   if (((thePho.*cutCodeFunc_)() & cutCode_) != 0x0 || (bit2ToPass_ & thePho.trigBits()) != bit2ToPass_)
0071     return false;
0072 
0073   //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)
0074   int nrTags = 0;
0075   const OffPho* tagPho = nullptr;
0076   const std::vector<OffPho>& phos = evt.phos();
0077   //we are looking for an *additional* tag
0078   for (auto const& pho : phos) {
0079     if (((pho.*cutCodeFunc_)() & cutCode_) == 0x0 && (bit1ToPass_ & pho.trigBits()) == bit1ToPass_) {
0080       //now a check that the tag is not the same as the probe
0081       if (reco::deltaR2(thePho.eta(), thePho.phi(), pho.eta(), pho.phi()) >
0082           0.1 * 0.1) {  //not in a cone of 0.1 of probe "photon"
0083         nrTags++;
0084         tagPho = &pho;
0085       }
0086     }
0087   }
0088   if (nrTags ==
0089       1) {  //we are requiring one and only one additional tag (the thePho is automatically excluded from the tag list)
0090     float mass = (thePho.p4() + tagPho->p4()).mag();
0091     if (mass > minMass_ && mass < maxMass_)
0092       return true;  //mass requirements
0093   }
0094   //}//if 10<pt<20
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) {  //different electrons
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) {  //different phos
0115 
0116       int diPhoCutCode = (obj.*cutCodeFunc_)() | (pho.*cutCodeFunc_)();
0117       if ((diPhoCutCode & cutCode_) == 0x0)
0118         return true;
0119     }
0120   }
0121   return false;
0122 }