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 hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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::DTUnpackingModule ( const edm::ParameterSet pset)

Constructor.

Definition at line 36 of file DTUnpackingModule.cc.

36  : unpacker(nullptr), dataType("") {
37  dataType = ps.getParameter<string>("dataType");
38 
39  ParameterSet unpackerParameters = ps.getParameter<ParameterSet>("readOutParameters");
40 
41  if (dataType == "DDU") {
42  unpacker = new DTDDUUnpacker(unpackerParameters);
43  } else if (dataType == "ROS25") {
44  unpacker = new DTROS25Unpacker(unpackerParameters.getParameter<ParameterSet>("rosParameters"));
45  } else if (dataType == "ROS8") {
46  unpacker = new DTROS8Unpacker(unpackerParameters);
47  } else {
48  throw cms::Exception("InvalidParameter") << "DTUnpackingModule: dataType " << dataType << " is unknown";
49  }
50 
51  inputLabel = consumes<FEDRawDataCollection>(ps.getParameter<InputTag>("inputLabel")); // default was: source
52  useStandardFEDid_ = ps.getParameter<bool>("useStandardFEDid"); // default was: true
53  minFEDid_ = ps.getUntrackedParameter<int>("minFEDid", 770); // default: 770
54  maxFEDid_ = ps.getUntrackedParameter<int>("maxFEDid", 779); // default 779
55  dqmOnly = ps.getParameter<bool>("dqmOnly"); // default: false
57  unpackerParameters.getUntrackedParameter<bool>("performDataIntegrityMonitor", false); // default: false
58 
59  if (!dqmOnly) {
60  produces<DTDigiCollection>();
61  produces<DTLocalTriggerCollection>();
62  }
64  produces<std::vector<DTDDUData>>();
65  produces<std::vector<std::vector<DTROS25Data>>>();
66  }
67 }

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

◆ ~DTUnpackingModule()

DTUnpackingModule::~DTUnpackingModule ( )
override

Destructor.

Definition at line 69 of file DTUnpackingModule.cc.

69 { delete unpacker; }

References unpacker.

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 71 of file DTUnpackingModule.cc.

71  {
73  desc.add<std::string>("dataType", "DDU");
74  desc.add<edm::InputTag>("inputLabel", edm::InputTag("rawDataCollector"));
75  desc.add<bool>("useStandardFEDid", true);
76  desc.addUntracked<int>("minFEDid", 770);
77  desc.addUntracked<int>("maxFEDid", 779);
78  desc.addOptional<bool>("fedbyType"); // never used, only kept here for back-compatibility
79  {
81  psd0.addUntracked<bool>("debug", false);
82  {
84  psd1.addUntracked<bool>("writeSC", true);
85  psd1.addUntracked<bool>("readingDDU", true);
86  psd1.addUntracked<bool>("performDataIntegrityMonitor", false);
87  psd1.addUntracked<bool>("readDDUIDfromDDU", true);
88  psd1.addUntracked<bool>("debug", false);
89  psd1.addUntracked<bool>("localDAQ", false);
90  psd0.add<edm::ParameterSetDescription>("rosParameters", psd1);
91  }
92  psd0.addUntracked<bool>("performDataIntegrityMonitor", false);
93  psd0.addUntracked<bool>("localDAQ", false);
94  desc.add<edm::ParameterSetDescription>("readOutParameters", psd0);
95  }
96  desc.add<bool>("dqmOnly", false);
97  descriptions.add("dtUnpackingModule", desc);
98 }

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

◆ produce()

void DTUnpackingModule::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Call the Unpackers and create the digis.

Definition at line 100 of file DTUnpackingModule.cc.

100  {
102  e.getByToken(inputLabel, rawdata);
103 
104  if (!rawdata.isValid()) {
105  LogError("DTUnpackingModule::produce") << " unable to get raw data from the event" << endl;
106  return;
107  }
108 
109  // Get the mapping from the setup
111  context.get<DTReadOutMappingRcd>().get(mapping);
112 
113  // Create the result i.e. the collections of MB Digis and SC local triggers
114  auto detectorProduct = std::make_unique<DTDigiCollection>();
115  auto triggerProduct = std::make_unique<DTLocalTriggerCollection>();
116 
117  auto dduProduct = std::make_unique<std::vector<DTDDUData>>();
118  auto ros25Product = std::make_unique<DTROS25Collection>();
119 
120  // Loop over the DT FEDs
121  int FEDIDmin = 0, FEDIDMax = 0;
122  if (useStandardFEDid_) {
123  FEDIDmin = FEDNumbering::MINDTFEDID;
124  FEDIDMax = FEDNumbering::MAXDTFEDID;
125  } else {
126  FEDIDmin = minFEDid_;
127  FEDIDMax = maxFEDid_;
128  }
129 
130  for (int id = FEDIDmin; id <= FEDIDMax; ++id) {
131  const FEDRawData& feddata = rawdata->FEDData(id);
132 
133  if (feddata.size()) {
134  // Unpack the data
135  unpacker->interpretRawData(reinterpret_cast<const unsigned int*>(feddata.data()),
136  feddata.size(),
137  id,
138  mapping,
139  detectorProduct,
140  triggerProduct);
142  if (dataType == "DDU") {
143  dduProduct->push_back(dynamic_cast<DTDDUUnpacker*>(unpacker)->getDDUControlData());
144  ros25Product->push_back(dynamic_cast<DTDDUUnpacker*>(unpacker)->getROSsControlData());
145  } else if (dataType == "ROS25") {
146  ros25Product->push_back(dynamic_cast<DTROS25Unpacker*>(unpacker)->getROSsControlData());
147  }
148  }
149  }
150  }
151 
152  // commit to the event
153  if (!dqmOnly) {
154  e.put(std::move(detectorProduct));
155  e.put(std::move(triggerProduct));
156  }
158  e.put(std::move(dduProduct));
159  e.put(std::move(ros25Product));
160  }
161 }

References FEDRawData::data(), dataType, dqmOnly, MillePedeFileConverter_cfg::e, FEDRawDataCollection::FEDData(), edm::EventSetup::get(), get, triggerObjects_cff::id, inputLabel, DTUnpacker::interpretRawData(), edm::HandleBase::isValid(), taus_updatedMVAIds_cff::mapping, FEDNumbering::MAXDTFEDID, maxFEDid_, FEDNumbering::MINDTFEDID, minFEDid_, eostools::move(), performDataIntegrityMonitor, FEDRawData::size(), unpacker, and useStandardFEDid_.

Member Data Documentation

◆ dataType

std::string DTUnpackingModule::dataType
private

Definition at line 43 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().

◆ dqmOnly

bool DTUnpackingModule::dqmOnly
private

Definition at line 41 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().

◆ inputLabel

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

if not you need the label

Definition at line 35 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().

◆ maxFEDid_

int DTUnpackingModule::maxFEDid_
private

Definition at line 40 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().

◆ minFEDid_

int DTUnpackingModule::minFEDid_
private

if not you need to set the range by hand

Definition at line 39 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().

◆ performDataIntegrityMonitor

bool DTUnpackingModule::performDataIntegrityMonitor
private

Definition at line 42 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().

◆ unpacker

DTUnpacker* DTUnpackingModule::unpacker
private

Definition at line 32 of file DTUnpackingModule.h.

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

◆ useStandardFEDid_

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 37 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().

DTROS25Unpacker
Definition: DTROS25Unpacker.h:18
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
DTReadOutMappingRcd
Definition: DTReadOutMappingRcd.h:5
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
DTUnpacker::interpretRawData
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
DTUnpackingModule::inputLabel
edm::EDGetTokenT< FEDRawDataCollection > inputLabel
if not you need the label
Definition: DTUnpackingModule.h:35
edm::Handle
Definition: AssociativeIterator.h:50
edm::ParameterSetDescription::addOptional
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:105
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
FEDRawData
Definition: FEDRawData.h:19
DTUnpackingModule::dataType
std::string dataType
Definition: DTUnpackingModule.h:43
DTROS8Unpacker
Definition: DTROS8Unpacker.h:18
DTUnpackingModule::minFEDid_
int minFEDid_
if not you need to set the range by hand
Definition: DTUnpackingModule.h:39
DTUnpackingModule::maxFEDid_
int maxFEDid_
Definition: DTUnpackingModule.h:40
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
DTUnpackingModule::useStandardFEDid_
bool useStandardFEDid_
do you want to use the standard DT FED ID's, i.e. [770-775]? (why the hell 6??)
Definition: DTUnpackingModule.h:37
edm::ESHandle< DTReadOutMapping >
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FEDNumbering::MAXDTFEDID
Definition: FEDNumbering.h:56
DTDDUUnpacker
Definition: DTDDUUnpacker.h:17
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
FEDNumbering::MINDTFEDID
Definition: FEDNumbering.h:55
get
#define get
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
DTUnpackingModule::performDataIntegrityMonitor
bool performDataIntegrityMonitor
Definition: DTUnpackingModule.h:42
DTUnpackingModule::dqmOnly
bool dqmOnly
Definition: DTUnpackingModule.h:41
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
Exception
Definition: hltDiff.cc:246
DTUnpackingModule::unpacker
DTUnpacker * unpacker
Definition: DTUnpackingModule.h:32
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:28
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37