CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RoadSearchCloudMaker.cc
Go to the documentation of this file.
1 //
2 // Package: RecoTracker/RoadSearchCloudMaker
3 // Class: RoadSearchCloudMaker
4 //
5 // Description: Calls RoadSeachCloudMakerAlgorithm
6 // to find RoadSearchClouds.
7 //
8 // Original Author: Oliver Gutsche, gutsche@fnal.gov
9 // Created: Sat Jan 14 22:00:00 UTC 2006
10 //
11 // $Author: noeding $
12 // $Date: 2007/11/07 23:42:04 $
13 // $Revision: 1.19 $
14 //
15 
16 #include <memory>
17 #include <string>
18 
20 
25 
29 
31  roadSearchCloudMakerAlgorithm_(conf) ,
32  conf_(conf)
33 {
34  produces<RoadSearchCloudCollection>();
35 
36  // retrieve InputTags for rechits
41 
42  // retrieve InputTags of input SeedCollection
43  seedProducer_ = conf_.getParameter<edm::InputTag>("SeedProducer");
44 
45 }
46 
47 
48 // Virtual destructor needed.
50 
51 // Functions that gets called by framework every event
53 {
54 
55  // Step A: Get Inputs
57  e.getByLabel(seedProducer_, seedHandle);
58 
59  // get Inputs
61  e.getByLabel(rphiStripRecHitsInputTag_ ,rphirecHitHandle);
62  const SiStripRecHit2DCollection *rphiRecHitCollection = rphirecHitHandle.product();
63  edm::Handle<SiStripRecHit2DCollection> stereorecHitHandle;
64  e.getByLabel(stereoStripRecHitsInputTag_ ,stereorecHitHandle);
65  const SiStripRecHit2DCollection *stereoRecHitCollection = stereorecHitHandle.product();
66 
67  // special treatment for getting matched RecHit collection
68  // if collection exists in file, use collection from file
69  // if collection does not exist in file, create empty collection
70  static const SiStripMatchedRecHit2DCollection s_empty0;
71  const SiStripMatchedRecHit2DCollection *matchedRecHitCollection = &s_empty0;
73  if( e.getByLabel(matchedStripRecHitsInputTag_, matchedRecHits)) {
74  matchedRecHitCollection = matchedRecHits.product();
75  } else {
76  LogDebug("RoadSearch") << "Collection SiStripMatchedRecHit2DCollection with InputTag " << matchedStripRecHitsInputTag_ << " cannot be found, using empty collection of same type. The RoadSearch algorithm is also fully functional without matched RecHits.";
77  }
78 
79  // special treatment for getting pixel collection
80  // if collection exists in file, use collection from file
81  // if collection does not exist in file, create empty collection
82  static const SiPixelRecHitCollection s_empty1;
83  const SiPixelRecHitCollection *pixelRecHitCollection = &s_empty1;
85  if( e.getByLabel(pixelRecHitsInputTag_, pixelRecHits)) {
86  pixelRecHitCollection = pixelRecHits.product();
87  } else {
88  LogDebug("RoadSearch") << "Collection SiPixelRecHitCollection with InputTag " << pixelRecHitsInputTag_ << " cannot be found, using empty collection of same type. The RoadSearch algorithm is also fully functional without Pixel RecHits.";
89  }
90 
91 
92  // Step B: create empty output collection
93  std::auto_ptr<RoadSearchCloudCollection> output(new RoadSearchCloudCollection);
94 
95  // Step C: Invoke the seed finding algorithm
97  rphiRecHitCollection,
98  stereoRecHitCollection,
99  matchedRecHitCollection,
100  pixelRecHitCollection,
101  es,
102  *output);
103 
104  // Step D: write output to file
105  e.put(output);
106 
107 }
#define LogDebug(id)
T getParameter(std::string const &) const
RoadSearchCloudMaker(const edm::ParameterSet &conf)
RoadSearchCloudMakerAlgorithm roadSearchCloudMakerAlgorithm_
edm::ParameterSet conf_
void run(edm::Handle< RoadSearchSeedCollection > input, const SiStripRecHit2DCollection *rphiRecHits, const SiStripRecHit2DCollection *stereoRecHits, const SiStripMatchedRecHit2DCollection *matchedRecHits, const SiPixelRecHitCollection *pixRecHits, const edm::EventSetup &es, RoadSearchCloudCollection &output)
Runs the algorithm.
edm::InputTag matchedStripRecHitsInputTag_
edm::InputTag pixelRecHitsInputTag_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
edm::InputTag rphiStripRecHitsInputTag_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
tuple conf
Definition: dbtoconf.py:185
T const * product() const
Definition: Handle.h:74
virtual void produce(edm::Event &e, const edm::EventSetup &c)
edm::InputTag stereoStripRecHitsInputTag_
std::vector< RoadSearchCloud > RoadSearchCloudCollection