CMS 3D CMS Logo

Public Member Functions | Private Attributes

HiggsToZZ4LeptonsPreFilter Class Reference

#include <HiggsToZZ4LeptonsPreFilter.h>

Inheritance diagram for HiggsToZZ4LeptonsPreFilter:
edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

virtual bool filter (edm::Event &, const edm::EventSetup &)
 Get event properties to send to builder to fill seed collection.
 HiggsToZZ4LeptonsPreFilter (const edm::ParameterSet &)
 ~HiggsToZZ4LeptonsPreFilter ()

Private Attributes

bool debug
int evt
int ikept
int leptonFlavour

Detailed Description

Definition at line 26 of file HiggsToZZ4LeptonsPreFilter.h.


Constructor & Destructor Documentation

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

Definition at line 33 of file HiggsToZZ4LeptonsPreFilter.cc.

References debug, and edm::ParameterSet::getParameter().

                                                                                  {

// LeptonFlavour
// 0 = no tau
// 1 = 4 mu
// 2 = 4 e
// 3 = 2e 2mu

  // Local Debug flag
  debug              = pset.getParameter<bool>("DebugHiggsToZZ4LeptonsPreFilter");
  leptonFlavour      = pset.getParameter<int>("HiggsToZZ4LeptonsPreFilterLeptonFlavour");

  ikept = 0;
  evt = 0;
}
HiggsToZZ4LeptonsPreFilter::~HiggsToZZ4LeptonsPreFilter ( )

Definition at line 51 of file HiggsToZZ4LeptonsPreFilter.cc.

References gather_cfg::cout.

                                                        {

  std::cout << "number of events processed: " << evt << std::endl;
  std::cout << "number of events kept: " << ikept << std::endl;

}

Member Function Documentation

bool HiggsToZZ4LeptonsPreFilter::filter ( edm::Event event,
const edm::EventSetup setup 
) [virtual]

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

Implements edm::EDFilter.

Definition at line 60 of file HiggsToZZ4LeptonsPreFilter.cc.

References genParticleCandidates2GenParticles_cfi::genParticles, and edm::HandleBase::isValid().

                                                                                    {

  bool keepEvent   = false;
  evt++;

  bool FourL    = false;
  bool FourE    = false;
  bool FourM    = false;
  bool TwoETwoM = false;

  // get gen particle candidates 
  Handle<GenParticleCollection> genParticles;

  event.getByLabel("genParticles", genParticles);

  if ( genParticles.isValid() ) {

  int nElec = 0;
  int nMuon = 0;

  for (GenParticleCollection::const_iterator mcIter=genParticles->begin(); mcIter!=genParticles->end(); ++mcIter) {
    // Muons:
    if ( mcIter->pdgId() == 13 || mcIter->pdgId() == -13) {
      // Mother is a Z
      if ( mcIter->mother()->pdgId() == 23 ) {
       // In fiducial volume:
        if ( mcIter->pt() < 3 ) continue;
        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->pt() < 3 ) continue;
        if ( mcIter->eta() > -2.5 && mcIter->eta() < 2.5 ) nElec++;
      }
    }

     
    if (nElec > 3) FourE = true;
    if (nMuon > 3) FourM = true;
    if (nMuon > 1 && nElec > 1) TwoETwoM = true;
    if ( FourE || FourM || TwoETwoM ) FourL = true;

    if ( leptonFlavour == 0 && FourL    ) keepEvent = true;    
    if ( leptonFlavour == 1 && FourM    ) keepEvent = true;    
    if ( leptonFlavour == 2 && FourE    ) keepEvent = true;    
    if ( leptonFlavour == 3 && TwoETwoM ) keepEvent = true;    

  }

  if (keepEvent ) ikept++;

  return keepEvent;

}

Member Data Documentation

Definition at line 42 of file HiggsToZZ4LeptonsPreFilter.h.

Definition at line 40 of file HiggsToZZ4LeptonsPreFilter.h.

Definition at line 40 of file HiggsToZZ4LeptonsPreFilter.h.

Definition at line 43 of file HiggsToZZ4LeptonsPreFilter.h.