CMS 3D CMS Logo

Public Member Functions | Private Attributes

CosmicSeedGenerator Class Reference

#include <CosmicSeedGenerator.h>

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

List of all members.

Public Member Functions

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

Private Attributes

edm::ParameterSet conf_
SeedGeneratorForCosmics cosmic_seed

Detailed Description

Definition at line 22 of file CosmicSeedGenerator.h.


Constructor & Destructor Documentation

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

Definition at line 19 of file CosmicSeedGenerator.cc.

                                                                    : 
  conf_(conf) ,cosmic_seed(conf)
 {
  edm::LogInfo ("CosmicSeedGenerator")<<"Enter the CosmicSeedGenerator";
  produces<TrajectorySeedCollection>();
}
CosmicSeedGenerator::~CosmicSeedGenerator ( ) [virtual]

Definition at line 28 of file CosmicSeedGenerator.cc.

{ }  

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 31 of file CosmicSeedGenerator.cc.

References CastorDataFrameFilter_impl::check(), conf_, cosmic_seed, edm::Event::getByLabel(), edm::ParameterSet::getParameter(), SeedGeneratorForCosmics::init(), LogDebug, convertSQLitetoXML_cfg::output, edm::Event::put(), SeedGeneratorForCosmics::run(), and ClusterChecker::tooManyClusters().

{
  // get Inputs
  edm::InputTag matchedrecHitsTag = conf_.getParameter<edm::InputTag>("matchedRecHits");
  edm::InputTag rphirecHitsTag = conf_.getParameter<edm::InputTag>("rphirecHits");
  edm::InputTag stereorecHitsTag = conf_.getParameter<edm::InputTag>("stereorecHits");

  edm::Handle<SiStripRecHit2DCollection> rphirecHits;
  ev.getByLabel( rphirecHitsTag, rphirecHits );
  edm::Handle<SiStripRecHit2DCollection> stereorecHits;
  ev.getByLabel( stereorecHitsTag ,stereorecHits );
  edm::Handle<SiStripMatchedRecHit2DCollection> matchedrecHits;          
  ev.getByLabel( matchedrecHitsTag ,matchedrecHits );
 

  std::auto_ptr<TrajectorySeedCollection> output(new TrajectorySeedCollection);

  //check on the number of clusters
  ClusterChecker check(conf_);
  size_t clustsOrZero = check.tooManyClusters(ev);
  if (!clustsOrZero){
    cosmic_seed.init(*stereorecHits,*rphirecHits,*matchedrecHits, es);
    
    // invoke the seed finding algorithm
    cosmic_seed.run(*output,es);
  } else edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";

  // write output to file
  LogDebug("CosmicSeedGenerator")<<" number of seeds = "<< output->size();


  ev.put(output);
}

Member Data Documentation

Definition at line 33 of file CosmicSeedGenerator.h.

Referenced by produce().

Definition at line 34 of file CosmicSeedGenerator.h.

Referenced by produce().