CMS 3D CMS Logo

Public Member Functions | Private Attributes

EgammaProbeSelector Class Reference

#include <EgammaProbeSelector.h>

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

List of all members.

Public Member Functions

 EgammaProbeSelector (const edm::ParameterSet &)
virtual bool filter (edm::Event &, const edm::EventSetup &)
 ~EgammaProbeSelector ()

Private Attributes

bool debug
double jetEtaMax
double jetEtaMin
double jetEtMin
edm::InputTag jetLabel
int minNumberOfjets
int minNumberOfSuperClusters
int nEvents
int nSelectedEvents
edm::InputTag scEELabel
double scEtaMax
double scEtaMin
double scEtMin
edm::InputTag scLabel

Detailed Description

Filter to select events passing offline jets and superclusters

This class is an EDFilter for heavy W+jet and Z+jet events

Definition at line 30 of file EgammaProbeSelector.h.


Constructor & Destructor Documentation

EgammaProbeSelector::EgammaProbeSelector ( const edm::ParameterSet iConfig) [explicit]

Definition at line 24 of file EgammaProbeSelector.cc.

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

                                                                       {
  
  jetLabel        = iConfig.getParameter<InputTag>("JetCollection");
  minNumberOfjets = iConfig.getParameter<int>("MinNumberOfJets");
  jetEtMin        = iConfig.getParameter<double>("JetEtMin");
  jetEtaMin       = iConfig.getParameter<double>("JetEtaMin");
  jetEtaMax       = iConfig.getParameter<double>("JetEtaMax");
  
  nEvents         = 0;
  nSelectedEvents = 0;
  
  scLabel          = iConfig.getParameter<InputTag>("SuperClusterBarrelCollection");
  scEELabel        = iConfig.getParameter<InputTag>("SuperClusterEndCapCollection");
  minNumberOfSuperClusters = iConfig.getParameter<int>("MinNumberOfSuperClusters");
  scEtMin          = iConfig.getParameter<double>("ScEtMin");
  scEtaMin         = iConfig.getParameter<double>("ScEtaMin");
  scEtaMax         = iConfig.getParameter<double>("ScEtaMax");
}
EgammaProbeSelector::~EgammaProbeSelector ( )

Definition at line 44 of file EgammaProbeSelector.cc.

References nEvents.

                                         {
  edm::LogVerbatim("EgammaProbeSelector") 
    << " Number_events_read " << nEvents
    << " Number_events_kept " << nSelectedEvents
    << " Efficiency         " << ((double)nSelectedEvents)/((double) nEvents + 0.01) << std::endl;
  
}

Member Function Documentation

bool EgammaProbeSelector::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDFilter.

Definition at line 53 of file EgammaProbeSelector.cc.

References edm::Event::getByLabel(), edm::HandleBase::isValid(), fwrapper::jets, nEvents, and edm::Handle< T >::product().

                                                                              {
  int nSC   = 0;
  int nJets = 0;  
  nEvents++;
  
  // Get reconstructed Jets, check their Et and eta, and count their number
  Handle<CaloJetCollection> jetHandle;
  iEvent.getByLabel(jetLabel,jetHandle);
  
  if(jetHandle.isValid()){
    const reco::CaloJetCollection & jets = *(jetHandle.product());
    CaloJetCollection::const_iterator ijet;
    for(ijet = jets.begin(); ijet!= jets.end(); ijet++){
      if(ijet->pt()  > jetEtMin  && 
         ijet->eta() > jetEtaMin &&
         ijet->eta() < jetEtaMax ) 
        nJets++;                
    }
  }
  
  // Get Super Clusters, check their Et and eta, and count their number
  // EB
  Handle<reco::SuperClusterCollection> scHandle;
  iEvent.getByLabel(scLabel,scHandle);
  
  if(scHandle.isValid()){
    const reco::SuperClusterCollection & SCs = *(scHandle.product());
    
    for(reco::SuperClusterCollection::const_iterator scIt = SCs.begin(); 
        scIt!= SCs.end(); scIt++){

      double scEt   = scIt->energy() * TMath::Sin(scIt->position().theta());
      double _eta = scIt->position().eta();
      if(scEt  > scEtMin && _eta > scEtaMin && _eta < scEtaMax) nSC++;          
    }
  }

  // EE
  Handle<reco::SuperClusterCollection> scEEHandle;
  iEvent.getByLabel(scEELabel,scEEHandle);
  
  if(scEEHandle.isValid()){
    const reco::SuperClusterCollection & SCs = *(scEEHandle.product());
    for(reco::SuperClusterCollection::const_iterator scIt = SCs.begin(); 
        scIt!= SCs.end(); scIt++){
      
      double scEt   = scIt->energy() * TMath::Sin(scIt->position().theta()); 
      double _eta = scIt->position().eta();
      if(scEt  > scEtMin && _eta > scEtaMin && _eta < scEtaMax) nSC++; 
    }
  } 
  
  // Make final desicion on passed events
  bool accepted = false;
  if(nJets >= minNumberOfjets || nSC >=minNumberOfSuperClusters) {
    accepted = true;
    nSelectedEvents++;
  }
  
  return accepted;
}

Member Data Documentation

Definition at line 39 of file EgammaProbeSelector.h.

Definition at line 45 of file EgammaProbeSelector.h.

Definition at line 44 of file EgammaProbeSelector.h.

Definition at line 43 of file EgammaProbeSelector.h.

Definition at line 41 of file EgammaProbeSelector.h.

Definition at line 42 of file EgammaProbeSelector.h.

Definition at line 49 of file EgammaProbeSelector.h.

Definition at line 54 of file EgammaProbeSelector.h.

Definition at line 54 of file EgammaProbeSelector.h.

Definition at line 48 of file EgammaProbeSelector.h.

Definition at line 52 of file EgammaProbeSelector.h.

Definition at line 51 of file EgammaProbeSelector.h.

double EgammaProbeSelector::scEtMin [private]

Definition at line 50 of file EgammaProbeSelector.h.

Definition at line 47 of file EgammaProbeSelector.h.