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::EDConsumerBase 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 ()
 
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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
 
- 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

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_, sourceTag_, and AlCaHLTBitMon_QueryRunRegistry::string.

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:47
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
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:390
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().