CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
sistrip::RawToDigiModule Class Reference

#include <SiStripRawToDigiModule.h>

Inheritance diagram for sistrip::RawToDigiModule:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (edm::Run &, const edm::EventSetup &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 RawToDigiModule (const edm::ParameterSet &)
 
 ~RawToDigiModule ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

void updateCabling (const edm::EventSetup &)
 

Private Attributes

const SiStripFedCablingcabling_
 
uint32_t cacheId_
 
bool doFullCorruptBufferChecks_
 
bool extractCm_
 
edm::InputTag productLabel_
 
RawToDigiUnpackerrawToDigi_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 25 of file SiStripRawToDigiModule.h.

Constructor & Destructor Documentation

sistrip::RawToDigiModule::RawToDigiModule ( const edm::ParameterSet pset)

Definition at line 20 of file SiStripRawToDigiModule.cc.

References doFullCorruptBufferChecks_, extractCm_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), edm::isDebugEnabled(), LogTrace, and rawToDigi_.

20  :
21  rawToDigi_(0),
22  productLabel_(pset.getParameter<edm::InputTag>("ProductLabel")),
23  cabling_(0),
24  cacheId_(0),
25  extractCm_(false),
27  {
28  if ( edm::isDebugEnabled() ) {
29  LogTrace("SiStripRawToDigi")
30  << "[sistrip::RawToDigiModule::" << __func__ << "]"
31  << " Constructing object...";
32  }
33 
34  int16_t appended_bytes = pset.getParameter<int>("AppendedBytes");
35  int16_t trigger_fed_id = pset.getParameter<int>("TriggerFedId");
36  bool use_daq_register = pset.getParameter<bool>("UseDaqRegister");
37  bool using_fed_key = pset.getParameter<bool>("UseFedKey");
38  bool unpack_bad_channels = pset.getParameter<bool>("UnpackBadChannels");
39  bool mark_missing_feds = pset.getParameter<bool>("MarkModulesOnMissingFeds");
40 
41  int16_t fed_buffer_dump_freq = pset.getUntrackedParameter<int>("FedBufferDumpFreq",0);
42  int16_t fed_event_dump_freq = pset.getUntrackedParameter<int>("FedEventDumpFreq",0);
43  bool quiet = pset.getUntrackedParameter<bool>("Quiet",true);
44  extractCm_ = pset.getParameter<bool>("UnpackCommonModeValues");
45  doFullCorruptBufferChecks_ = pset.getParameter<bool>("DoAllCorruptBufferChecks");
46  uint32_t errorThreshold = pset.getParameter<unsigned int>("ErrorThreshold");
47 
48  rawToDigi_ = new sistrip::RawToDigiUnpacker( appended_bytes, fed_buffer_dump_freq, fed_event_dump_freq, trigger_fed_id, using_fed_key, unpack_bad_channels, mark_missing_feds, errorThreshold);
49  rawToDigi_->quiet(quiet);
50  rawToDigi_->useDaqRegister( use_daq_register );
51  rawToDigi_->extractCm(extractCm_);
52  rawToDigi_->doFullCorruptBufferChecks(doFullCorruptBufferChecks_);
53 
54  produces< SiStripEventSummary >();
55  produces< edm::DetSetVector<SiStripRawDigi> >("ScopeMode");
56  produces< edm::DetSetVector<SiStripRawDigi> >("VirginRaw");
57  produces< edm::DetSetVector<SiStripRawDigi> >("ProcessedRaw");
58  produces< edm::DetSetVector<SiStripDigi> >("ZeroSuppressed");
59  produces<DetIdCollection>();
60  if ( extractCm_ ) produces< edm::DetSetVector<SiStripRawDigi> >("CommonMode");
61 
62  }
T getParameter(std::string const &) const
bool isDebugEnabled()
T getUntrackedParameter(std::string const &, T const &) const
#define LogTrace(id)
RawToDigiUnpacker * rawToDigi_
const SiStripFedCabling * cabling_
sistrip::RawToDigiModule::~RawToDigiModule ( )

Definition at line 64 of file SiStripRawToDigiModule.cc.

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

64  {
65  if ( rawToDigi_ ) { delete rawToDigi_; }
66  if ( cabling_ ) { cabling_ = 0; }
67  if ( edm::isDebugEnabled() ) {
68  LogTrace("SiStripRawToDigi")
69  << "[sistrip::RawToDigiModule::" << __func__ << "]"
70  << " Destructing object...";
71  }
72  }
bool isDebugEnabled()
#define LogTrace(id)
RawToDigiUnpacker * rawToDigi_
const SiStripFedCabling * cabling_

Member Function Documentation

void sistrip::RawToDigiModule::beginRun ( edm::Run run,
const edm::EventSetup setup 
)
virtual

Reimplemented from edm::EDProducer.

Definition at line 74 of file SiStripRawToDigiModule.cc.

References updateCabling().

74  {
75  updateCabling( setup );
76  }
void updateCabling(const edm::EventSetup &)
void sistrip::RawToDigiModule::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 84 of file SiStripRawToDigiModule.cc.

References cabling_, sistrip::RawToDigiUnpacker::createDigis(), edm::EventID::event(), extractCm_, edm::EventBase::id(), productLabel_, rawToDigi_, edmLumisInFiles::summary, sistrip::RawToDigiUnpacker::triggerFed(), and updateCabling().

Referenced by python.JSONExport.JsonExport::export(), and python.HTMLExport.HTMLExport::export().

84  {
85 
86  updateCabling( setup );
87 
88  // Retrieve FED raw data (by label, which is "source" by default)
90  event.getByLabel( productLabel_, buffers );
91 
92  // Populate SiStripEventSummary object with "trigger FED" info
93  std::auto_ptr<SiStripEventSummary> summary( new SiStripEventSummary() );
94  rawToDigi_->triggerFed( *buffers, *summary, event.id().event() );
95 
96  // Create containers for digis
101  DetIdCollection* ids = new DetIdCollection();
103 
104  // Create digis
105  if ( rawToDigi_ ) { rawToDigi_->createDigis( *cabling_,*buffers,*summary,*sm,*vr,*pr,*zs,*ids,*cm ); }
106 
107  // Create auto_ptr's of digi products
108  std::auto_ptr< edm::DetSetVector<SiStripRawDigi> > sm_dsv(sm);
109  std::auto_ptr< edm::DetSetVector<SiStripRawDigi> > vr_dsv(vr);
110  std::auto_ptr< edm::DetSetVector<SiStripRawDigi> > pr_dsv(pr);
111  std::auto_ptr< edm::DetSetVector<SiStripDigi> > zs_dsv(zs);
112  std::auto_ptr< DetIdCollection > det_ids(ids);
113  std::auto_ptr< edm::DetSetVector<SiStripRawDigi> > cm_dsv(cm);
114 
115  // Add to event
116  event.put( summary );
117  event.put( sm_dsv, "ScopeMode" );
118  event.put( vr_dsv, "VirginRaw" );
119  event.put( pr_dsv, "ProcessedRaw" );
120  event.put( zs_dsv, "ZeroSuppressed" );
121  event.put( det_ids );
122  if ( extractCm_ ) event.put( cm_dsv, "CommonMode" );
123 
124  }
void triggerFed(const FEDRawDataCollection &, SiStripEventSummary &, const uint32_t &event)
trigger info
EventNumber_t event() const
Definition: EventID.h:44
void updateCabling(const edm::EventSetup &)
edm::EventID id() const
Definition: EventBase.h:56
void createDigis(const SiStripFedCabling &, const FEDRawDataCollection &, SiStripEventSummary &, RawDigis &scope_mode, RawDigis &virgin_raw, RawDigis &proc_raw, Digis &zero_suppr, DetIdCollection &, RawDigis &common_mode)
creates digis
edm::EDCollection< DetId > DetIdCollection
RawToDigiUnpacker * rawToDigi_
const SiStripFedCabling * cabling_
void sistrip::RawToDigiModule::updateCabling ( const edm::EventSetup setup)
private

Definition at line 126 of file SiStripRawToDigiModule.cc.

References trackerHits::c, cabling_, cacheId_, edm::EventSetup::get(), edm::isDebugEnabled(), LogTrace, edm::ESHandle< class >::product(), SiStripFedCabling::summary(), and SiStripFedCabling::terse().

Referenced by beginRun(), and produce().

126  {
127 
128  uint32_t cache_id = setup.get<SiStripFedCablingRcd>().cacheIdentifier();
129 
130  if ( cacheId_ != cache_id ) {
131 
133  setup.get<SiStripFedCablingRcd>().get( c );
134  cabling_ = c.product();
135 
136  if ( edm::isDebugEnabled() ) {
137  if ( !cacheId_ ) {
138  std::stringstream ss;
139  ss << "[sistrip::RawToDigiModule::" << __func__ << "]"
140  << " Updating cabling for first time..." << std::endl
141  << " Terse print out of FED cabling:" << std::endl;
142  cabling_->terse(ss);
143  LogTrace("SiStripRawToDigi") << ss.str();
144  }
145  }
146 
147  if ( edm::isDebugEnabled() ) {
148  std::stringstream sss;
149  sss << "[sistrip::RawToDigiModule::" << __func__ << "]"
150  << " Summary of FED cabling:" << std::endl;
151  cabling_->summary(sss);
152  LogTrace("SiStripRawToDigi") << sss.str();
153  }
154  cacheId_ = cache_id;
155  }
156  }
bool isDebugEnabled()
void terse(std::stringstream &) const
void summary(std::stringstream &ss) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTSUMMARY.
#define LogTrace(id)
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
const SiStripFedCabling * cabling_

Member Data Documentation

const SiStripFedCabling* sistrip::RawToDigiModule::cabling_
private

Definition at line 41 of file SiStripRawToDigiModule.h.

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

uint32_t sistrip::RawToDigiModule::cacheId_
private

Definition at line 42 of file SiStripRawToDigiModule.h.

Referenced by updateCabling().

bool sistrip::RawToDigiModule::doFullCorruptBufferChecks_
private

Definition at line 44 of file SiStripRawToDigiModule.h.

Referenced by RawToDigiModule().

bool sistrip::RawToDigiModule::extractCm_
private

Definition at line 43 of file SiStripRawToDigiModule.h.

Referenced by produce(), and RawToDigiModule().

edm::InputTag sistrip::RawToDigiModule::productLabel_
private

Definition at line 40 of file SiStripRawToDigiModule.h.

Referenced by produce().

RawToDigiUnpacker* sistrip::RawToDigiModule::rawToDigi_
private

Definition at line 39 of file SiStripRawToDigiModule.h.

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