CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CosmicSeedGenerator Class Reference

#include <CosmicSeedGenerator.h>

Inheritance diagram for CosmicSeedGenerator:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CosmicSeedGenerator (const edm::ParameterSet &conf)
 
void produce (edm::Event &e, const edm::EventSetup &c) override
 
 ~CosmicSeedGenerator () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 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 & itemsToGetFrom (BranchType iType) 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

ClusterChecker check
 
SeedGeneratorForCosmics cosmic_seed
 
edm::EDGetTokenT< SiStripMatchedRecHit2DCollectionmatchedrecHitsToken_
 
edm::EDGetTokenT< SiStripRecHit2DCollectionrphirecHitsToken_
 
edm::EDGetTokenT< SiStripRecHit2DCollectionstereorecHitsToken_
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
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 23 of file CosmicSeedGenerator.h.

Constructor & Destructor Documentation

CosmicSeedGenerator::CosmicSeedGenerator ( const edm::ParameterSet conf)
explicit

Definition at line 18 of file CosmicSeedGenerator.cc.

References edm::ParameterSet::getParameter(), matchedrecHitsToken_, rphirecHitsToken_, and stereorecHitsToken_.

18  :
19  cosmic_seed(conf),
20  check(conf,consumesCollector())
21 
22  {
23  edm::LogInfo ("CosmicSeedGenerator")<<"Enter the CosmicSeedGenerator";
24  // get Inputs
25  matchedrecHitsToken_ = consumes<SiStripMatchedRecHit2DCollection>(
26  conf.getParameter<edm::InputTag>("matchedRecHits"));
27  rphirecHitsToken_ = consumes<SiStripRecHit2DCollection>(
28  conf.getParameter<edm::InputTag>("rphirecHits"));
29  stereorecHitsToken_ = consumes<SiStripRecHit2DCollection>(
30  conf.getParameter<edm::InputTag>("stereorecHits"));
31 
32  produces<TrajectorySeedCollection>();
33 }
T getParameter(std::string const &) const
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > matchedrecHitsToken_
edm::EDGetTokenT< SiStripRecHit2DCollection > rphirecHitsToken_
edm::EDGetTokenT< SiStripRecHit2DCollection > stereorecHitsToken_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
SeedGeneratorForCosmics cosmic_seed
CosmicSeedGenerator::~CosmicSeedGenerator ( )
override

Definition at line 37 of file CosmicSeedGenerator.cc.

37 { }

Member Function Documentation

void CosmicSeedGenerator::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Definition at line 40 of file CosmicSeedGenerator.cc.

References check, cosmic_seed, edm::Event::getByToken(), SeedGeneratorForCosmics::init(), LogDebug, AlignmentTrackSelector_cfi::matchedrecHits, matchedrecHitsToken_, eostools::move(), convertSQLitetoXML_cfg::output, edm::Event::put(), AlignmentTrackSelector_cfi::rphirecHits, rphirecHitsToken_, SeedGeneratorForCosmics::run(), convBremSeeds_cfi::stereorecHits, stereorecHitsToken_, and ClusterChecker::tooManyClusters().

41 {
43  ev.getByToken( rphirecHitsToken_, rphirecHits);
45  ev.getByToken( stereorecHitsToken_,stereorecHits);
47  ev.getByToken( matchedrecHitsToken_, matchedrecHits);
48 
49 
50  auto output = std::make_unique<TrajectorySeedCollection>();
51 
52  //check on the number of clusters
53  size_t clustsOrZero = check.tooManyClusters(ev);
54  if (!clustsOrZero){
55  cosmic_seed.init(*stereorecHits,*rphirecHits,*matchedrecHits, es);
56 
57  // invoke the seed finding algorithm
58  cosmic_seed.run(*output,es);
59  } else edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
60 
61  // write output to file
62  LogDebug("CosmicSeedGenerator")<<" number of seeds = "<< output->size();
63 
64 
65  ev.put(std::move(output));
66 }
#define LogDebug(id)
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > matchedrecHitsToken_
void run(TrajectorySeedCollection &, const edm::EventSetup &c)
edm::EDGetTokenT< SiStripRecHit2DCollection > rphirecHitsToken_
bool ev
edm::EDGetTokenT< SiStripRecHit2DCollection > stereorecHitsToken_
size_t tooManyClusters(const edm::Event &e) const
SeedGeneratorForCosmics cosmic_seed
def move(src, dest)
Definition: eostools.py:510
void init(const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const edm::EventSetup &c)

Member Data Documentation

ClusterChecker CosmicSeedGenerator::check
private

Definition at line 35 of file CosmicSeedGenerator.h.

Referenced by produce().

SeedGeneratorForCosmics CosmicSeedGenerator::cosmic_seed
private

Definition at line 34 of file CosmicSeedGenerator.h.

Referenced by produce().

edm::EDGetTokenT<SiStripMatchedRecHit2DCollection> CosmicSeedGenerator::matchedrecHitsToken_
private

Definition at line 37 of file CosmicSeedGenerator.h.

Referenced by CosmicSeedGenerator(), and produce().

edm::EDGetTokenT<SiStripRecHit2DCollection> CosmicSeedGenerator::rphirecHitsToken_
private

Definition at line 38 of file CosmicSeedGenerator.h.

Referenced by CosmicSeedGenerator(), and produce().

edm::EDGetTokenT<SiStripRecHit2DCollection> CosmicSeedGenerator::stereorecHitsToken_
private

Definition at line 39 of file CosmicSeedGenerator.h.

Referenced by CosmicSeedGenerator(), and produce().