CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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,
TrackingComponentsRecord
estimatorToken_
 
edm::ESGetToken
< GeometricSearchTracker,
TrackerRecoGeometryRecord
geomSearchTrackerToken_
 
bool improveSeeds
 
edm::ESGetToken
< MeasurementTracker,
CkfComponentsRecord
measurementTrackerToken_
 
edm::EDGetTokenT
< MeasurementTrackerEvent
mteToken_
 
edm::ESGetToken
< NavigationSchool,
NavigationSchoolRecord
navigationToken_
 
edm::EDGetTokenT
< TrajectoryCollection
producer_
 
edm::ESGetToken< Propagator,
TrackingComponentsRecord
propagatorToken_
 
std::unique_ptr
< NuclearInteractionFinder
theNuclearInteractionFinder
 
edm::ESGetToken
< TrackerGeometry,
TrackerDigiGeometryRecord
trackerGeomToken_
 

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 ( 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, 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_
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_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< NavigationSchool, NavigationSchoolRecord > navigationToken_
edm::EDGetTokenT< MeasurementTrackerEvent > mteToken_
NuclearSeedsEDProducer::~NuclearSeedsEDProducer ( )
override

Definition at line 46 of file NuclearSeedsEDProducer.cc.

46 {}

Member Function Documentation

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_
std::unique_ptr< NuclearInteractionFinder > theNuclearInteractionFinder
edm::ESGetToken< MeasurementTracker, CkfComponentsRecord > measurementTrackerToken_
bool getData(T &iHolder) const
Definition: EventSetup.h:122
NuclearInteractionFinder::Config config_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomToken_
edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > estimatorToken_
edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > geomSearchTrackerToken_
edm::ESGetToken< NavigationSchool, NavigationSchoolRecord > navigationToken_
void NuclearSeedsEDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 53 of file NuclearSeedsEDProducer.cc.

References data, edm::Event::getByToken(), mps_fire::i, improveSeeds, dqmiolumiharvest::j, LogDebug, eostools::move(), mteToken_, convertSQLitetoXML_cfg::output, producer_, edm::Event::put(), 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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
std::unique_ptr< NuclearInteractionFinder > theNuclearInteractionFinder
edm::EDGetTokenT< TrajectoryCollection > producer_
def move
Definition: eostools.py:511
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
edm::EDGetTokenT< MeasurementTrackerEvent > mteToken_
#define LogDebug(id)

Member Data Documentation

NuclearInteractionFinder::Config NuclearSeedsEDProducer::config_
private

Definition at line 63 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and NuclearSeedsEDProducer().

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

Definition at line 72 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and NuclearSeedsEDProducer().

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

Definition at line 74 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and NuclearSeedsEDProducer().

bool NuclearSeedsEDProducer::improveSeeds
private

Definition at line 66 of file NuclearSeedsEDProducer.h.

Referenced by produce().

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

Definition at line 73 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and NuclearSeedsEDProducer().

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

Definition at line 68 of file NuclearSeedsEDProducer.h.

Referenced by produce().

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

Definition at line 75 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and NuclearSeedsEDProducer().

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

Definition at line 67 of file NuclearSeedsEDProducer.h.

Referenced by produce().

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

Definition at line 71 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and NuclearSeedsEDProducer().

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

Definition at line 64 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and produce().

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

Definition at line 70 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and NuclearSeedsEDProducer().