CMS 3D CMS Logo

SiStripRawToDigiModule Class Reference

A plug-in module that takes a FEDRawDataCollection as input from the Event and creates EDProducts containing StripDigis. More...

#include <EventFilter/SiStripRawToDigi/plugins/SiStripRawToDigiModule.h>

Inheritance diagram for SiStripRawToDigiModule:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

virtual void beginJob (const edm::EventSetup &)
virtual void beginRun (edm::Run &, const edm::EventSetup &)
virtual void produce (edm::Event &, const edm::EventSetup &)
 Retrieves cabling map from EventSetup and FEDRawDataCollection from Event, creates a DetSetVector of SiStrip(Raw)Digis, uses the SiStripRawToDigiUnpacker class to fill the DetSetVector, and attaches the container to the Event.
 SiStripRawToDigiModule (const edm::ParameterSet &)
 ~SiStripRawToDigiModule ()

Private Member Functions

void updateCabling (const edm::EventSetup &)

Private Attributes

const SiStripFedCablingcabling_
uint32_t cacheId_
std::string instance_
std::string label_
SiStripRawToDigiUnpackerrawToDigi_


Detailed Description

A plug-in module that takes a FEDRawDataCollection as input from the Event and creates EDProducts containing StripDigis.

Definition at line 23 of file SiStripRawToDigiModule.h.


Constructor & Destructor Documentation

SiStripRawToDigiModule::SiStripRawToDigiModule ( const edm::ParameterSet pset  ) 

Definition at line 22 of file SiStripRawToDigiModule.cc.

References edm::ParameterSet::getUntrackedParameter(), edm::isDebugEnabled(), LogTrace, sistrip::mlRawToDigi_, and rawToDigi_.

00022                                                                             :
00023   rawToDigi_(0),
00024   label_( pset.getUntrackedParameter<std::string>("ProductLabel","source") ),
00025   instance_( pset.getUntrackedParameter<std::string>("ProductInstance","") ),
00026   cabling_(0),
00027   cacheId_(0)
00028 {
00029   if ( edm::isDebugEnabled() ) {
00030     LogTrace(mlRawToDigi_)
00031       << "[SiStripRawToDigiModule::" << __func__ << "]"
00032       << " Constructing object...";
00033   }
00034 
00035   int16_t appended_bytes = pset.getUntrackedParameter<int>("AppendedBytes",0);
00036   int16_t fed_buffer_dump_freq = pset.getUntrackedParameter<int>("FedBufferDumpFreq",0);
00037   int16_t fed_event_dump_freq = pset.getUntrackedParameter<int>("FedEventDumpFreq",0);
00038   int16_t trigger_fed_id = pset.getUntrackedParameter<int>("TriggerFedId",0);
00039   bool using_fed_key  = pset.getUntrackedParameter<bool>("UseFedKey",false);
00040   bool quiet = pset.getUntrackedParameter<bool>("Quiet",true);
00041   rawToDigi_ = new SiStripRawToDigiUnpacker( appended_bytes, 
00042                                              fed_buffer_dump_freq,
00043                                              fed_event_dump_freq,
00044                                              trigger_fed_id,
00045                                              using_fed_key );
00046   if ( rawToDigi_ ) { rawToDigi_->quiet(quiet); }
00047   
00048   produces< SiStripEventSummary >();
00049   produces< edm::DetSetVector<SiStripRawDigi> >("ScopeMode");
00050   produces< edm::DetSetVector<SiStripRawDigi> >("VirginRaw");
00051   produces< edm::DetSetVector<SiStripRawDigi> >("ProcessedRaw");
00052   produces< edm::DetSetVector<SiStripDigi> >("ZeroSuppressed");
00053   
00054 }

SiStripRawToDigiModule::~SiStripRawToDigiModule (  ) 

Definition at line 58 of file SiStripRawToDigiModule.cc.

References cabling_, edm::isDebugEnabled(), LogTrace, sistrip::mlRawToDigi_, and rawToDigi_.

00058                                                 {
00059   if ( rawToDigi_ ) { delete rawToDigi_; }
00060   if ( cabling_ ) { cabling_ = 0; }
00061   if ( edm::isDebugEnabled() ) {
00062     LogTrace(mlRawToDigi_)
00063       << "[SiStripRawToDigiModule::" << __func__ << "]"
00064       << " Destructing object...";
00065   }
00066 }


Member Function Documentation

void SiStripRawToDigiModule::beginJob ( const edm::EventSetup setup  )  [virtual]

Reimplemented from edm::EDProducer.

Definition at line 70 of file SiStripRawToDigiModule.cc.

00070                                                                   {
00071   //@@ unstable behaviour if uncommented!
00072   //updateCabling( setup );
00073 }

void SiStripRawToDigiModule::beginRun ( edm::Run run,
const edm::EventSetup setup 
) [virtual]

Reimplemented from edm::EDProducer.

Definition at line 77 of file SiStripRawToDigiModule.cc.

References updateCabling().

00077                                                                                {
00078   updateCabling( setup );
00079 }  

void SiStripRawToDigiModule::produce ( edm::Event event,
const edm::EventSetup setup 
) [virtual]

Retrieves cabling map from EventSetup and FEDRawDataCollection from Event, creates a DetSetVector of SiStrip(Raw)Digis, uses the SiStripRawToDigiUnpacker class to fill the DetSetVector, and attaches the container to the Event.

Implements edm::EDProducer.

Definition at line 88 of file SiStripRawToDigiModule.cc.

References cabling_, SiStripRawToDigiUnpacker::createDigis(), edm::Event::id(), instance_, label_, rawToDigi_, summary, SiStripRawToDigiUnpacker::triggerFed(), and updateCabling().

00089                                                                    {
00090   
00091   updateCabling( setup );
00092   
00093   // Retrieve FED raw data (by label, which is "source" by default)
00094   edm::Handle<FEDRawDataCollection> buffers;
00095   event.getByLabel( label_, instance_, buffers ); 
00096 
00097   // Populate SiStripEventSummary object with "trigger FED" info
00098   std::auto_ptr<SiStripEventSummary> summary( new SiStripEventSummary() );
00099   rawToDigi_->triggerFed( *buffers, *summary, event.id().event() ); 
00100 
00101   // Create containers for digis
00102   edm::DetSetVector<SiStripRawDigi>* sm = new edm::DetSetVector<SiStripRawDigi>();
00103   edm::DetSetVector<SiStripRawDigi>* vr = new edm::DetSetVector<SiStripRawDigi>();
00104   edm::DetSetVector<SiStripRawDigi>* pr = new edm::DetSetVector<SiStripRawDigi>();
00105   edm::DetSetVector<SiStripDigi>* zs = new edm::DetSetVector<SiStripDigi>();
00106 
00107   // Create digis
00108   if ( rawToDigi_ ) { rawToDigi_->createDigis( *cabling_,*buffers,*summary,*sm,*vr,*pr,*zs ); }
00109   
00110   // Create auto_ptr's of digi products
00111   std::auto_ptr< edm::DetSetVector<SiStripRawDigi> > sm_dsv(sm);
00112   std::auto_ptr< edm::DetSetVector<SiStripRawDigi> > vr_dsv(vr);
00113   std::auto_ptr< edm::DetSetVector<SiStripRawDigi> > pr_dsv(pr);
00114   std::auto_ptr< edm::DetSetVector<SiStripDigi> > zs_dsv(zs);
00115   
00116   // Add to event
00117   event.put( summary );
00118   event.put( sm_dsv, "ScopeMode" );
00119   event.put( vr_dsv, "VirginRaw" );
00120   event.put( pr_dsv, "ProcessedRaw" );
00121   event.put( zs_dsv, "ZeroSuppressed" );
00122   
00123 }

void SiStripRawToDigiModule::updateCabling ( const edm::EventSetup setup  )  [private]

Definition at line 127 of file SiStripRawToDigiModule.cc.

References c, cabling_, cacheId_, lat::endl(), edm::EventSetup::get(), edm::isDebugEnabled(), LogTrace, sistrip::mlRawToDigi_, edm::ESHandle< T >::product(), ss, SiStripFedCabling::summary(), and SiStripFedCabling::terse().

Referenced by beginRun(), and produce().

00127                                                                        {
00128 
00129   uint32_t cache_id = setup.get<SiStripFedCablingRcd>().cacheIdentifier();
00130 
00131   if ( cacheId_ != cache_id ) {
00132     
00133     edm::ESHandle<SiStripFedCabling> c;
00134     setup.get<SiStripFedCablingRcd>().get( c );
00135     cabling_ = c.product();
00136     
00137     if ( edm::isDebugEnabled() ) {
00138       if ( !cacheId_ ) {
00139         std::stringstream ss;
00140         ss << "[SiStripRawToDigiModule::" << __func__ << "]"
00141            << " Updating cabling for first time..." << std::endl;
00142         ss << "[SiStripRawToDigiModule::" << __func__ << "]"
00143            << " Terse print out of FED cabling:" << std::endl;
00144         cabling_->terse(ss);
00145         LogTrace(mlRawToDigi_) << ss.str();
00146       }
00147     }
00148     
00149     if ( edm::isDebugEnabled() ) {
00150       std::stringstream sss;
00151       sss << "[SiStripRawToDigiModule::" << __func__ << "]"
00152           << " Summary of FED cabling:" << std::endl;
00153       cabling_->summary(sss);
00154       LogTrace(mlRawToDigi_) << sss.str();
00155     }
00156 
00157     cacheId_ = cache_id;
00158     
00159   }
00160   
00161 }


Member Data Documentation

const SiStripFedCabling* SiStripRawToDigiModule::cabling_ [private]

Definition at line 43 of file SiStripRawToDigiModule.h.

Referenced by produce(), updateCabling(), and ~SiStripRawToDigiModule().

uint32_t SiStripRawToDigiModule::cacheId_ [private]

Definition at line 45 of file SiStripRawToDigiModule.h.

Referenced by updateCabling().

std::string SiStripRawToDigiModule::instance_ [private]

Definition at line 41 of file SiStripRawToDigiModule.h.

Referenced by produce().

std::string SiStripRawToDigiModule::label_ [private]

Definition at line 40 of file SiStripRawToDigiModule.h.

Referenced by produce().

SiStripRawToDigiUnpacker* SiStripRawToDigiModule::rawToDigi_ [private]

Definition at line 38 of file SiStripRawToDigiModule.h.

Referenced by produce(), SiStripRawToDigiModule(), and ~SiStripRawToDigiModule().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:32:32 2009 for CMSSW by  doxygen 1.5.4