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::EDConsumerBase 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 ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

std::string dataType
 
bool dqmOnly
 
edm::EDGetTokenT
< FEDRawDataCollection
inputLabel
 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::EDProducer
typedef EDProducer ModuleType
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 ( const edm::ParameterSet pset)

Constructor.

Definition at line 38 of file DTUnpackingModule.cc.

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

38  : unpacker(0),dataType("") {
39 
40  dataType = ps.getParameter<string>("dataType");
41 
42  ParameterSet unpackerParameters = ps.getParameter<ParameterSet>("readOutParameters");
43 
44  if (dataType == "DDU") {
45  unpacker = new DTDDUUnpacker(unpackerParameters);
46  }
47  else if (dataType == "ROS25") {
48  unpacker = new DTROS25Unpacker(unpackerParameters.getParameter<ParameterSet>("rosParameters"));
49  }
50  else if (dataType == "ROS8") {
51  unpacker = new DTROS8Unpacker(unpackerParameters);
52  }
53  else {
54  throw cms::Exception("InvalidParameter") << "DTUnpackingModule: dataType "
55  << dataType << " is unknown";
56  }
57 
58  inputLabel = consumes<FEDRawDataCollection>(ps.getParameter<InputTag>("inputLabel")); // default was: source
59  useStandardFEDid_ = ps.getParameter<bool>("useStandardFEDid"); // default was: true
60  minFEDid_ = ps.getUntrackedParameter<int>("minFEDid",770); // default: 770
61  maxFEDid_ = ps.getUntrackedParameter<int>("maxFEDid",779); // default 779
62  dqmOnly = ps.getParameter<bool>("dqmOnly"); // default: false
63  performDataIntegrityMonitor = unpackerParameters.getUntrackedParameter<bool>("performDataIntegrityMonitor",false); // default: false
64 
65  if(!dqmOnly) {
66  produces<DTDigiCollection>();
67  produces<DTLocalTriggerCollection>();
68  }
69  if(performDataIntegrityMonitor) {
70  produces<std::vector<DTDDUData> >();
71  produces<std::vector<std::vector<DTROS25Data> > >();
72  }
73 }
T getParameter(std::string const &) const
edm::EDGetTokenT< FEDRawDataCollection > inputLabel
if not you need the label
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??)
DTUnpacker * unpacker
DTUnpackingModule::~DTUnpackingModule ( )
virtual

Destructor.

Definition at line 75 of file DTUnpackingModule.cc.

References unpacker.

75  {
76  delete unpacker;
77 }
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 80 of file DTUnpackingModule.cc.

References FEDRawData::data(), dataType, dqmOnly, edm::EventSetup::get(), edm::Event::getByToken(), inputLabel, DTUnpacker::interpretRawData(), edm::HandleBase::isValid(), FEDNumbering::MAXDTFEDID, maxFEDid_, FEDNumbering::MINDTFEDID, minFEDid_, performDataIntegrityMonitor, edm::Event::put(), lumiPlot::rawdata, FEDRawData::size(), unpacker, and useStandardFEDid_.

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

80  {
81 
83  e.getByToken(inputLabel, rawdata);
84 
85  if(!rawdata.isValid()){
86  LogError("DTUnpackingModule::produce") << " unable to get raw data from the event" << endl;
87  return;
88  }
89 
90  // Get the mapping from the setup
92  context.get<DTReadOutMappingRcd>().get(mapping);
93 
94  // Create the result i.e. the collections of MB Digis and SC local triggers
95  auto_ptr<DTDigiCollection> detectorProduct(new DTDigiCollection);
96  auto_ptr<DTLocalTriggerCollection> triggerProduct(new DTLocalTriggerCollection);
97 
98  auto_ptr<std::vector<DTDDUData> > dduProduct(new std::vector<DTDDUData>);
99  auto_ptr<DTROS25Collection> ros25Product(new DTROS25Collection);
100 
101  // Loop over the DT FEDs
102  int FEDIDmin = 0, FEDIDMax = 0;
103  if (useStandardFEDid_){
104  FEDIDmin = FEDNumbering::MINDTFEDID;
105  FEDIDMax = FEDNumbering::MAXDTFEDID;
106  }
107  else {
108  FEDIDmin = minFEDid_;
109  FEDIDMax = maxFEDid_;
110  }
111 
112  for (int id=FEDIDmin; id<=FEDIDMax; ++id){
113  const FEDRawData& feddata = rawdata->FEDData(id);
114 
115  if (feddata.size()){
116  // Unpack the data
117  unpacker->interpretRawData(reinterpret_cast<const unsigned int*>(feddata.data()),
118  feddata.size(), id, mapping, detectorProduct, triggerProduct);
120  if(dataType == "DDU") {
121  dduProduct->push_back(dynamic_cast<DTDDUUnpacker*>(unpacker)->getDDUControlData());
122  ros25Product->push_back(dynamic_cast<DTDDUUnpacker*>(unpacker)->getROSsControlData());
123  }
124  else if(dataType == "ROS25") {
125  ros25Product->push_back(dynamic_cast<DTROS25Unpacker*>(unpacker)->getROSsControlData());
126  }
127  }
128  }
129  }
130 
131  // commit to the event
132  if(!dqmOnly) {
133  e.put(detectorProduct);
134  e.put(triggerProduct);
135  }
137  e.put(dduProduct);
138  e.put(ros25Product);
139  }
140 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetTokenT< FEDRawDataCollection > inputLabel
if not you need the label
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
std::vector< std::vector< DTROS25Data > > DTROS25Collection
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
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:116
bool isValid() const
Definition: HandleBase.h:76
DTUnpacker * unpacker
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
dictionary rawdata
Definition: lumiPlot.py:393

Member Data Documentation

std::string DTUnpackingModule::dataType
private

Definition at line 43 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().

bool DTUnpackingModule::dqmOnly
private

Definition at line 41 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().

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

int DTUnpackingModule::maxFEDid_
private

Definition at line 40 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 39 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().

bool DTUnpackingModule::performDataIntegrityMonitor
private

Definition at line 42 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 37 of file DTUnpackingModule.h.

Referenced by DTUnpackingModule(), and produce().