CMS 3D CMS Logo

Public Member Functions | Private Attributes

HiggsToZZ4LeptonsSkimEff Class Reference

#include <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 25 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(), and nEvents.

                                                                              {

  // Local Debug flag
  debug              = pset.getParameter<bool>("DebugHiggsToZZ4LeptonsSkim");

  // Reconstructed objects
  recTrackLabel      = pset.getParameter<edm::InputTag>("RecoTrackLabel");
  theGLBMuonLabel    = pset.getParameter<edm::InputTag>("GlobalMuonCollectionLabel");
  thePixelGsfELabel  = pset.getParameter<edm::InputTag>("ElectronCollectionLabel");

  // Minimum Pt for leptons for skimming
  // Minimum Pt for leptons for skimming
  stiffMinPt         = pset.getParameter<double>("stiffMinimumPt");
  softMinPt          = pset.getParameter<double>("softMinimumPt");
  nStiffLeptonMin    = pset.getParameter<int>("nStiffLeptonMinimum");
  nLeptonMin         = pset.getParameter<int>("nLeptonMinimum");

  nEvents   = 0;
  nSelFourE = nSelFourM = nSelTwoETwoM = nSelFourL = nSelTau = 0;
  nFourE    = nFourM    = nTwoETwoM    = nFourL    = nTau    = 0;

}
HiggsToZZ4LeptonsSkimEff::~HiggsToZZ4LeptonsSkimEff ( )

Definition at line 66 of file HiggsToZZ4LeptonsSkimEff.cc.

References gather_cfg::cout, and nEvents.

                                                    {

  std::cout << "Number of events read " << nEvents << std::endl;
  std::cout << "*** Efficiency for the various subsamples *** " <<  endl;

  std::cout << "Four leptons: " 
  << " pres "    << nFourL         
  << " kept "    << nSelFourL
  << " eff  "    << ((double)nSelFourL)/((double) nFourL + 0.0001) << std::endl;
  std::cout << "Four muons:   "
  << " pres "    << nFourM         
  << " kept "    << nSelFourM
  << " eff  "    << ((double)nSelFourM)/((double) nFourM + 0.0001) << std::endl;
  std::cout << "Four elecs:   "
  << " pres "    << nFourE         
  << " kept "    << nSelFourE
  << " eff  "    << ((double)nSelFourE)/((double) nFourE + 0.0001) << std::endl;
  std::cout << "2 elec 2 mu:  "
  << " pres "    << nTwoETwoM   
  << " kept "    << nSelTwoETwoM
  << " eff  "    << ((double)nSelTwoETwoM)/((double) nTwoETwoM + 0.0001) << std::endl;
  std::cout << "with taus:    "
  << " pres "    << nTau     
  << " kept "    << nSelTau
  << " eff  "    << ((double)nSelTau)/((double) nTau + 0.0001) << std::endl;

}

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::HandleBase::isValid(), patZpeak::muons, nEvents, and edm::Handle< T >::product().

                                                                                         {

  nEvents++;

  using reco::TrackCollection;

  bool keepEvent   = false;

  // First, pre-selection:
  int nMuon = 0;
  int nElec = 0;
  int nTau  = 0;

  bool isFourE = false;
  bool isFourM = false;
  bool isTwoETwoM = false;
  bool isFourL = false;
  bool isTau = false;

  // get gen particle candidates
  edm::Handle<CandidateCollection> genCandidates;
  event.getByLabel("genParticleCandidates", genCandidates);

  for ( CandidateCollection::const_iterator mcIter=genCandidates->begin(); mcIter!=genCandidates->end(); ++mcIter ) {

    // Muons:
    if ( mcIter->pdgId() == 13 || mcIter->pdgId() == -13) {
      // Mother is a Z
      if ( mcIter->mother()->pdgId() == 23 ) {
       // In fiducial volume:
        if ( mcIter->eta() > -2.4 && mcIter->eta() < 2.4 ) nMuon++;
      }
    }
    // Electrons:
    if ( mcIter->pdgId() == 11 || mcIter->pdgId() == -11) {
      // Mother is a Z
      if ( mcIter->mother()->pdgId() == 23 ) {
        // In fiducial volume:
        if ( mcIter->eta() > -2.5 && mcIter->eta() < 2.5 ) nElec++;
      }
    }
    // Taus:
    if ( mcIter->pdgId() == 15 || mcIter->pdgId() == -15) {
      // Mother is a Z
      if ( mcIter->mother()->pdgId() == 23 ) {
        // In fiducial volume:
        if ( mcIter->eta() > -2.5 && mcIter->eta() < 2.5 ) nTau++;
      }
    }

  }
   
    if (nElec > 3) {
      isFourE = true;
      nFourE++;
    }
    if (nMuon > 3) {
      isFourM = true;
      nFourM++;
    }
    if (nMuon > 1 && nElec > 1) {
      isTwoETwoM = true;
      nTwoETwoM++;
    }
    if ( isFourE || isFourM || isTwoETwoM ) {
      isFourL = true;
      nFourL++;
    }
    if (nTau > 1) {
      isTau = true;
      nTau++;
    }

  if ( isFourL ) {
    keepEvent = true;
  } else {
    return;
  }


  int  nStiffLeptons = 0;
  int  nLeptons      = 0;

  // First look at muons:

  // Get the muon track collection from the event
  edm::Handle<reco::TrackCollection> muTracks;
  event.getByLabel(theGLBMuonLabel.label(), muTracks);
 
  if ( muTracks.isValid() ) {   
    reco::TrackCollection::const_iterator muons;
        
    // Loop over muon collections and count how many muons there are, 
    // and how many are above threshold
    for ( muons = muTracks->begin(); muons != muTracks->end(); ++muons ) {
      float pt_mu =  muons->pt();
      if ( pt_mu > stiffMinPt ) nStiffLeptons++; 
      if ( pt_mu > softMinPt ) nLeptons++; 
    }  
  } 
  

  // Now look at electrons:

  // Get the electron track collection from the event
  edm::Handle<reco::GsfElectronCollection> pTracks;
  event.getByLabel(thePixelGsfELabel.label(),pTracks);

  if ( pTracks.isValid() ) { 

    const reco::GsfElectronCollection* eTracks = pTracks.product();

    reco::GsfElectronCollection::const_iterator electrons;

    // Loop over electron collections and count how many muons there are, 
    // and how many are above threshold
    for ( electrons = eTracks->begin(); electrons != eTracks->end(); ++electrons ) {
      float pt_e = electrons->pt(); 
      if ( pt_e > stiffMinPt ) nStiffLeptons++; 
      if ( pt_e > softMinPt ) nLeptons++; 
    }
  }

  
  // Make decision:
  if ( nStiffLeptons >= nStiffLeptonMin && nLeptons >= nLeptonMin) {
    keepEvent = true;
  } else {
    keepEvent = false;
  }

  if ( keepEvent ) {
    if (isFourE)    nSelFourE++;
    if (isFourM)    nSelFourM++;
    if (isTwoETwoM) nSelTwoETwoM++;
    if (isFourL)    nSelFourL++;
    if (isTau)      nSelTau++;
  }

}

Member Data Documentation

Definition at line 39 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 45 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 46 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 46 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 46 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 43 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 45 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 45 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 45 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 45 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 45 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 42 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 46 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 46 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 49 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 41 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 40 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 50 of file HiggsToZZ4LeptonsSkimEff.h.

Definition at line 51 of file HiggsToZZ4LeptonsSkimEff.h.