CMS 3D CMS Logo

NuclearSeedsEDProducer Class Reference

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

#include <RecoTracker/NuclearSeedGenerator/interface/NuclearSeedsEDProducer.h>

Inheritance diagram for NuclearSeedsEDProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 NuclearSeedsEDProducer (const edm::ParameterSet &)
 ~NuclearSeedsEDProducer ()

Private Member Functions

virtual void beginJob (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


Detailed Description

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

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

Definition at line 50 of file NuclearSeedsEDProducer.h.


Constructor & Destructor Documentation

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

Definition at line 18 of file NuclearSeedsEDProducer.cc.

00018                                                                              : conf_(iConfig),
00019 improveSeeds(iConfig.getParameter<bool>("improveSeeds")),
00020 producer_(iConfig.getParameter<std::string>("producer"))
00021 {
00022    produces<TrajectorySeedCollection>();
00023    produces<TrajectoryToSeedsMap>();
00024 
00025 
00026 }

NuclearSeedsEDProducer::~NuclearSeedsEDProducer (  ) 

Definition at line 29 of file NuclearSeedsEDProducer.cc.

00030 {
00031 }


Member Function Documentation

void NuclearSeedsEDProducer::beginJob ( const edm::EventSetup es  )  [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 89 of file NuclearSeedsEDProducer.cc.

References conf_, and theNuclearInteractionFinder.

00090 {
00091    theNuclearInteractionFinder = std::auto_ptr<NuclearInteractionFinder>(new NuclearInteractionFinder(es, conf_));
00092 
00093 }

void NuclearSeedsEDProducer::endJob ( void   )  [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 95 of file NuclearSeedsEDProducer.cc.

00095 {}

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, output(), producer_, edm::Event::put(), and theNuclearInteractionFinder.

00041 {
00042    typedef TrajectoryMeasurement TM;
00043 
00044    edm::Handle< TrajectoryCollection > m_TrajectoryCollection;
00045    iEvent.getByLabel( producer_, m_TrajectoryCollection );
00046 
00047    LogDebug("NuclearSeedGenerator") << "Number of trajectory in event :" << m_TrajectoryCollection->size() << "\n";
00048 
00049    std::auto_ptr<TrajectorySeedCollection> output(new TrajectorySeedCollection);
00050    std::auto_ptr<TrajectoryToSeedsMap> outAssoc(new TrajectoryToSeedsMap);
00051 
00052    // Update the measurement
00053    theNuclearInteractionFinder->setEvent(iEvent);
00054    NavigationSetter setter( *(theNuclearInteractionFinder->nav()) );
00055 
00056    std::vector<std::pair<int, int> > assocPair;
00057    int i=0;
00058 
00059    for(std::vector<Trajectory>::const_iterator iTraj = m_TrajectoryCollection->begin(); iTraj != m_TrajectoryCollection->end(); iTraj++,i++) {
00060 
00061          // run the finder
00062          theNuclearInteractionFinder->run( *iTraj );
00063 
00064          // improve seeds
00065          if( improveSeeds == true ) theNuclearInteractionFinder->improveSeeds();
00066 
00067          // push back the new persistent seeds in output
00068          std::auto_ptr<TrajectorySeedCollection> newSeeds(theNuclearInteractionFinder->getPersistentSeeds());
00069          output->insert(output->end(), newSeeds->begin(), newSeeds->end());
00070 
00071          // fill the id of the Trajectory and the if of the seed in assocPair
00072          for(unsigned int j=0; j<newSeeds->size(); j++) {
00073                   assocPair.push_back( std::make_pair( i, output->size()-newSeeds->size()+j ) );
00074          }
00075 
00076    }
00077 
00078    const edm::OrphanHandle<TrajectorySeedCollection> refprodTrajSeedColl = iEvent.put(output);
00079 
00080    for(std::vector<std::pair<int, int> >::const_iterator iVecP = assocPair.begin(); iVecP != assocPair.end(); iVecP++) {
00081         outAssoc->insert(edm::Ref<TrajectoryCollection>(m_TrajectoryCollection,iVecP->first), edm::Ref<TrajectorySeedCollection>(refprodTrajSeedColl, iVecP->second));
00082    }
00083    iEvent.put(outAssoc);
00084 
00085 }


Member Data Documentation

edm::ParameterSet NuclearSeedsEDProducer::conf_ [private]

Definition at line 62 of file NuclearSeedsEDProducer.h.

Referenced by beginJob().

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 beginJob(), and produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:29:04 2009 for CMSSW by  doxygen 1.5.4