CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CosmicSeedGenerator.cc
Go to the documentation of this file.
1 //
2 // Package: RecoTracker/TkSeedGenerator
3 // Class: GlobalPixelLessSeedGenerator
4 //
5 
6 #include <iostream>
7 #include <memory>
8 #include <string>
9 
15 
16 
17 using namespace std;
19  conf_(conf) ,cosmic_seed(conf),
20  check(conf,consumesCollector())
21 
22  {
23  edm::LogInfo ("CosmicSeedGenerator")<<"Enter the CosmicSeedGenerator";
24  produces<TrajectorySeedCollection>();
25 }
26 
27 
28 // Virtual destructor needed.
30 
31 // Functions that gets called by framework every event
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)
virtual void produce(edm::Event &e, const edm::EventSetup &c) override
CosmicSeedGenerator(const edm::ParameterSet &conf)
std::vector< TrajectorySeed > TrajectorySeedCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
bool check(const DataFrame &df, bool capcheck, bool dvercheck)
size_t tooManyClusters(const edm::Event &e) const
SeedGeneratorForCosmics cosmic_seed
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
tuple conf
Definition: dbtoconf.py:185
edm::ParameterSet conf_
void init(const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const edm::EventSetup &c)