CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
LowPtElectronModifier Class Reference
Inheritance diagram for LowPtElectronModifier:
ModifyObjectValueBase

Public Member Functions

 LowPtElectronModifier (const edm::ParameterSet &conf, edm::ConsumesCollector &)
 
void modifyObject (pat::Electron &ele) const final
 
void setEvent (const edm::Event &) final
 
void setEventContent (const edm::EventSetup &) final
 
 ~LowPtElectronModifier () override=default
 
- Public Member Functions inherited from ModifyObjectValueBase
virtual void modifyObject (pat::Jet &) const
 
virtual void modifyObject (pat::Muon &) const
 
virtual void modifyObject (pat::Photon &) const
 
virtual void modifyObject (pat::Tau &) const
 
virtual void modifyObject (reco::BaseTau &) const
 
virtual void modifyObject (reco::GsfElectron &) const
 
virtual void modifyObject (reco::Jet &) const
 
virtual void modifyObject (reco::Muon &) const
 
virtual void modifyObject (reco::Photon &) const
 
 ModifyObjectValueBase (const edm::ParameterSet &conf)
 
const std::string & name () const
 
virtual ~ModifyObjectValueBase ()
 

Private Attributes

reco::BeamSpot const * beamSpot_ = nullptr
 
const edm::EDGetTokenT< reco::BeamSpotbeamSpotT_
 
reco::ConversionCollection const * conv_ = nullptr
 
const edm::EDGetTokenT< reco::ConversionCollectionconvT_
 
bool extra_
 
reco::VertexCollection const * vertices_ = nullptr
 
const edm::EDGetTokenT< reco::VertexCollectionverticesT_
 

Detailed Description

Definition at line 10 of file LowPtElectronsModifier.cc.

Constructor & Destructor Documentation

◆ LowPtElectronModifier()

LowPtElectronModifier::LowPtElectronModifier ( const edm::ParameterSet conf,
edm::ConsumesCollector cc 
)

Definition at line 32 of file LowPtElectronsModifier.cc.

33  : ModifyObjectValueBase(conf),
34  convT_(cc.consumes<reco::ConversionCollection>(conf.getParameter<edm::InputTag>("conversions"))),
35  conv_(),
36  beamSpotT_(cc.consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpot"))),
37  beamSpot_(),
38  verticesT_(cc.consumes<reco::VertexCollection>(conf.getParameter<edm::InputTag>("vertices"))),
39  vertices_(),
40  extra_(conf.getParameter<bool>("addExtraUserVars")) {
41  ;
42 }

◆ ~LowPtElectronModifier()

LowPtElectronModifier::~LowPtElectronModifier ( )
overridedefault

Member Function Documentation

◆ modifyObject()

void LowPtElectronModifier::modifyObject ( pat::Electron ele) const
finalvirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 58 of file LowPtElectronsModifier.cc.

58  {
59  // Embed Conversion info
61  conv.match(*beamSpot_, *conv_, ele);
62  conv.addUserVars(ele);
63  if (extra_) {
64  conv.addExtraUserVars(ele);
65  }
66  // Set impact parameters
67  auto const& gsfTrack = *ele.gsfTrack();
68  if (!vertices_->empty()) {
69  const reco::Vertex& pv = vertices_->front();
70  ele.setDB(gsfTrack.dxy(pv.position()),
71  gsfTrack.dxyError(pv.position(), pv.covariance()),
72  pat::Electron::PV2D); // PV2D
73  ele.setDB(gsfTrack.dz(pv.position()), std::hypot(gsfTrack.dzError(), pv.zError()),
74  pat::Electron::PVDZ); // PVDZ
75  }
76  ele.setDB(gsfTrack.dxy(*beamSpot_), gsfTrack.dxyError(*beamSpot_),
77  pat::Electron::BS2D); // BS2D
78 }

References beamSpot_, pat::Electron::BS2D, conv, conv_, extra_, pat::Electron::gsfTrack(), MetAnalyzer::pv(), pat::Electron::PV2D, pat::Electron::PVDZ, pat::Electron::setDB(), and vertices_.

◆ setEvent()

void LowPtElectronModifier::setEvent ( const edm::Event iEvent)
finalvirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 46 of file LowPtElectronsModifier.cc.

46  {
47  conv_ = &iEvent.get(convT_);
48  beamSpot_ = &iEvent.get(beamSpotT_);
49  vertices_ = &iEvent.get(verticesT_);
50 }

References beamSpot_, beamSpotT_, conv_, convT_, iEvent, vertices_, and verticesT_.

◆ setEventContent()

void LowPtElectronModifier::setEventContent ( const edm::EventSetup iSetup)
finalvirtual

Reimplemented from ModifyObjectValueBase.

Definition at line 54 of file LowPtElectronsModifier.cc.

54 {}

Member Data Documentation

◆ beamSpot_

reco::BeamSpot const* LowPtElectronModifier::beamSpot_ = nullptr
private

Definition at line 24 of file LowPtElectronsModifier.cc.

Referenced by modifyObject(), and setEvent().

◆ beamSpotT_

const edm::EDGetTokenT<reco::BeamSpot> LowPtElectronModifier::beamSpotT_
private

Definition at line 23 of file LowPtElectronsModifier.cc.

Referenced by setEvent().

◆ conv_

reco::ConversionCollection const* LowPtElectronModifier::conv_ = nullptr
private

Definition at line 22 of file LowPtElectronsModifier.cc.

Referenced by modifyObject(), and setEvent().

◆ convT_

const edm::EDGetTokenT<reco::ConversionCollection> LowPtElectronModifier::convT_
private

Definition at line 21 of file LowPtElectronsModifier.cc.

Referenced by setEvent().

◆ extra_

bool LowPtElectronModifier::extra_
private

Definition at line 27 of file LowPtElectronsModifier.cc.

Referenced by modifyObject().

◆ vertices_

reco::VertexCollection const* LowPtElectronModifier::vertices_ = nullptr
private

Definition at line 26 of file LowPtElectronsModifier.cc.

Referenced by modifyObject(), and setEvent().

◆ verticesT_

const edm::EDGetTokenT<reco::VertexCollection> LowPtElectronModifier::verticesT_
private

Definition at line 25 of file LowPtElectronsModifier.cc.

Referenced by setEvent().

LowPtConversion
Definition: LowPtConversion.h:13
pat::Electron::PV2D
Definition: Electron.h:190
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
pat::Electron::gsfTrack
reco::GsfTrackRef gsfTrack() const override
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster
pat::Electron::BS2D
Definition: Electron.h:190
LowPtElectronModifier::verticesT_
const edm::EDGetTokenT< reco::VertexCollection > verticesT_
Definition: LowPtElectronsModifier.cc:25
ModifyObjectValueBase::ModifyObjectValueBase
ModifyObjectValueBase(const edm::ParameterSet &conf)
Definition: ModifyObjectValueBase.h:20
reco::ConversionCollection
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
pat::Electron::setDB
void setDB(double dB, double edB, IPTYPE type)
Set impact parameter of a certain type and its uncertainty.
reco::BeamSpot
Definition: BeamSpot.h:21
LowPtElectronModifier::extra_
bool extra_
Definition: LowPtElectronsModifier.cc:27
LowPtElectronModifier::convT_
const edm::EDGetTokenT< reco::ConversionCollection > convT_
Definition: LowPtElectronsModifier.cc:21
LowPtElectronModifier::conv_
reco::ConversionCollection const * conv_
Definition: LowPtElectronsModifier.cc:22
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
iEvent
int iEvent
Definition: GenABIO.cc:224
cc
pat::Electron::PVDZ
Definition: Electron.h:190
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
LowPtElectronModifier::beamSpot_
reco::BeamSpot const * beamSpot_
Definition: LowPtElectronsModifier.cc:24
LowPtElectronModifier::beamSpotT_
const edm::EDGetTokenT< reco::BeamSpot > beamSpotT_
Definition: LowPtElectronsModifier.cc:23
edm::InputTag
Definition: InputTag.h:15
reco::Vertex
Definition: Vertex.h:35
LowPtElectronModifier::vertices_
reco::VertexCollection const * vertices_
Definition: LowPtElectronsModifier.cc:26
conv
EPOS::IO_EPOS conv
Definition: ReggeGribovPartonMCHadronizer.cc:42