CMS 3D CMS Logo

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

A plug-in module that takes StripDigis as input from the Event and creates an EDProduct comprising a FEDRawDataCollection. More...

#include <SiStripDigiToRawModule.h>

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

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

bool copyBufferHeader_
 
DigiToRawdigiToRaw_
 
uint32_t eventCounter_
 
edm::InputTag inputDigiTag_
 
FEDReadoutMode mode_
 
uint8_t packetCode_
 
edm::InputTag rawDataTag_
 
bool rawdigi_
 
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcdtokenCabling
 
edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > tokenDigi
 
edm::EDGetTokenT< FEDRawDataCollectiontokenRawBuffer
 
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > tokenRawDigi
 

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

A plug-in module that takes StripDigis as input from the Event and creates an EDProduct comprising a FEDRawDataCollection.

Definition at line 32 of file SiStripDigiToRawModule.h.

Constructor & Destructor Documentation

◆ DigiToRawModule()

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

Creates instance of DigiToRaw converter, defines EDProduct type.

Definition at line 36 of file SiStripDigiToRawModule.cc.

37  : copyBufferHeader_(pset.getParameter<bool>("CopyBufferHeader")),
38  mode_(fedReadoutModeFromString(pset.getParameter<std::string>("FedReadoutMode"))),
39  packetCode_(packetCodeFromString(pset.getParameter<std::string>("PacketCode"), mode_)),
40  rawdigi_(false),
41  digiToRaw_(nullptr),
42  eventCounter_(0),
43  inputDigiTag_(pset.getParameter<edm::InputTag>("InputDigis")),
44  rawDataTag_(pset.getParameter<edm::InputTag>("RawDataTag")),
45  tokenCabling(esConsumes<SiStripFedCabling, SiStripFedCablingRcd>()) {
46  if (edm::isDebugEnabled()) {
47  LogDebug("DigiToRawModule") << "[sistrip::DigiToRawModule::DigiToRawModule]"
48  << " Constructing object...";
49  }
50 
51  switch (mode_) {
53  rawdigi_ = false;
54  break;
56  rawdigi_ = false;
57  break;
59  rawdigi_ = false;
60  break;
62  rawdigi_ = false;
63  break;
65  rawdigi_ = false;
66  break;
68  rawdigi_ = false;
69  break;
71  rawdigi_ = false;
72  break;
74  rawdigi_ = false;
75  break;
77  rawdigi_ = false;
78  break;
80  rawdigi_ = false;
81  break;
83  rawdigi_ = false;
84  break;
86  rawdigi_ = true;
87  break;
89  rawdigi_ = true;
90  break;
91  case READOUT_MODE_SCOPE:
92  rawdigi_ = true;
93  break;
94  case READOUT_MODE_INVALID: {
95  if (edm::isDebugEnabled()) {
96  edm::LogWarning("DigiToRawModule")
97  << "[sistrip::DigiToRawModule::DigiToRawModule]"
98  << " UNKNOWN readout mode: " << pset.getParameter<std::string>("FedReadoutMode");
99  }
100  } break;
101  case READOUT_MODE_SPY: {
102  if (edm::isDebugEnabled()) {
103  edm::LogWarning("DigiToRawModule") << "[sistrip::DigiToRawModule::DigiToRawModule]"
104  << " Digi to raw is not supported for spy channel data";
105  }
106  } break;
107  }
108  if (pset.getParameter<bool>("UseWrongDigiType")) {
109  rawdigi_ = !rawdigi_;
110  if (edm::isDebugEnabled()) {
111  edm::LogWarning("DigiToRawModule") << "[sistrip::DigiToRawModule::DigiToRawModule]"
112  << " You are using the wrong type of digis!";
113  }
114  }
115 
116  // Create instance of DigiToRaw formatter
117  digiToRaw_ = new DigiToRaw(mode_, packetCode_, pset.getParameter<bool>("UseFedKey"));
118 
119  if (rawdigi_) {
120  tokenRawDigi = consumes<edm::DetSetVector<SiStripRawDigi> >(inputDigiTag_);
121  } else {
122  tokenDigi = consumes<edm::DetSetVector<SiStripDigi> >(inputDigiTag_);
123  }
124  if (copyBufferHeader_) {
125  //CAMM input raw module label or same as digi ????
126  if (edm::isDebugEnabled()) {
127  edm::LogWarning("DigiToRawModule") << "[sistrip::DigiToRawModule::DigiToRawModule]"
128  << "Copying buffer header from collection " << rawDataTag_;
129  }
130  tokenRawBuffer = consumes<FEDRawDataCollection>(rawDataTag_);
131  }
132 
133  produces<FEDRawDataCollection>();
134  }

References copyBufferHeader_, DigiToRaw_cff::DigiToRaw, digiToRaw_, inputDigiTag_, edm::isDebugEnabled(), LogDebug, mode_, packetCode_, muonDTDigis_cfi::pset, rawDataTag_, rawdigi_, sistrip::READOUT_MODE_INVALID, sistrip::READOUT_MODE_PREMIX_RAW, sistrip::READOUT_MODE_PROC_RAW, sistrip::READOUT_MODE_SCOPE, sistrip::READOUT_MODE_SPY, sistrip::READOUT_MODE_VIRGIN_RAW, sistrip::READOUT_MODE_ZERO_SUPPRESSED, sistrip::READOUT_MODE_ZERO_SUPPRESSED_FAKE, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10_CMOVERRIDE, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT_CMOVERRIDE, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_CMOVERRIDE, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT_CMOVERRIDE, AlCaHLTBitMon_QueryRunRegistry::string, tokenDigi, tokenRawBuffer, and tokenRawDigi.

◆ ~DigiToRawModule()

sistrip::DigiToRawModule::~DigiToRawModule ( )
override

Definition at line 138 of file SiStripDigiToRawModule.cc.

138  {
139  if (edm::isDebugEnabled()) {
140  LogDebug("DigiToRaw") << "[sistrip::DigiToRawModule::~DigiToRawModule]"
141  << " Destructing object...";
142  }
143  if (digiToRaw_)
144  delete digiToRaw_;
145  }

References digiToRaw_, edm::isDebugEnabled(), and LogDebug.

Member Function Documentation

◆ beginJob()

virtual void sistrip::DigiToRawModule::beginJob ( void  )
inlinevirtual

Definition at line 37 of file SiStripDigiToRawModule.h.

37 {}

◆ endJob()

virtual void sistrip::DigiToRawModule::endJob ( void  )
inlinevirtual

Definition at line 38 of file SiStripDigiToRawModule.h.

38 {}

◆ endStream()

void sistrip::DigiToRawModule::endStream ( )
override

◆ fillDescriptions()

void sistrip::DigiToRawModule::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 20 of file SiStripDigiToRawModule.cc.

20  {
22  desc.add<std::string>("FedReadoutMode", "ZERO_SUPPRESSED");
23  desc.add<std::string>("PacketCode", "ZERO_SUPPRESSED");
24  desc.add<bool>("UseFedKey", false);
25  desc.add<bool>("UseWrongDigiType", false);
26  desc.add<bool>("CopyBufferHeader", false);
27  desc.add<edm::InputTag>("InputDigis", edm::InputTag("simSiStripDigis", "ZeroSuppressed"));
28  desc.add<edm::InputTag>("RawDataTag", edm::InputTag("rawDataCollector"));
29  descriptions.add("SiStripDigiToRawModule", desc);
30  }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ produce()

void sistrip::DigiToRawModule::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Retrieves cabling map from EventSetup, retrieves a DetSetVector of SiStripDigis from Event, creates a FEDRawDataCollection (EDProduct), uses DigiToRaw converter to fill FEDRawDataCollection, attaches FEDRawDataCollection to Event.

Definition at line 154 of file SiStripDigiToRawModule.cc.

154  {
155  eventCounter_++;
156 
157  auto buffers = std::make_unique<FEDRawDataCollection>();
158 
160 
161  //get buffer header from original rawdata
163  if (copyBufferHeader_) {
164  if (edm::isDebugEnabled()) {
165  edm::LogWarning("DigiToRawModule") << "[sistrip::DigiToRawModule::DigiToRawModule]"
166  << "Getting raw buffer: ";
167  }
168  try {
169  iEvent.getByToken(tokenRawBuffer, rawbuffers);
170  } catch (const cms::Exception& e) {
171  if (edm::isDebugEnabled()) {
172  edm::LogWarning("DigiToRawModule") << "[sistrip::DigiToRawModule::DigiToRawModule]"
173  << " Failed to get collection " << rawDataTag_;
174  }
175  }
176  }
177 
178  if (rawdigi_) {
180  iEvent.getByToken(tokenRawDigi, rawdigis);
181  if (copyBufferHeader_)
182  digiToRaw_->createFedBuffers(iEvent, cabling, rawbuffers, rawdigis, buffers);
183  else
184  digiToRaw_->createFedBuffers(iEvent, cabling, rawdigis, buffers);
185  } else {
187  iEvent.getByToken(tokenDigi, digis);
188  if (copyBufferHeader_)
189  digiToRaw_->createFedBuffers(iEvent, cabling, rawbuffers, digis, buffers);
190  else
191  digiToRaw_->createFedBuffers(iEvent, cabling, digis, buffers);
192  }
193 
194  iEvent.put(std::move(buffers));
195  }

References copyBufferHeader_, sistrip::DigiToRaw::createFedBuffers(), digiToRaw_, MillePedeFileConverter_cfg::e, eventCounter_, edm::EventSetup::getHandle(), iEvent, edm::isDebugEnabled(), eostools::move(), rawDataTag_, rawdigi_, tokenCabling, tokenDigi, tokenRawBuffer, and tokenRawDigi.

Member Data Documentation

◆ copyBufferHeader_

bool sistrip::DigiToRawModule::copyBufferHeader_
private

Definition at line 46 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule(), and produce().

◆ digiToRaw_

DigiToRaw* sistrip::DigiToRawModule::digiToRaw_
private

Definition at line 50 of file SiStripDigiToRawModule.h.

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

◆ eventCounter_

uint32_t sistrip::DigiToRawModule::eventCounter_
private

Definition at line 51 of file SiStripDigiToRawModule.h.

Referenced by produce().

◆ inputDigiTag_

edm::InputTag sistrip::DigiToRawModule::inputDigiTag_
private

Definition at line 52 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule().

◆ mode_

FEDReadoutMode sistrip::DigiToRawModule::mode_
private

Definition at line 47 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule().

◆ packetCode_

uint8_t sistrip::DigiToRawModule::packetCode_
private

Definition at line 48 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule().

◆ rawDataTag_

edm::InputTag sistrip::DigiToRawModule::rawDataTag_
private

Definition at line 55 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule(), and produce().

◆ rawdigi_

bool sistrip::DigiToRawModule::rawdigi_
private

Definition at line 49 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule(), and produce().

◆ tokenCabling

edm::ESGetToken<SiStripFedCabling, SiStripFedCablingRcd> sistrip::DigiToRawModule::tokenCabling
private

Definition at line 57 of file SiStripDigiToRawModule.h.

Referenced by produce().

◆ tokenDigi

edm::EDGetTokenT<edm::DetSetVector<SiStripDigi> > sistrip::DigiToRawModule::tokenDigi
private

Definition at line 54 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule(), and produce().

◆ tokenRawBuffer

edm::EDGetTokenT<FEDRawDataCollection> sistrip::DigiToRawModule::tokenRawBuffer
private

Definition at line 56 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule(), and produce().

◆ tokenRawDigi

edm::EDGetTokenT<edm::DetSetVector<SiStripRawDigi> > sistrip::DigiToRawModule::tokenRawDigi
private

Definition at line 53 of file SiStripDigiToRawModule.h.

Referenced by DigiToRawModule(), and produce().

sistrip::DigiToRaw::createFedBuffers
void createFedBuffers(edm::Event &, edm::ESHandle< SiStripFedCabling > &cabling, edm::Handle< edm::DetSetVector< SiStripDigi > > &digis, std::unique_ptr< FEDRawDataCollection > &buffers)
Definition: SiStripDigiToRaw.cc:55
sistrip::READOUT_MODE_PREMIX_RAW
Definition: SiStripFEDBufferComponents.h:61
DigiToRaw_cff.DigiToRaw
DigiToRaw
Definition: DigiToRaw_cff.py:23
sistrip::DigiToRawModule::copyBufferHeader_
bool copyBufferHeader_
Definition: SiStripDigiToRawModule.h:46
sistrip::packetCodeFromString
uint8_t packetCodeFromString(const std::string &packetCodeString, FEDReadoutMode mode)
Definition: SiStripFEDBufferComponents.cc:464
sistrip::READOUT_MODE_SCOPE
Definition: SiStripFEDBufferComponents.h:47
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89281
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
sistrip::READOUT_MODE_SPY
Definition: SiStripFEDBufferComponents.h:60
sistrip::fedReadoutModeFromString
FEDReadoutMode fedReadoutModeFromString(const std::string &readoutModeString)
Definition: SiStripFEDBufferComponents.cc:418
edm::Handle< FEDRawDataCollection >
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT
Definition: SiStripFEDBufferComponents.h:51
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10_CMOVERRIDE
Definition: SiStripFEDBufferComponents.h:50
sistrip::DigiToRawModule::inputDigiTag_
edm::InputTag inputDigiTag_
Definition: SiStripDigiToRawModule.h:52
sistrip::DigiToRawModule::packetCode_
uint8_t packetCode_
Definition: SiStripDigiToRawModule.h:48
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
sistrip::DigiToRawModule::tokenCabling
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > tokenCabling
Definition: SiStripDigiToRawModule.h:57
edm::ESHandle
Definition: DTSurvey.h:22
sistrip::READOUT_MODE_PROC_RAW
Definition: SiStripFEDBufferComponents.h:52
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8
Definition: SiStripFEDBufferComponents.h:58
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT_CMOVERRIDE
Definition: SiStripFEDBufferComponents.h:59
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10
Definition: SiStripFEDBufferComponents.h:49
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT_CMOVERRIDE
Definition: SiStripFEDBufferComponents.h:53
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT
Definition: SiStripFEDBufferComponents.h:55
sistrip::DigiToRawModule::rawDataTag_
edm::InputTag rawDataTag_
Definition: SiStripDigiToRawModule.h:55
iEvent
int iEvent
Definition: GenABIO.cc:224
sistrip::READOUT_MODE_VIRGIN_RAW
Definition: SiStripFEDBufferComponents.h:48
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
sistrip::READOUT_MODE_INVALID
Definition: SiStripFEDBufferComponents.h:46
sistrip::DigiToRawModule::tokenDigi
edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > tokenDigi
Definition: SiStripDigiToRawModule.h:54
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
sistrip::DigiToRawModule::rawdigi_
bool rawdigi_
Definition: SiStripDigiToRawModule.h:49
sistrip::DigiToRawModule::mode_
FEDReadoutMode mode_
Definition: SiStripDigiToRawModule.h:47
sistrip::DigiToRawModule::tokenRawDigi
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > tokenRawDigi
Definition: SiStripDigiToRawModule.h:53
sistrip::DigiToRawModule::digiToRaw_
DigiToRaw * digiToRaw_
Definition: SiStripDigiToRawModule.h:50
sistrip::DigiToRaw::printWarningSummary
void printWarningSummary() const
Definition: SiStripDigiToRaw.h:59
edm::isDebugEnabled
bool isDebugEnabled()
Definition: MessageLogger.cc:12
cms::Exception
Definition: Exception.h:70
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_CMOVERRIDE
Definition: SiStripFEDBufferComponents.h:54
edm::InputTag
Definition: InputTag.h:15
sistrip::READOUT_MODE_ZERO_SUPPRESSED_FAKE
Definition: SiStripFEDBufferComponents.h:57
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
sistrip::READOUT_MODE_ZERO_SUPPRESSED
Definition: SiStripFEDBufferComponents.h:56
sistrip::DigiToRawModule::eventCounter_
uint32_t eventCounter_
Definition: SiStripDigiToRawModule.h:51
sistrip::DigiToRawModule::tokenRawBuffer
edm::EDGetTokenT< FEDRawDataCollection > tokenRawBuffer
Definition: SiStripDigiToRawModule.h:56