CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CRackSeedGenerator.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 using namespace std;
17 CRackSeedGenerator::CRackSeedGenerator(edm::ParameterSet const& conf) : cosmic_seed(conf, consumesCollector()) {
18  edm::LogInfo("CRackSeedGenerator") << "Enter the CRackSeedGenerator";
19  matchedrecHitsToken_ = consumes<SiStripMatchedRecHit2DCollection>(conf.getParameter<edm::InputTag>("matchedRecHits"));
20  rphirecHitsToken_ = consumes<SiStripRecHit2DCollection>(conf.getParameter<edm::InputTag>("rphirecHits"));
21  stereorecHitsToken_ = consumes<SiStripRecHit2DCollection>(conf.getParameter<edm::InputTag>("stereorecHits"));
22 
23  produces<TrajectorySeedCollection>();
24 }
25 
26 // Virtual destructor needed.
28 
29 // Functions that gets called by framework every event
31  // get Inputs
33  ev.getByToken(rphirecHitsToken_, rphirecHits);
35  ev.getByToken(stereorecHitsToken_, stereorecHits);
37  ev.getByToken(matchedrecHitsToken_, matchedrecHits);
38 
39  auto output = std::make_unique<TrajectorySeedCollection>();
40  //
41 
42  cosmic_seed.init(*stereorecHits, *rphirecHits, *matchedrecHits, es);
43 
44  // invoke the seed finding algorithm
45  cosmic_seed.run(*output, es);
46 
47  // write output to file
48  LogDebug("CRackSeedGenerator") << " number of seeds = " << output->size();
49 
50  ev.put(std::move(output));
51 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
CRackSeedGenerator(const edm::ParameterSet &conf)
~CRackSeedGenerator() override
edm::EDGetTokenT< SiStripRecHit2DCollection > rphirecHitsToken_
def move
Definition: eostools.py:511
SeedGeneratorForCRack cosmic_seed
void produce(edm::Event &e, const edm::EventSetup &c) override
Log< level::Info, false > LogInfo
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void init(const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const edm::EventSetup &c)
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > matchedrecHitsToken_
void run(TrajectorySeedCollection &, const edm::EventSetup &c)
edm::EDGetTokenT< SiStripRecHit2DCollection > stereorecHitsToken_
#define LogDebug(id)