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
CosmicSeedGenerator Class Reference

#include <CosmicSeedGenerator.h>

Inheritance diagram for CosmicSeedGenerator:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CosmicSeedGenerator (const edm::ParameterSet &conf)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c) override
 
virtual ~CosmicSeedGenerator ()
 
- 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

ClusterChecker check
 
edm::ParameterSet conf_
 
SeedGeneratorForCosmics cosmic_seed
 

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 23 of file CosmicSeedGenerator.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file CosmicSeedGenerator.cc.

18  :
19  conf_(conf) ,cosmic_seed(conf),
20  check(conf,consumesCollector())
21 
22  {
23  edm::LogInfo ("CosmicSeedGenerator")<<"Enter the CosmicSeedGenerator";
24  produces<TrajectorySeedCollection>();
25 }
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
SeedGeneratorForCosmics cosmic_seed
edm::ParameterSet conf_
CosmicSeedGenerator::~CosmicSeedGenerator ( )
virtual

Definition at line 29 of file CosmicSeedGenerator.cc.

29 { }

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 32 of file CosmicSeedGenerator.cc.

References check, conf_, cosmic_seed, edm::Event::getByLabel(), edm::ParameterSet::getParameter(), SeedGeneratorForCosmics::init(), LogDebug, convertSQLitetoXML_cfg::output, edm::Event::put(), SeedGeneratorForCosmics::run(), and ClusterChecker::tooManyClusters().

33 {
34  // get Inputs
35  edm::InputTag matchedrecHitsTag = conf_.getParameter<edm::InputTag>("matchedRecHits");
36  edm::InputTag rphirecHitsTag = conf_.getParameter<edm::InputTag>("rphirecHits");
37  edm::InputTag stereorecHitsTag = conf_.getParameter<edm::InputTag>("stereorecHits");
38 
40  ev.getByLabel( rphirecHitsTag, rphirecHits );
42  ev.getByLabel( stereorecHitsTag ,stereorecHits );
44  ev.getByLabel( matchedrecHitsTag ,matchedrecHits );
45 
46 
47  std::auto_ptr<TrajectorySeedCollection> output(new TrajectorySeedCollection);
48 
49  //check on the number of clusters
50  size_t clustsOrZero = check.tooManyClusters(ev);
51  if (!clustsOrZero){
52  cosmic_seed.init(*stereorecHits,*rphirecHits,*matchedrecHits, es);
53 
54  // invoke the seed finding algorithm
55  cosmic_seed.run(*output,es);
56  } else edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
57 
58  // write output to file
59  LogDebug("CosmicSeedGenerator")<<" number of seeds = "<< output->size();
60 
61 
62  ev.put(output);
63 }
#define LogDebug(id)
T getParameter(std::string const &) const
void run(TrajectorySeedCollection &, const edm::EventSetup &c)
std::vector< TrajectorySeed > TrajectorySeedCollection
size_t tooManyClusters(const edm::Event &e) const
SeedGeneratorForCosmics cosmic_seed
edm::ParameterSet conf_
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 36 of file CosmicSeedGenerator.h.

Referenced by produce().

edm::ParameterSet CosmicSeedGenerator::conf_
private

Definition at line 34 of file CosmicSeedGenerator.h.

Referenced by produce().

SeedGeneratorForCosmics CosmicSeedGenerator::cosmic_seed
private

Definition at line 35 of file CosmicSeedGenerator.h.

Referenced by produce().