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::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (const edm::Run &, const edm::EventSetup &) override
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 RawToDigiModule (const edm::ParameterSet &)
 
 ~RawToDigiModule ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

void updateCabling (const edm::EventSetup &)
 

Private Attributes

const SiStripFedCablingcabling_
 
uint32_t cacheId_
 
bool doAPVEmulatorCheck_
 
bool doFullCorruptBufferChecks_
 
bool extractCm_
 
RawToDigiUnpackerrawToDigi_
 
edm::EDGetTokenT
< FEDRawDataCollection
token_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 26 of file SiStripRawToDigiModule.h.

Constructor & Destructor Documentation

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

Definition at line 20 of file SiStripRawToDigiModule.cc.

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

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

Definition at line 68 of file SiStripRawToDigiModule.cc.

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

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

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 78 of file SiStripRawToDigiModule.cc.

References updateCabling().

78  {
79  updateCabling( setup );
80  }
void updateCabling(const edm::EventSetup &)
void sistrip::RawToDigiModule::produce ( edm::Event event,
const edm::EventSetup setup 
)
overridevirtual

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_, sistrip::RawToDigiUnpacker::createDigis(), edm::EventID::event(), extractCm_, edm::EventBase::id(), rawToDigi_, edmLumisInFiles::summary, token_, sistrip::RawToDigiUnpacker::triggerFed(), and updateCabling().

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

88  {
89 
90  updateCabling( setup );
91 
92  // Retrieve FED raw data (by label, which is "source" by default)
94  event.getByToken( token_, buffers );
95 
96  // Populate SiStripEventSummary object with "trigger FED" info
97  std::auto_ptr<SiStripEventSummary> summary( new SiStripEventSummary() );
98  rawToDigi_->triggerFed( *buffers, *summary, event.id().event() );
99 
100  // Create containers for digis
105  DetIdCollection* ids = new DetIdCollection();
107 
108  // Create digis
109  if ( rawToDigi_ ) { rawToDigi_->createDigis( *cabling_,*buffers,*summary,*sm,*vr,*pr,*zs,*ids,*cm ); }
110 
111  // Create auto_ptr's of digi products
112  std::auto_ptr< edm::DetSetVector<SiStripRawDigi> > sm_dsv(sm);
113  std::auto_ptr< edm::DetSetVector<SiStripRawDigi> > vr_dsv(vr);
114  std::auto_ptr< edm::DetSetVector<SiStripRawDigi> > pr_dsv(pr);
115  std::auto_ptr< edm::DetSetVector<SiStripDigi> > zs_dsv(zs);
116  std::auto_ptr< DetIdCollection > det_ids(ids);
117  std::auto_ptr< edm::DetSetVector<SiStripRawDigi> > cm_dsv(cm);
118 
119  // Add to event
120  event.put( summary );
121  event.put( sm_dsv, "ScopeMode" );
122  event.put( vr_dsv, "VirginRaw" );
123  event.put( pr_dsv, "ProcessedRaw" );
124  event.put( zs_dsv, "ZeroSuppressed" );
125  event.put( det_ids );
126  if ( extractCm_ ) event.put( cm_dsv, "CommonMode" );
127 
128  }
void triggerFed(const FEDRawDataCollection &, SiStripEventSummary &, const uint32_t &event)
trigger info
EventNumber_t event() const
Definition: EventID.h:44
edm::EDGetTokenT< FEDRawDataCollection > token_
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 130 of file SiStripRawToDigiModule.cc.

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

Referenced by beginRun(), and produce().

130  {
131 
132  uint32_t cache_id = setup.get<SiStripFedCablingRcd>().cacheIdentifier();
133 
134  if ( cacheId_ != cache_id ) {
135 
137  setup.get<SiStripFedCablingRcd>().get( c );
138  cabling_ = c.product();
139 
140  if ( edm::isDebugEnabled() ) {
141  if ( !cacheId_ ) {
142  std::stringstream ss;
143  ss << "[sistrip::RawToDigiModule::" << __func__ << "]"
144  << " Updating cabling for first time..." << std::endl
145  << " Terse print out of FED cabling:" << std::endl;
146  cabling_->terse(ss);
147  LogTrace("SiStripRawToDigi") << ss.str();
148  }
149  }
150 
151  if ( edm::isDebugEnabled() ) {
152  std::stringstream sss;
153  sss << "[sistrip::RawToDigiModule::" << __func__ << "]"
154  << " Summary of FED cabling:" << std::endl;
155  cabling_->summary(sss);
156  LogTrace("SiStripRawToDigi") << sss.str();
157  }
158  cacheId_ = cache_id;
159  }
160  }
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 42 of file SiStripRawToDigiModule.h.

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

uint32_t sistrip::RawToDigiModule::cacheId_
private

Definition at line 43 of file SiStripRawToDigiModule.h.

Referenced by updateCabling().

bool sistrip::RawToDigiModule::doAPVEmulatorCheck_
private

Definition at line 48 of file SiStripRawToDigiModule.h.

Referenced by RawToDigiModule().

bool sistrip::RawToDigiModule::doFullCorruptBufferChecks_
private

Definition at line 45 of file SiStripRawToDigiModule.h.

Referenced by RawToDigiModule().

bool sistrip::RawToDigiModule::extractCm_
private

Definition at line 44 of file SiStripRawToDigiModule.h.

Referenced by produce(), and RawToDigiModule().

RawToDigiUnpacker* sistrip::RawToDigiModule::rawToDigi_
private

Definition at line 40 of file SiStripRawToDigiModule.h.

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

edm::EDGetTokenT<FEDRawDataCollection> sistrip::RawToDigiModule::token_
private

Definition at line 41 of file SiStripRawToDigiModule.h.

Referenced by produce(), and RawToDigiModule().