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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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_, and theNuclearInteractionFinder.

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:355
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
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
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
NuclearSeedsEDProducer::theNuclearInteractionFinder
std::unique_ptr< NuclearInteractionFinder > theNuclearInteractionFinder
Definition: NuclearSeedsEDProducer.h:61
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::OrphanHandle
Definition: EDProductfwd.h:39
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