CMS 3D CMS Logo

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

Public Member Functions

 PFDisplacedTrackerVertexProducer (const edm::ParameterSet &)
 Constructor. More...
 
 ~PFDisplacedTrackerVertexProducer () 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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

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_
 
edm::EDGetTokenT< reco::PFDisplacedVertexCollectionpfDisplacedVertexContainer_
 
edm::EDGetTokenT< reco::TrackCollectionpfTrackContainer_
 
PFTrackTransformerpfTransformer_
 PFTrackTransformer. 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 11 of file PFDisplacedTrackerVertexProducer.cc.

Constructor & Destructor Documentation

◆ PFDisplacedTrackerVertexProducer()

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

Constructor.

Definition at line 48 of file PFDisplacedTrackerVertexProducer.cc.

References edm::BeginRun, edm::ParameterSet::getParameter(), pfDisplacedVertexContainer_, and pfTrackContainer_.

49  : pfTransformer_(nullptr), magneticFieldToken_(esConsumes<edm::Transition::BeginRun>()) {
50  produces<reco::PFRecTrackCollection>();
51  produces<reco::PFDisplacedTrackerVertexCollection>();
52 
54  consumes<reco::PFDisplacedVertexCollection>(iConfig.getParameter<InputTag>("displacedTrackerVertexColl"));
55 
56  pfTrackContainer_ = consumes<reco::TrackCollection>(iConfig.getParameter<InputTag>("trackColl"));
57 }
edm::EDGetTokenT< reco::TrackCollection > pfTrackContainer_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< reco::PFDisplacedVertexCollection > pfDisplacedVertexContainer_
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_

◆ ~PFDisplacedTrackerVertexProducer()

PFDisplacedTrackerVertexProducer::~PFDisplacedTrackerVertexProducer ( )
override

Destructor.

Definition at line 59 of file PFDisplacedTrackerVertexProducer.cc.

References pfTransformer_.

59 { delete pfTransformer_; }
PFTrackTransformer * pfTransformer_
PFTrackTransformer.

Member Function Documentation

◆ beginRun()

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

Definition at line 117 of file PFDisplacedTrackerVertexProducer.cc.

References edm::EventSetup::getData(), HLT_2024v13_cff::magneticField, magneticFieldToken_, PFTrackTransformer::OnlyProp(), and pfTransformer_.

117  {
118  auto const& magneticField = &iSetup.getData(magneticFieldToken_);
121 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31

◆ endRun()

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

Definition at line 124 of file PFDisplacedTrackerVertexProducer.cc.

References pfTransformer_.

124  {
125  delete pfTransformer_;
126  pfTransformer_ = nullptr;
127 }
PFTrackTransformer * pfTransformer_
PFTrackTransformer.

◆ fillDescriptions()

void PFDisplacedTrackerVertexProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 39 of file PFDisplacedTrackerVertexProducer.cc.

References edm::ConfigurationDescriptions::add(), and submitPVResolutionJobs::desc.

39  {
41  desc.add<edm::InputTag>("displacedTrackerVertexColl", {"particleFlowDisplacedVertex"});
42  desc.add<edm::InputTag>("trackColl", {"generalTracks"});
43  descriptions.add("pfDisplacedTrackerVertex", desc);
44 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Produce the PFRecTrack collection.

Definition at line 61 of file PFDisplacedTrackerVertexProducer.cc.

References PFTrackTransformer::addPoints(), reco::TrackBase::charge(), icoll, heavyIonCSV_trainingSettings::idx, iEvent, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, edm::RefToBase< T >::key(), reco::PFRecTrack::KF, eostools::move(), pfDisplacedVertexContainer_, pfTrackContainer_, pfTransformer_, edm::RefVector< C, T, F >::push_back(), tkAlTrackRefitSequence_cff::refittedTracks, and validateGeometry_cfg::valid.

61  {
62  //create the empty collections
63  auto pfDisplacedTrackerVertexColl = std::make_unique<reco::PFDisplacedTrackerVertexCollection>();
64  auto pfRecTrackColl = std::make_unique<reco::PFRecTrackCollection>();
65 
66  reco::PFRecTrackRefProd pfTrackRefProd = iEvent.getRefBeforePut<reco::PFRecTrackCollection>();
67 
69  iEvent.getByToken(pfDisplacedVertexContainer_, nuclCollH);
70  const reco::PFDisplacedVertexCollection& nuclColl = *(nuclCollH.product());
71 
73  iEvent.getByToken(pfTrackContainer_, trackColl);
74 
75  int idx = 0;
76 
77  // cout << "Size of Displaced Vertices "
78  // << nuclColl.size() << endl;
79 
80  // loop on all NuclearInteraction
81  for (unsigned int icoll = 0; icoll < nuclColl.size(); icoll++) {
82  reco::PFRecTrackRefVector pfRecTkcoll;
83 
84  std::vector<reco::Track> refittedTracks = nuclColl[icoll].refittedTracks();
85 
86  // convert the secondary tracks
87  for (unsigned it = 0; it < refittedTracks.size(); it++) {
88  reco::TrackBaseRef trackBaseRef = nuclColl[icoll].originalTrack(refittedTracks[it]);
89 
90  // cout << "track base pt = " << trackBaseRef->pt() << endl;
91 
92  reco::TrackRef trackRef(trackColl, trackBaseRef.key());
93 
94  // cout << "track pt = " << trackRef->pt() << endl;
95 
96  reco::PFRecTrack pfRecTrack(trackBaseRef->charge(), reco::PFRecTrack::KF, trackBaseRef.key(), trackRef);
97 
98  // cout << pfRecTrack << endl;
99 
100  Trajectory FakeTraj;
101  bool valid = pfTransformer_->addPoints(pfRecTrack, *trackBaseRef, FakeTraj);
102  if (valid) {
103  pfRecTkcoll.push_back(reco::PFRecTrackRef(pfTrackRefProd, idx++));
104  pfRecTrackColl->push_back(pfRecTrack);
105  // cout << "after "<< pfRecTrack << endl;
106  }
107  }
108  reco::PFDisplacedVertexRef niRef(nuclCollH, icoll);
109  pfDisplacedTrackerVertexColl->push_back(reco::PFDisplacedTrackerVertex(niRef, pfRecTkcoll));
110  }
111 
112  iEvent.put(std::move(pfRecTrackColl));
113  iEvent.put(std::move(pfDisplacedTrackerVertexColl));
114 }
edm::EDGetTokenT< reco::TrackCollection > pfTrackContainer_
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:20
std::vector< PFDisplacedVertex > PFDisplacedVertexCollection
collection of PFDisplacedVertex objects
edm::EDGetTokenT< reco::PFDisplacedVertexCollection > pfDisplacedVertexContainer_
int charge() const
track electric charge
Definition: TrackBase.h:596
int iEvent
Definition: GenABIO.cc:224
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
size_t key() const
Definition: RefToBase.h:221
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.
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
std::vector< PFRecTrack > PFRecTrackCollection
collection of PFRecTrack objects
Definition: PFRecTrackFwd.h:9
def move(src, dest)
Definition: eostools.py:511
int icoll
Definition: AMPTWrapper.h:146

Member Data Documentation

◆ magneticFieldToken_

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

Definition at line 33 of file PFDisplacedTrackerVertexProducer.cc.

Referenced by beginRun().

◆ pfDisplacedVertexContainer_

edm::EDGetTokenT<reco::PFDisplacedVertexCollection> PFDisplacedTrackerVertexProducer::pfDisplacedVertexContainer_
private

◆ pfTrackContainer_

edm::EDGetTokenT<reco::TrackCollection> PFDisplacedTrackerVertexProducer::pfTrackContainer_
private

◆ pfTransformer_

PFTrackTransformer* PFDisplacedTrackerVertexProducer::pfTransformer_
private