#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 |
bool | fedbyType_ |
get the FED payload by type? | |
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 18 of file DTUnpackingModule.h.
DTUnpackingModule::DTUnpackingModule | ( | const edm::ParameterSet & | pset | ) |
Constructor.
Definition at line 38 of file DTUnpackingModule.cc.
References ExpressReco_HICollisions_FallBack::dataType, dqmOnly, Exception, fedbyType_, 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"; } fedbyType_ = ps.getParameter<bool>("fedbyType"); // default was: true 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, fedbyType_, edm::EventSetup::get(), edm::Event::getByLabel(), edm::Event::getByType(), ExpressReco_HICollisions_FallBack::id, inputLabel, DTUnpacker::interpretRawData(), FEDNumbering::MAXDTFEDID, maxFEDid_, FEDNumbering::MINDTFEDID, minFEDid_, edm::Event::put(), FEDRawData::size(), unpacker, and useStandardFEDid_.
{ Handle<FEDRawDataCollection> rawdata; if (fedbyType_) { e.getByType(rawdata); } else { e.getByLabel(inputLabel, rawdata); } // 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 43 of file DTUnpackingModule.h.
Referenced by DTUnpackingModule(), and produce().
bool DTUnpackingModule::fedbyType_ [private] |
get the FED payload by type?
Definition at line 35 of file DTUnpackingModule.h.
Referenced by DTUnpackingModule(), and produce().
edm::InputTag DTUnpackingModule::inputLabel [private] |
if not you need the label
Definition at line 37 of file DTUnpackingModule.h.
Referenced by DTUnpackingModule(), and produce().
int DTUnpackingModule::maxFEDid_ [private] |
Definition at line 42 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 41 of file DTUnpackingModule.h.
Referenced by DTUnpackingModule(), and produce().
DTUnpacker* DTUnpackingModule::unpacker [private] |
Definition at line 32 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 39 of file DTUnpackingModule.h.
Referenced by DTUnpackingModule(), and produce().