CMS 3D CMS Logo

Public Member Functions | Private Attributes

RoadSearchSeedFinder Class Reference

#include <RoadSearchSeedFinder.h>

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

List of all members.

Public Member Functions

virtual void produce (edm::Event &e, const edm::EventSetup &c)
 RoadSearchSeedFinder (const edm::ParameterSet &conf)
virtual ~RoadSearchSeedFinder ()

Private Attributes

edm::ParameterSet conf_
RoadSearchSeedFinderAlgorithm roadSearchSeedFinderAlgorithm_

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.

                                                                      : 
  roadSearchSeedFinderAlgorithm_(conf) ,
  conf_(conf)
{
  produces<RoadSearchSeedCollection>();

}
RoadSearchSeedFinder::~RoadSearchSeedFinder ( ) [virtual]

Definition at line 45 of file RoadSearchSeedFinder.cc.

{ }  

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().

{

  // retrieve InputTags for strip rechits
  edm::InputTag matchedStripRecHitsInputTag = conf_.getParameter<edm::InputTag>("matchedStripRecHits");
  edm::InputTag rphiStripRecHitsInputTag    = conf_.getParameter<edm::InputTag>("rphiStripRecHits");
  edm::InputTag stereoStripRecHitsInputTag  = conf_.getParameter<edm::InputTag>("stereoStripRecHits");
  edm::InputTag clusterCollectionInputTag   = conf_.getParameter<edm::InputTag>("ClusterCollectionLabel");
  
  // get Inputs
  edm::Handle<SiStripMatchedRecHit2DCollection> matchedRecHits;
  e.getByLabel(matchedStripRecHitsInputTag ,matchedRecHits);
  edm::Handle<SiStripRecHit2DCollection> rphiRecHits;
  e.getByLabel(rphiStripRecHitsInputTag ,rphiRecHits);
  edm::Handle<SiStripRecHit2DCollection> stereoRecHits;
  e.getByLabel(stereoStripRecHitsInputTag ,stereoRecHits);
 
  // retrieve InputTag for pixel rechits
  edm::InputTag pixelRecHitsInputTag  = conf_.getParameter<edm::InputTag>("pixelRecHits");

  // special treatment for getting pixel collection
  // if collection exists in file, use collection from file
  // if collection does not exist in file, create empty collection
  static const SiPixelRecHitCollection s_empty;
  const SiPixelRecHitCollection *pixelRecHitCollection = &s_empty;
  edm::Handle<SiPixelRecHitCollection> pixelRecHits;
  if( e.getByLabel(pixelRecHitsInputTag, pixelRecHits)) {
    pixelRecHitCollection = pixelRecHits.product();
  } else {
    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.";
  }

  // create empty output collection
  std::auto_ptr<RoadSearchSeedCollection> output(new RoadSearchSeedCollection);

  ClusterChecker check(conf_);
    
  // invoke the seed finding algorithm: check number of clusters per event *only* in cosmic tracking mode
  size_t clustsOrZero = check.tooManyClusters(e);
  if (!clustsOrZero) {

    roadSearchSeedFinderAlgorithm_.run(rphiRecHits.product(),  
                                       stereoRecHits.product(),
                                       matchedRecHits.product(),
                                       pixelRecHitCollection,
                                       es,
                                       *output);
  } else {
    edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
  }

  // write output to file
  e.put(output);

}

Member Data Documentation

Definition at line 40 of file RoadSearchSeedFinder.h.

Referenced by produce().

Definition at line 39 of file RoadSearchSeedFinder.h.

Referenced by produce().