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 Attributes
SeedGeneratorFromRegionHitsEDProducer Class Reference

#include <SeedGeneratorFromRegionHitsEDProducer.h>

Inheritance diagram for SeedGeneratorFromRegionHitsEDProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (edm::Run &run, const edm::EventSetup &es)
 
virtual void endRun (edm::Run &run, const edm::EventSetup &es)
 
virtual void produce (edm::Event &ev, const edm::EventSetup &es)
 
 SeedGeneratorFromRegionHitsEDProducer (const edm::ParameterSet &cfg)
 
 ~SeedGeneratorFromRegionHitsEDProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

ClusterChecker theClusterCheck
 
edm::ParameterSet theConfig
 
SeedGeneratorFromRegionHitstheGenerator
 
TrackingRegionProducertheRegionProducer
 
bool theSilentOnClusterCheck
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 13 of file SeedGeneratorFromRegionHitsEDProducer.h.

Constructor & Destructor Documentation

SeedGeneratorFromRegionHitsEDProducer::SeedGeneratorFromRegionHitsEDProducer ( const edm::ParameterSet cfg)

Definition at line 24 of file SeedGeneratorFromRegionHitsEDProducer.cc.

References edm::ParameterSet::getParameter(), and theSilentOnClusterCheck.

27 {
28  theSilentOnClusterCheck = cfg.getParameter<edm::ParameterSet>("ClusterCheckPSet").getUntrackedParameter<bool>("silentClusterCheck",false);
29  produces<TrajectorySeedCollection>();
30 }
T getParameter(std::string const &) const
SeedGeneratorFromRegionHitsEDProducer::~SeedGeneratorFromRegionHitsEDProducer ( )

Definition at line 32 of file SeedGeneratorFromRegionHitsEDProducer.cc.

33 {
34 }

Member Function Documentation

void SeedGeneratorFromRegionHitsEDProducer::beginRun ( edm::Run run,
const edm::EventSetup es 
)
virtual

Reimplemented from edm::EDProducer.

Definition at line 41 of file SeedGeneratorFromRegionHitsEDProducer.cc.

References reco::get(), edm::ParameterSet::getParameter(), theConfig, theGenerator, and theRegionProducer.

42 {
43  edm::ParameterSet regfactoryPSet =
44  theConfig.getParameter<edm::ParameterSet>("RegionFactoryPSet");
45  std::string regfactoryName = regfactoryPSet.getParameter<std::string>("ComponentName");
46  theRegionProducer = TrackingRegionProducerFactory::get()->create(regfactoryName,regfactoryPSet);
47 
48  edm::ParameterSet hitsfactoryPSet =
49  theConfig.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
50  std::string hitsfactoryName = hitsfactoryPSet.getParameter<std::string>("ComponentName");
51  OrderedHitsGenerator* hitsGenerator =
52  OrderedHitsGeneratorFactory::get()->create( hitsfactoryName, hitsfactoryPSet);
53 
54  edm::ParameterSet comparitorPSet =
55  theConfig.getParameter<edm::ParameterSet>("SeedComparitorPSet");
56  std::string comparitorName = comparitorPSet.getParameter<std::string>("ComponentName");
57  SeedComparitor * aComparitor = (comparitorName == "none") ?
58  0 : SeedComparitorFactory::get()->create( comparitorName, comparitorPSet);
59 
60  edm::ParameterSet creatorPSet =
61  theConfig.getParameter<edm::ParameterSet>("SeedCreatorPSet");
62  std::string creatorName = creatorPSet.getParameter<std::string>("ComponentName");
63  SeedCreator * aCreator = SeedCreatorFactory::get()->create( creatorName, creatorPSet);
64 
65  theGenerator = new SeedGeneratorFromRegionHits(hitsGenerator, aComparitor, aCreator);
66 
67 
68 }
T getParameter(std::string const &) const
T get(const Candidate &c)
Definition: component.h:56
void SeedGeneratorFromRegionHitsEDProducer::endRun ( edm::Run run,
const edm::EventSetup es 
)
virtual

Reimplemented from edm::EDProducer.

Definition at line 36 of file SeedGeneratorFromRegionHitsEDProducer.cc.

References theGenerator, and theRegionProducer.

36  {
37  delete theRegionProducer;
38  delete theGenerator;
39 }
void SeedGeneratorFromRegionHitsEDProducer::produce ( edm::Event ev,
const edm::EventSetup es 
)
virtual

Implements edm::EDProducer.

Definition at line 70 of file SeedGeneratorFromRegionHitsEDProducer.cc.

References edm::Event::put(), TrackingRegionProducer::regions(), query::result, mathSSE::return(), SeedGeneratorFromRegionHits::run(), theClusterCheck, theGenerator, theRegionProducer, theSilentOnClusterCheck, and ClusterChecker::tooManyClusters().

71 {
72  std::auto_ptr<TrajectorySeedCollection> result(new TrajectorySeedCollection());
73 
74  //protection for big ass events...
75  size_t clustsOrZero = theClusterCheck.tooManyClusters(ev);
76  if (clustsOrZero){
78  edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
79  ev.put(result);
80  return ;
81  }
82 
83  typedef std::vector<TrackingRegion* > Regions;
84  typedef Regions::const_iterator IR;
85  Regions regions = theRegionProducer->regions(ev,es);
86 
87  for (IR ir=regions.begin(), irEnd=regions.end(); ir < irEnd; ++ir) {
88  const TrackingRegion & region = **ir;
89 
90  // make job
91  theGenerator->run(*result, region, ev,es);
92  }
93 
94  // clear memory
95  for (IR ir=regions.begin(), irEnd=regions.end(); ir < irEnd; ++ir) delete (*ir);
96 
97  // put to event
98  ev.put(result);
99 }
return((rh^lh)&mask)
std::vector< TrajectorySeed > TrajectorySeedCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
tuple result
Definition: query.py:137
size_t tooManyClusters(const edm::Event &e)
void run(TrajectorySeedCollection &seedCollection, const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
virtual std::vector< TrackingRegion * > regions(const edm::Event &ev, const edm::EventSetup &es) const =0

Member Data Documentation

ClusterChecker SeedGeneratorFromRegionHitsEDProducer::theClusterCheck
private

Definition at line 28 of file SeedGeneratorFromRegionHitsEDProducer.h.

Referenced by produce().

edm::ParameterSet SeedGeneratorFromRegionHitsEDProducer::theConfig
private

Definition at line 25 of file SeedGeneratorFromRegionHitsEDProducer.h.

Referenced by beginRun().

SeedGeneratorFromRegionHits* SeedGeneratorFromRegionHitsEDProducer::theGenerator
private

Definition at line 26 of file SeedGeneratorFromRegionHitsEDProducer.h.

Referenced by beginRun(), endRun(), and produce().

TrackingRegionProducer* SeedGeneratorFromRegionHitsEDProducer::theRegionProducer
private

Definition at line 27 of file SeedGeneratorFromRegionHitsEDProducer.h.

Referenced by beginRun(), endRun(), and produce().

bool SeedGeneratorFromRegionHitsEDProducer::theSilentOnClusterCheck
private