CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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,
SiStripFedCablingRcd
fedCablingToken_
 
edm::ESWatcher
< SiStripFedCablingRcd
fedCablingWatcher_
 
RawToDigiUnpackerrawToDigi_
 
edm::EDGetTokenT
< FEDRawDataCollection
token_
 
edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
tTopoToken_
 

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

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

Definition at line 18 of file SiStripRawToDigiModule.cc.

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

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);
60  rawToDigi_->extractCm(extractCm_);
61  rawToDigi_->doFullCorruptBufferChecks(doFullCorruptBufferChecks_);
62  rawToDigi_->doAPVEmulatorCheck(doAPVEmulatorCheck_);
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  }
bool isDebugEnabled()
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< FEDRawDataCollection > token_
#define LogTrace(id)
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
RawToDigiUnpacker * rawToDigi_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const SiStripFedCabling * cabling_
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
sistrip::RawToDigiModule::~RawToDigiModule ( )
override

Definition at line 74 of file SiStripRawToDigiModule.cc.

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

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  }
bool isDebugEnabled()
#define LogTrace(id)
RawToDigiUnpacker * rawToDigi_
const SiStripFedCabling * cabling_

Member Function Documentation

void sistrip::RawToDigiModule::endStream ( )
override
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.

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

93  {
94  updateCabling(setup);
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  }
void triggerFed(const FEDRawDataCollection &, SiStripEventSummary &, const uint32_t &event)
trigger info
EventNumber_t event() const
Definition: EventID.h:40
edm::EDGetTokenT< FEDRawDataCollection > token_
void updateCabling(const edm::EventSetup &)
def move
Definition: eostools.py:511
edm::EventID id() const
Definition: EventBase.h:59
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 136 of file SiStripRawToDigiModule.cc.

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

Referenced by produce().

136  {
137  if (fedCablingWatcher_.check(setup)) {
138  const bool isFirst = cabling_ != nullptr;
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  }
bool isDebugEnabled()
void terse(std::stringstream &) const
isFirst
Definition: cuy.py:418
#define LogTrace(id)
bool getData(T &iHolder) const
Definition: EventSetup.h:122
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
edm::ESWatcher< SiStripFedCablingRcd > fedCablingWatcher_
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
void summary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTSUMMARY.
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const SiStripFedCabling * cabling_

Member Data Documentation

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

Definition at line 47 of file SiStripRawToDigiModule.h.

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

bool sistrip::RawToDigiModule::doAPVEmulatorCheck_
private

Definition at line 52 of file SiStripRawToDigiModule.h.

Referenced by RawToDigiModule().

bool sistrip::RawToDigiModule::doFullCorruptBufferChecks_
private

Definition at line 49 of file SiStripRawToDigiModule.h.

Referenced by RawToDigiModule().

bool sistrip::RawToDigiModule::extractCm_
private

Definition at line 48 of file SiStripRawToDigiModule.h.

Referenced by produce(), and RawToDigiModule().

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

Definition at line 55 of file SiStripRawToDigiModule.h.

Referenced by updateCabling().

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

Definition at line 56 of file SiStripRawToDigiModule.h.

Referenced by updateCabling().

RawToDigiUnpacker* sistrip::RawToDigiModule::rawToDigi_
private

Definition at line 45 of file SiStripRawToDigiModule.h.

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

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

Definition at line 46 of file SiStripRawToDigiModule.h.

Referenced by produce(), and RawToDigiModule().

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

Definition at line 54 of file SiStripRawToDigiModule.h.

Referenced by updateCabling().