CMS 3D CMS Logo

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

#include <RecoTracker/NuclearSeedGenerator/interface/NuclearSeedsEDProducer.h>

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

Public Member Functions

 NuclearSeedsEDProducer (const edm::ParameterSet &)
 
 ~NuclearSeedsEDProducer () override
 
- 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 (edm::Run const &run, const edm::EventSetup &) override
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

NuclearInteractionFinder::Config config_
 
edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecordestimatorToken_
 
edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecordgeomSearchTrackerToken_
 
bool improveSeeds
 
edm::ESGetToken< MeasurementTracker, CkfComponentsRecordmeasurementTrackerToken_
 
edm::EDGetTokenT< MeasurementTrackerEventmteToken_
 
edm::ESGetToken< NavigationSchool, NavigationSchoolRecordnavigationToken_
 
edm::EDGetTokenT< TrajectoryCollectionproducer_
 
edm::ESGetToken< Propagator, TrackingComponentsRecordpropagatorToken_
 
std::unique_ptr< NuclearInteractionFindertheNuclearInteractionFinder
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtrackerGeomToken_
 

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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 53 of file NuclearSeedsEDProducer.h.

Constructor & Destructor Documentation

◆ NuclearSeedsEDProducer()

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

Definition at line 21 of file NuclearSeedsEDProducer.cc.

References NuclearInteractionFinder::Config::checkCompletedTrack, config_, estimatorToken_, geomSearchTrackerToken_, edm::ParameterSet::getParameter(), NuclearInteractionFinder::Config::maxHits, HLT_2024v12_cff::measurementTrackerName, measurementTrackerToken_, navigationToken_, propagatorToken_, NuclearInteractionFinder::Config::ptMin, NuclearInteractionFinder::Config::rescaleErrorFactor, AlCaHLTBitMon_QueryRunRegistry::string, and trackerGeomToken_.

22  : config_(),
23  improveSeeds(iConfig.getParameter<bool>("improveSeeds")),
24  producer_(consumes<TrajectoryCollection>(iConfig.getParameter<std::string>("producer"))),
25  mteToken_(consumes<MeasurementTrackerEvent>(edm::InputTag("MeasurementTrackerEvents"))) {
26  produces<TrajectorySeedCollection>();
27  produces<TrajectoryToSeedsMap>();
28 
29  trackerGeomToken_ = esConsumes<edm::Transition::BeginRun>();
30  propagatorToken_ = esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", "PropagatorWithMaterial"));
31  estimatorToken_ = esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", "Chi2"));
32 
33  std::string measurementTrackerName = iConfig.getParameter<std::string>("MeasurementTrackerName");
34  measurementTrackerToken_ = esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", measurementTrackerName));
35  geomSearchTrackerToken_ = esConsumes<edm::Transition::BeginRun>();
36 
37  auto navigationSchoolName = iConfig.getParameter<std::string>("NavigationSchool");
38  navigationToken_ = esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", navigationSchoolName));
39 
40  config_.maxHits = iConfig.getParameter<int>("maxHits");
41  config_.rescaleErrorFactor = iConfig.getParameter<double>("rescaleErrorFactor");
42  config_.checkCompletedTrack = iConfig.getParameter<bool>("checkCompletedTrack");
43  config_.ptMin = iConfig.getParameter<double>("ptMin");
44 }
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::ESGetToken< MeasurementTracker, CkfComponentsRecord > measurementTrackerToken_
edm::EDGetTokenT< TrajectoryCollection > producer_
NuclearInteractionFinder::Config config_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomToken_
edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > estimatorToken_
edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > geomSearchTrackerToken_
edm::ESGetToken< NavigationSchool, NavigationSchoolRecord > navigationToken_
edm::EDGetTokenT< MeasurementTrackerEvent > mteToken_

◆ ~NuclearSeedsEDProducer()

NuclearSeedsEDProducer::~NuclearSeedsEDProducer ( )
override

Definition at line 46 of file NuclearSeedsEDProducer.cc.

46 {}

Member Function Documentation

◆ beginRun()

void NuclearSeedsEDProducer::beginRun ( edm::Run const &  run,
const edm::EventSetup es 
)
overrideprivate

Definition at line 102 of file NuclearSeedsEDProducer.cc.

References config_, estimatorToken_, geomSearchTrackerToken_, edm::EventSetup::getData(), measurementTrackerToken_, navigationToken_, propagatorToken_, theNuclearInteractionFinder, and trackerGeomToken_.

102  {
103  theNuclearInteractionFinder = std::make_unique<NuclearInteractionFinder>(config_,
110 }
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
std::unique_ptr< NuclearInteractionFinder > theNuclearInteractionFinder
edm::ESGetToken< MeasurementTracker, CkfComponentsRecord > measurementTrackerToken_
NuclearInteractionFinder::Config config_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomToken_
edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > estimatorToken_
edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > geomSearchTrackerToken_
edm::ESGetToken< NavigationSchool, NavigationSchoolRecord > navigationToken_

◆ produce()

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

Definition at line 53 of file NuclearSeedsEDProducer.cc.

References data, mps_fire::i, iEvent, improveSeeds, dqmiolumiharvest::j, LogDebug, eostools::move(), mteToken_, producer_, theNuclearInteractionFinder, and trackerHitRTTI::vector.

53  {
54  typedef TrajectoryMeasurement TM;
55 
56  edm::Handle<TrajectoryCollection> m_TrajectoryCollection;
57  iEvent.getByToken(producer_, m_TrajectoryCollection);
58 
59  LogDebug("NuclearSeedGenerator") << "Number of trajectory in event :" << m_TrajectoryCollection->size() << "\n";
60 
61  auto output = std::make_unique<TrajectorySeedCollection>();
62  auto outAssoc = std::make_unique<TrajectoryToSeedsMap>();
63 
65  iEvent.getByToken(mteToken_, data);
66 
67  // NavigationSetter setter( *(theNuclearInteractionFinder->nav()) ); why???
68 
69  std::vector<std::pair<int, int> > assocPair;
70  int i = 0;
71 
72  for (std::vector<Trajectory>::const_iterator iTraj = m_TrajectoryCollection->begin();
73  iTraj != m_TrajectoryCollection->end();
74  iTraj++, i++) {
75  // run the finder
76  theNuclearInteractionFinder->run(*iTraj, *data);
77 
78  // improve seeds
79  if (improveSeeds == true)
80  theNuclearInteractionFinder->improveSeeds(*data);
81 
82  // push back the new persistent seeds in output
83  std::unique_ptr<TrajectorySeedCollection> newSeeds(theNuclearInteractionFinder->getPersistentSeeds());
84  output->insert(output->end(), newSeeds->begin(), newSeeds->end());
85 
86  // fill the id of the Trajectory and the if of the seed in assocPair
87  for (unsigned int j = 0; j < newSeeds->size(); j++) {
88  assocPair.push_back(std::make_pair(i, output->size() - newSeeds->size() + j));
89  }
90  }
91 
92  const edm::OrphanHandle<TrajectorySeedCollection> refprodTrajSeedColl = iEvent.put(std::move(output));
93 
94  for (std::vector<std::pair<int, int> >::const_iterator iVecP = assocPair.begin(); iVecP != assocPair.end(); iVecP++) {
95  outAssoc->insert(edm::Ref<TrajectoryCollection>(m_TrajectoryCollection, iVecP->first),
96  edm::Ref<TrajectorySeedCollection>(refprodTrajSeedColl, iVecP->second));
97  }
98  iEvent.put(std::move(outAssoc));
99 }
std::unique_ptr< NuclearInteractionFinder > theNuclearInteractionFinder
edm::EDGetTokenT< TrajectoryCollection > producer_
int iEvent
Definition: GenABIO.cc:224
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
edm::EDGetTokenT< MeasurementTrackerEvent > mteToken_
Definition: output.py:1
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

Member Data Documentation

◆ config_

NuclearInteractionFinder::Config NuclearSeedsEDProducer::config_
private

Definition at line 63 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and NuclearSeedsEDProducer().

◆ estimatorToken_

edm::ESGetToken<Chi2MeasurementEstimatorBase, TrackingComponentsRecord> NuclearSeedsEDProducer::estimatorToken_
private

Definition at line 72 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and NuclearSeedsEDProducer().

◆ geomSearchTrackerToken_

edm::ESGetToken<GeometricSearchTracker, TrackerRecoGeometryRecord> NuclearSeedsEDProducer::geomSearchTrackerToken_
private

Definition at line 74 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and NuclearSeedsEDProducer().

◆ improveSeeds

bool NuclearSeedsEDProducer::improveSeeds
private

Definition at line 66 of file NuclearSeedsEDProducer.h.

Referenced by produce().

◆ measurementTrackerToken_

edm::ESGetToken<MeasurementTracker, CkfComponentsRecord> NuclearSeedsEDProducer::measurementTrackerToken_
private

Definition at line 73 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and NuclearSeedsEDProducer().

◆ mteToken_

edm::EDGetTokenT<MeasurementTrackerEvent> NuclearSeedsEDProducer::mteToken_
private

Definition at line 68 of file NuclearSeedsEDProducer.h.

Referenced by produce().

◆ navigationToken_

edm::ESGetToken<NavigationSchool, NavigationSchoolRecord> NuclearSeedsEDProducer::navigationToken_
private

Definition at line 75 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and NuclearSeedsEDProducer().

◆ producer_

edm::EDGetTokenT<TrajectoryCollection> NuclearSeedsEDProducer::producer_
private

Definition at line 67 of file NuclearSeedsEDProducer.h.

Referenced by produce().

◆ propagatorToken_

edm::ESGetToken<Propagator, TrackingComponentsRecord> NuclearSeedsEDProducer::propagatorToken_
private

Definition at line 71 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and NuclearSeedsEDProducer().

◆ theNuclearInteractionFinder

std::unique_ptr<NuclearInteractionFinder> NuclearSeedsEDProducer::theNuclearInteractionFinder
private

Definition at line 64 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and produce().

◆ trackerGeomToken_

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> NuclearSeedsEDProducer::trackerGeomToken_
private

Definition at line 70 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and NuclearSeedsEDProducer().