CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/DQMOffline/Trigger/src/EgHLTDQMCut.cc

Go to the documentation of this file.
00001 #include "DQMOffline/Trigger/interface/EgHLTDQMCut.h"
00002 
00003 using namespace egHLT;
00004 
00005 bool EgTrigTagProbeCut::pass(const OffEle& theEle,const OffEvt& evt)const
00006 {
00007   //first we check if our electron passes our id
00008   if( ((theEle.*cutCodeFunc_)() & cutCode_)!=0x0) return false;
00009 
00010   //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)
00011   int nrTags=0;
00012   const OffEle* tagEle=NULL;
00013   const std::vector<OffEle>& eles = evt.eles();
00014   //we are looking for an *additional* tag
00015   for(size_t eleNr=0;eleNr<eles.size();eleNr++){
00016     if( ((eles[eleNr].*cutCodeFunc_)() & cutCode_)==0x0 && (bitsToPass_&eles[eleNr].trigBits())==bitsToPass_){
00017       //now a check that the tag is not the same as the probe
00018       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
00019         nrTags++;
00020         tagEle = &eles[eleNr];
00021       }
00022     }
00023   }
00024   if(nrTags==1){ //we are requiring one and only one additional tag (the theEle is automatically excluded from the tag list) 
00025     float mass = (theEle.p4()+tagEle->p4()).mag();
00026     if(mass>minMass_ && mass<maxMass_) return true; //mass requirements
00027   }
00028   return false; 
00029 }
00030 
00031 bool EgTrigTagProbeCut_New::pass(const OffEle& theEle,const OffEvt& evt)const
00032 {
00033   //looking at only Et>20, since probe is required to pass SC17
00034   //if(theEle.et()>20/* && theEle.et()<20*/){
00035   //first we check if our probe electron passes WP80 and the second leg of our T&P trigger
00036   if( ((theEle.*cutCodeFunc_)() & cutCode_)!=0x0 || (bit2ToPass_&theEle.trigBits())!=bit2ToPass_) return false;
00037 
00038   //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)
00039   int nrTags=0;
00040   const OffEle* tagEle=NULL;
00041   const std::vector<OffEle>& eles = evt.eles();
00042   //we are looking for an *additional* tag
00043   for(size_t eleNr=0;eleNr<eles.size();eleNr++){
00044     if( ((eles[eleNr].*cutCodeFunc_)() & cutCode_)==0x0 && (bit1ToPass_&eles[eleNr].trigBits())==bit1ToPass_){
00045       //now a check that the tag is not the same as the probe
00046       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
00047         nrTags++;
00048         tagEle = &eles[eleNr];
00049       }
00050     }
00051   }
00052   if(nrTags==1){ //we are requiring one and only one additional tag (the theEle is automatically excluded from the tag list) 
00053     float mass = (theEle.p4()+tagEle->p4()).mag();
00054     if(mass>minMass_ && mass<maxMass_) return true; //mass requirements
00055   }
00056   //}//if 10<pt<20
00057   return false; 
00058 }
00059 //same for photons
00060 bool EgTrigTagProbeCut_NewPho::pass(const OffPho& thePho,const OffEvt& evt)const
00061 {
00062   //looking at only Et>20, since probe is required to pass SC17
00063   //if(theEle.et()>20/* && theEle.et()<20*/){
00064   //first we check if our probe electron passes WP80 and the second leg of our T&P trigger
00065   if( ((thePho.*cutCodeFunc_)() & cutCode_)!=0x0 || (bit2ToPass_&thePho.trigBits())!=bit2ToPass_) return false;
00066 
00067   //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)
00068   int nrTags=0;
00069   const OffPho* tagPho=NULL;
00070   const std::vector<OffPho>& phos = evt.phos();
00071   //we are looking for an *additional* tag
00072   for(size_t phoNr=0;phoNr<phos.size();phoNr++){
00073     if( ((phos[phoNr].*cutCodeFunc_)() & cutCode_)==0x0 && (bit1ToPass_&phos[phoNr].trigBits())==bit1ToPass_){
00074       //now a check that the tag is not the same as the probe
00075       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"
00076         nrTags++;
00077         tagPho = &phos[phoNr];
00078       }
00079     }
00080   }
00081   if(nrTags==1){ //we are requiring one and only one additional tag (the thePho is automatically excluded from the tag list) 
00082     float mass = (thePho.p4()+tagPho->p4()).mag();
00083     if(mass>minMass_ && mass<maxMass_) return true; //mass requirements
00084   }
00085   //}//if 10<pt<20
00086   return false; 
00087 }
00088 
00089 bool EgDiEleCut::pass(const OffEle& obj,const OffEvt& evt)const
00090 {
00091   const std::vector<OffEle>& eles = evt.eles();
00092   for(size_t eleNr=0;eleNr<eles.size();eleNr++){
00093     if(&eles[eleNr]!=&obj){ //different electrons
00094      
00095       int diEleCutCode = (obj.*cutCodeFunc_)() | (eles[eleNr].*cutCodeFunc_)();
00096       if( (diEleCutCode & cutCode_)==0x0) return true;
00097     }
00098   }
00099   return false;
00100 }
00101 
00102 
00103 
00104 bool EgDiPhoCut::pass(const OffPho& obj,const OffEvt& evt)const
00105 {
00106   const std::vector<OffPho>& phos = evt.phos();
00107   for(size_t phoNr=0;phoNr<phos.size();phoNr++){
00108     if(&phos[phoNr]!=&obj){ //different phos
00109      
00110       int diPhoCutCode = (obj.*cutCodeFunc_)() | (phos[phoNr].*cutCodeFunc_)();
00111       if( (diPhoCutCode & cutCode_)==0x0) return true;
00112     }
00113   }
00114   return false;
00115 }