CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
LightPFTrackProducer Class Reference

#include <LightPFTrackProducer.h>

Inheritance diagram for LightPFTrackProducer:
edm::stream::EDProducer<>

Public Member Functions

 LightPFTrackProducer (const edm::ParameterSet &)
 Constructor. More...
 
 ~LightPFTrackProducer () override
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 
void produce (edm::Event &, const edm::EventSetup &) override
 Produce the PFRecTrack collection. More...
 

Private Attributes

PFTrackTransformerpfTransformer_
 PFTrackTransformer. More...
 
reco::TrackBase::TrackQuality trackQuality_
 
std::vector< edm::EDGetTokenT< reco::TrackCollection > > tracksContainers_
 
bool useQuality_
 TRACK QUALITY. More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 13 of file LightPFTrackProducer.h.

Constructor & Destructor Documentation

◆ LightPFTrackProducer()

LightPFTrackProducer::LightPFTrackProducer ( const edm::ParameterSet iConfig)
explicit

Constructor.

Definition at line 14 of file LightPFTrackProducer.cc.

14  : pfTransformer_(nullptr) {
15  produces<reco::PFRecTrackCollection>();
16 
17  std::vector<InputTag> tags = iConfig.getParameter<vector<InputTag> >("TkColList");
18 
19  for (unsigned int i = 0; i < tags.size(); ++i)
20  tracksContainers_.push_back(consumes<reco::TrackCollection>(tags[i]));
21 
22  useQuality_ = iConfig.getParameter<bool>("UseQuality");
24 }

References edm::ParameterSet::getParameter(), mps_fire::i, reco::TrackBase::qualityByName(), AlCaHLTBitMon_QueryRunRegistry::string, triggerMatcherToHLTDebug_cfi::tags, trackQuality_, tracksContainers_, and useQuality_.

◆ ~LightPFTrackProducer()

LightPFTrackProducer::~LightPFTrackProducer ( )
override

Destructor.

Definition at line 26 of file LightPFTrackProducer.cc.

26 { delete pfTransformer_; }

References pfTransformer_.

Member Function Documentation

◆ beginRun()

void LightPFTrackProducer::beginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprivate

◆ endRun()

void LightPFTrackProducer::endRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 61 of file LightPFTrackProducer.cc.

61  {
62  delete pfTransformer_;
63  pfTransformer_ = nullptr;
64 }

References pfTransformer_.

◆ produce()

void LightPFTrackProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Produce the PFRecTrack collection.

Definition at line 28 of file LightPFTrackProducer.cc.

28  {
29  //create the empty collections
30  auto PfTrColl = std::make_unique<reco::PFRecTrackCollection>();
31 
32  for (unsigned int istr = 0; istr < tracksContainers_.size(); istr++) {
33  //Track collection
34  Handle<reco::TrackCollection> tkRefCollection;
35  iEvent.getByToken(tracksContainers_[istr], tkRefCollection);
36  reco::TrackCollection Tk = *(tkRefCollection.product());
37  for (unsigned int i = 0; i < Tk.size(); i++) {
38  if (useQuality_ && (!(Tk[i].quality(trackQuality_))))
39  continue;
40  reco::TrackRef trackRef(tkRefCollection, i);
41  reco::PFRecTrack pftrack(trackRef->charge(), reco::PFRecTrack::KF, i, trackRef);
42  Trajectory FakeTraj;
43  bool mymsgwarning = false;
44  bool valid = pfTransformer_->addPoints(pftrack, *trackRef, FakeTraj, mymsgwarning);
45  if (valid)
46  PfTrColl->push_back(pftrack);
47  }
48  }
49  iEvent.put(std::move(PfTrColl));
50 }

References PFTrackTransformer::addPoints(), mps_fire::i, iEvent, reco::PFRecTrack::KF, eostools::move(), pfTransformer_, edm::Handle< T >::product(), qcdUeDQM_cfi::quality, trackQuality_, tracksContainers_, useQuality_, and validateGeometry_cfg::valid.

Member Data Documentation

◆ pfTransformer_

PFTrackTransformer* LightPFTrackProducer::pfTransformer_
private

◆ trackQuality_

reco::TrackBase::TrackQuality LightPFTrackProducer::trackQuality_
private

Definition at line 33 of file LightPFTrackProducer.h.

Referenced by LightPFTrackProducer(), and produce().

◆ tracksContainers_

std::vector<edm::EDGetTokenT<reco::TrackCollection> > LightPFTrackProducer::tracksContainers_
private

Definition at line 30 of file LightPFTrackProducer.h.

Referenced by LightPFTrackProducer(), and produce().

◆ useQuality_

bool LightPFTrackProducer::useQuality_
private

TRACK QUALITY.

Definition at line 32 of file LightPFTrackProducer.h.

Referenced by LightPFTrackProducer(), and produce().

mps_fire.i
i
Definition: mps_fire.py:355
edm::Handle::product
T const * product() const
Definition: Handle.h:70
HLT_2018_cff.magneticField
magneticField
Definition: HLT_2018_cff.py:348
LightPFTrackProducer::trackQuality_
reco::TrackBase::TrackQuality trackQuality_
Definition: LightPFTrackProducer.h:33
LightPFTrackProducer::tracksContainers_
std::vector< edm::EDGetTokenT< reco::TrackCollection > > tracksContainers_
Definition: LightPFTrackProducer.h:30
reco::PFRecTrack::KF
Definition: PFRecTrack.h:27
edm::Handle< reco::TrackCollection >
validateGeometry_cfg.valid
valid
Definition: validateGeometry_cfg.py:21
edm::Ref< TrackCollection >
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
PFTrackTransformer::addPoints
bool addPoints(reco::PFRecTrack &pftrack, const reco::Track &track, const Trajectory &traj, bool msgwarning=true) const
Add points to a PFTrack. return false if a TSOS is invalid.
Definition: PFTrackTransformer.cc:40
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
LightPFTrackProducer::useQuality_
bool useQuality_
TRACK QUALITY.
Definition: LightPFTrackProducer.h:32
edm::ESHandle< MagneticField >
LightPFTrackProducer::pfTransformer_
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
Definition: LightPFTrackProducer.h:29
Point3DBase< float, GlobalTag >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
iEvent
int iEvent
Definition: GenABIO.cc:224
get
#define get
reco::TrackBase::qualityByName
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
reco::PFRecTrack
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:22
Trajectory
Definition: Trajectory.h:38
PFTrackTransformer::OnlyProp
void OnlyProp()
Definition: PFTrackTransformer.h:54
triggerMatcherToHLTDebug_cfi.tags
tags
Definition: triggerMatcherToHLTDebug_cfi.py:9
PFTrackTransformer
Definition: PFTrackTransformer.h:34
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14