CMS 3D CMS Logo

Public Member Functions | Private Attributes

RoadSearchCloudMaker Class Reference

#include <RoadSearchCloudMaker.h>

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

List of all members.

Public Member Functions

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

Private Attributes

edm::ParameterSet conf_
edm::InputTag matchedStripRecHitsInputTag_
edm::InputTag pixelRecHitsInputTag_
RoadSearchCloudMakerAlgorithm roadSearchCloudMakerAlgorithm_
edm::InputTag rphiStripRecHitsInputTag_
edm::InputTag seedProducer_
edm::InputTag stereoStripRecHitsInputTag_

Detailed Description

Definition at line 31 of file RoadSearchCloudMaker.h.


Constructor & Destructor Documentation

RoadSearchCloudMaker::RoadSearchCloudMaker ( const edm::ParameterSet conf) [explicit]

Definition at line 30 of file RoadSearchCloudMaker.cc.

References conf_, edm::ParameterSet::getParameter(), matchedStripRecHitsInputTag_, pixelRecHitsInputTag_, rphiStripRecHitsInputTag_, seedProducer_, and stereoStripRecHitsInputTag_.

                                                                      : 
  roadSearchCloudMakerAlgorithm_(conf) ,
  conf_(conf)
{
  produces<RoadSearchCloudCollection>();

  // retrieve InputTags for rechits
  matchedStripRecHitsInputTag_ = conf_.getParameter<edm::InputTag>("matchedStripRecHits");
  rphiStripRecHitsInputTag_    = conf_.getParameter<edm::InputTag>("rphiStripRecHits");
  stereoStripRecHitsInputTag_  = conf_.getParameter<edm::InputTag>("stereoStripRecHits");
  pixelRecHitsInputTag_        = conf_.getParameter<edm::InputTag>("pixelRecHits");
    
  // retrieve InputTags of input SeedCollection
  seedProducer_                = conf_.getParameter<edm::InputTag>("SeedProducer");

}
RoadSearchCloudMaker::~RoadSearchCloudMaker ( ) [virtual]

Definition at line 49 of file RoadSearchCloudMaker.cc.

{ }  

Member Function Documentation

void RoadSearchCloudMaker::produce ( edm::Event e,
const edm::EventSetup c 
) [virtual]

Implements edm::EDProducer.

Definition at line 52 of file RoadSearchCloudMaker.cc.

References edm::Event::getByLabel(), LogDebug, matchedStripRecHitsInputTag_, convertSQLitetoXML_cfg::output, pixelRecHitsInputTag_, edm::Handle< T >::product(), edm::Event::put(), roadSearchCloudMakerAlgorithm_, rphiStripRecHitsInputTag_, RoadSearchCloudMakerAlgorithm::run(), seedProducer_, and stereoStripRecHitsInputTag_.

{

  // Step A: Get Inputs 
  edm::Handle<RoadSearchSeedCollection> seedHandle;
  e.getByLabel(seedProducer_, seedHandle);
    
  // get Inputs
  edm::Handle<SiStripRecHit2DCollection> rphirecHitHandle;
  e.getByLabel(rphiStripRecHitsInputTag_ ,rphirecHitHandle);
  const SiStripRecHit2DCollection *rphiRecHitCollection = rphirecHitHandle.product();
  edm::Handle<SiStripRecHit2DCollection> stereorecHitHandle;
  e.getByLabel(stereoStripRecHitsInputTag_ ,stereorecHitHandle);
  const SiStripRecHit2DCollection *stereoRecHitCollection = stereorecHitHandle.product();

  // special treatment for getting matched RecHit collection
  // if collection exists in file, use collection from file
  // if collection does not exist in file, create empty collection
  static const SiStripMatchedRecHit2DCollection s_empty0;
  const SiStripMatchedRecHit2DCollection *matchedRecHitCollection = &s_empty0;
  edm::Handle<SiStripMatchedRecHit2DCollection> matchedRecHits;
  if( e.getByLabel(matchedStripRecHitsInputTag_, matchedRecHits)) {
    matchedRecHitCollection = matchedRecHits.product();
  } else {
    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.";
  }
  
  // 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_empty1;
  const SiPixelRecHitCollection *pixelRecHitCollection = &s_empty1;
  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.";
  }
  

  // Step B: create empty output collection
  std::auto_ptr<RoadSearchCloudCollection> output(new RoadSearchCloudCollection);

  // Step C: Invoke the seed finding algorithm
  roadSearchCloudMakerAlgorithm_.run(seedHandle,
                                     rphiRecHitCollection,  
                                     stereoRecHitCollection,
                                     matchedRecHitCollection,
                                     pixelRecHitCollection,
                                     es,
                                     *output);

  // Step D: write output to file
  e.put(output);

}

Member Data Documentation

Definition at line 43 of file RoadSearchCloudMaker.h.

Referenced by RoadSearchCloudMaker().

Definition at line 45 of file RoadSearchCloudMaker.h.

Referenced by produce(), and RoadSearchCloudMaker().

Definition at line 48 of file RoadSearchCloudMaker.h.

Referenced by produce(), and RoadSearchCloudMaker().

Definition at line 42 of file RoadSearchCloudMaker.h.

Referenced by produce().

Definition at line 46 of file RoadSearchCloudMaker.h.

Referenced by produce(), and RoadSearchCloudMaker().

Definition at line 44 of file RoadSearchCloudMaker.h.

Referenced by produce(), and RoadSearchCloudMaker().

Definition at line 47 of file RoadSearchCloudMaker.h.

Referenced by produce(), and RoadSearchCloudMaker().