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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 NuclearSeedsEDProducer (const edm::ParameterSet &)
 
 ~NuclearSeedsEDProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

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

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

Definition at line 49 of file NuclearSeedsEDProducer.h.

Constructor & Destructor Documentation

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

Definition at line 18 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 {
23  produces<TrajectorySeedCollection>();
24  produces<TrajectoryToSeedsMap>();
25 
26 
27 }
T getParameter(std::string const &) const
edm::EDGetTokenT< TrajectoryCollection > producer_
edm::EDGetTokenT< MeasurementTrackerEvent > mteToken_
NuclearSeedsEDProducer::~NuclearSeedsEDProducer ( )
override

Definition at line 30 of file NuclearSeedsEDProducer.cc.

31 {
32 }

Member Function Documentation

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

Definition at line 92 of file NuclearSeedsEDProducer.cc.

References conf_, and theNuclearInteractionFinder.

93 {
94  theNuclearInteractionFinder = std::make_unique<NuclearInteractionFinder>(es, conf_);
95 
96 }
std::unique_ptr< NuclearInteractionFinder > theNuclearInteractionFinder
void NuclearSeedsEDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 41 of file NuclearSeedsEDProducer.cc.

References data, edm::Event::getByToken(), mps_fire::i, improveSeeds, LogDebug, eostools::move(), mteToken_, convertSQLitetoXML_cfg::output, producer_, edm::Event::put(), and theNuclearInteractionFinder.

42 {
43  typedef TrajectoryMeasurement TM;
44 
45  edm::Handle< TrajectoryCollection > m_TrajectoryCollection;
46  iEvent.getByToken( producer_, m_TrajectoryCollection );
47 
48  LogDebug("NuclearSeedGenerator") << "Number of trajectory in event :" << m_TrajectoryCollection->size() << "\n";
49 
50  auto output = std::make_unique<TrajectorySeedCollection>();
51  auto outAssoc = std::make_unique<TrajectoryToSeedsMap>();
52 
53 
55  iEvent.getByToken(mteToken_, data);
56 
57 // NavigationSetter setter( *(theNuclearInteractionFinder->nav()) ); why???
58 
59  std::vector<std::pair<int, int> > assocPair;
60  int i=0;
61 
62  for(std::vector<Trajectory>::const_iterator iTraj = m_TrajectoryCollection->begin(); iTraj != m_TrajectoryCollection->end(); iTraj++,i++) {
63 
64  // run the finder
65  theNuclearInteractionFinder->run( *iTraj, *data );
66 
67  // improve seeds
68  if( improveSeeds == true ) theNuclearInteractionFinder->improveSeeds( *data );
69 
70  // push back the new persistent seeds in output
71  std::unique_ptr<TrajectorySeedCollection> newSeeds(theNuclearInteractionFinder->getPersistentSeeds());
72  output->insert(output->end(), newSeeds->begin(), newSeeds->end());
73 
74  // fill the id of the Trajectory and the if of the seed in assocPair
75  for(unsigned int j=0; j<newSeeds->size(); j++) {
76  assocPair.push_back( std::make_pair( i, output->size()-newSeeds->size()+j ) );
77  }
78 
79  }
80 
81  const edm::OrphanHandle<TrajectorySeedCollection> refprodTrajSeedColl = iEvent.put(std::move(output));
82 
83  for(std::vector<std::pair<int, int> >::const_iterator iVecP = assocPair.begin(); iVecP != assocPair.end(); iVecP++) {
84  outAssoc->insert(edm::Ref<TrajectoryCollection>(m_TrajectoryCollection,iVecP->first), edm::Ref<TrajectorySeedCollection>(refprodTrajSeedColl, iVecP->second));
85  }
86  iEvent.put(std::move(outAssoc));
87 
88 }
#define LogDebug(id)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
std::unique_ptr< NuclearInteractionFinder > theNuclearInteractionFinder
edm::EDGetTokenT< TrajectoryCollection > producer_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
edm::EDGetTokenT< MeasurementTrackerEvent > mteToken_
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::ParameterSet NuclearSeedsEDProducer::conf_
private

Definition at line 60 of file NuclearSeedsEDProducer.h.

Referenced by beginRun().

bool NuclearSeedsEDProducer::improveSeeds
private

Definition at line 63 of file NuclearSeedsEDProducer.h.

Referenced by produce().

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

Definition at line 65 of file NuclearSeedsEDProducer.h.

Referenced by produce().

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

Definition at line 64 of file NuclearSeedsEDProducer.h.

Referenced by produce().

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

Definition at line 61 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and produce().