A plug-in module that takes StripDigis as input from the Event and creates an EDProduct comprising a FEDRawDataCollection. More...
#include <SiStripDigiToRawModule.h>
Public Member Functions | |
virtual void | beginJob () |
DigiToRawModule (const edm::ParameterSet &) | |
virtual void | endJob () |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~DigiToRawModule () | |
Private Attributes | |
DigiToRaw * | digiToRaw_ |
uint32_t | eventCounter_ |
std::string | inputDigiLabel_ |
std::string | inputModuleLabel_ |
FEDReadoutMode | mode_ |
bool | rawdigi_ |
A plug-in module that takes StripDigis as input from the Event and creates an EDProduct comprising a FEDRawDataCollection.
Definition at line 22 of file SiStripDigiToRawModule.h.
sistrip::DigiToRawModule::DigiToRawModule | ( | const edm::ParameterSet & | pset | ) |
Creates instance of DigiToRaw converter, defines EDProduct type.
Definition at line 24 of file SiStripDigiToRawModule.cc.
References DigiToRaw_cff::DigiToRaw, digiToRaw_, edm::ParameterSet::getParameter(), edm::isDebugEnabled(), LogDebug, mode_, rawdigi_, sistrip::READOUT_MODE_INVALID, sistrip::READOUT_MODE_PROC_RAW, sistrip::READOUT_MODE_SCOPE, sistrip::READOUT_MODE_SPY, sistrip::READOUT_MODE_VIRGIN_RAW, sistrip::READOUT_MODE_ZERO_SUPPRESSED, and sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE.
: inputModuleLabel_( pset.getParameter<std::string>( "InputModuleLabel" ) ), inputDigiLabel_( pset.getParameter<std::string>( "InputDigiLabel" ) ), mode_( fedReadoutModeFromString(pset.getParameter<std::string>( "FedReadoutMode" ))), rawdigi_( false ), digiToRaw_(0), eventCounter_(0) { if ( edm::isDebugEnabled() ) { LogDebug("DigiToRawModule") << "[sistrip::DigiToRawModule::DigiToRawModule]" << " Constructing object..."; } switch(mode_) { case READOUT_MODE_ZERO_SUPPRESSED_LITE: rawdigi_ = false; break; case READOUT_MODE_ZERO_SUPPRESSED: rawdigi_ = false; break; case READOUT_MODE_VIRGIN_RAW: rawdigi_ = true; break; case READOUT_MODE_PROC_RAW: rawdigi_ = true; break; case READOUT_MODE_SCOPE: rawdigi_ = true; break; case READOUT_MODE_INVALID: { if( edm::isDebugEnabled()) { edm::LogWarning("DigiToRawModule") << "[sistrip::DigiToRawModule::DigiToRawModule]" << " UNKNOWN readout mode: " << pset.getParameter<std::string>("FedReadoutMode"); }} break; case READOUT_MODE_SPY: { if( edm::isDebugEnabled()) { edm::LogWarning("DigiToRawModule") << "[sistrip::DigiToRawModule::DigiToRawModule]" << " Digi to raw is not supported for spy channel data"; }} break; } if(pset.getParameter<bool>("UseWrongDigiType")) { rawdigi_ = !rawdigi_; if( edm::isDebugEnabled()) { edm::LogWarning("DigiToRawModule") << "[sistrip::DigiToRawModule::DigiToRawModule]" << " You are using the wrong type of digis!"; } } // Create instance of DigiToRaw formatter digiToRaw_ = new DigiToRaw( mode_, pset.getParameter<bool>("UseFedKey") ); produces<FEDRawDataCollection>(); }
sistrip::DigiToRawModule::~DigiToRawModule | ( | ) |
Definition at line 75 of file SiStripDigiToRawModule.cc.
References digiToRaw_, edm::isDebugEnabled(), and LogDebug.
{ if ( edm::isDebugEnabled() ) { LogDebug("DigiToRaw") << "[sistrip::DigiToRawModule::~DigiToRawModule]" << " Destructing object..."; } if ( digiToRaw_ ) delete digiToRaw_; }
virtual void sistrip::DigiToRawModule::beginJob | ( | void | ) | [inline, virtual] |
virtual void sistrip::DigiToRawModule::endJob | ( | void | ) | [inline, virtual] |
void sistrip::DigiToRawModule::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Retrieves cabling map from EventSetup, retrieves a DetSetVector of SiStripDigis from Event, creates a FEDRawDataCollection (EDProduct), uses DigiToRaw converter to fill FEDRawDataCollection, attaches FEDRawDataCollection to Event.
Implements edm::EDProducer.
Definition at line 91 of file SiStripDigiToRawModule.cc.
References sistrip::DigiToRaw::createFedBuffers(), digiToRaw_, eventCounter_, edm::EventSetup::get(), edm::Event::getByLabel(), inputDigiLabel_, inputModuleLabel_, edm::Event::put(), and rawdigi_.
{ eventCounter_++; std::auto_ptr<FEDRawDataCollection> buffers( new FEDRawDataCollection ); edm::ESHandle<SiStripFedCabling> cabling; iSetup.get<SiStripFedCablingRcd>().get( cabling ); if( rawdigi_ ) { edm::Handle< edm::DetSetVector<SiStripRawDigi> > rawdigis; iEvent.getByLabel( inputModuleLabel_, inputDigiLabel_, rawdigis ); digiToRaw_->createFedBuffers( iEvent, cabling, rawdigis, buffers ); } else { edm::Handle< edm::DetSetVector<SiStripDigi> > digis; iEvent.getByLabel( inputModuleLabel_, inputDigiLabel_, digis ); digiToRaw_->createFedBuffers( iEvent, cabling, digis, buffers ); } iEvent.put( buffers ); }
DigiToRaw* sistrip::DigiToRawModule::digiToRaw_ [private] |
Definition at line 40 of file SiStripDigiToRawModule.h.
Referenced by DigiToRawModule(), produce(), and ~DigiToRawModule().
uint32_t sistrip::DigiToRawModule::eventCounter_ [private] |
Definition at line 41 of file SiStripDigiToRawModule.h.
Referenced by produce().
std::string sistrip::DigiToRawModule::inputDigiLabel_ [private] |
Definition at line 37 of file SiStripDigiToRawModule.h.
Referenced by produce().
std::string sistrip::DigiToRawModule::inputModuleLabel_ [private] |
Definition at line 36 of file SiStripDigiToRawModule.h.
Referenced by produce().
Definition at line 38 of file SiStripDigiToRawModule.h.
Referenced by DigiToRawModule().
bool sistrip::DigiToRawModule::rawdigi_ [private] |
Definition at line 39 of file SiStripDigiToRawModule.h.
Referenced by DigiToRawModule(), and produce().