CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
sistrip::RawToDigiModule Class Referencefinal

#include <SiStripRawToDigiModule.h>

Inheritance diagram for sistrip::RawToDigiModule:
edm::stream::EDProducer<>

Public Member Functions

void endStream () override
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 RawToDigiModule (const edm::ParameterSet &)
 
 ~RawToDigiModule () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

void updateCabling (const edm::EventSetup &)
 

Private Attributes

const SiStripFedCablingcabling_ = nullptr
 
bool doAPVEmulatorCheck_
 
bool doFullCorruptBufferChecks_
 
bool extractCm_
 
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcdfedCablingToken_
 
edm::ESWatcher< SiStripFedCablingRcdfedCablingWatcher_
 
RawToDigiUnpackerrawToDigi_
 
edm::EDGetTokenT< FEDRawDataCollectiontoken_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 34 of file SiStripRawToDigiModule.h.

Constructor & Destructor Documentation

◆ RawToDigiModule()

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

Definition at line 18 of file SiStripRawToDigiModule.cc.

19  : rawToDigi_(nullptr),
20  cabling_(nullptr),
21  extractCm_(false),
23  doAPVEmulatorCheck_(true),
26  if (edm::isDebugEnabled()) {
27  LogTrace("SiStripRawToDigi") << "[sistrip::RawToDigiModule::" << __func__ << "]"
28  << " Constructing object...";
29  }
30 
31  token_ = consumes<FEDRawDataCollection>(pset.getParameter<edm::InputTag>("ProductLabel"));
32  int16_t appended_bytes = pset.getParameter<int>("AppendedBytes");
33  int16_t trigger_fed_id = pset.getParameter<int>("TriggerFedId");
34  bool legacy_unpacker = pset.getParameter<bool>("LegacyUnpacker");
35  bool use_daq_register = pset.getParameter<bool>("UseDaqRegister");
36  bool using_fed_key = pset.getParameter<bool>("UseFedKey");
37  bool unpack_bad_channels = pset.getParameter<bool>("UnpackBadChannels");
38  bool mark_missing_feds = pset.getParameter<bool>("MarkModulesOnMissingFeds");
39 
40  int16_t fed_buffer_dump_freq = pset.getUntrackedParameter<int>("FedBufferDumpFreq", 0);
41  int16_t fed_event_dump_freq = pset.getUntrackedParameter<int>("FedEventDumpFreq", 0);
42  bool quiet = pset.getUntrackedParameter<bool>("Quiet", true);
43  extractCm_ = pset.getParameter<bool>("UnpackCommonModeValues");
44  doFullCorruptBufferChecks_ = pset.getParameter<bool>("DoAllCorruptBufferChecks");
45  doAPVEmulatorCheck_ = pset.getParameter<bool>("DoAPVEmulatorCheck");
46 
47  uint32_t errorThreshold = pset.getParameter<unsigned int>("ErrorThreshold");
48 
49  rawToDigi_ = new sistrip::RawToDigiUnpacker(appended_bytes,
50  fed_buffer_dump_freq,
51  fed_event_dump_freq,
52  trigger_fed_id,
53  using_fed_key,
54  unpack_bad_channels,
55  mark_missing_feds,
56  errorThreshold);
57  rawToDigi_->legacy(legacy_unpacker);
58  rawToDigi_->quiet(quiet);
59  rawToDigi_->useDaqRegister(use_daq_register);
63 
64  produces<SiStripEventSummary>();
65  produces<edm::DetSetVector<SiStripRawDigi> >("ScopeMode");
66  produces<edm::DetSetVector<SiStripRawDigi> >("VirginRaw");
67  produces<edm::DetSetVector<SiStripRawDigi> >("ProcessedRaw");
68  produces<edm::DetSetVector<SiStripDigi> >("ZeroSuppressed");
69  produces<DetIdCollection>();
70  if (extractCm_)
71  produces<edm::DetSetVector<SiStripRawDigi> >("CommonMode");
72  }

References sistrip::RawToDigiUnpacker::doAPVEmulatorCheck(), doAPVEmulatorCheck_, sistrip::RawToDigiUnpacker::doFullCorruptBufferChecks(), doFullCorruptBufferChecks_, sistrip::RawToDigiUnpacker::extractCm(), extractCm_, edm::isDebugEnabled(), sistrip::RawToDigiUnpacker::legacy(), LogTrace, muonDTDigis_cfi::pset, sistrip::RawToDigiUnpacker::quiet(), rawToDigi_, token_, and sistrip::RawToDigiUnpacker::useDaqRegister().

◆ ~RawToDigiModule()

sistrip::RawToDigiModule::~RawToDigiModule ( )
override

Definition at line 74 of file SiStripRawToDigiModule.cc.

74  {
75  if (rawToDigi_) {
76  delete rawToDigi_;
77  }
78  if (cabling_) {
79  cabling_ = nullptr;
80  }
81  if (edm::isDebugEnabled()) {
82  LogTrace("SiStripRawToDigi") << "[sistrip::RawToDigiModule::" << __func__ << "]"
83  << " Destructing object...";
84  }
85  }

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

Member Function Documentation

◆ endStream()

void sistrip::RawToDigiModule::endStream ( )
override

◆ produce()

void sistrip::RawToDigiModule::produce ( edm::Event event,
const edm::EventSetup setup 
)
override

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.

Definition at line 93 of file SiStripRawToDigiModule.cc.

93  {
95 
96  // Retrieve FED raw data (by label, which is "source" by default)
98  event.getByToken(token_, buffers);
99 
100  // Populate SiStripEventSummary object with "trigger FED" info
101  auto summary = std::make_unique<SiStripEventSummary>();
102  rawToDigi_->triggerFed(*buffers, *summary, event.id().event());
103 
104  // Create containers for digis
109  DetIdCollection* ids = new DetIdCollection();
111 
112  // Create digis
113  if (rawToDigi_) {
114  rawToDigi_->createDigis(*cabling_, *buffers, *summary, *sm, *vr, *pr, *zs, *ids, *cm);
115  }
116 
117  // Create unique_ptr's of digi products
118  std::unique_ptr<edm::DetSetVector<SiStripRawDigi> > sm_dsv(sm);
119  std::unique_ptr<edm::DetSetVector<SiStripRawDigi> > vr_dsv(vr);
120  std::unique_ptr<edm::DetSetVector<SiStripRawDigi> > pr_dsv(pr);
121  std::unique_ptr<edm::DetSetVector<SiStripDigi> > zs_dsv(zs);
122  std::unique_ptr<DetIdCollection> det_ids(ids);
123  std::unique_ptr<edm::DetSetVector<SiStripRawDigi> > cm_dsv(cm);
124 
125  // Add to event
126  event.put(std::move(summary));
127  event.put(std::move(sm_dsv), "ScopeMode");
128  event.put(std::move(vr_dsv), "VirginRaw");
129  event.put(std::move(pr_dsv), "ProcessedRaw");
130  event.put(std::move(zs_dsv), "ZeroSuppressed");
131  event.put(std::move(det_ids));
132  if (extractCm_)
133  event.put(std::move(cm_dsv), "CommonMode");
134  }

References cabling_, sistrip::RawToDigiUnpacker::createDigis(), extractCm_, eostools::move(), rawToDigi_, singleTopDQM_cfi::setup, edmLumisInFiles::summary, token_, sistrip::RawToDigiUnpacker::triggerFed(), and updateCabling().

◆ updateCabling()

void sistrip::RawToDigiModule::updateCabling ( const edm::EventSetup setup)
private

Definition at line 136 of file SiStripRawToDigiModule.cc.

136  {
138  const bool isFirst = cabling_ != nullptr;
139  cabling_ = &setup.getData(fedCablingToken_);
140 
141  if (edm::isDebugEnabled()) {
142  if (isFirst) {
143  std::stringstream ss;
144  ss << "[sistrip::RawToDigiModule::" << __func__ << "]"
145  << " Updating cabling for first time..." << std::endl
146  << " Terse print out of FED cabling:" << std::endl;
147  cabling_->terse(ss);
148  LogTrace("SiStripRawToDigi") << ss.str();
149  }
150  }
151 
152  if (edm::isDebugEnabled()) {
153  std::stringstream sss;
154  sss << "[sistrip::RawToDigiModule::" << __func__ << "]"
155  << " Summary of FED cabling:" << std::endl;
156  cabling_->summary(sss, &setup.getData(tTopoToken_));
157  LogTrace("SiStripRawToDigi") << sss.str();
158  }
159  }
160  }

References cabling_, edm::ESWatcher< T >::check(), fedCablingToken_, fedCablingWatcher_, edm::isDebugEnabled(), cuy::isFirst, LogTrace, singleTopDQM_cfi::setup, contentValuesCheck::ss, SiStripFedCabling::summary(), SiStripFedCabling::terse(), and tTopoToken_.

Referenced by produce().

Member Data Documentation

◆ cabling_

const SiStripFedCabling* sistrip::RawToDigiModule::cabling_ = nullptr
private

Definition at line 47 of file SiStripRawToDigiModule.h.

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

◆ doAPVEmulatorCheck_

bool sistrip::RawToDigiModule::doAPVEmulatorCheck_
private

Definition at line 52 of file SiStripRawToDigiModule.h.

Referenced by RawToDigiModule().

◆ doFullCorruptBufferChecks_

bool sistrip::RawToDigiModule::doFullCorruptBufferChecks_
private

Definition at line 49 of file SiStripRawToDigiModule.h.

Referenced by RawToDigiModule().

◆ extractCm_

bool sistrip::RawToDigiModule::extractCm_
private

Definition at line 48 of file SiStripRawToDigiModule.h.

Referenced by produce(), and RawToDigiModule().

◆ fedCablingToken_

edm::ESGetToken<SiStripFedCabling, SiStripFedCablingRcd> sistrip::RawToDigiModule::fedCablingToken_
private

Definition at line 55 of file SiStripRawToDigiModule.h.

Referenced by updateCabling().

◆ fedCablingWatcher_

edm::ESWatcher<SiStripFedCablingRcd> sistrip::RawToDigiModule::fedCablingWatcher_
private

Definition at line 56 of file SiStripRawToDigiModule.h.

Referenced by updateCabling().

◆ rawToDigi_

RawToDigiUnpacker* sistrip::RawToDigiModule::rawToDigi_
private

Definition at line 45 of file SiStripRawToDigiModule.h.

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

◆ token_

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

Definition at line 46 of file SiStripRawToDigiModule.h.

Referenced by produce(), and RawToDigiModule().

◆ tTopoToken_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> sistrip::RawToDigiModule::tTopoToken_
private

Definition at line 54 of file SiStripRawToDigiModule.h.

Referenced by updateCabling().

edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
edm::DetSetVector< SiStripRawDigi >
sistrip::RawToDigiUnpacker::printWarningSummary
void printWarningSummary() const
Definition: SiStripRawToDigiUnpacker.h:82
sistrip::RawToDigiModule::extractCm_
bool extractCm_
Definition: SiStripRawToDigiModule.h:48
sistrip::RawToDigiModule::rawToDigi_
RawToDigiUnpacker * rawToDigi_
Definition: SiStripRawToDigiModule.h:45
sistrip::RawToDigiModule::token_
edm::EDGetTokenT< FEDRawDataCollection > token_
Definition: SiStripRawToDigiModule.h:46
cuy.isFirst
isFirst
Definition: cuy.py:418
edm::Handle< FEDRawDataCollection >
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
sistrip::RawToDigiModule::fedCablingWatcher_
edm::ESWatcher< SiStripFedCablingRcd > fedCablingWatcher_
Definition: SiStripRawToDigiModule.h:56
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
sistrip::RawToDigiUnpacker::quiet
void quiet(bool)
verbosity
Definition: SiStripRawToDigiUnpacker.h:195
sistrip::RawToDigiUnpacker::createDigis
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
Definition: SiStripRawToDigiUnpacker.cc:84
sistrip::RawToDigiUnpacker::doFullCorruptBufferChecks
void doFullCorruptBufferChecks(bool)
Definition: SiStripRawToDigiUnpacker.h:201
sistrip::RawToDigiUnpacker::useDaqRegister
void useDaqRegister(bool)
EventSummary update request -> not yet implemented for FEDBuffer class.
Definition: SiStripRawToDigiUnpacker.h:197
sipixeldigitoraw
Definition: SiPixelDigiToRaw.cc:32
sistrip::RawToDigiUnpacker::triggerFed
void triggerFed(const FEDRawDataCollection &, SiStripEventSummary &, const uint32_t &event)
trigger info
Definition: SiStripRawToDigiUnpacker.cc:727
sistrip::RawToDigiModule::tTopoToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
Definition: SiStripRawToDigiModule.h:54
sistrip::RawToDigiUnpacker::legacy
void legacy(bool)
Definition: SiStripRawToDigiUnpacker.h:209
edmLumisInFiles.summary
summary
Definition: edmLumisInFiles.py:39
sistrip::RawToDigiUnpacker::doAPVEmulatorCheck
void doAPVEmulatorCheck(bool)
Definition: SiStripRawToDigiUnpacker.h:205
sistrip::RawToDigiUnpacker::extractCm
void extractCm(bool)
Definition: SiStripRawToDigiUnpacker.h:199
sistrip::RawToDigiModule::cabling_
const SiStripFedCabling * cabling_
Definition: SiStripRawToDigiModule.h:47
edm::EDCollection< DetId >
eostools.move
def move(src, dest)
Definition: eostools.py:511
DetIdCollection
edm::EDCollection< DetId > DetIdCollection
Definition: DetIdCollection.h:7
sistrip::RawToDigiModule::doFullCorruptBufferChecks_
bool doFullCorruptBufferChecks_
Definition: SiStripRawToDigiModule.h:49
sistrip::RawToDigiModule::updateCabling
void updateCabling(const edm::EventSetup &)
Definition: SiStripRawToDigiModule.cc:136
sistrip::RawToDigiUnpacker
Definition: SiStripRawToDigiUnpacker.h:31
SiStripFedCabling::summary
void summary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTSUMMARY.
Definition: SiStripFedCabling.h:101
edm::isDebugEnabled
bool isDebugEnabled()
Definition: MessageLogger.cc:12
SiStripFedCabling::terse
void terse(std::stringstream &) const
Definition: SiStripFedCabling.cc:249
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
event
Definition: event.py:1
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::InputTag
Definition: InputTag.h:15
sistrip::RawToDigiModule::fedCablingToken_
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
Definition: SiStripRawToDigiModule.h:55
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
sistrip::RawToDigiModule::doAPVEmulatorCheck_
bool doAPVEmulatorCheck_
Definition: SiStripRawToDigiModule.h:52