CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
EgammaProbeSelector Class Reference

#include <EgammaProbeSelector.h>

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

Public Member Functions

 EgammaProbeSelector (const edm::ParameterSet &)
 
virtual bool filter (edm::Event &, const edm::EventSetup &)
 
 ~EgammaProbeSelector ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDFilter
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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.

24  {
25 
26  jetLabel = iConfig.getParameter<InputTag>("JetCollection");
27  minNumberOfjets = iConfig.getParameter<int>("MinNumberOfJets");
28  jetEtMin = iConfig.getParameter<double>("JetEtMin");
29  jetEtaMin = iConfig.getParameter<double>("JetEtaMin");
30  jetEtaMax = iConfig.getParameter<double>("JetEtaMax");
31 
32  nEvents = 0;
33  nSelectedEvents = 0;
34 
35  scLabel = iConfig.getParameter<InputTag>("SuperClusterBarrelCollection");
36  scEELabel = iConfig.getParameter<InputTag>("SuperClusterEndCapCollection");
37  minNumberOfSuperClusters = iConfig.getParameter<int>("MinNumberOfSuperClusters");
38  scEtMin = iConfig.getParameter<double>("ScEtMin");
39  scEtaMin = iConfig.getParameter<double>("ScEtaMin");
40  scEtaMax = iConfig.getParameter<double>("ScEtaMax");
41 }
T getParameter(std::string const &) const
EgammaProbeSelector::~EgammaProbeSelector ( )

Definition at line 44 of file EgammaProbeSelector.cc.

References nEvents.

44  {
45  edm::LogVerbatim("EgammaProbeSelector")
46  << " Number_events_read " << nEvents
47  << " Number_events_kept " << nSelectedEvents
48  << " Efficiency " << ((double)nSelectedEvents)/((double) nEvents + 0.01) << std::endl;
49 
50 }

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().

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

53  {
54  int nSC = 0;
55  int nJets = 0;
56  nEvents++;
57 
58  // Get reconstructed Jets, check their Et and eta, and count their number
59  Handle<CaloJetCollection> jetHandle;
60  iEvent.getByLabel(jetLabel,jetHandle);
61 
62  if(jetHandle.isValid()){
63  const reco::CaloJetCollection & jets = *(jetHandle.product());
64  CaloJetCollection::const_iterator ijet;
65  for(ijet = jets.begin(); ijet!= jets.end(); ijet++){
66  if(ijet->pt() > jetEtMin &&
67  ijet->eta() > jetEtaMin &&
68  ijet->eta() < jetEtaMax )
69  nJets++;
70  }
71  }
72 
73  // Get Super Clusters, check their Et and eta, and count their number
74  // EB
76  iEvent.getByLabel(scLabel,scHandle);
77 
78  if(scHandle.isValid()){
79  const reco::SuperClusterCollection & SCs = *(scHandle.product());
80 
81  for(reco::SuperClusterCollection::const_iterator scIt = SCs.begin();
82  scIt!= SCs.end(); scIt++){
83 
84  double scEt = scIt->energy() * TMath::Sin(scIt->position().theta());
85  double _eta = scIt->position().eta();
86  if(scEt > scEtMin && _eta > scEtaMin && _eta < scEtaMax) nSC++;
87  }
88  }
89 
90  // EE
92  iEvent.getByLabel(scEELabel,scEEHandle);
93 
94  if(scEEHandle.isValid()){
95  const reco::SuperClusterCollection & SCs = *(scEEHandle.product());
96  for(reco::SuperClusterCollection::const_iterator scIt = SCs.begin();
97  scIt!= SCs.end(); scIt++){
98 
99  double scEt = scIt->energy() * TMath::Sin(scIt->position().theta());
100  double _eta = scIt->position().eta();
101  if(scEt > scEtMin && _eta > scEtaMin && _eta < scEtaMax) nSC++;
102  }
103  }
104 
105  // Make final desicion on passed events
106  bool accepted = false;
107  if(nJets >= minNumberOfjets || nSC >=minNumberOfSuperClusters) {
108  accepted = true;
109  nSelectedEvents++;
110  }
111 
112  return accepted;
113 }
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
vector< PseudoJet > jets
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
T const * product() const
Definition: Handle.h:74
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects

Member Data Documentation

bool EgammaProbeSelector::debug
private
double EgammaProbeSelector::jetEtaMax
private

Definition at line 45 of file EgammaProbeSelector.h.

double EgammaProbeSelector::jetEtaMin
private

Definition at line 44 of file EgammaProbeSelector.h.

double EgammaProbeSelector::jetEtMin
private

Definition at line 43 of file EgammaProbeSelector.h.

edm::InputTag EgammaProbeSelector::jetLabel
private

Definition at line 41 of file EgammaProbeSelector.h.

int EgammaProbeSelector::minNumberOfjets
private

Definition at line 42 of file EgammaProbeSelector.h.

int EgammaProbeSelector::minNumberOfSuperClusters
private

Definition at line 49 of file EgammaProbeSelector.h.

int EgammaProbeSelector::nEvents
private

Definition at line 54 of file EgammaProbeSelector.h.

int EgammaProbeSelector::nSelectedEvents
private

Definition at line 54 of file EgammaProbeSelector.h.

edm::InputTag EgammaProbeSelector::scEELabel
private

Definition at line 48 of file EgammaProbeSelector.h.

double EgammaProbeSelector::scEtaMax
private

Definition at line 52 of file EgammaProbeSelector.h.

double EgammaProbeSelector::scEtaMin
private

Definition at line 51 of file EgammaProbeSelector.h.

double EgammaProbeSelector::scEtMin
private

Definition at line 50 of file EgammaProbeSelector.h.

edm::InputTag EgammaProbeSelector::scLabel
private

Definition at line 47 of file EgammaProbeSelector.h.