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
ESRawToDigi Class Reference

#include <ESRawToDigi.h>

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

Public Member Functions

 ESRawToDigi (const edm::ParameterSet &ps)
 
void produce (edm::Event &e, const edm::EventSetup &es)
 
virtual ~ESRawToDigi ()
 
- 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 debug_
 
std::string ESdigiCollection_
 
ESUnpackerESUnpacker_
 
edm::InputTag fedsListLabel_
 
bool regional_
 
edm::InputTag sourceTag_
 

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

Definition at line 14 of file ESRawToDigi.h.

Constructor & Destructor Documentation

ESRawToDigi::ESRawToDigi ( const edm::ParameterSet ps)

Definition at line 13 of file ESRawToDigi.cc.

References debug_, ESdigiCollection_, ESUnpacker_, fedsListLabel_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), regional_, and sourceTag_.

14 {
15  sourceTag_ = ps.getParameter<edm::InputTag>("sourceTag");
16  ESdigiCollection_ = ps.getParameter<std::string>("ESdigiCollection");
17  regional_ = ps.getUntrackedParameter<bool>("DoRegional",false);
18  fedsListLabel_ = ps.getUntrackedParameter<edm::InputTag>("ESFedsListLabel", edm::InputTag(":esfedslist"));
19  debug_ = ps.getUntrackedParameter<bool>("debugMode", false);
20 
21  ESUnpacker_ = new ESUnpacker(ps);
22 
23  produces<ESRawDataCollection>();
24  produces<ESLocalRawDataCollection>();
25  produces<ESDigiCollection>();
26 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag fedsListLabel_
Definition: ESRawToDigi.h:26
edm::InputTag sourceTag_
Definition: ESRawToDigi.h:25
ESUnpacker * ESUnpacker_
Definition: ESRawToDigi.h:32
std::string ESdigiCollection_
Definition: ESRawToDigi.h:27
bool regional_
Definition: ESRawToDigi.h:28
ESRawToDigi::~ESRawToDigi ( )
virtual

Definition at line 28 of file ESRawToDigi.cc.

References ESUnpacker_.

28  {
29 
30  delete ESUnpacker_;
31 
32 }
ESUnpacker * ESUnpacker_
Definition: ESRawToDigi.h:32

Member Function Documentation

void ESRawToDigi::produce ( edm::Event e,
const edm::EventSetup es 
)
virtual

Implements edm::EDProducer.

Definition at line 34 of file ESRawToDigi.cc.

References gather_cfg::cout, debug_, ESdigiCollection_, ESUnpacker_, fedsListLabel_, edm::Event::getByLabel(), i, ESUnpacker::interpretRawData(), edm::HandleBase::isValid(), LogDebug, FEDNumbering::MAXPreShowerFEDID, FEDNumbering::MINPreShowerFEDID, edm::Event::put(), lumiPlot::rawdata, regional_, FEDRawData::size(), and sourceTag_.

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

34  {
35 
36  // Input
38  e.getByLabel(sourceTag_, rawdata);
39  if (!rawdata.isValid()) {
40  LogDebug("") << "ESRawToDigi : Error! can't get rawdata!" << std::endl;
41  }
42 
43  std::vector<int> esFeds_to_unpack;
44  if (regional_) {
46  e.getByLabel(fedsListLabel_, fedslist);
47  esFeds_to_unpack = fedslist->GetList();
48  }
49 
50  // Output
51  std::auto_ptr<ESRawDataCollection> productDCC(new ESRawDataCollection);
52  std::auto_ptr<ESLocalRawDataCollection> productKCHIP(new ESLocalRawDataCollection);
53  std::auto_ptr<ESDigiCollection> productDigis(new ESDigiCollection);
54 
55  ESDigiCollection digis;
56 
57  if (regional_) {
58  for (unsigned int i=0; i<esFeds_to_unpack.size(); ++i) {
59 
60  const FEDRawData& fedRawData = rawdata->FEDData(esFeds_to_unpack[i]);
61  ESUnpacker_->interpretRawData(esFeds_to_unpack[i], fedRawData, *productDCC, *productKCHIP, *productDigis);
62 
63  if (debug_) std::cout<<"FED : "<<esFeds_to_unpack[i]<<" Data size : "<<fedRawData.size()<<" (Bytes)"<<std::endl;
64  }
65  } else {
66  for (int fedId=FEDNumbering::MINPreShowerFEDID; fedId<=FEDNumbering::MAXPreShowerFEDID; ++fedId) {
67 
68  const FEDRawData& fedRawData = rawdata->FEDData(fedId);
69  ESUnpacker_->interpretRawData(fedId, fedRawData, *productDCC, *productKCHIP, *productDigis);
70 
71  if (debug_) std::cout<<"FED : "<<fedId<<" Data size : "<<fedRawData.size()<<" (Bytes)"<<std::endl;
72  }
73  }
74 
75  e.put(productDCC);
76  e.put(productKCHIP);
77  e.put(productDigis, ESdigiCollection_);
78 }
#define LogDebug(id)
edm::InputTag fedsListLabel_
Definition: ESRawToDigi.h:26
int i
Definition: DBlmapReader.cc:9
edm::InputTag sourceTag_
Definition: ESRawToDigi.h:25
ESUnpacker * ESUnpacker_
Definition: ESRawToDigi.h:32
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
std::string ESdigiCollection_
Definition: ESRawToDigi.h:27
bool regional_
Definition: ESRawToDigi.h:28
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
void interpretRawData(int fedId, const FEDRawData &rawData, ESRawDataCollection &dccs, ESLocalRawDataCollection &kchips, ESDigiCollection &digis)
Definition: ESUnpacker.cc:53
tuple cout
Definition: gather_cfg.py:121
dictionary rawdata
Definition: lumiPlot.py:393

Member Data Documentation

bool ESRawToDigi::debug_
private

Definition at line 30 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

std::string ESRawToDigi::ESdigiCollection_
private

Definition at line 27 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

ESUnpacker* ESRawToDigi::ESUnpacker_
private

Definition at line 32 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), produce(), and ~ESRawToDigi().

edm::InputTag ESRawToDigi::fedsListLabel_
private

Definition at line 26 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

bool ESRawToDigi::regional_
private

Definition at line 28 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

edm::InputTag ESRawToDigi::sourceTag_
private

Definition at line 25 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().