CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
PFV0Producer Class Reference
Inheritance diagram for PFV0Producer:
edm::stream::EDProducer<>

Public Member Functions

 PFV0Producer (const edm::ParameterSet &)
 Constructor. More...
 
 ~PFV0Producer () 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...
 
std::vector< edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > > V0list_
 

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 13 of file PFV0Producer.cc.

Constructor & Destructor Documentation

◆ PFV0Producer()

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

Constructor.

Definition at line 41 of file PFV0Producer.cc.

42  : pfTransformer_(nullptr), magneticFieldToken_(esConsumes<edm::Transition::BeginRun>()) {
43  produces<reco::PFV0Collection>();
44  produces<reco::PFRecTrackCollection>();
45 
46  std::vector<edm::InputTag> tags = iConfig.getParameter<vector<InputTag> >("V0List");
47 
48  for (unsigned int i = 0; i < tags.size(); ++i)
49  V0list_.push_back(consumes<reco::VertexCompositeCandidateCollection>(tags[i]));
50 }

References edm::BeginRun, edm::ParameterSet::getParameter(), mps_fire::i, triggerMatcherToHLTDebug_cfi::tags, and V0list_.

◆ ~PFV0Producer()

PFV0Producer::~PFV0Producer ( )
override

Destructor.

Definition at line 52 of file PFV0Producer.cc.

52 { delete pfTransformer_; }

References pfTransformer_.

Member Function Documentation

◆ beginRun()

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

◆ endRun()

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

Definition at line 103 of file PFV0Producer.cc.

103  {
104  delete pfTransformer_;
105  pfTransformer_ = nullptr;
106 }

References pfTransformer_.

◆ produce()

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

Produce the PFRecTrack collection.

Definition at line 54 of file PFV0Producer.cc.

54  {
55  LogDebug("PFV0Producer") << "START event: " << iEvent.id().event() << " in run " << iEvent.id().run();
56  //create the empty collections
57  auto pfV0Coll = std::make_unique<PFV0Collection>();
58 
59  auto pfV0RecTrackColl = std::make_unique<reco::PFRecTrackCollection>();
60 
61  reco::PFRecTrackRefProd pfTrackRefProd = iEvent.getRefBeforePut<reco::PFRecTrackCollection>();
62  int idx = 0;
63 
64  for (unsigned int il = 0; il < V0list_.size(); il++) {
66  iEvent.getByToken(V0list_[il], V0coll);
67  LogDebug("PFV0Producer") << "V0list_[" << il << "] contains " << V0coll->size() << " V0 candidates ";
68  for (unsigned int iv = 0; iv < V0coll->size(); iv++) {
69  VertexCompositeCandidateRef V0(V0coll, iv);
70  vector<TrackRef> Tracks;
71  vector<PFRecTrackRef> PFTracks;
72  for (unsigned int ndx = 0; ndx < V0->numberOfDaughters(); ndx++) {
73  Tracks.push_back((dynamic_cast<const RecoChargedCandidate*>(V0->daughter(ndx)))->track());
74  TrackRef trackRef = (dynamic_cast<const RecoChargedCandidate*>(V0->daughter(ndx)))->track();
75 
76  reco::PFRecTrack pfRecTrack(trackRef->charge(), reco::PFRecTrack::KF, trackRef.key(), trackRef);
77 
78  Trajectory FakeTraj;
79  bool valid = pfTransformer_->addPoints(pfRecTrack, *trackRef, FakeTraj);
80  if (valid) {
81  PFTracks.push_back(reco::PFRecTrackRef(pfTrackRefProd, idx++));
82  pfV0RecTrackColl->push_back(pfRecTrack);
83  }
84  }
85  if ((PFTracks.size() == 2) && (Tracks.size() == 2)) {
86  pfV0Coll->push_back(PFV0(V0, PFTracks, Tracks));
87  }
88  }
89  }
90 
91  iEvent.put(std::move(pfV0Coll));
92  iEvent.put(std::move(pfV0RecTrackColl));
93 }

References PFTrackTransformer::addPoints(), heavyIonCSV_trainingSettings::idx, iEvent, gpuVertexFinder::iv, edm::Ref< C, T, F >::key(), reco::PFRecTrack::KF, LogDebug, eostools::move(), pfTransformer_, pfTrackElec_cfi::PFV0, gather_cfg::Tracks, V0list_, and RunInfoPI::valid.

Member Data Documentation

◆ magneticFieldToken_

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

Definition at line 32 of file PFV0Producer.cc.

Referenced by beginRun().

◆ pfTransformer_

PFTrackTransformer* PFV0Producer::pfTransformer_
private

PFTrackTransformer.

Definition at line 29 of file PFV0Producer.cc.

Referenced by beginRun(), endRun(), produce(), and ~PFV0Producer().

◆ V0list_

std::vector<edm::EDGetTokenT<reco::VertexCompositeCandidateCollection> > PFV0Producer::V0list_
private

Definition at line 30 of file PFV0Producer.cc.

Referenced by PFV0Producer(), and produce().

edm::RefProd
Definition: EDProductfwd.h:25
mps_fire.i
i
Definition: mps_fire.py:428
gpuVertexFinder::iv
int32_t *__restrict__ iv
Definition: gpuClusterTracksDBSCAN.h:42
reco::PFRecTrack::KF
Definition: PFRecTrack.h:25
HLT_FULL_cff.magneticField
magneticField
Definition: HLT_FULL_cff.py:348
edm::Handle
Definition: AssociativeIterator.h:50
edm::Ref< VertexCompositeCandidateCollection >
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
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
Point3DBase< float, GlobalTag >
PFV0Producer::pfTransformer_
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
Definition: PFV0Producer.cc:29
pfTrackElec_cfi.PFV0
PFV0
Definition: pfTrackElec_cfi.py:27
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
iEvent
int iEvent
Definition: GenABIO.cc:224
gather_cfg.Tracks
Tracks
Definition: gather_cfg.py:251
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
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
PFV0Producer::V0list_
std::vector< edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > > V0list_
Definition: PFV0Producer.cc:30
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
triggerMatcherToHLTDebug_cfi.tags
tags
Definition: triggerMatcherToHLTDebug_cfi.py:9
reco::PFRecTrackCollection
std::vector< PFRecTrack > PFRecTrackCollection
collection of PFRecTrack objects
Definition: PFRecTrackFwd.h:9
edm::Ref::key
key_type key() const
Accessor for product key.
Definition: Ref.h:250
RunInfoPI::valid
Definition: RunInfoPayloadInspectoHelper.h:16
PFTrackTransformer
Definition: PFTrackTransformer.h:34
PFV0Producer::magneticFieldToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
Definition: PFV0Producer.cc:32