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
RecoSelector Class Reference

#include <RecoSelector.h>

Public Member Functions

std::string GetName ()
 
void handleObjects (const edm::Event &)
 
bool isSelected (const edm::Event &)
 
 RecoSelector (edm::ParameterSet userCut_params)
 
virtual ~RecoSelector ()
 

Private Attributes

std::string m_calometSrc
 
std::string m_electronSrc
 
std::string m_jetsSrc
 
std::string m_muonSrc
 
std::string m_photonProducerSrc
 
std::string m_photonSrc
 
std::string name
 
double reco_metMin
 
double reco_ptElecMin
 
double reco_ptJet1Min
 
double reco_ptJet2Min
 
double reco_ptMuonMin
 
double reco_ptPhotMin
 
const reco::CaloJetCollectiontheCaloJetCollection
 
const reco::CaloMETCollectiontheCaloMETCollection
 
const reco::GsfElectronCollectiontheElectronCollection
 
const reco::MuonCollectiontheMuonCollection
 
const reco::PhotonCollectionthePhotonCollection
 

Detailed Description

Definition at line 33 of file RecoSelector.h.

Constructor & Destructor Documentation

RecoSelector::RecoSelector ( edm::ParameterSet  userCut_params)

Definition at line 20 of file RecoSelector.cc.

References edm::ParameterSet::getParameter(), and mergeVDriftHistosByStation::name.

21 {
22 
23  name = userCut_params.getParameter<string>("name");
24  m_electronSrc = userCut_params.getParameter<string>("electrons");
25  m_muonSrc = userCut_params.getParameter<string>("muons");
26  m_jetsSrc = userCut_params.getParameter<string>("jets");
27  m_photonProducerSrc = userCut_params.getParameter<string>("photonProducer");
28  m_photonSrc = userCut_params.getParameter<string>("photons");
29  m_calometSrc = userCut_params.getParameter<string>("calomet");
30 
31  reco_metMin = userCut_params.getParameter<double>("reco_metMin") ;
32  reco_ptJet1Min = userCut_params.getParameter<double>("reco_ptJet1Min");
33  reco_ptJet2Min = userCut_params.getParameter<double>("reco_ptJet2Min");
34  reco_ptElecMin = userCut_params.getParameter<double>("reco_ptElecMin");
35  reco_ptMuonMin = userCut_params.getParameter<double>("reco_ptMuonMin");
36  reco_ptPhotMin = userCut_params.getParameter<double>("reco_ptPhotMin");
37 
38  edm::LogInfo("RecoSelectorParameters") << endl;
39  edm::LogInfo("RecoSelectorParameters") << "UserAnalysis parameters for " << name << " selection:" << endl;
40  edm::LogInfo("RecoSelectorParameters") << " reco_metMin = " << reco_metMin << endl;
41  edm::LogInfo("RecoSelectorParameters") << " reco_ptJet1Min = " << reco_ptJet1Min << endl;
42  edm::LogInfo("RecoSelectorParameters") << " reco_ptJet2Min = " << reco_ptJet2Min << endl;
43  edm::LogInfo("RecoSelectorParameters") << " reco_ptElecMin = " << reco_ptElecMin << endl;
44  edm::LogInfo("RecoSelectorParameters") << " reco_ptMuonMin = " << reco_ptMuonMin << endl;
45  edm::LogInfo("RecoSelectorParameters") << " reco_ptPhotMin = " << reco_ptPhotMin << endl;
46 
47 }
T getParameter(std::string const &) const
std::string m_jetsSrc
Definition: RecoSelector.h:53
std::string m_calometSrc
Definition: RecoSelector.h:56
std::string m_photonProducerSrc
Definition: RecoSelector.h:55
double reco_ptJet2Min
Definition: RecoSelector.h:59
std::string m_electronSrc
Definition: RecoSelector.h:51
std::string m_photonSrc
Definition: RecoSelector.h:54
std::string name
Definition: RecoSelector.h:50
double reco_ptMuonMin
Definition: RecoSelector.h:61
double reco_ptElecMin
Definition: RecoSelector.h:60
std::string m_muonSrc
Definition: RecoSelector.h:52
double reco_ptJet1Min
Definition: RecoSelector.h:58
double reco_metMin
Definition: RecoSelector.h:57
double reco_ptPhotMin
Definition: RecoSelector.h:62
virtual RecoSelector::~RecoSelector ( )
inlinevirtual

Definition at line 40 of file RecoSelector.h.

40 {};

Member Function Documentation

string RecoSelector::GetName ( )

Definition at line 49 of file RecoSelector.cc.

References mergeVDriftHistosByStation::name.

49 {return name;}
std::string name
Definition: RecoSelector.h:50
void RecoSelector::handleObjects ( const edm::Event iEvent)

Definition at line 121 of file RecoSelector.cc.

References edm::Event::getByLabel(), and edm::Handle< T >::product().

122 {
123 
124  //Get the electrons
125  Handle<GsfElectronCollection> theElectronCollectionHandle;
126  iEvent.getByLabel(m_electronSrc, theElectronCollectionHandle);
127  theElectronCollection = theElectronCollectionHandle.product();
128 
129  //Get the Muons
130  Handle<MuonCollection> theMuonCollectionHandle;
131  iEvent.getByLabel(m_muonSrc, theMuonCollectionHandle);
132  theMuonCollection = theMuonCollectionHandle.product();
133 
134  //Get the Photons
135  Handle<PhotonCollection> thePhotonCollectionHandle;
136  iEvent.getByLabel(m_photonProducerSrc, m_photonSrc, thePhotonCollectionHandle);
137  thePhotonCollection = thePhotonCollectionHandle.product();
138 
139  //Get the CaloJets
140  Handle<CaloJetCollection> theCaloJetCollectionHandle;
141  iEvent.getByLabel(m_jetsSrc, theCaloJetCollectionHandle);
142  theCaloJetCollection = theCaloJetCollectionHandle.product();
143 
144  //Get the CaloMET
145  Handle<CaloMETCollection> theCaloMETCollectionHandle;
146  iEvent.getByLabel(m_calometSrc, theCaloMETCollectionHandle);
147  theCaloMETCollection = theCaloMETCollectionHandle.product();
148 
149 }
const reco::CaloMETCollection * theCaloMETCollection
Definition: RecoSelector.h:68
std::string m_jetsSrc
Definition: RecoSelector.h:53
std::string m_calometSrc
Definition: RecoSelector.h:56
std::string m_photonProducerSrc
Definition: RecoSelector.h:55
const reco::PhotonCollection * thePhotonCollection
Definition: RecoSelector.h:66
std::string m_electronSrc
Definition: RecoSelector.h:51
const reco::GsfElectronCollection * theElectronCollection
Definition: RecoSelector.h:64
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
std::string m_photonSrc
Definition: RecoSelector.h:54
T const * product() const
Definition: Handle.h:74
const reco::CaloJetCollection * theCaloJetCollection
Definition: RecoSelector.h:67
std::string m_muonSrc
Definition: RecoSelector.h:52
const reco::MuonCollection * theMuonCollection
Definition: RecoSelector.h:65
bool RecoSelector::isSelected ( const edm::Event iEvent)

Definition at line 51 of file RecoSelector.cc.

References reco::GsfElectron::ecalDrivenSeed(), metsig::electron, i, LogDebug, metsig::muon, reco::LeafCandidate::p(), reco::LeafCandidate::pt(), and reco::GsfElectron::superCluster().

52 {
53 
54 
55  this->handleObjects(iEvent);
56 
57 
58  bool TotalCutPassed = false;
59 
60  bool ElectronCutPassed = false;
61  for(unsigned int i=0; i<theElectronCollection->size(); i++) {
62  GsfElectron electron = (*theElectronCollection)[i];
63  if (electron.ecalDrivenSeed()) {
64  float elenergy = electron.superCluster()->energy();
65  float elpt = electron.pt() * elenergy / electron.p();
66  if(elpt>reco_ptElecMin) ElectronCutPassed = true;
67  LogDebug("RecoSelectorCuts") << "elpt = " << elpt << endl;
68  }
69  else {
70  // float elenergy = 0;
71  // float elpt = 0;
72  ElectronCutPassed = false;
73  }
74  }
75 
76  bool MuonCutPassed = false;
77  for(unsigned int i=0; i<theMuonCollection->size(); i++) {
78  Muon muon = (*theMuonCollection)[i];
79  float muonpt = muon.pt();
80  if(muonpt>reco_ptMuonMin) MuonCutPassed = true;
81  LogDebug("RecoSelectorCuts") << "muonpt = " << muonpt << endl;
82  }
83 
84  bool PhotonCutPassed = false;
85  for(unsigned int i=0; i<thePhotonCollection->size(); i++) {
86  Photon photon = (*thePhotonCollection)[i];
87  float photonpt = photon.pt();
88  if(photonpt>reco_ptPhotMin) PhotonCutPassed = true;
89  LogDebug("RecoSelectorCuts") << "photonpt = " << photonpt << endl;
90  }
91 
92 
93  bool JetCutPassed = false;
94  if(theCaloJetCollection->size()>1) {
95  if((*theCaloJetCollection)[0].pt() > reco_ptJet1Min &&
96  (*theCaloJetCollection)[1].pt() > reco_ptJet2Min ) JetCutPassed = true;
97  }
98 
99  bool MetCutPassed = false;
100  const CaloMET theCaloMET = theCaloMETCollection->front();
101  float calomet = theCaloMET.pt();
102  LogDebug("RecoSelectorCuts") << "calomet = " << calomet << endl;
103  if(calomet > reco_metMin) MetCutPassed = true;
104 
105  edm::LogInfo("RecoSelectorPassed") << "ElectronCutPassed = " << (int)ElectronCutPassed << endl;
106  edm::LogInfo("RecoSelectorPassed") << "MuonCutPassed = " << (int)MuonCutPassed << endl;
107  edm::LogInfo("RecoSelectorPassed") << "PhotonCutPassed = " << (int)PhotonCutPassed << endl;
108  edm::LogInfo("RecoSelectorPassed") << "JetCutPassed = " << (int)JetCutPassed << endl;
109  edm::LogInfo("RecoSelectorPassed") << "MetCutPassed = " << (int)MetCutPassed << endl;
110 
111 
112  if(
113  (ElectronCutPassed || MuonCutPassed) &&
114  PhotonCutPassed &&
115  JetCutPassed &&
116  MetCutPassed ) TotalCutPassed = true;
117 
118  return TotalCutPassed;
119 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
virtual double p() const
magnitude of momentum vector
const reco::CaloMETCollection * theCaloMETCollection
Definition: RecoSelector.h:68
void handleObjects(const edm::Event &)
double reco_ptJet2Min
Definition: RecoSelector.h:59
const reco::PhotonCollection * thePhotonCollection
Definition: RecoSelector.h:66
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:168
const reco::GsfElectronCollection * theElectronCollection
Definition: RecoSelector.h:64
virtual double pt() const
transverse momentum
const reco::CaloJetCollection * theCaloJetCollection
Definition: RecoSelector.h:67
double reco_ptMuonMin
Definition: RecoSelector.h:61
double reco_ptElecMin
Definition: RecoSelector.h:60
const reco::MuonCollection * theMuonCollection
Definition: RecoSelector.h:65
double reco_ptJet1Min
Definition: RecoSelector.h:58
double reco_metMin
Definition: RecoSelector.h:57
double reco_ptPhotMin
Definition: RecoSelector.h:62
bool ecalDrivenSeed() const
Definition: GsfElectron.h:172

Member Data Documentation

std::string RecoSelector::m_calometSrc
private

Definition at line 56 of file RecoSelector.h.

std::string RecoSelector::m_electronSrc
private

Definition at line 51 of file RecoSelector.h.

std::string RecoSelector::m_jetsSrc
private

Definition at line 53 of file RecoSelector.h.

std::string RecoSelector::m_muonSrc
private

Definition at line 52 of file RecoSelector.h.

std::string RecoSelector::m_photonProducerSrc
private

Definition at line 55 of file RecoSelector.h.

std::string RecoSelector::m_photonSrc
private

Definition at line 54 of file RecoSelector.h.

std::string RecoSelector::name
private
double RecoSelector::reco_metMin
private

Definition at line 57 of file RecoSelector.h.

double RecoSelector::reco_ptElecMin
private

Definition at line 60 of file RecoSelector.h.

double RecoSelector::reco_ptJet1Min
private

Definition at line 58 of file RecoSelector.h.

double RecoSelector::reco_ptJet2Min
private

Definition at line 59 of file RecoSelector.h.

double RecoSelector::reco_ptMuonMin
private

Definition at line 61 of file RecoSelector.h.

double RecoSelector::reco_ptPhotMin
private

Definition at line 62 of file RecoSelector.h.

const reco::CaloJetCollection* RecoSelector::theCaloJetCollection
private

Definition at line 67 of file RecoSelector.h.

const reco::CaloMETCollection* RecoSelector::theCaloMETCollection
private

Definition at line 68 of file RecoSelector.h.

const reco::GsfElectronCollection* RecoSelector::theElectronCollection
private

Definition at line 64 of file RecoSelector.h.

const reco::MuonCollection* RecoSelector::theMuonCollection
private

Definition at line 65 of file RecoSelector.h.

const reco::PhotonCollection* RecoSelector::thePhotonCollection
private

Definition at line 66 of file RecoSelector.h.