CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
DTUnpackingModule Class Reference

#include <DTUnpackingModule.h>

Inheritance diagram for DTUnpackingModule:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 DTUnpackingModule (const edm::ParameterSet &pset)
 Constructor. More...
 
void produce (edm::Event &e, const edm::EventSetup &c)
 Call the Unpackers and create the digis. More...
 
virtual ~DTUnpackingModule ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

bool dqmOnly
 
bool fedbyType_
 get the FED payload by type? More...
 
edm::InputTag inputLabel
 if not you need the label More...
 
int maxFEDid_
 
int minFEDid_
 if not you need to set the range by hand More...
 
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::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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 dtTPAnalyzer_cfg::dataType, dqmOnly, edm::hlt::Exception, fedbyType_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), inputLabel, maxFEDid_, minFEDid_, unpacker, and useStandardFEDid_.

38  : unpacker(0) {
39 
40  const string & dataType = ps.getParameter<string>("dataType");
41 
42  ParameterSet unpackerParameters = ps.getParameter<ParameterSet>("readOutParameters");
43 
44 
45  if (dataType == "DDU") {
46  unpacker = new DTDDUUnpacker(unpackerParameters);
47  }
48  else if (dataType == "ROS25") {
49  unpacker = new DTROS25Unpacker(unpackerParameters.getParameter<ParameterSet>("rosParameters"));
50  }
51  else if (dataType == "ROS8") {
52  unpacker = new DTROS8Unpacker(unpackerParameters);
53  }
54  else {
55  throw cms::Exception("InvalidParameter") << "DTUnpackingModule: dataType "
56  << dataType << " is unknown";
57  }
58 
59  fedbyType_ = ps.getParameter<bool>("fedbyType"); // default was: true
60  inputLabel = 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 
66  if(!dqmOnly) {
67  produces<DTDigiCollection>();
68  produces<DTLocalTriggerCollection>();
69  }
70 }
T getParameter(std::string const &) const
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??)
bool fedbyType_
get the FED payload by type?
DTUnpacker * unpacker
edm::InputTag inputLabel
if not you need the label
DTUnpackingModule::~DTUnpackingModule ( )
virtual

Destructor.

Definition at line 72 of file DTUnpackingModule.cc.

References unpacker.

72  {
73  delete unpacker;
74 }
DTUnpacker * unpacker

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

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

77  {
78 
80  if (fedbyType_) {
81  e.getByType(rawdata);
82  }
83  else {
84  e.getByLabel(inputLabel, rawdata);
85  }
86 
87  // Get the mapping from the setup
89  context.get<DTReadOutMappingRcd>().get(mapping);
90 
91  // Create the result i.e. the collections of MB Digis and SC local triggers
92  auto_ptr<DTDigiCollection> detectorProduct(new DTDigiCollection);
93  auto_ptr<DTLocalTriggerCollection> triggerProduct(new DTLocalTriggerCollection);
94 
95 
96  // Loop over the DT FEDs
97  int FEDIDmin = 0, FEDIDMax = 0;
98  if (useStandardFEDid_){
99  FEDIDmin = FEDNumbering::MINDTFEDID;
100  FEDIDMax = FEDNumbering::MAXDTFEDID;
101  }
102  else {
103  FEDIDmin = minFEDid_;
104  FEDIDMax = maxFEDid_;
105  }
106 
107  for (int id=FEDIDmin; id<=FEDIDMax; ++id){
108 
109  const FEDRawData& feddata = rawdata->FEDData(id);
110 
111  if (feddata.size()){
112 
113  // Unpack the data
114  unpacker->interpretRawData(reinterpret_cast<const unsigned int*>(feddata.data()),
115  feddata.size(), id, mapping, detectorProduct, triggerProduct);
116  }
117  }
118 
119  // commit to the event
120  if(!dqmOnly) {
121  e.put(detectorProduct);
122  e.put(triggerProduct);
123  }
124 }
virtual void interpretRawData(const unsigned int *index, int datasize, int dduID, edm::ESHandle< DTReadOutMapping > &mapping, std::auto_ptr< DTDigiCollection > &product, std::auto_ptr< DTLocalTriggerCollection > &product2, uint16_t rosList=0)=0
bool getByType(Handle< PROD > &result) const
Definition: Event.h:398
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
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??)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
bool fedbyType_
get the FED payload by type?
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
DTUnpacker * unpacker
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29
edm::InputTag inputLabel
if not you need the label
dictionary rawdata
Definition: lumiPlot.py:393

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