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

edm::ParameterSet conf_
 
bool improveSeeds
 
edm::EDGetTokenT< MeasurementTrackerEventmteToken_
 
edm::EDGetTokenT< TrajectoryCollectionproducer_
 
std::unique_ptr< NuclearInteractionFindertheNuclearInteractionFinder
 

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 50 of file NuclearSeedsEDProducer.h.

Constructor & Destructor Documentation

◆ NuclearSeedsEDProducer()

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

Definition at line 17 of file NuclearSeedsEDProducer.cc.

18  : conf_(iConfig),
19  improveSeeds(iConfig.getParameter<bool>("improveSeeds")),
20  producer_(consumes<TrajectoryCollection>(iConfig.getParameter<std::string>("producer"))),
21  mteToken_(consumes<MeasurementTrackerEvent>(edm::InputTag("MeasurementTrackerEvents"))) {
22  produces<TrajectorySeedCollection>();
23  produces<TrajectoryToSeedsMap>();
24 }

◆ ~NuclearSeedsEDProducer()

NuclearSeedsEDProducer::~NuclearSeedsEDProducer ( )
override

Definition at line 26 of file NuclearSeedsEDProducer.cc.

26 {}

Member Function Documentation

◆ beginRun()

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

Definition at line 82 of file NuclearSeedsEDProducer.cc.

82  {
83  theNuclearInteractionFinder = std::make_unique<NuclearInteractionFinder>(es, conf_);
84 }

References conf_, and theNuclearInteractionFinder.

◆ produce()

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

Definition at line 33 of file NuclearSeedsEDProducer.cc.

33  {
34  typedef TrajectoryMeasurement TM;
35 
36  edm::Handle<TrajectoryCollection> m_TrajectoryCollection;
37  iEvent.getByToken(producer_, m_TrajectoryCollection);
38 
39  LogDebug("NuclearSeedGenerator") << "Number of trajectory in event :" << m_TrajectoryCollection->size() << "\n";
40 
41  auto output = std::make_unique<TrajectorySeedCollection>();
42  auto outAssoc = std::make_unique<TrajectoryToSeedsMap>();
43 
45  iEvent.getByToken(mteToken_, data);
46 
47  // NavigationSetter setter( *(theNuclearInteractionFinder->nav()) ); why???
48 
49  std::vector<std::pair<int, int> > assocPair;
50  int i = 0;
51 
52  for (std::vector<Trajectory>::const_iterator iTraj = m_TrajectoryCollection->begin();
53  iTraj != m_TrajectoryCollection->end();
54  iTraj++, i++) {
55  // run the finder
56  theNuclearInteractionFinder->run(*iTraj, *data);
57 
58  // improve seeds
59  if (improveSeeds == true)
60  theNuclearInteractionFinder->improveSeeds(*data);
61 
62  // push back the new persistent seeds in output
63  std::unique_ptr<TrajectorySeedCollection> newSeeds(theNuclearInteractionFinder->getPersistentSeeds());
64  output->insert(output->end(), newSeeds->begin(), newSeeds->end());
65 
66  // fill the id of the Trajectory and the if of the seed in assocPair
67  for (unsigned int j = 0; j < newSeeds->size(); j++) {
68  assocPair.push_back(std::make_pair(i, output->size() - newSeeds->size() + j));
69  }
70  }
71 
72  const edm::OrphanHandle<TrajectorySeedCollection> refprodTrajSeedColl = iEvent.put(std::move(output));
73 
74  for (std::vector<std::pair<int, int> >::const_iterator iVecP = assocPair.begin(); iVecP != assocPair.end(); iVecP++) {
75  outAssoc->insert(edm::Ref<TrajectoryCollection>(m_TrajectoryCollection, iVecP->first),
76  edm::Ref<TrajectorySeedCollection>(refprodTrajSeedColl, iVecP->second));
77  }
78  iEvent.put(std::move(outAssoc));
79 }

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

Member Data Documentation

◆ conf_

edm::ParameterSet NuclearSeedsEDProducer::conf_
private

Definition at line 60 of file NuclearSeedsEDProducer.h.

Referenced by beginRun().

◆ improveSeeds

bool NuclearSeedsEDProducer::improveSeeds
private

Definition at line 63 of file NuclearSeedsEDProducer.h.

Referenced by produce().

◆ mteToken_

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

Definition at line 65 of file NuclearSeedsEDProducer.h.

Referenced by produce().

◆ producer_

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

Definition at line 64 of file NuclearSeedsEDProducer.h.

Referenced by produce().

◆ theNuclearInteractionFinder

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

Definition at line 61 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and produce().

NuclearSeedsEDProducer::producer_
edm::EDGetTokenT< TrajectoryCollection > producer_
Definition: NuclearSeedsEDProducer.h:64
mps_fire.i
i
Definition: mps_fire.py:428
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
NuclearSeedsEDProducer::conf_
edm::ParameterSet conf_
Definition: NuclearSeedsEDProducer.h:60
edm::Handle
Definition: AssociativeIterator.h:50
NuclearSeedsEDProducer::mteToken_
edm::EDGetTokenT< MeasurementTrackerEvent > mteToken_
Definition: NuclearSeedsEDProducer.h:65
edm::Ref
Definition: AssociativeIterator.h:58
NuclearSeedsEDProducer::improveSeeds
bool improveSeeds
Definition: NuclearSeedsEDProducer.h:63
NuclearSeedsEDProducer::theNuclearInteractionFinder
std::unique_ptr< NuclearInteractionFinder > theNuclearInteractionFinder
Definition: NuclearSeedsEDProducer.h:61
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
iEvent
int iEvent
Definition: GenABIO.cc:224
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::OrphanHandle
Definition: EDProductfwd.h:39
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
TrajectoryMeasurement
Definition: TrajectoryMeasurement.h:25
edm::InputTag
Definition: InputTag.h:15