CMS 3D CMS Logo

HiggsToZZ4LeptonsSkimEff Class Reference

#include <HiggsAnalysis/Skimming/interface/HiggsToZZ4LeptonsSkimEff.h>

Inheritance diagram for HiggsToZZ4LeptonsSkimEff:

edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 Get event properties to send to builder to fill seed collection.
 HiggsToZZ4LeptonsSkimEff (const edm::ParameterSet &)
 ~HiggsToZZ4LeptonsSkimEff ()

Private Attributes

bool debug
int nEvents
int nFourE
int nFourL
int nFourM
int nLeptonMin
int nSelFourE
int nSelFourL
int nSelFourM
int nSelTau
int nSelTwoETwoM
int nStiffLeptonMin
int nTau
int nTwoETwoM
edm::InputTag recTrackLabel
float softMinPt
float stiffMinPt
edm::InputTag theGLBMuonLabel
edm::InputTag thePixelGsfELabel


Detailed Description

Definition at line 28 of file HiggsToZZ4LeptonsSkimEff.h.


Constructor & Destructor Documentation

HiggsToZZ4LeptonsSkimEff::HiggsToZZ4LeptonsSkimEff ( const edm::ParameterSet pset  )  [explicit]

Definition at line 41 of file HiggsToZZ4LeptonsSkimEff.cc.

References debug, edm::ParameterSet::getParameter(), nEvents, nFourE, nFourL, nFourM, nLeptonMin, nSelFourE, nSelFourL, nSelFourM, nSelTau, nSelTwoETwoM, nStiffLeptonMin, nTau, nTwoETwoM, recTrackLabel, softMinPt, stiffMinPt, theGLBMuonLabel, and thePixelGsfELabel.

00041                                                                               {
00042 
00043   // Local Debug flag
00044   debug              = pset.getParameter<bool>("DebugHiggsToZZ4LeptonsSkim");
00045 
00046   // Reconstructed objects
00047   recTrackLabel      = pset.getParameter<edm::InputTag>("RecoTrackLabel");
00048   theGLBMuonLabel    = pset.getParameter<edm::InputTag>("GlobalMuonCollectionLabel");
00049   thePixelGsfELabel  = pset.getParameter<edm::InputTag>("ElectronCollectionLabel");
00050 
00051   // Minimum Pt for leptons for skimming
00052   // Minimum Pt for leptons for skimming
00053   stiffMinPt         = pset.getParameter<double>("stiffMinimumPt");
00054   softMinPt          = pset.getParameter<double>("softMinimumPt");
00055   nStiffLeptonMin    = pset.getParameter<int>("nStiffLeptonMinimum");
00056   nLeptonMin         = pset.getParameter<int>("nLeptonMinimum");
00057 
00058   nEvents   = 0;
00059   nSelFourE = nSelFourM = nSelTwoETwoM = nSelFourL = nSelTau = 0;
00060   nFourE    = nFourM    = nTwoETwoM    = nFourL    = nTau    = 0;
00061 
00062 }

HiggsToZZ4LeptonsSkimEff::~HiggsToZZ4LeptonsSkimEff (  ) 

Definition at line 66 of file HiggsToZZ4LeptonsSkimEff.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), nEvents, nFourE, nFourL, nFourM, nSelFourE, nSelFourL, nSelFourM, nSelTau, nSelTwoETwoM, nTau, and nTwoETwoM.

00066                                                     {
00067 
00068   std::cout << "Number of events read " << nEvents << std::endl;
00069   std::cout << "*** Efficiency for the various subsamples *** " <<  endl;
00070 
00071   std::cout << "Four leptons: " 
00072   << " pres "    << nFourL         
00073   << " kept "    << nSelFourL
00074   << " eff  "    << ((double)nSelFourL)/((double) nFourL + 0.0001) << std::endl;
00075   std::cout << "Four muons:   "
00076   << " pres "    << nFourM         
00077   << " kept "    << nSelFourM
00078   << " eff  "    << ((double)nSelFourM)/((double) nFourM + 0.0001) << std::endl;
00079   std::cout << "Four elecs:   "
00080   << " pres "    << nFourE         
00081   << " kept "    << nSelFourE
00082   << " eff  "    << ((double)nSelFourE)/((double) nFourE + 0.0001) << std::endl;
00083   std::cout << "2 elec 2 mu:  "
00084   << " pres "    << nTwoETwoM   
00085   << " kept "    << nSelTwoETwoM
00086   << " eff  "    << ((double)nSelTwoETwoM)/((double) nTwoETwoM + 0.0001) << std::endl;
00087   std::cout << "with taus:    "
00088   << " pres "    << nTau     
00089   << " kept "    << nSelTau
00090   << " eff  "    << ((double)nSelTau)/((double) nTau + 0.0001) << std::endl;
00091 
00092 }


Member Function Documentation

void HiggsToZZ4LeptonsSkimEff::analyze ( const edm::Event event,
const edm::EventSetup setup 
) [virtual]

Get event properties to send to builder to fill seed collection.

Implements edm::EDAnalyzer.

Definition at line 97 of file HiggsToZZ4LeptonsSkimEff.cc.

References genCandidates_cfi::genCandidates, reco::isTau(), edm::Handle< T >::isValid(), edm::InputTag::label(), muons_cfi::muons, nEvents, nFourE, nFourL, nFourM, nLeptonMin, nSelFourE, nSelFourL, nSelFourM, nSelTau, nSelTwoETwoM, nStiffLeptonMin, nTau, nTwoETwoM, edm::Handle< T >::product(), softMinPt, stiffMinPt, theGLBMuonLabel, and thePixelGsfELabel.

00097                                                                                          {
00098 
00099   nEvents++;
00100 
00101   using reco::TrackCollection;
00102 
00103   bool keepEvent   = false;
00104 
00105   // First, pre-selection:
00106   int nMuon = 0;
00107   int nElec = 0;
00108   int nTau  = 0;
00109 
00110   bool isFourE = false;
00111   bool isFourM = false;
00112   bool isTwoETwoM = false;
00113   bool isFourL = false;
00114   bool isTau = false;
00115 
00116   // get gen particle candidates
00117   edm::Handle<CandidateCollection> genCandidates;
00118   event.getByLabel("genParticleCandidates", genCandidates);
00119 
00120   for ( CandidateCollection::const_iterator mcIter=genCandidates->begin(); mcIter!=genCandidates->end(); ++mcIter ) {
00121 
00122     // Muons:
00123     if ( mcIter->pdgId() == 13 || mcIter->pdgId() == -13) {
00124       // Mother is a Z
00125       if ( mcIter->mother()->pdgId() == 23 ) {
00126        // In fiducial volume:
00127         if ( mcIter->eta() > -2.4 && mcIter->eta() < 2.4 ) nMuon++;
00128       }
00129     }
00130     // Electrons:
00131     if ( mcIter->pdgId() == 11 || mcIter->pdgId() == -11) {
00132       // Mother is a Z
00133       if ( mcIter->mother()->pdgId() == 23 ) {
00134         // In fiducial volume:
00135         if ( mcIter->eta() > -2.5 && mcIter->eta() < 2.5 ) nElec++;
00136       }
00137     }
00138     // Taus:
00139     if ( mcIter->pdgId() == 15 || mcIter->pdgId() == -15) {
00140       // Mother is a Z
00141       if ( mcIter->mother()->pdgId() == 23 ) {
00142         // In fiducial volume:
00143         if ( mcIter->eta() > -2.5 && mcIter->eta() < 2.5 ) nTau++;
00144       }
00145     }
00146 
00147   }
00148    
00149     if (nElec > 3) {
00150       isFourE = true;
00151       nFourE++;
00152     }
00153     if (nMuon > 3) {
00154       isFourM = true;
00155       nFourM++;
00156     }
00157     if (nMuon > 1 && nElec > 1) {
00158       isTwoETwoM = true;
00159       nTwoETwoM++;
00160     }
00161     if ( isFourE || isFourM || isTwoETwoM ) {
00162       isFourL = true;
00163       nFourL++;
00164     }
00165     if (nTau > 1) {
00166       isTau = true;
00167       nTau++;
00168     }
00169 
00170   if ( isFourL ) {
00171     keepEvent = true;
00172   } else {
00173     return;
00174   }
00175 
00176 
00177   int  nStiffLeptons = 0;
00178   int  nLeptons      = 0;
00179 
00180   // First look at muons:
00181 
00182   // Get the muon track collection from the event
00183   edm::Handle<reco::TrackCollection> muTracks;
00184   event.getByLabel(theGLBMuonLabel.label(), muTracks);
00185  
00186   if ( muTracks.isValid() ) {   
00187     reco::TrackCollection::const_iterator muons;
00188         
00189     // Loop over muon collections and count how many muons there are, 
00190     // and how many are above threshold
00191     for ( muons = muTracks->begin(); muons != muTracks->end(); ++muons ) {
00192       float pt_mu =  muons->pt();
00193       if ( pt_mu > stiffMinPt ) nStiffLeptons++; 
00194       if ( pt_mu > softMinPt ) nLeptons++; 
00195     }  
00196   } 
00197   
00198 
00199   // Now look at electrons:
00200 
00201   // Get the electron track collection from the event
00202   edm::Handle<reco::PixelMatchGsfElectronCollection> pTracks;
00203   event.getByLabel(thePixelGsfELabel.label(),pTracks);
00204 
00205   if ( pTracks.isValid() ) { 
00206 
00207     const reco::PixelMatchGsfElectronCollection* eTracks = pTracks.product();
00208 
00209     reco::PixelMatchGsfElectronCollection::const_iterator electrons;
00210 
00211     // Loop over electron collections and count how many muons there are, 
00212     // and how many are above threshold
00213     for ( electrons = eTracks->begin(); electrons != eTracks->end(); ++electrons ) {
00214       float pt_e = electrons->pt(); 
00215       if ( pt_e > stiffMinPt ) nStiffLeptons++; 
00216       if ( pt_e > softMinPt ) nLeptons++; 
00217     }
00218   }
00219 
00220   
00221   // Make decision:
00222   if ( nStiffLeptons >= nStiffLeptonMin && nLeptons >= nLeptonMin) {
00223     keepEvent = true;
00224   } else {
00225     keepEvent = false;
00226   }
00227 
00228   if ( keepEvent ) {
00229     if (isFourE)    nSelFourE++;
00230     if (isFourM)    nSelFourM++;
00231     if (isTwoETwoM) nSelTwoETwoM++;
00232     if (isFourL)    nSelFourL++;
00233     if (isTau)      nSelTau++;
00234   }
00235 
00236 }


Member Data Documentation

bool HiggsToZZ4LeptonsSkimEff::debug [private]

Definition at line 42 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by HiggsToZZ4LeptonsSkimEff().

int HiggsToZZ4LeptonsSkimEff::nEvents [private]

Definition at line 48 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by analyze(), HiggsToZZ4LeptonsSkimEff(), and ~HiggsToZZ4LeptonsSkimEff().

int HiggsToZZ4LeptonsSkimEff::nFourE [private]

Definition at line 49 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by analyze(), HiggsToZZ4LeptonsSkimEff(), and ~HiggsToZZ4LeptonsSkimEff().

int HiggsToZZ4LeptonsSkimEff::nFourL [private]

Definition at line 49 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by analyze(), HiggsToZZ4LeptonsSkimEff(), and ~HiggsToZZ4LeptonsSkimEff().

int HiggsToZZ4LeptonsSkimEff::nFourM [private]

Definition at line 49 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by analyze(), HiggsToZZ4LeptonsSkimEff(), and ~HiggsToZZ4LeptonsSkimEff().

int HiggsToZZ4LeptonsSkimEff::nLeptonMin [private]

Definition at line 46 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by analyze(), and HiggsToZZ4LeptonsSkimEff().

int HiggsToZZ4LeptonsSkimEff::nSelFourE [private]

Definition at line 48 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by analyze(), HiggsToZZ4LeptonsSkimEff(), and ~HiggsToZZ4LeptonsSkimEff().

int HiggsToZZ4LeptonsSkimEff::nSelFourL [private]

Definition at line 48 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by analyze(), HiggsToZZ4LeptonsSkimEff(), and ~HiggsToZZ4LeptonsSkimEff().

int HiggsToZZ4LeptonsSkimEff::nSelFourM [private]

Definition at line 48 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by analyze(), HiggsToZZ4LeptonsSkimEff(), and ~HiggsToZZ4LeptonsSkimEff().

int HiggsToZZ4LeptonsSkimEff::nSelTau [private]

Definition at line 48 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by analyze(), HiggsToZZ4LeptonsSkimEff(), and ~HiggsToZZ4LeptonsSkimEff().

int HiggsToZZ4LeptonsSkimEff::nSelTwoETwoM [private]

Definition at line 48 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by analyze(), HiggsToZZ4LeptonsSkimEff(), and ~HiggsToZZ4LeptonsSkimEff().

int HiggsToZZ4LeptonsSkimEff::nStiffLeptonMin [private]

Definition at line 45 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by analyze(), and HiggsToZZ4LeptonsSkimEff().

int HiggsToZZ4LeptonsSkimEff::nTau [private]

Definition at line 49 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by analyze(), HiggsToZZ4LeptonsSkimEff(), and ~HiggsToZZ4LeptonsSkimEff().

int HiggsToZZ4LeptonsSkimEff::nTwoETwoM [private]

Definition at line 49 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by analyze(), HiggsToZZ4LeptonsSkimEff(), and ~HiggsToZZ4LeptonsSkimEff().

edm::InputTag HiggsToZZ4LeptonsSkimEff::recTrackLabel [private]

Definition at line 52 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by HiggsToZZ4LeptonsSkimEff().

float HiggsToZZ4LeptonsSkimEff::softMinPt [private]

Definition at line 44 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by analyze(), and HiggsToZZ4LeptonsSkimEff().

float HiggsToZZ4LeptonsSkimEff::stiffMinPt [private]

Definition at line 43 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by analyze(), and HiggsToZZ4LeptonsSkimEff().

edm::InputTag HiggsToZZ4LeptonsSkimEff::theGLBMuonLabel [private]

Definition at line 53 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by analyze(), and HiggsToZZ4LeptonsSkimEff().

edm::InputTag HiggsToZZ4LeptonsSkimEff::thePixelGsfELabel [private]

Definition at line 54 of file HiggsToZZ4LeptonsSkimEff.h.

Referenced by analyze(), and HiggsToZZ4LeptonsSkimEff().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:24:15 2009 for CMSSW by  doxygen 1.5.4