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 
17 
18 using namespace std;
20  conf_(conf) ,cosmic_seed(conf)
21  {
22  edm::LogInfo ("CosmicSeedGenerator")<<"Enter the CosmicSeedGenerator";
23  produces<TrajectorySeedCollection>();
24 }
25 
26 
27 // Virtual destructor needed.
29 
30 // Functions that gets called by framework every event
32 {
33  // get Inputs
34  edm::InputTag matchedrecHitsTag = conf_.getParameter<edm::InputTag>("matchedRecHits");
35  edm::InputTag rphirecHitsTag = conf_.getParameter<edm::InputTag>("rphirecHits");
36  edm::InputTag stereorecHitsTag = conf_.getParameter<edm::InputTag>("stereorecHits");
37 
39  ev.getByLabel( rphirecHitsTag, rphirecHits );
41  ev.getByLabel( stereorecHitsTag ,stereorecHits );
43  ev.getByLabel( matchedrecHitsTag ,matchedrecHits );
44 
45 
46  std::auto_ptr<TrajectorySeedCollection> output(new TrajectorySeedCollection);
47 
48  //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:94
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:361
tuple conf
Definition: dbtoconf.py:185
edm::ParameterSet conf_
void init(const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const edm::EventSetup &c)