CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RoadSearchSeedFinder.cc
Go to the documentation of this file.
1 //
2 // Package: RecoTracker/RoadSearchSeedFinder
3 // Class: RoadSearchSeedFinder
4 //
5 // Description: Calls RoadSeachSeedFinderAlgorithm
6 // to find RoadSearchSeeds.
7 //
8 // Original Author: Oliver Gutsche, gutsche@fnal.gov
9 // Created: Sat Jan 14 22:00:00 UTC 2006
10 //
11 // $Author: gpetrucc $
12 // $Date: 2009/05/23 09:01:36 $
13 // $Revision: 1.17 $
14 //
15 
16 #include <iostream>
17 #include <memory>
18 #include <string>
19 
21 
25 
27 
31 
34 
36  roadSearchSeedFinderAlgorithm_(conf) ,
37  conf_(conf)
38 {
39  produces<RoadSearchSeedCollection>();
40 
41 }
42 
43 
44 // Virtual destructor needed.
46 
47 // Functions that gets called by framework every event
49 {
50 
51  // retrieve InputTags for strip rechits
52  edm::InputTag matchedStripRecHitsInputTag = conf_.getParameter<edm::InputTag>("matchedStripRecHits");
53  edm::InputTag rphiStripRecHitsInputTag = conf_.getParameter<edm::InputTag>("rphiStripRecHits");
54  edm::InputTag stereoStripRecHitsInputTag = conf_.getParameter<edm::InputTag>("stereoStripRecHits");
55  edm::InputTag clusterCollectionInputTag = conf_.getParameter<edm::InputTag>("ClusterCollectionLabel");
56 
57  // get Inputs
59  e.getByLabel(matchedStripRecHitsInputTag ,matchedRecHits);
61  e.getByLabel(rphiStripRecHitsInputTag ,rphiRecHits);
63  e.getByLabel(stereoStripRecHitsInputTag ,stereoRecHits);
64 
65  // retrieve InputTag for pixel rechits
66  edm::InputTag pixelRecHitsInputTag = conf_.getParameter<edm::InputTag>("pixelRecHits");
67 
68  // special treatment for getting pixel collection
69  // if collection exists in file, use collection from file
70  // if collection does not exist in file, create empty collection
71  static const SiPixelRecHitCollection s_empty;
72  const SiPixelRecHitCollection *pixelRecHitCollection = &s_empty;
74  if( e.getByLabel(pixelRecHitsInputTag, pixelRecHits)) {
75  pixelRecHitCollection = pixelRecHits.product();
76  } else {
77  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.";
78  }
79 
80  // create empty output collection
81  std::auto_ptr<RoadSearchSeedCollection> output(new RoadSearchSeedCollection);
82 
84 
85  // invoke the seed finding algorithm: check number of clusters per event *only* in cosmic tracking mode
86  size_t clustsOrZero = check.tooManyClusters(e);
87  if (!clustsOrZero) {
88 
90  stereoRecHits.product(),
91  matchedRecHits.product(),
92  pixelRecHitCollection,
93  es,
94  *output);
95  } else {
96  edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
97  }
98 
99  // write output to file
100  e.put(output);
101 
102 }
#define LogDebug(id)
T getParameter(std::string const &) const
virtual void produce(edm::Event &e, const edm::EventSetup &c)
std::vector< RoadSearchSeed > RoadSearchSeedCollection
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)
void run(const SiStripRecHit2DCollection *rphiRecHits, const SiStripRecHit2DCollection *stereoRecHits, const SiStripMatchedRecHit2DCollection *matchedRecHits, const SiPixelRecHitCollection *pixelRecHits, const edm::EventSetup &es, RoadSearchSeedCollection &output)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
tuple conf
Definition: dbtoconf.py:185
size_t tooManyClusters(const edm::Event &e)
edm::ParameterSet conf_
T const * product() const
Definition: Handle.h:74
RoadSearchSeedFinder(const edm::ParameterSet &conf)
RoadSearchSeedFinderAlgorithm roadSearchSeedFinderAlgorithm_