CMS 3D CMS Logo

DTUnpackingModule Class Reference

The unpacking module for DTs. More...

#include <EventFilter/DTRawToDigi/plugins/DTUnpackingModule.h>

Inheritance diagram for DTUnpackingModule:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

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
DTUnpackerunpacker
bool useStandardFEDid_
 do you want to use the standard DT FED ID's, i.e. [770-775]? (why the hell 6??)


Detailed Description

The unpacking module for DTs.

Date
2008/11/06 17:06:20
Revision
1.6
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 38 of file DTUnpackingModule.cc.

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

00038                                                               : unpacker(0) {
00039 
00040   const string & dataType = ps.getParameter<string>("dataType");
00041 
00042   ParameterSet unpackerParameters = ps.getParameter<ParameterSet>("readOutParameters");
00043   
00044 
00045   if (dataType == "DDU") {
00046     unpacker = new DTDDUUnpacker(unpackerParameters);
00047   } 
00048   else if (dataType == "ROS25") {
00049     unpacker = new DTROS25Unpacker(unpackerParameters.getParameter<ParameterSet>("rosParameters"));
00050   } 
00051   else if (dataType == "ROS8") {
00052     unpacker = new DTROS8Unpacker(unpackerParameters);
00053   } 
00054   else {
00055     throw cms::Exception("InvalidParameter") << "DTUnpackingModule: dataType "
00056                                              << dataType << " is unknown";
00057   }
00058   
00059   fedbyType_ = ps.getUntrackedParameter<bool>("fedbyType", true);
00060   inputLabel = ps.getUntrackedParameter<InputTag>("inputLabel",InputTag("source"));
00061   useStandardFEDid_ = ps.getUntrackedParameter<bool>("useStandardFEDid", true);
00062   minFEDid_ = ps.getUntrackedParameter<int>("minFEDid", 73);
00063   maxFEDid_ = ps.getUntrackedParameter<int>("maxFEDid", 735);
00064   dqmOnly = ps.getUntrackedParameter<bool>("dqmOnly", false);
00065 
00066   if(!dqmOnly) {
00067     produces<DTDigiCollection>();
00068     produces<DTLocalTriggerCollection>();
00069   }
00070 }

DTUnpackingModule::~DTUnpackingModule (  )  [virtual]

Destructor.

Definition at line 72 of file DTUnpackingModule.cc.

References unpacker.

00072                                      {
00073   delete unpacker;
00074 }


Member Function Documentation

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(), FEDNumbering::getDTFEDIds(), id, inputLabel, DTUnpacker::interpretRawData(), maxFEDid_, minFEDid_, edm::Event::put(), FEDRawData::size(), unpacker, and useStandardFEDid_.

00077                                                                    {
00078 
00079   Handle<FEDRawDataCollection> rawdata;
00080   if (fedbyType_) {
00081     e.getByType(rawdata);
00082   }
00083   else {
00084     e.getByLabel(inputLabel, rawdata);
00085   }
00086 
00087   // Get the mapping from the setup
00088   ESHandle<DTReadOutMapping> mapping;
00089   context.get<DTReadOutMappingRcd>().get(mapping);
00090   
00091   // Create the result i.e. the collections of MB Digis and SC local triggers
00092   auto_ptr<DTDigiCollection> detectorProduct(new DTDigiCollection);
00093   auto_ptr<DTLocalTriggerCollection> triggerProduct(new DTLocalTriggerCollection);
00094 
00095 
00096   // Loop over the DT FEDs
00097   int FEDIDmin = 0, FEDIDMax = 0;
00098   if (useStandardFEDid_){
00099     FEDIDmin = FEDNumbering::getDTFEDIds().first;
00100     FEDIDMax = FEDNumbering::getDTFEDIds().second;
00101   }
00102   else {
00103     FEDIDmin = minFEDid_;
00104     FEDIDMax = maxFEDid_;
00105   }
00106   
00107   for (int id=FEDIDmin; id<=FEDIDMax; ++id){ 
00108     
00109     const FEDRawData& feddata = rawdata->FEDData(id);
00110     
00111     if (feddata.size()){
00112       
00113       // Unpack the data
00114       unpacker->interpretRawData(reinterpret_cast<const unsigned int*>(feddata.data()), 
00115                                  feddata.size(), id, mapping, detectorProduct, triggerProduct);
00116     }
00117   }
00118 
00119   // commit to the event  
00120   if(!dqmOnly) {
00121     e.put(detectorProduct);
00122     e.put(triggerProduct);
00123   }
00124 }


Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:19:12 2009 for CMSSW by  doxygen 1.5.4