CMS 3D CMS Logo

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 final
 
void getEventContent (const edm::EventBase &) final
 
 GsfEleConversionVetoCut (const edm::ParameterSet &c)
 
result_type operator() (const reco::GsfElectronPtr &) const final
 
void setConsumes (edm::ConsumesCollector &) final
 
double value (const reco::CandidatePtr &cand) const final
 
- Public Member Functions inherited from CutApplicatorWithEventContentBase
 CutApplicatorWithEventContentBase ()
 
 CutApplicatorWithEventContentBase (const CutApplicatorWithEventContentBase &)=delete
 
 CutApplicatorWithEventContentBase (const edm::ParameterSet &c)
 
CutApplicatorWithEventContentBaseoperator= (const CutApplicatorWithEventContentBase &)=delete
 
 ~CutApplicatorWithEventContentBase () override
 Destructor. More...
 
- Public Member Functions inherited from CutApplicatorBase
virtual result_type asCandidate (const argument_type &) const
 
 CutApplicatorBase ()
 
 CutApplicatorBase (const CutApplicatorBase &)=delete
 
 CutApplicatorBase (const edm::ParameterSet &c)
 
const std::string & name () const override
 
result_type operator() (const argument_type &) const final
 
virtual result_type operator() (const pat::ElectronPtr &) const
 
virtual result_type operator() (const pat::MuonPtr &) const
 
virtual result_type operator() (const pat::PhotonPtr &) const
 
virtual result_type operator() (const pat::TauPtr &) const
 
virtual result_type operator() (const reco::MuonPtr &) const
 
virtual result_type operator() (const reco::PFTauPtr &) const
 
virtual result_type operator() (const reco::PhotonPtr &) const
 
CutApplicatorBaseoperator= (const CutApplicatorBase &)=delete
 
 ~CutApplicatorBase () override
 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
}
 
- Public Types inherited from candidate_functions::CandidateCut
using argument_type = reco::CandidatePtr
 
using result_type = bool
 
- Protected Attributes inherited from CutApplicatorWithEventContentBase
std::unordered_map< std::string, edm::InputTagcontentTags_
 
std::unordered_map< std::string, edm::EDGetTokencontentTokens_
 

Detailed Description

Definition at line 8 of file GsfEleConversionVetoCut.cc.

Constructor & Destructor Documentation

◆ GsfEleConversionVetoCut()

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

Definition at line 28 of file GsfEleConversionVetoCut.cc.

29  edm::InputTag conversiontag = c.getParameter<edm::InputTag>("conversionSrc");
30  contentTags_.emplace("conversions", conversiontag);
31 
32  edm::InputTag conversiontagMiniAOD = c.getParameter<edm::InputTag>("conversionSrcMiniAOD");
33  contentTags_.emplace("conversionsMiniAOD", conversiontagMiniAOD);
34 
35  edm::InputTag beamspottag = c.getParameter<edm::InputTag>("beamspotSrc");
36  contentTags_.emplace("beamspot", beamspottag);
37 }

References c, and CutApplicatorWithEventContentBase::contentTags_.

Member Function Documentation

◆ candidateType()

CandidateType GsfEleConversionVetoCut::candidateType ( ) const
inlinefinalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 19 of file GsfEleConversionVetoCut.cc.

19 { return ELECTRON; }

References CutApplicatorBase::ELECTRON.

◆ getEventContent()

void GsfEleConversionVetoCut::getEventContent ( const edm::EventBase ev)
finalvirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 48 of file GsfEleConversionVetoCut.cc.

48  {
49  // First try AOD, then go to miniAOD. Use the same Handle since collection class is the same.
50  ev.getByLabel(contentTags_["conversions"], _convs);
51  if (!_convs.isValid())
52  ev.getByLabel(contentTags_["conversionsMiniAOD"], _convs);
53 
54  ev.getByLabel(contentTags_["beamspot"], _thebs);
55 }

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

◆ operator()()

CutApplicatorBase::result_type GsfEleConversionVetoCut::operator() ( const reco::GsfElectronPtr cand) const
finalvirtual

Reimplemented from CutApplicatorBase.

Definition at line 57 of file GsfEleConversionVetoCut.cc.

57  {
58  if (_thebs.isValid() && _convs.isValid()) {
60  } else {
61  edm::LogWarning("GsfEleConversionVetoCut") << "Couldn't find a necessary collection, returning true!";
62  }
63  return true;
64 }

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

◆ setConsumes()

void GsfEleConversionVetoCut::setConsumes ( edm::ConsumesCollector cc)
finalvirtual

Implements CutApplicatorWithEventContentBase.

Definition at line 39 of file GsfEleConversionVetoCut.cc.

39  {
40  auto convs = cc.mayConsume<reco::ConversionCollection>(contentTags_["conversions"]);
41  auto convsMiniAOD = cc.mayConsume<reco::ConversionCollection>(contentTags_["conversionsMiniAOD"]);
42  auto thebs = cc.consumes<reco::BeamSpot>(contentTags_["beamspot"]);
43  contentTokens_.emplace("conversions", convs);
44  contentTokens_.emplace("conversionsMiniAOD", convsMiniAOD);
45  contentTokens_.emplace("beamspot", thebs);
46 }

References CutApplicatorWithEventContentBase::contentTags_, and CutApplicatorWithEventContentBase::contentTokens_.

◆ value()

double GsfEleConversionVetoCut::value ( const reco::CandidatePtr cand) const
finalvirtual

Implements candidate_functions::CandidateCut.

Definition at line 66 of file GsfEleConversionVetoCut.cc.

66  {
68  if (_thebs.isValid() && _convs.isValid()) {
70  } else {
71  edm::LogWarning("GsfEleConversionVetoCut") << "Couldn't find a necessary collection, returning true!";
72  return true;
73  }
74 }

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

Member Data Documentation

◆ _convs

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

Definition at line 22 of file GsfEleConversionVetoCut.cc.

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

◆ _thebs

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

Definition at line 23 of file GsfEleConversionVetoCut.cc.

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

GsfEleConversionVetoCut::_thebs
edm::Handle< reco::BeamSpot > _thebs
Definition: GsfEleConversionVetoCut.cc:23
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
GsfEleConversionVetoCut::_convs
edm::Handle< reco::ConversionCollection > _convs
Definition: GsfEleConversionVetoCut.cc:22
reco::ConversionCollection
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
CutApplicatorWithEventContentBase::contentTags_
std::unordered_map< std::string, edm::InputTag > contentTags_
Definition: CutApplicatorWithEventContentBase.h:35
reco::BeamSpot
Definition: BeamSpot.h:21
ConversionTools::hasMatchedConversion
static bool hasMatchedConversion(const reco::GsfElectron &ele, const reco::ConversionCollection &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0)
Definition: ConversionTools.cc:181
reco::BeamSpot::position
const Point & position() const
position
Definition: BeamSpot.h:59
CutApplicatorWithEventContentBase::CutApplicatorWithEventContentBase
CutApplicatorWithEventContentBase()
Definition: CutApplicatorWithEventContentBase.h:21
cand
Definition: decayParser.h:32
cc
edm::Ptr< reco::GsfElectron >
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
CutApplicatorWithEventContentBase::contentTokens_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
Definition: CutApplicatorWithEventContentBase.h:40
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
CutApplicatorBase::ELECTRON
Definition: CutApplicatorBase.h:47
edm::InputTag
Definition: InputTag.h:15