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

Public Member Functions

virtual void beginRun (edm::Run const &run, const edm::EventSetup &es) override
 
virtual void endRun (edm::Run const &run, const edm::EventSetup &es) override
 
virtual void produce (edm::Event &ev, const edm::EventSetup &es) override
 
 SeedGeneratorFromRegionHitsEDProducer (const edm::ParameterSet &cfg)
 
 ~SeedGeneratorFromRegionHitsEDProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

std::string moduleName
 
ClusterChecker theClusterCheck
 
edm::ParameterSet theConfig
 
SeedGeneratorFromRegionHitstheGenerator
 
QuadrupletSeedMergertheMerger_
 
TrackingRegionProducertheRegionProducer
 
bool theSilentOnClusterCheck
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

Definition at line 14 of file SeedGeneratorFromRegionHitsEDProducer.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file SeedGeneratorFromRegionHitsEDProducer.cc.

References edm::EDConsumerBase::consumesCollector(), edm::ParameterSet::exists(), reco::get(), edm::ParameterSet::getParameter(), moduleName, AlCaHLTBitMon_QueryRunRegistry::string, theConfig, theMerger_, theRegionProducer, and theSilentOnClusterCheck.

29  theMerger_(0)
30 {
31  theSilentOnClusterCheck = cfg.getParameter<edm::ParameterSet>("ClusterCheckPSet").getUntrackedParameter<bool>("silentClusterCheck",false);
32 
33  moduleName = cfg.getParameter<std::string>("@module_label");
34 
35  // seed merger & its settings
36  if ( cfg.exists("SeedMergerPSet")) {
37  edm::ParameterSet mergerPSet = theConfig.getParameter<edm::ParameterSet>( "SeedMergerPSet" );
39  theMerger_->setTTRHBuilderLabel( mergerPSet.getParameter<std::string>( "ttrhBuilderLabel" ) );
40  theMerger_->setMergeTriplets( mergerPSet.getParameter<bool>( "mergeTriplets" ) );
41  theMerger_->setAddRemainingTriplets( mergerPSet.getParameter<bool>( "addRemainingTriplets" ) );
42  theMerger_->setLayerListName( mergerPSet.getParameter<std::string>( "layerListName" ) );
43  }
44 
45  edm::ParameterSet regfactoryPSet =
46  theConfig.getParameter<edm::ParameterSet>("RegionFactoryPSet");
47  std::string regfactoryName = regfactoryPSet.getParameter<std::string>("ComponentName");
48  theRegionProducer = TrackingRegionProducerFactory::get()->create(regfactoryName,regfactoryPSet, consumesCollector());
49 
50  produces<TrajectorySeedCollection>();
51 }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
T get(const Candidate &c)
Definition: component.h:55
SeedGeneratorFromRegionHitsEDProducer::~SeedGeneratorFromRegionHitsEDProducer ( )

Definition at line 53 of file SeedGeneratorFromRegionHitsEDProducer.cc.

References theRegionProducer.

54 {
55  delete theRegionProducer; theRegionProducer = nullptr;
56 }

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 62 of file SeedGeneratorFromRegionHitsEDProducer.cc.

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

63 {
64  edm::ParameterSet hitsfactoryPSet =
65  theConfig.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
66  std::string hitsfactoryName = hitsfactoryPSet.getParameter<std::string>("ComponentName");
67  OrderedHitsGenerator* hitsGenerator =
68  OrderedHitsGeneratorFactory::get()->create( hitsfactoryName, hitsfactoryPSet);
69 
70  edm::ParameterSet comparitorPSet =
71  theConfig.getParameter<edm::ParameterSet>("SeedComparitorPSet");
72  std::string comparitorName = comparitorPSet.getParameter<std::string>("ComponentName");
73  SeedComparitor * aComparitor = (comparitorName == "none") ?
74  0 : SeedComparitorFactory::get()->create( comparitorName, comparitorPSet);
75 
76  edm::ParameterSet creatorPSet =
77  theConfig.getParameter<edm::ParameterSet>("SeedCreatorPSet");
78  std::string creatorName = creatorPSet.getParameter<std::string>("ComponentName");
79  SeedCreator * aCreator = SeedCreatorFactory::get()->create( creatorName, creatorPSet);
80 
81  theGenerator = new SeedGeneratorFromRegionHits(hitsGenerator, aComparitor, aCreator);
82 }
T getParameter(std::string const &) const
T get(const Candidate &c)
Definition: component.h:55
void SeedGeneratorFromRegionHitsEDProducer::endRun ( edm::Run const &  run,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 58 of file SeedGeneratorFromRegionHitsEDProducer.cc.

References theGenerator.

58  {
59  delete theGenerator;
60 }
void SeedGeneratorFromRegionHitsEDProducer::produce ( edm::Event ev,
const edm::EventSetup es 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 84 of file SeedGeneratorFromRegionHitsEDProducer.cc.

References QuadrupletSeedMerger::mergeTriplets(), edm::Event::put(), TrackingRegionProducer::regions(), reco::return(), SeedGeneratorFromRegionHits::run(), theClusterCheck, theConfig, theGenerator, theMerger_, theRegionProducer, theSilentOnClusterCheck, ClusterChecker::tooManyClusters(), and QuadrupletSeedMerger::update().

85 {
86  std::auto_ptr<TrajectorySeedCollection> triplets(new TrajectorySeedCollection());
87  std::auto_ptr<TrajectorySeedCollection> quadruplets( new TrajectorySeedCollection() );
88 
89  //protection for big ass events...
90  size_t clustsOrZero = theClusterCheck.tooManyClusters(ev);
91  if (clustsOrZero){
93  edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
94  ev.put(triplets);
95  return ;
96  }
97 
98  typedef std::vector<TrackingRegion* > Regions;
99  typedef Regions::const_iterator IR;
100  Regions regions = theRegionProducer->regions(ev,es);
101  if (theMerger_!=0)
102  theMerger_->update(es);
103 
104  for (IR ir=regions.begin(), irEnd=regions.end(); ir < irEnd; ++ir) {
105  const TrackingRegion & region = **ir;
106 
107  // make job
108  theGenerator->run(*triplets, region, ev,es);
109  // std::cout << "created seeds for " << moduleName << " " << triplets->size() << std::endl;
110 
111 
112  // make quadruplets
113  // (TODO: can partly be propagated to the merger)
114  if ( theMerger_ !=0 ) {
115  TrajectorySeedCollection const& tempQuads = theMerger_->mergeTriplets( *triplets, region, es, theConfig ); //@@
116  for( TrajectorySeedCollection::const_iterator qIt = tempQuads.begin(); qIt < tempQuads.end(); ++qIt ) {
117  quadruplets->push_back( *qIt );
118  }
119  }
120  }
121 
122  // clear memory
123  for (IR ir=regions.begin(), irEnd=regions.end(); ir < irEnd; ++ir) delete (*ir);
124 
125  // put to event
126  if ( theMerger_!=0)
127  ev.put(quadruplets);
128  else
129  ev.put(triplets);
130 }
std::vector< TrajectorySeed > TrajectorySeedCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
size_t tooManyClusters(const edm::Event &e) const
void update(const edm::EventSetup &)
const OrderedSeedingHits & mergeTriplets(const OrderedSeedingHits &, const edm::EventSetup &)
void run(TrajectorySeedCollection &seedCollection, const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
return(e1-e2)*(e1-e2)+dp *dp
virtual std::vector< TrackingRegion * > regions(const edm::Event &ev, const edm::EventSetup &es) const =0

Member Data Documentation

std::string SeedGeneratorFromRegionHitsEDProducer::moduleName
private
ClusterChecker SeedGeneratorFromRegionHitsEDProducer::theClusterCheck
private

Definition at line 29 of file SeedGeneratorFromRegionHitsEDProducer.h.

Referenced by produce().

edm::ParameterSet SeedGeneratorFromRegionHitsEDProducer::theConfig
private
SeedGeneratorFromRegionHits* SeedGeneratorFromRegionHitsEDProducer::theGenerator
private

Definition at line 27 of file SeedGeneratorFromRegionHitsEDProducer.h.

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

QuadrupletSeedMerger* SeedGeneratorFromRegionHitsEDProducer::theMerger_
private
TrackingRegionProducer* SeedGeneratorFromRegionHitsEDProducer::theRegionProducer
private
bool SeedGeneratorFromRegionHitsEDProducer::theSilentOnClusterCheck
private