CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 NuclearSeedsEDProducer (const edm::ParameterSet &)
 
 ~NuclearSeedsEDProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void beginRun (edm::Run const &run, const edm::EventSetup &) override
 
virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::ParameterSet conf_
 
bool improveSeeds
 
std::string producer_
 
std::auto_ptr
< NuclearInteractionFinder
theNuclearInteractionFinder
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
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_(iConfig.getParameter<std::string>("producer"))
21 {
22  produces<TrajectorySeedCollection>();
23  produces<TrajectoryToSeedsMap>();
24 
25 
26 }
T getParameter(std::string const &) const
NuclearSeedsEDProducer::~NuclearSeedsEDProducer ( )

Definition at line 29 of file NuclearSeedsEDProducer.cc.

30 {
31 }

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 91 of file NuclearSeedsEDProducer.cc.

References conf_, and theNuclearInteractionFinder.

92 {
93  theNuclearInteractionFinder = std::auto_ptr<NuclearInteractionFinder>(new NuclearInteractionFinder(es, conf_));
94 
95 }
Class used to obtain vector of all compatible TMs associated to a trajectory to be used by the Nuclea...
std::auto_ptr< NuclearInteractionFinder > theNuclearInteractionFinder
void NuclearSeedsEDProducer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 97 of file NuclearSeedsEDProducer.cc.

97 {}
void NuclearSeedsEDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 40 of file NuclearSeedsEDProducer.cc.

References data, edm::Event::getByLabel(), i, improveSeeds, j, LogDebug, convertSQLitetoXML_cfg::output, producer_, edm::Event::put(), and theNuclearInteractionFinder.

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

Member Data Documentation

edm::ParameterSet NuclearSeedsEDProducer::conf_
private

Definition at line 61 of file NuclearSeedsEDProducer.h.

Referenced by beginRun().

bool NuclearSeedsEDProducer::improveSeeds
private

Definition at line 64 of file NuclearSeedsEDProducer.h.

Referenced by produce().

std::string NuclearSeedsEDProducer::producer_
private

Definition at line 65 of file NuclearSeedsEDProducer.h.

Referenced by produce().

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

Definition at line 62 of file NuclearSeedsEDProducer.h.

Referenced by beginRun(), and produce().