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 beginRun (const edm::Run &, const edm::EventSetup &) override
 
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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

void updateCabling (const edm::EventSetup &)
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 31 of file SiStripRawToDigiModule.h.

Constructor & Destructor Documentation

◆ RawToDigiModule()

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

Definition at line 20 of file SiStripRawToDigiModule.cc.

21  : rawToDigi_(nullptr),
22  cabling_(nullptr),
23  cacheId_(0),
24  extractCm_(false),
26  doAPVEmulatorCheck_(true) {
27  if (edm::isDebugEnabled()) {
28  LogTrace("SiStripRawToDigi") << "[sistrip::RawToDigiModule::" << __func__ << "]"
29  << " Constructing object...";
30  }
31 
32  token_ = consumes<FEDRawDataCollection>(pset.getParameter<edm::InputTag>("ProductLabel"));
33  int16_t appended_bytes = pset.getParameter<int>("AppendedBytes");
34  int16_t trigger_fed_id = pset.getParameter<int>("TriggerFedId");
35  bool legacy_unpacker = pset.getParameter<bool>("LegacyUnpacker");
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  doAPVEmulatorCheck_ = pset.getParameter<bool>("DoAPVEmulatorCheck");
47 
48  uint32_t errorThreshold = pset.getParameter<unsigned int>("ErrorThreshold");
49 
50  rawToDigi_ = new sistrip::RawToDigiUnpacker(appended_bytes,
51  fed_buffer_dump_freq,
52  fed_event_dump_freq,
53  trigger_fed_id,
54  using_fed_key,
55  unpack_bad_channels,
56  mark_missing_feds,
57  errorThreshold);
58  rawToDigi_->legacy(legacy_unpacker);
59  rawToDigi_->quiet(quiet);
60  rawToDigi_->useDaqRegister(use_daq_register);
64 
65  produces<SiStripEventSummary>();
66  produces<edm::DetSetVector<SiStripRawDigi> >("ScopeMode");
67  produces<edm::DetSetVector<SiStripRawDigi> >("VirginRaw");
68  produces<edm::DetSetVector<SiStripRawDigi> >("ProcessedRaw");
69  produces<edm::DetSetVector<SiStripDigi> >("ZeroSuppressed");
70  produces<DetIdCollection>();
71  if (extractCm_)
72  produces<edm::DetSetVector<SiStripRawDigi> >("CommonMode");
73  }

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 75 of file SiStripRawToDigiModule.cc.

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

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

Member Function Documentation

◆ beginRun()

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

Definition at line 88 of file SiStripRawToDigiModule.cc.

88 { updateCabling(setup); }

References singleTopDQM_cfi::setup, and updateCabling().

◆ 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 96 of file SiStripRawToDigiModule.cc.

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

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 139 of file SiStripRawToDigiModule.cc.

139  {
140  uint32_t cache_id = setup.get<SiStripFedCablingRcd>().cacheIdentifier();
141 
142  if (cacheId_ != cache_id) {
145  cabling_ = c.product();
146 
147  if (edm::isDebugEnabled()) {
148  if (!cacheId_) {
149  std::stringstream ss;
150  ss << "[sistrip::RawToDigiModule::" << __func__ << "]"
151  << " Updating cabling for first time..." << std::endl
152  << " Terse print out of FED cabling:" << std::endl;
153  cabling_->terse(ss);
154  LogTrace("SiStripRawToDigi") << ss.str();
155  }
156  }
157 
158  if (edm::isDebugEnabled()) {
159  std::stringstream sss;
160  sss << "[sistrip::RawToDigiModule::" << __func__ << "]"
161  << " Summary of FED cabling:" << std::endl;
163  setup.get<TrackerTopologyRcd>().get(tTopo);
164  cabling_->summary(sss, tTopo.product());
165  LogTrace("SiStripRawToDigi") << sss.str();
166  }
167  cacheId_ = cache_id;
168  }
169  }

References HltBtagPostValidation_cff::c, cabling_, cacheId_, get, edm::isDebugEnabled(), LogTrace, edm::ESHandle< T >::product(), singleTopDQM_cfi::setup, contentValuesCheck::ss, SiStripFedCabling::summary(), and SiStripFedCabling::terse().

Referenced by beginRun(), and produce().

Member Data Documentation

◆ cabling_

const SiStripFedCabling* sistrip::RawToDigiModule::cabling_
private

Definition at line 45 of file SiStripRawToDigiModule.h.

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

◆ cacheId_

uint32_t sistrip::RawToDigiModule::cacheId_
private

Definition at line 46 of file SiStripRawToDigiModule.h.

Referenced by updateCabling().

◆ doAPVEmulatorCheck_

bool sistrip::RawToDigiModule::doAPVEmulatorCheck_
private

Definition at line 51 of file SiStripRawToDigiModule.h.

Referenced by RawToDigiModule().

◆ doFullCorruptBufferChecks_

bool sistrip::RawToDigiModule::doFullCorruptBufferChecks_
private

Definition at line 48 of file SiStripRawToDigiModule.h.

Referenced by RawToDigiModule().

◆ extractCm_

bool sistrip::RawToDigiModule::extractCm_
private

Definition at line 47 of file SiStripRawToDigiModule.h.

Referenced by produce(), and RawToDigiModule().

◆ rawToDigi_

RawToDigiUnpacker* sistrip::RawToDigiModule::rawToDigi_
private

Definition at line 43 of file SiStripRawToDigiModule.h.

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

◆ token_

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

Definition at line 44 of file SiStripRawToDigiModule.h.

Referenced by produce(), and RawToDigiModule().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
edm::DetSetVector< SiStripRawDigi >
sistrip::RawToDigiUnpacker::printWarningSummary
void printWarningSummary() const
Definition: SiStripRawToDigiUnpacker.h:82
sistrip::RawToDigiModule::extractCm_
bool extractCm_
Definition: SiStripRawToDigiModule.h:47
sistrip::RawToDigiModule::rawToDigi_
RawToDigiUnpacker * rawToDigi_
Definition: SiStripRawToDigiModule.h:43
sistrip::RawToDigiModule::token_
edm::EDGetTokenT< FEDRawDataCollection > token_
Definition: SiStripRawToDigiModule.h:44
edm::Handle
Definition: AssociativeIterator.h:50
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiStripFedCablingRcd
Definition: SiStripCondDataRecords.h:22
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:81
sistrip::RawToDigiUnpacker::doFullCorruptBufferChecks
void doFullCorruptBufferChecks(bool)
Definition: SiStripRawToDigiUnpacker.h:201
edm::ESHandle< SiStripFedCabling >
sistrip::RawToDigiUnpacker::useDaqRegister
void useDaqRegister(bool)
EventSummary update request -> not yet implemented for FEDBuffer class.
Definition: SiStripRawToDigiUnpacker.h:197
sistrip::RawToDigiModule::cacheId_
uint32_t cacheId_
Definition: SiStripRawToDigiModule.h:46
sipixeldigitoraw
Definition: SiPixelDigiToRaw.cc:38
sistrip::RawToDigiUnpacker::triggerFed
void triggerFed(const FEDRawDataCollection &, SiStripEventSummary &, const uint32_t &event)
trigger info
Definition: SiStripRawToDigiUnpacker.cc:723
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:45
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
get
#define get
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:48
sistrip::RawToDigiModule::updateCabling
void updateCabling(const edm::EventSetup &)
Definition: SiStripRawToDigiModule.cc:139
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:71
SiStripFedCabling::terse
void terse(std::stringstream &) const
Definition: SiStripFedCabling.cc:249
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
event
Definition: event.py:1
edm::InputTag
Definition: InputTag.h:15
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
sistrip::RawToDigiModule::doAPVEmulatorCheck_
bool doAPVEmulatorCheck_
Definition: SiStripRawToDigiModule.h:51