CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

SiStripClusterizer Class Reference

#include <SiStripClusterizer.h>

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

List of all members.

Public Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &)
 SiStripClusterizer (const edm::ParameterSet &conf)

Private Member Functions

template<class T >
bool findInput (const edm::InputTag &, edm::Handle< T > &, const edm::Event &)

Private Attributes

std::auto_ptr
< StripClusterizerAlgorithm
algorithm
const std::vector< edm::InputTaginputTags

Detailed Description

Definition at line 8 of file SiStripClusterizer.h.


Constructor & Destructor Documentation

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

Definition at line 8 of file SiStripClusterizer.cc.

  : inputTags( conf.getParameter<std::vector<edm::InputTag> >("DigiProducersList") ),
    algorithm( StripClusterizerAlgorithmFactory::create(conf.getParameter<edm::ParameterSet>("Clusterizer")) ) {
  produces< edmNew::DetSetVector<SiStripCluster> > ();
}

Member Function Documentation

template<class T >
bool SiStripClusterizer::findInput ( const edm::InputTag tag,
edm::Handle< T > &  handle,
const edm::Event e 
) [inline, private]

Definition at line 39 of file SiStripClusterizer.cc.

References edm::Event::getByLabel(), and edm::HandleBase::isValid().

Referenced by produce().

                                                                           {
    e.getByLabel( tag, handle);
    return handle.isValid();
}
void SiStripClusterizer::produce ( edm::Event event,
const edm::EventSetup es 
) [virtual]

Implements edm::EDProducer.

Definition at line 15 of file SiStripClusterizer.cc.

References algorithm, findInput(), inputTags, LogDebug, convertSQLitetoXML_cfg::output, and GlobalPosition_Frontier_DevDB_cff::tag.

                                                   {

  std::auto_ptr< edmNew::DetSetVector<SiStripCluster> > output(new edmNew::DetSetVector<SiStripCluster>());
  output->reserve(10000,4*10000);

  edm::Handle< edm::DetSetVector<SiStripDigi> >     inputOld;  
  edm::Handle< edmNew::DetSetVector<SiStripDigi> >  inputNew;  

  algorithm->initialize(es);  

  BOOST_FOREACH( const edm::InputTag& tag, inputTags) {
    if(      findInput( tag, inputOld, event) ) algorithm->clusterize(*inputOld, *output); 
    else if( findInput( tag, inputNew, event) ) algorithm->clusterize(*inputNew, *output);
    else edm::LogError("Input Not Found") << "[SiStripClusterizer::produce] " << tag;
  }

  LogDebug("Output") << output->dataSize() << " clusters from " 
                     << output->size()     << " modules";
  event.put(output);
}

Member Data Documentation

Definition at line 19 of file SiStripClusterizer.h.

Referenced by produce().

const std::vector<edm::InputTag> SiStripClusterizer::inputTags [private]

Definition at line 18 of file SiStripClusterizer.h.

Referenced by produce().