CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
LightPFTrackProducer Class Reference
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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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

const edm::ESGetToken< MagneticField, IdealMagneticFieldRecordmagneticFieldToken_
 
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<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 12 of file LightPFTrackProducer.cc.

Constructor & Destructor Documentation

◆ LightPFTrackProducer()

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

Constructor.

Definition at line 42 of file LightPFTrackProducer.cc.

43  : pfTransformer_(nullptr), magneticFieldToken_(esConsumes<edm::Transition::BeginRun>()) {
44  produces<reco::PFRecTrackCollection>();
45 
46  std::vector<InputTag> tags = iConfig.getParameter<vector<InputTag> >("TkColList");
47 
48  for (unsigned int i = 0; i < tags.size(); ++i)
49  tracksContainers_.push_back(consumes<reco::TrackCollection>(tags[i]));
50 
51  useQuality_ = iConfig.getParameter<bool>("UseQuality");
53 }

References edm::BeginRun, 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 55 of file LightPFTrackProducer.cc.

55 { 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 89 of file LightPFTrackProducer.cc.

89  {
90  delete pfTransformer_;
91  pfTransformer_ = nullptr;
92 }

References pfTransformer_.

◆ produce()

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

Produce the PFRecTrack collection.

Definition at line 57 of file LightPFTrackProducer.cc.

57  {
58  //create the empty collections
59  auto PfTrColl = std::make_unique<reco::PFRecTrackCollection>();
60 
61  for (unsigned int istr = 0; istr < tracksContainers_.size(); istr++) {
62  //Track collection
63  Handle<reco::TrackCollection> tkRefCollection;
64  iEvent.getByToken(tracksContainers_[istr], tkRefCollection);
65  reco::TrackCollection Tk = *(tkRefCollection.product());
66  for (unsigned int i = 0; i < Tk.size(); i++) {
67  if (useQuality_ && (!(Tk[i].quality(trackQuality_))))
68  continue;
69  reco::TrackRef trackRef(tkRefCollection, i);
70  reco::PFRecTrack pftrack(trackRef->charge(), reco::PFRecTrack::KF, i, trackRef);
71  Trajectory FakeTraj;
72  bool mymsgwarning = false;
73  bool valid = pfTransformer_->addPoints(pftrack, *trackRef, FakeTraj, mymsgwarning);
74  if (valid)
75  PfTrColl->push_back(pftrack);
76  }
77  }
78  iEvent.put(std::move(PfTrColl));
79 }

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

Member Data Documentation

◆ magneticFieldToken_

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> LightPFTrackProducer::magneticFieldToken_
private

Definition at line 31 of file LightPFTrackProducer.cc.

Referenced by beginRun().

◆ pfTransformer_

PFTrackTransformer* LightPFTrackProducer::pfTransformer_
private

◆ trackQuality_

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

Definition at line 34 of file LightPFTrackProducer.cc.

Referenced by LightPFTrackProducer(), and produce().

◆ tracksContainers_

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

Definition at line 29 of file LightPFTrackProducer.cc.

Referenced by LightPFTrackProducer(), and produce().

◆ useQuality_

bool LightPFTrackProducer::useQuality_
private

TRACK QUALITY.

Definition at line 33 of file LightPFTrackProducer.cc.

Referenced by LightPFTrackProducer(), and produce().

mps_fire.i
i
Definition: mps_fire.py:428
edm::Handle::product
T const * product() const
Definition: Handle.h:70
LightPFTrackProducer::trackQuality_
reco::TrackBase::TrackQuality trackQuality_
Definition: LightPFTrackProducer.cc:34
LightPFTrackProducer::tracksContainers_
std::vector< edm::EDGetTokenT< reco::TrackCollection > > tracksContainers_
Definition: LightPFTrackProducer.cc:29
reco::PFRecTrack::KF
Definition: PFRecTrack.h:25
HLT_FULL_cff.magneticField
magneticField
Definition: HLT_FULL_cff.py:348
LightPFTrackProducer::magneticFieldToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
Definition: LightPFTrackProducer.cc:31
edm::Handle< reco::TrackCollection >
edm::Ref< TrackCollection >
quality
const uint32_t *__restrict__ Quality * quality
Definition: CAHitNtupletGeneratorKernelsImpl.h:122
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
LightPFTrackProducer::useQuality_
bool useQuality_
TRACK QUALITY.
Definition: LightPFTrackProducer.cc:33
LightPFTrackProducer::pfTransformer_
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
Definition: LightPFTrackProducer.cc:28
Point3DBase< float, GlobalTag >
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
iEvent
int iEvent
Definition: GenABIO.cc:224
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
reco::TrackBase::qualityByName
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
eostools.move
def move(src, dest)
Definition: eostools.py:511
reco::PFRecTrack
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:20
Trajectory
Definition: Trajectory.h:38
PFTrackTransformer::OnlyProp
void OnlyProp()
Definition: PFTrackTransformer.h:54
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
triggerMatcherToHLTDebug_cfi.tags
tags
Definition: triggerMatcherToHLTDebug_cfi.py:9
RunInfoPI::valid
Definition: RunInfoPayloadInspectoHelper.h:16
PFTrackTransformer
Definition: PFTrackTransformer.h:34
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14