#include <ShallowDigisProducer.h>
Classes | |
struct | products |
Public Member Functions | |
ShallowDigisProducer (const edm::ParameterSet &) | |
Private Member Functions | |
template<class T > | |
bool | findInput (edm::Handle< T > &, const edm::Event &) |
void | insert (products &, edm::Event &) |
void | produce (edm::Event &, const edm::EventSetup &) |
template<class T > | |
void | recordDigis (const T &, products &) |
Private Attributes | |
std::vector< edm::InputTag > | inputTags |
edm::ESHandle< SiStripNoises > | noiseHandle |
Definition at line 10 of file ShallowDigisProducer.h.
ShallowDigisProducer::ShallowDigisProducer | ( | const edm::ParameterSet & | conf | ) | [explicit] |
Definition at line 14 of file ShallowDigisProducer.cc.
: inputTags(conf.getParameter<std::vector<edm::InputTag> >("DigiProducersList")) { produces<std::vector<unsigned> >("id"); produces<std::vector<unsigned> >("subdet"); produces<std::vector<unsigned> >("strip"); produces<std::vector<unsigned> >("adc"); produces<std::vector<float> >("noise"); }
bool ShallowDigisProducer::findInput | ( | edm::Handle< T > & | handle, |
const edm::Event & | e | ||
) | [inline, private] |
Definition at line 64 of file ShallowDigisProducer.cc.
References edm::Event::getByLabel(), inputTags, edm::HandleBase::isValid(), and LogDebug.
Referenced by produce().
{ BOOST_FOREACH( const edm::InputTag inputTag, inputTags) { e.getByLabel(inputTag, handle); if( handle.isValid() && !handle->empty() ) { LogDebug("Input") << inputTag; return true; } } return false; }
void ShallowDigisProducer::insert | ( | products & | p, |
edm::Event & | e | ||
) | [private] |
Definition at line 25 of file ShallowDigisProducer.cc.
References ShallowDigisProducer::products::adc, ShallowDigisProducer::products::id, ShallowDigisProducer::products::noise, edm::Event::put(), ShallowDigisProducer::products::strip, and ShallowDigisProducer::products::subdet.
Referenced by produce().
void ShallowDigisProducer::produce | ( | edm::Event & | e, |
const edm::EventSetup & | es | ||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 50 of file ShallowDigisProducer.cc.
References findInput(), edm::EventSetup::get(), insert(), noiseHandle, AlCaHLTBitMon_ParallelJobs::p, and recordDigis().
{ products p; edm::Handle< edm::DetSetVector<SiStripDigi> > inputOld; edm::Handle< edmNew::DetSetVector<SiStripDigi> > inputNew; es.get<SiStripNoisesRcd>().get(noiseHandle); if( findInput(inputOld, e) ) recordDigis(*inputOld, p); else if( findInput(inputNew, e) ) recordDigis(*inputNew, p); else edm::LogWarning("Input Not Found"); insert(p,e); }
void ShallowDigisProducer::recordDigis | ( | const T & | digiCollection, |
products & | p | ||
) | [inline, private] |
Definition at line 36 of file ShallowDigisProducer.cc.
References SiStripDigi::adc(), ShallowDigisProducer::products::adc, ShallowDigisProducer::products::id, ShallowDigisProducer::products::noise, noiseHandle, ShallowDigisProducer::products::strip, SiStripDigi::strip(), and ShallowDigisProducer::products::subdet.
Referenced by produce().
{ BOOST_FOREACH(const typename T::value_type set, digiCollection) { SiStripNoises::Range detNoiseRange = noiseHandle->getRange(set.detId()); BOOST_FOREACH(const SiStripDigi digi, set) { p.id->push_back(set.detId()); p.subdet->push_back((set.detId()>>25)&0x7); p.strip->push_back(digi.strip()); p.adc->push_back(digi.adc()); p.noise->push_back(noiseHandle->getNoise( digi.strip(), detNoiseRange)); } } }
std::vector<edm::InputTag> ShallowDigisProducer::inputTags [private] |
Definition at line 30 of file ShallowDigisProducer.h.
Referenced by findInput().
Definition at line 31 of file ShallowDigisProducer.h.
Referenced by produce(), and recordDigis().