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
GsfEleConversionVetoCut Class Reference
Inheritance diagram for GsfEleConversionVetoCut:
CutApplicatorWithEventContentBase CutApplicatorBase candidate_functions::CandidateCut

Public Member Functions

CandidateType candidateType () const overridefinal
 
void getEventContent (const edm::EventBase &) overridefinal
 
 GsfEleConversionVetoCut (const edm::ParameterSet &c)
 
result_type operator() (const reco::GsfElectronPtr &) const overridefinal
 
void setConsumes (edm::ConsumesCollector &) overridefinal
 
double value (const reco::CandidatePtr &cand) const overridefinal
 
- Public Member Functions inherited from CutApplicatorWithEventContentBase
 CutApplicatorWithEventContentBase ()
 
 CutApplicatorWithEventContentBase (const edm::ParameterSet &c)
 
 CutApplicatorWithEventContentBase (const CutApplicatorWithEventContentBase &)=delete
 
CutApplicatorWithEventContentBaseoperator= (const CutApplicatorWithEventContentBase &)=delete
 
virtual ~CutApplicatorWithEventContentBase ()
 Destructor. More...
 
- Public Member Functions inherited from CutApplicatorBase
virtual result_type asCandidate (const argument_type &) const
 
 CutApplicatorBase ()
 
 CutApplicatorBase (const edm::ParameterSet &c)
 
 CutApplicatorBase (const CutApplicatorBase &)=delete
 
virtual const std::string & name () const
 
virtual result_type operator() (const argument_type &) const final
 
virtual result_type operator() (const pat::ElectronPtr &) const
 
virtual result_type operator() (const reco::PhotonPtr &) const
 
virtual result_type operator() (const pat::PhotonPtr &) const
 
virtual result_type operator() (const reco::MuonPtr &) const
 
virtual result_type operator() (const pat::MuonPtr &) const
 
virtual result_type operator() (const reco::PFTauPtr &) const
 
virtual result_type operator() (const pat::TauPtr &) const
 
CutApplicatorBaseoperator= (const CutApplicatorBase &)=delete
 
virtual ~CutApplicatorBase ()
 Destructor. More...
 
- Public Member Functions inherited from candidate_functions::CandidateCut
 CandidateCut ()
 
virtual ~CandidateCut ()
 

Private Attributes

edm::Handle
< reco::ConversionCollection
_convs
 
edm::Handle< reco::BeamSpot_thebs
 

Additional Inherited Members

- Public Types inherited from CutApplicatorBase
enum  CandidateType {
  NONE, ELECTRON, MUON, PHOTON,
  TAU, PATELECTRON, PATMUON, PATPHOTON,
  PATTAU
}
 
- Protected Attributes inherited from CutApplicatorWithEventContentBase
std::unordered_map
< std::string, edm::InputTag
contentTags_
 
std::unordered_map
< std::string, edm::EDGetToken
contentTokens_
 

Detailed Description

Definition at line 8 of file GsfEleConversionVetoCut.cc.

Constructor & Destructor Documentation

GsfEleConversionVetoCut::GsfEleConversionVetoCut ( const edm::ParameterSet c)

Definition at line 32 of file GsfEleConversionVetoCut.cc.

References CutApplicatorWithEventContentBase::contentTags_, and edm::ParameterSet::getParameter().

32  :
34 
35  edm::InputTag conversiontag = c.getParameter<edm::InputTag>("conversionSrc");
36  contentTags_.emplace("conversions",conversiontag);
37 
38  edm::InputTag conversiontagMiniAOD = c.getParameter<edm::InputTag>("conversionSrcMiniAOD");
39  contentTags_.emplace("conversionsMiniAOD",conversiontagMiniAOD);
40 
41  edm::InputTag beamspottag = c.getParameter<edm::InputTag>("beamspotSrc");
42  contentTags_.emplace("beamspot",beamspottag);
43 }
T getParameter(std::string const &) const
std::unordered_map< std::string, edm::InputTag > contentTags_

Member Function Documentation

CandidateType GsfEleConversionVetoCut::candidateType ( ) const
inlinefinaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 19 of file GsfEleConversionVetoCut.cc.

References CutApplicatorBase::ELECTRON.

19  {
20  return ELECTRON;
21  }
void GsfEleConversionVetoCut::getEventContent ( const edm::EventBase ev)
finaloverridevirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 54 of file GsfEleConversionVetoCut.cc.

References _convs, _thebs, CutApplicatorWithEventContentBase::contentTags_, edm::EventBase::getByLabel(), and edm::HandleBase::isValid().

54  {
55 
56  // First try AOD, then go to miniAOD. Use the same Handle since collection class is the same.
57  ev.getByLabel(contentTags_["conversions"],_convs);
58  if (!_convs.isValid())
59  ev.getByLabel(contentTags_["conversionsMiniAOD"],_convs);
60 
61  ev.getByLabel(contentTags_["beamspot"],_thebs);
62 }
edm::Handle< reco::BeamSpot > _thebs
std::unordered_map< std::string, edm::InputTag > contentTags_
edm::Handle< reco::ConversionCollection > _convs
bool isValid() const
Definition: HandleBase.h:75
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:90
CutApplicatorBase::result_type GsfEleConversionVetoCut::operator() ( const reco::GsfElectronPtr cand) const
finaloverridevirtual

Reimplemented from CutApplicatorBase.

Definition at line 66 of file GsfEleConversionVetoCut.cc.

References _convs, _thebs, ConversionTools::hasMatchedConversion(), and edm::HandleBase::isValid().

66  {
67  if( _thebs.isValid() && _convs.isValid() ) {
69  _thebs->position());
70  } else {
71  edm::LogWarning("GsfEleConversionVetoCut")
72  << "Couldn't find a necessary collection, returning true!";
73  }
74  return true;
75 }
edm::Handle< reco::BeamSpot > _thebs
edm::Handle< reco::ConversionCollection > _convs
bool isValid() const
Definition: HandleBase.h:75
static bool hasMatchedConversion(const reco::GsfElectron &ele, const edm::Handle< reco::ConversionCollection > &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0)
void GsfEleConversionVetoCut::setConsumes ( edm::ConsumesCollector cc)
finaloverridevirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 45 of file GsfEleConversionVetoCut.cc.

References edm::ConsumesCollector::consumes(), CutApplicatorWithEventContentBase::contentTags_, CutApplicatorWithEventContentBase::contentTokens_, and edm::ConsumesCollector::mayConsume().

45  {
46  auto convs = cc.mayConsume<reco::ConversionCollection>(contentTags_["conversions"]);
47  auto convsMiniAOD = cc.mayConsume<reco::ConversionCollection>(contentTags_["conversionsMiniAOD"]);
48  auto thebs = cc.consumes<reco::BeamSpot>(contentTags_["beamspot"]);
49  contentTokens_.emplace("conversions",convs);
50  contentTokens_.emplace("conversionsMiniAOD",convsMiniAOD);
51  contentTokens_.emplace("beamspot",thebs);
52 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
std::unordered_map< std::string, edm::InputTag > contentTags_
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
double GsfEleConversionVetoCut::value ( const reco::CandidatePtr cand) const
finaloverridevirtual

Implements candidate_functions::CandidateCut.

Definition at line 77 of file GsfEleConversionVetoCut.cc.

References _convs, _thebs, ConversionTools::hasMatchedConversion(), and edm::HandleBase::isValid().

77  {
78  reco::GsfElectronPtr ele(cand);
79  if( _thebs.isValid() && _convs.isValid() ) {
81  _thebs->position());
82  } else {
83  edm::LogWarning("GsfEleConversionVetoCut")
84  << "Couldn't find a necessary collection, returning true!";
85  return true;
86  }
87 }
edm::Handle< reco::BeamSpot > _thebs
edm::Handle< reco::ConversionCollection > _convs
bool isValid() const
Definition: HandleBase.h:75
static bool hasMatchedConversion(const reco::GsfElectron &ele, const edm::Handle< reco::ConversionCollection > &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0)

Member Data Documentation

edm::Handle<reco::ConversionCollection> GsfEleConversionVetoCut::_convs
private

Definition at line 24 of file GsfEleConversionVetoCut.cc.

Referenced by getEventContent(), operator()(), and value().

edm::Handle<reco::BeamSpot> GsfEleConversionVetoCut::_thebs
private

Definition at line 25 of file GsfEleConversionVetoCut.cc.

Referenced by getEventContent(), operator()(), and value().