CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
RoadSearchSeedFinder Class Reference

#include <RoadSearchSeedFinder.h>

Inheritance diagram for RoadSearchSeedFinder:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual void produce (edm::Event &e, const edm::EventSetup &c)
 
 RoadSearchSeedFinder (const edm::ParameterSet &conf)
 
virtual ~RoadSearchSeedFinder ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

edm::ParameterSet conf_
 
RoadSearchSeedFinderAlgorithm roadSearchSeedFinderAlgorithm_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 28 of file RoadSearchSeedFinder.h.

Constructor & Destructor Documentation

RoadSearchSeedFinder::RoadSearchSeedFinder ( const edm::ParameterSet conf)
explicit

Definition at line 35 of file RoadSearchSeedFinder.cc.

35  :
37  conf_(conf)
38 {
39  produces<RoadSearchSeedCollection>();
40 
41 }
edm::ParameterSet conf_
RoadSearchSeedFinderAlgorithm roadSearchSeedFinderAlgorithm_
RoadSearchSeedFinder::~RoadSearchSeedFinder ( )
virtual

Definition at line 45 of file RoadSearchSeedFinder.cc.

45 { }

Member Function Documentation

void RoadSearchSeedFinder::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDProducer.

Definition at line 48 of file RoadSearchSeedFinder.cc.

References CastorDataFrameFilter_impl::check(), conf_, edm::Event::getByLabel(), edm::ParameterSet::getParameter(), LogDebug, convertSQLitetoXML_cfg::output, edm::Handle< T >::product(), edm::Event::put(), roadSearchSeedFinderAlgorithm_, RoadSearchSeedFinderAlgorithm::run(), and ClusterChecker::tooManyClusters().

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
std::vector< RoadSearchSeed > RoadSearchSeedCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
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:356
edm::ParameterSet conf_
T const * product() const
Definition: Handle.h:74
RoadSearchSeedFinderAlgorithm roadSearchSeedFinderAlgorithm_

Member Data Documentation

edm::ParameterSet RoadSearchSeedFinder::conf_
private

Definition at line 40 of file RoadSearchSeedFinder.h.

Referenced by produce().

RoadSearchSeedFinderAlgorithm RoadSearchSeedFinder::roadSearchSeedFinderAlgorithm_
private

Definition at line 39 of file RoadSearchSeedFinder.h.

Referenced by produce().