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 (reco::GsfElectron &) const
 
virtual void modifyObject (reco::Photon &) const
 
virtual void modifyObject (reco::Muon &) const
 
virtual void modifyObject (reco::BaseTau &) const
 
virtual void modifyObject (reco::Jet &) const
 
virtual void modifyObject (pat::Photon &) const
 
virtual void modifyObject (pat::Muon &) const
 
virtual void modifyObject (pat::Tau &) const
 
virtual void modifyObject (pat::Jet &) 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),
35  conv_(),
37  beamSpot_(),
39  vertices_(),
40  extra_(conf.getParameter<bool>("addExtraUserVars")) {
41  ;
42 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
reco::BeamSpot const * beamSpot_
const edm::EDGetTokenT< reco::BeamSpot > beamSpotT_
ModifyObjectValueBase(const edm::ParameterSet &conf)
const edm::EDGetTokenT< reco::VertexCollection > verticesT_
const edm::EDGetTokenT< reco::ConversionCollection > convT_
reco::ConversionCollection const * conv_
reco::VertexCollection const * vertices_

◆ ~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.

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

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 }
reco::GsfTrackRef gsfTrack() const override
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster ...
void setDB(double dB, double edB, IPTYPE type)
Set impact parameter of a certain type and its uncertainty.
reco::BeamSpot const * beamSpot_
def pv(vc)
Definition: MetAnalyzer.py:7
EPOS::IO_EPOS conv
reco::ConversionCollection const * conv_
reco::VertexCollection const * vertices_

◆ setEvent()

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

Reimplemented from ModifyObjectValueBase.

Definition at line 46 of file LowPtElectronsModifier.cc.

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

46  {
47  conv_ = &iEvent.get(convT_);
48  beamSpot_ = &iEvent.get(beamSpotT_);
49  vertices_ = &iEvent.get(verticesT_);
50 }
int iEvent
Definition: GenABIO.cc:224
reco::BeamSpot const * beamSpot_
const edm::EDGetTokenT< reco::BeamSpot > beamSpotT_
const edm::EDGetTokenT< reco::VertexCollection > verticesT_
const edm::EDGetTokenT< reco::ConversionCollection > convT_
reco::ConversionCollection const * conv_
reco::VertexCollection const * vertices_

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