CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
DTUnpackingModule Class Reference

#include <DTUnpackingModule.h>

Inheritance diagram for DTUnpackingModule:
edm::stream::EDProducer<>

Public Member Functions

 DTUnpackingModule (const edm::ParameterSet &pset)
 Constructor. More...
 
void produce (edm::Event &e, const edm::EventSetup &c) override
 Call the Unpackers and create the digis. More...
 
 ~DTUnpackingModule () override
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

std::string dataType
 
bool dqmOnly
 
edm::EDGetTokenT< FEDRawDataCollectioninputLabel
 if not you need the label More...
 
int maxFEDid_
 
int minFEDid_
 if not you need to set the range by hand More...
 
bool performDataIntegrityMonitor
 
DTUnpackerunpacker
 
bool useStandardFEDid_
 do you want to use the standard DT FED ID's, i.e. [770-775]? (why the hell 6??) More...
 

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

The unpacking module for DTs.

Author
N. Amapane - S. Argiro' - M. Zanetti

Definition at line 18 of file DTUnpackingModule.h.

Constructor & Destructor Documentation

DTUnpackingModule::DTUnpackingModule ( const edm::ParameterSet pset)

Constructor.

Definition at line 40 of file DTUnpackingModule.cc.

References dataType, dqmOnly, Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), inputLabel, maxFEDid_, minFEDid_, performDataIntegrityMonitor, unpacker, and useStandardFEDid_.

40  : unpacker(nullptr),dataType("") {
41 
42  dataType = ps.getParameter<string>("dataType");
43 
44  ParameterSet unpackerParameters = ps.getParameter<ParameterSet>("readOutParameters");
45 
46  if (dataType == "DDU") {
47  unpacker = new DTDDUUnpacker(unpackerParameters);
48  }
49  else if (dataType == "ROS25") {
50  unpacker = new DTROS25Unpacker(unpackerParameters.getParameter<ParameterSet>("rosParameters"));
51  }
52  else if (dataType == "ROS8") {
53  unpacker = new DTROS8Unpacker(unpackerParameters);
54  }
55  else {
56  throw cms::Exception("InvalidParameter") << "DTUnpackingModule: dataType "
57  << dataType << " is unknown";
58  }
59 
60  inputLabel = consumes<FEDRawDataCollection>(ps.getParameter<InputTag>("inputLabel")); // default was: source
61  useStandardFEDid_ = ps.getParameter<bool>("useStandardFEDid"); // default was: true
62  minFEDid_ = ps.getUntrackedParameter<int>("minFEDid",770); // default: 770
63  maxFEDid_ = ps.getUntrackedParameter<int>("maxFEDid",779); // default 779
64  dqmOnly = ps.getParameter<bool>("dqmOnly"); // default: false
65  performDataIntegrityMonitor = unpackerParameters.getUntrackedParameter<bool>("performDataIntegrityMonitor",false); // default: false
66 
67  if(!dqmOnly) {
68  produces<DTDigiCollection>();
69  produces<DTLocalTriggerCollection>();
70  }
71  if(performDataIntegrityMonitor) {
72  produces<std::vector<DTDDUData> >();
73  produces<std::vector<std::vector<DTROS25Data> > >();
74  }
75 }
T getParameter(std::string const &) const
edm::EDGetTokenT< FEDRawDataCollection > inputLabel
if not you need the label
int minFEDid_
if not you need to set the range by hand
bool useStandardFEDid_
do you want to use the standard DT FED ID&#39;s, i.e. [770-775]? (why the hell 6??)
DTUnpacker * unpacker
DTUnpackingModule::~DTUnpackingModule ( )
override

Destructor.

Definition at line 77 of file DTUnpackingModule.cc.

References unpacker.

77  {
78  delete unpacker;
79 }
DTUnpacker * unpacker

Member Function Documentation

void DTUnpackingModule::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 81 of file DTUnpackingModule.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addOptional(), edm::ParameterSetDescription::addUntracked(), and AlCaHLTBitMon_QueryRunRegistry::string.

81  {
83  desc.add<std::string>("dataType","DDU");
84  desc.add<edm::InputTag>("inputLabel",edm::InputTag("rawDataCollector"));
85  desc.add<bool>("useStandardFEDid",true);
86  desc.addUntracked<int>("minFEDid",770);
87  desc.addUntracked<int>("maxFEDid",779);
88  desc.addOptional<bool>("fedbyType"); // never used, only kept here for back-compatibility
89  {
91  psd0.addUntracked<bool>("debug",false);
92  {
94  psd1.addUntracked<bool>("writeSC",true);
95  psd1.addUntracked<bool>("readingDDU",true);
96  psd1.addUntracked<bool>("performDataIntegrityMonitor",false);
97  psd1.addUntracked<bool>("readDDUIDfromDDU",true);
98  psd1.addUntracked<bool>("debug",false);
99  psd1.addUntracked<bool>("localDAQ",false);
100  psd0.add<edm::ParameterSetDescription>("rosParameters",psd1);
101  }
102  psd0.addUntracked<bool>("performDataIntegrityMonitor",false);
103  psd0.addUntracked<bool>("localDAQ",false);
104  desc.add<edm::ParameterSetDescription>("readOutParameters",psd0);
105  }
106  desc.add<bool>("dqmOnly",false);
107  descriptions.add("dtUnpackingModule",desc);
108 }
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void DTUnpackingModule::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Call the Unpackers and create the digis.

Definition at line 110 of file DTUnpackingModule.cc.

References FEDRawData::data(), dataType, dqmOnly, FEDRawDataCollection::FEDData(), edm::EventSetup::get(), edm::Event::getByToken(), triggerObjects_cff::id, inputLabel, DTUnpacker::interpretRawData(), edm::HandleBase::isValid(), HPSPFTaus_cff::mapping, FEDNumbering::MAXDTFEDID, maxFEDid_, FEDNumbering::MINDTFEDID, minFEDid_, eostools::move(), performDataIntegrityMonitor, edm::Event::put(), matplotRender::rawdata, FEDRawData::size(), unpacker, and useStandardFEDid_.

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

110  {
111 
113  e.getByToken(inputLabel, rawdata);
114 
115  if(!rawdata.isValid()){
116  LogError("DTUnpackingModule::produce") << " unable to get raw data from the event" << endl;
117  return;
118  }
119 
120  // Get the mapping from the setup
122  context.get<DTReadOutMappingRcd>().get(mapping);
123 
124  // Create the result i.e. the collections of MB Digis and SC local triggers
125  auto detectorProduct = std::make_unique<DTDigiCollection>();
126  auto triggerProduct = std::make_unique<DTLocalTriggerCollection>();
127 
128  auto dduProduct = std::make_unique<std::vector<DTDDUData>>();
129  auto ros25Product = std::make_unique<DTROS25Collection>();
130 
131  // Loop over the DT FEDs
132  int FEDIDmin = 0, FEDIDMax = 0;
133  if (useStandardFEDid_){
134  FEDIDmin = FEDNumbering::MINDTFEDID;
135  FEDIDMax = FEDNumbering::MAXDTFEDID;
136  }
137  else {
138  FEDIDmin = minFEDid_;
139  FEDIDMax = maxFEDid_;
140  }
141 
142  for (int id=FEDIDmin; id<=FEDIDMax; ++id){
143  const FEDRawData& feddata = rawdata->FEDData(id);
144 
145  if (feddata.size()){
146  // Unpack the data
147  unpacker->interpretRawData(reinterpret_cast<const unsigned int*>(feddata.data()),
148  feddata.size(), id, mapping, detectorProduct, triggerProduct);
150  if(dataType == "DDU") {
151  dduProduct->push_back(dynamic_cast<DTDDUUnpacker*>(unpacker)->getDDUControlData());
152  ros25Product->push_back(dynamic_cast<DTDDUUnpacker*>(unpacker)->getROSsControlData());
153  }
154  else if(dataType == "ROS25") {
155  ros25Product->push_back(dynamic_cast<DTROS25Unpacker*>(unpacker)->getROSsControlData());
156  }
157  }
158  }
159  }
160 
161  // commit to the event
162  if(!dqmOnly) {
163  e.put(std::move(detectorProduct));
164  e.put(std::move(triggerProduct));
165  }
167  e.put(std::move(dduProduct));
168  e.put(std::move(ros25Product));
169  }
170 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
virtual void interpretRawData(const unsigned int *index, int datasize, int dduID, edm::ESHandle< DTReadOutMapping > &mapping, std::unique_ptr< DTDigiCollection > &product, std::unique_ptr< DTLocalTriggerCollection > &product2, uint16_t rosList=0)=0
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
edm::EDGetTokenT< FEDRawDataCollection > inputLabel
if not you need the label
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
int minFEDid_
if not you need to set the range by hand
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
bool useStandardFEDid_
do you want to use the standard DT FED ID&#39;s, i.e. [770-775]? (why the hell 6??)
bool isValid() const
Definition: HandleBase.h:74
DTUnpacker * unpacker
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

std::string DTUnpackingModule::dataType
private

Definition at line 44 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().

bool DTUnpackingModule::dqmOnly
private

Definition at line 42 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().

edm::EDGetTokenT<FEDRawDataCollection> DTUnpackingModule::inputLabel
private

if not you need the label

Definition at line 36 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().

int DTUnpackingModule::maxFEDid_
private

Definition at line 41 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().

int DTUnpackingModule::minFEDid_
private

if not you need to set the range by hand

Definition at line 40 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().

bool DTUnpackingModule::performDataIntegrityMonitor
private

Definition at line 43 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().

DTUnpacker* DTUnpackingModule::unpacker
private

Definition at line 33 of file DTUnpackingModule.h.

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

bool DTUnpackingModule::useStandardFEDid_
private

do you want to use the standard DT FED ID's, i.e. [770-775]? (why the hell 6??)

Definition at line 38 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().