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 
20 
22 
23 using namespace std;
25  conf_(conf) ,cosmic_seed(conf)
26  {
27  edm::LogInfo ("CosmicSeedGenerator")<<"Enter the CosmicSeedGenerator";
28  produces<TrajectorySeedCollection>();
29 }
30 
31 
32 // Virtual destructor needed.
34 
35 // Functions that gets called by framework every event
37 {
38  // get Inputs
39  edm::InputTag matchedrecHitsTag = conf_.getParameter<edm::InputTag>("matchedRecHits");
40  edm::InputTag rphirecHitsTag = conf_.getParameter<edm::InputTag>("rphirecHits");
41  edm::InputTag stereorecHitsTag = conf_.getParameter<edm::InputTag>("stereorecHits");
42 
44  ev.getByLabel( rphirecHitsTag, rphirecHits );
46  ev.getByLabel( stereorecHitsTag ,stereorecHits );
48  ev.getByLabel( matchedrecHitsTag ,matchedrecHits );
49 
50 
51  std::auto_ptr<TrajectorySeedCollection> output(new TrajectorySeedCollection);
52 
53  //check on the number of clusters
55  size_t clustsOrZero = check.tooManyClusters(ev);
56  if (!clustsOrZero){
57  cosmic_seed.init(*stereorecHits,*rphirecHits,*matchedrecHits, es);
58 
59  // invoke the seed finding algorithm
60  cosmic_seed.run(*output,es);
61  } else edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
62 
63  // write output to file
64  LogDebug("CosmicSeedGenerator")<<" number of seeds = "<< output->size();
65 
66 
67  ev.put(output);
68 }
#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)
CosmicSeedGenerator(const edm::ParameterSet &conf)
std::vector< TrajectorySeed > TrajectorySeedCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
bool check(const DataFrame &df, bool capcheck, bool dvercheck)
SeedGeneratorForCosmics cosmic_seed
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
tuple conf
Definition: dbtoconf.py:185
size_t tooManyClusters(const edm::Event &e)
edm::ParameterSet conf_
void init(const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const edm::EventSetup &c)