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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector
< edm::ProductResolverIndex >
const & 
indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector
< ProductResolverIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::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(), beamerCreator::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
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 eostools::move(), edm::Event::put(), HLT_FULL_cff::region, HLT_FULL_cff::Regions, reco::return(), theClusterCheck, theGenerator, theMerger_, theRegionProducer, theSilentOnClusterCheck, and ClusterChecker::tooManyClusters().

79 {
80  auto triplets = std::make_unique<TrajectorySeedCollection>();
81  auto quadruplets = std::make_unique<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(std::move(triplets));
89  return ;
90  }
91 
92  typedef std::vector<std::unique_ptr<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  // put to event
119  if ( theMerger_)
120  ev.put(std::move(quadruplets));
121  else
122  ev.put(std::move(triplets));
123 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
std::unique_ptr< TrackingRegionProducer > theRegionProducer
std::vector< TrajectorySeed > TrajectorySeedCollection
def move
Definition: eostools.py:510
size_t tooManyClusters(const edm::Event &e) const
return(e1-e2)*(e1-e2)+dp *dp
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