#include <RecoTracker/NuclearSeedGenerator/interface/NuclearSeedsEDProducer.h>
Public Member Functions | |
NuclearSeedsEDProducer (const edm::ParameterSet &) | |
~NuclearSeedsEDProducer () | |
Private Member Functions | |
virtual void | beginRun (edm::Run &run, const edm::EventSetup &) |
virtual void | endJob () |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
edm::ParameterSet | conf_ |
bool | improveSeeds |
std::string | producer_ |
std::auto_ptr < NuclearInteractionFinder > | theNuclearInteractionFinder |
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 50 of file NuclearSeedsEDProducer.h.
NuclearSeedsEDProducer::NuclearSeedsEDProducer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 18 of file NuclearSeedsEDProducer.cc.
: conf_(iConfig), improveSeeds(iConfig.getParameter<bool>("improveSeeds")), producer_(iConfig.getParameter<std::string>("producer")) { produces<TrajectorySeedCollection>(); produces<TrajectoryToSeedsMap>(); }
NuclearSeedsEDProducer::~NuclearSeedsEDProducer | ( | ) |
Definition at line 29 of file NuclearSeedsEDProducer.cc.
{ }
void NuclearSeedsEDProducer::beginRun | ( | edm::Run & | run, |
const edm::EventSetup & | es | ||
) | [private, virtual] |
Reimplemented from edm::EDProducer.
Definition at line 89 of file NuclearSeedsEDProducer.cc.
References conf_, and theNuclearInteractionFinder.
{ theNuclearInteractionFinder = std::auto_ptr<NuclearInteractionFinder>(new NuclearInteractionFinder(es, conf_)); }
void NuclearSeedsEDProducer::endJob | ( | void | ) | [private, virtual] |
void NuclearSeedsEDProducer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 40 of file NuclearSeedsEDProducer.cc.
References edm::Event::getByLabel(), i, improveSeeds, j, LogDebug, convertSQLitetoXML_cfg::output, producer_, edm::Event::put(), and theNuclearInteractionFinder.
{ typedef TrajectoryMeasurement TM; edm::Handle< TrajectoryCollection > m_TrajectoryCollection; iEvent.getByLabel( producer_, m_TrajectoryCollection ); LogDebug("NuclearSeedGenerator") << "Number of trajectory in event :" << m_TrajectoryCollection->size() << "\n"; std::auto_ptr<TrajectorySeedCollection> output(new TrajectorySeedCollection); std::auto_ptr<TrajectoryToSeedsMap> outAssoc(new TrajectoryToSeedsMap); // Update the measurement theNuclearInteractionFinder->setEvent(iEvent); NavigationSetter setter( *(theNuclearInteractionFinder->nav()) ); std::vector<std::pair<int, int> > assocPair; int i=0; for(std::vector<Trajectory>::const_iterator iTraj = m_TrajectoryCollection->begin(); iTraj != m_TrajectoryCollection->end(); iTraj++,i++) { // run the finder theNuclearInteractionFinder->run( *iTraj ); // improve seeds if( improveSeeds == true ) theNuclearInteractionFinder->improveSeeds(); // push back the new persistent seeds in output std::auto_ptr<TrajectorySeedCollection> newSeeds(theNuclearInteractionFinder->getPersistentSeeds()); output->insert(output->end(), newSeeds->begin(), newSeeds->end()); // fill the id of the Trajectory and the if of the seed in assocPair for(unsigned int j=0; j<newSeeds->size(); j++) { assocPair.push_back( std::make_pair( i, output->size()-newSeeds->size()+j ) ); } } const edm::OrphanHandle<TrajectorySeedCollection> refprodTrajSeedColl = iEvent.put(output); for(std::vector<std::pair<int, int> >::const_iterator iVecP = assocPair.begin(); iVecP != assocPair.end(); iVecP++) { outAssoc->insert(edm::Ref<TrajectoryCollection>(m_TrajectoryCollection,iVecP->first), edm::Ref<TrajectorySeedCollection>(refprodTrajSeedColl, iVecP->second)); } iEvent.put(outAssoc); }
Definition at line 62 of file NuclearSeedsEDProducer.h.
Referenced by beginRun().
bool NuclearSeedsEDProducer::improveSeeds [private] |
Definition at line 65 of file NuclearSeedsEDProducer.h.
Referenced by produce().
std::string NuclearSeedsEDProducer::producer_ [private] |
Definition at line 66 of file NuclearSeedsEDProducer.h.
Referenced by produce().
std::auto_ptr<NuclearInteractionFinder> NuclearSeedsEDProducer::theNuclearInteractionFinder [private] |
Definition at line 63 of file NuclearSeedsEDProducer.h.
Referenced by beginRun(), and produce().