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::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void produce (edm::Event &ev, const edm::EventSetup &es) override
 
 SeedGeneratorFromRegionHitsEDProducer (const edm::ParameterSet &cfg)
 
 ~SeedGeneratorFromRegionHitsEDProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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
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 Attributes

std::string moduleName
 
ClusterChecker theClusterCheck
 
std::unique_ptr
< SeedGeneratorFromRegionHits
theGenerator
 
std::unique_ptr
< QuadrupletSeedMerger
theMerger_
 
std::unique_ptr
< TrackingRegionProducer
theRegionProducer
 
bool theSilentOnClusterCheck
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
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 26 of file SeedGeneratorFromRegionHitsEDProducer.cc.

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

28  : theRegionProducer(nullptr),
30  theMerger_(nullptr)
31 {
32  theSilentOnClusterCheck = cfg.getParameter<edm::ParameterSet>("ClusterCheckPSet").getUntrackedParameter<bool>("silentClusterCheck",false);
33 
34  moduleName = cfg.getParameter<std::string>("@module_label");
35 
36  edm::ParameterSet creatorPSet =
37  cfg.getParameter<edm::ParameterSet>("SeedCreatorPSet");
38 
39  // seed merger & its settings
41  if ( cfg.exists("SeedMergerPSet")) {
42  edm::ParameterSet mergerPSet = cfg.getParameter<edm::ParameterSet>( "SeedMergerPSet" );
43  theMerger_.reset(new QuadrupletSeedMerger(mergerPSet.getParameter<edm::ParameterSet>( "layerList" ), creatorPSet, iC));
44  theMerger_->setTTRHBuilderLabel( mergerPSet.getParameter<std::string>( "ttrhBuilderLabel" ) );
45  theMerger_->setMergeTriplets( mergerPSet.getParameter<bool>( "mergeTriplets" ) );
46  theMerger_->setAddRemainingTriplets( mergerPSet.getParameter<bool>( "addRemainingTriplets" ) );
47  }
48 
49  edm::ParameterSet regfactoryPSet =
50  cfg.getParameter<edm::ParameterSet>("RegionFactoryPSet");
51  std::string regfactoryName = regfactoryPSet.getParameter<std::string>("ComponentName");
52  theRegionProducer.reset(TrackingRegionProducerFactory::get()->create(regfactoryName,regfactoryPSet, consumesCollector()));
53 
54  edm::ParameterSet hitsfactoryPSet =
55  cfg.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
56  std::string hitsfactoryName = hitsfactoryPSet.getParameter<std::string>("ComponentName");
57  OrderedHitsGenerator* hitsGenerator =
58  OrderedHitsGeneratorFactory::get()->create( hitsfactoryName, hitsfactoryPSet, iC);
59 
60  edm::ParameterSet comparitorPSet =
61  cfg.getParameter<edm::ParameterSet>("SeedComparitorPSet");
62  std::string comparitorName = comparitorPSet.getParameter<std::string>("ComponentName");
63  SeedComparitor * aComparitor = (comparitorName == "none") ?
64  0 : SeedComparitorFactory::get()->create( comparitorName, comparitorPSet, iC);
65 
66  std::string creatorName = creatorPSet.getParameter<std::string>("ComponentName");
67  SeedCreator * aCreator = SeedCreatorFactory::get()->create( creatorName, creatorPSet);
68 
69  theGenerator.reset(new SeedGeneratorFromRegionHits(hitsGenerator, aComparitor, aCreator));
70 
71  produces<TrajectorySeedCollection>();
72 }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::unique_ptr< TrackingRegionProducer > theRegionProducer
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::unique_ptr< QuadrupletSeedMerger > theMerger_
std::unique_ptr< SeedGeneratorFromRegionHits > theGenerator
SurfaceDeformation * create(int type, const std::vector< double > &params)
T get(const Candidate &c)
Definition: component.h:55
SeedGeneratorFromRegionHitsEDProducer::~SeedGeneratorFromRegionHitsEDProducer ( )

Definition at line 74 of file SeedGeneratorFromRegionHitsEDProducer.cc.

75 {
76 }

Member Function Documentation

void SeedGeneratorFromRegionHitsEDProducer::produce ( edm::Event ev,
const edm::EventSetup es 
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 78 of file SeedGeneratorFromRegionHitsEDProducer.cc.

References edm::Event::put(), HLT_50ns_5e33_v2_cff::region, HLT_25ns14e33_v1_cff::Regions, mathSSE::return(), theClusterCheck, theGenerator, theMerger_, theRegionProducer, theSilentOnClusterCheck, and ClusterChecker::tooManyClusters().

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

Member Data Documentation

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

Definition at line 25 of file SeedGeneratorFromRegionHitsEDProducer.h.

Referenced by produce().

std::unique_ptr<SeedGeneratorFromRegionHits> SeedGeneratorFromRegionHitsEDProducer::theGenerator
private
std::unique_ptr<QuadrupletSeedMerger> SeedGeneratorFromRegionHitsEDProducer::theMerger_
private
std::unique_ptr<TrackingRegionProducer> SeedGeneratorFromRegionHitsEDProducer::theRegionProducer
private
bool SeedGeneratorFromRegionHitsEDProducer::theSilentOnClusterCheck
private