#include <DTUnpackingModule.h>
Public Member Functions | |
DTUnpackingModule (const edm::ParameterSet &pset) | |
Constructor. | |
void | produce (edm::Event &e, const edm::EventSetup &c) |
Call the Unpackers and create the digis. | |
virtual | ~DTUnpackingModule () |
Destructor. | |
Private Attributes | |
bool | dqmOnly |
edm::InputTag | inputLabel |
if not you need the label | |
int | maxFEDid_ |
int | minFEDid_ |
if not you need to set the range by hand | |
DTUnpacker * | unpacker |
bool | useStandardFEDid_ |
do you want to use the standard DT FED ID's, i.e. [770-775]? (why the hell 6??) |
The unpacking module for DTs.
Definition at line 19 of file DTUnpackingModule.h.
DTUnpackingModule::DTUnpackingModule | ( | const edm::ParameterSet & | pset | ) |
Constructor.
Definition at line 39 of file DTUnpackingModule.cc.
References dtTPAnalyzer_cfg::dataType, dqmOnly, Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), inputLabel, maxFEDid_, minFEDid_, unpacker, and useStandardFEDid_.
: unpacker(0) { const string & dataType = ps.getParameter<string>("dataType"); ParameterSet unpackerParameters = ps.getParameter<ParameterSet>("readOutParameters"); if (dataType == "DDU") { unpacker = new DTDDUUnpacker(unpackerParameters); } else if (dataType == "ROS25") { unpacker = new DTROS25Unpacker(unpackerParameters.getParameter<ParameterSet>("rosParameters")); } else if (dataType == "ROS8") { unpacker = new DTROS8Unpacker(unpackerParameters); } else { throw cms::Exception("InvalidParameter") << "DTUnpackingModule: dataType " << dataType << " is unknown"; } inputLabel = ps.getParameter<InputTag>("inputLabel"); // default was: source useStandardFEDid_ = ps.getParameter<bool>("useStandardFEDid"); // default was: true minFEDid_ = ps.getUntrackedParameter<int>("minFEDid",770); // default: 770 maxFEDid_ = ps.getUntrackedParameter<int>("maxFEDid",779); // default 779 dqmOnly = ps.getParameter<bool>("dqmOnly"); // default: false if(!dqmOnly) { produces<DTDigiCollection>(); produces<DTLocalTriggerCollection>(); } }
DTUnpackingModule::~DTUnpackingModule | ( | ) | [virtual] |
Destructor.
Definition at line 72 of file DTUnpackingModule.cc.
References unpacker.
{ delete unpacker; }
void DTUnpackingModule::produce | ( | edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [virtual] |
Call the Unpackers and create the digis.
Implements edm::EDProducer.
Definition at line 77 of file DTUnpackingModule.cc.
References FEDRawData::data(), dqmOnly, edm::EventSetup::get(), edm::Event::getByLabel(), inputLabel, DTUnpacker::interpretRawData(), edm::HandleBase::isValid(), FEDNumbering::MAXDTFEDID, maxFEDid_, FEDNumbering::MINDTFEDID, minFEDid_, edm::Event::put(), lumiPlot::rawdata, FEDRawData::size(), unpacker, and useStandardFEDid_.
{ Handle<FEDRawDataCollection> rawdata; e.getByLabel(inputLabel, rawdata); if(!rawdata.isValid()){ LogError("DTUnpackingModule::produce") << " unable to get raw data from the event" << endl; return; } // Get the mapping from the setup ESHandle<DTReadOutMapping> mapping; context.get<DTReadOutMappingRcd>().get(mapping); // Create the result i.e. the collections of MB Digis and SC local triggers auto_ptr<DTDigiCollection> detectorProduct(new DTDigiCollection); auto_ptr<DTLocalTriggerCollection> triggerProduct(new DTLocalTriggerCollection); // Loop over the DT FEDs int FEDIDmin = 0, FEDIDMax = 0; if (useStandardFEDid_){ FEDIDmin = FEDNumbering::MINDTFEDID; FEDIDMax = FEDNumbering::MAXDTFEDID; } else { FEDIDmin = minFEDid_; FEDIDMax = maxFEDid_; } for (int id=FEDIDmin; id<=FEDIDMax; ++id){ const FEDRawData& feddata = rawdata->FEDData(id); if (feddata.size()){ // Unpack the data unpacker->interpretRawData(reinterpret_cast<const unsigned int*>(feddata.data()), feddata.size(), id, mapping, detectorProduct, triggerProduct); } } // commit to the event if(!dqmOnly) { e.put(detectorProduct); e.put(triggerProduct); } }
bool DTUnpackingModule::dqmOnly [private] |
Definition at line 42 of file DTUnpackingModule.h.
Referenced by DTUnpackingModule(), and produce().
edm::InputTag 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().
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().