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::stream::EDProducer<> edm::stream::EDProducerBase 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::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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

edm::EDGetTokenT
< FEDRawDataCollection
dataToken_
 
bool debug_
 
std::string ESdigiCollection_
 
ESUnpackerESUnpacker_
 
edm::EDGetTokenT< ESListOfFEDSfedsToken_
 
bool regional_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
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 12 of file ESRawToDigi.cc.

References dataToken_, debug_, ESdigiCollection_, ESUnpacker_, fedsToken_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), regional_, and AlCaHLTBitMon_QueryRunRegistry::string.

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

Definition at line 33 of file ESRawToDigi.cc.

References ESUnpacker_.

33  {
34 
35  delete ESUnpacker_;
36 
37 }
ESUnpacker * ESUnpacker_
Definition: ESRawToDigi.h:36

Member Function Documentation

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

Implements edm::stream::EDProducerBase.

Definition at line 39 of file ESRawToDigi.cc.

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

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

39  {
40 
41  // Input
43  e.getByToken(dataToken_, rawdata);
44  if (!rawdata.isValid()) {
45  LogDebug("") << "ESRawToDigi : Error! can't get rawdata!" << std::endl;
46  }
47 
48  std::vector<int> esFeds_to_unpack;
49  if (regional_) {
51  e.getByToken(fedsToken_, fedslist);
52  esFeds_to_unpack = fedslist->GetList();
53  }
54 
55  // Output
56  std::auto_ptr<ESRawDataCollection> productDCC(new ESRawDataCollection);
57  std::auto_ptr<ESLocalRawDataCollection> productKCHIP(new ESLocalRawDataCollection);
58  std::auto_ptr<ESDigiCollection> productDigis(new ESDigiCollection);
59 
60  ESDigiCollection digis;
61 
62  if (regional_) {
63  for (unsigned int i=0; i<esFeds_to_unpack.size(); ++i) {
64 
65  const FEDRawData& fedRawData = rawdata->FEDData(esFeds_to_unpack[i]);
66  ESUnpacker_->interpretRawData(esFeds_to_unpack[i], fedRawData, *productDCC, *productKCHIP, *productDigis);
67 
68  if (debug_) std::cout<<"FED : "<<esFeds_to_unpack[i]<<" Data size : "<<fedRawData.size()<<" (Bytes)"<<std::endl;
69  }
70  } else {
71  for (int fedId=FEDNumbering::MINPreShowerFEDID; fedId<=FEDNumbering::MAXPreShowerFEDID; ++fedId) {
72 
73  const FEDRawData& fedRawData = rawdata->FEDData(fedId);
74  ESUnpacker_->interpretRawData(fedId, fedRawData, *productDCC, *productKCHIP, *productDigis);
75 
76  if (debug_) std::cout<<"FED : "<<fedId<<" Data size : "<<fedRawData.size()<<" (Bytes)"<<std::endl;
77  }
78  }
79 
80  e.put(productDCC);
81  e.put(productKCHIP);
82  e.put(productDigis, ESdigiCollection_);
83 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
Definition: ESRawToDigi.h:28
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
ESUnpacker * ESUnpacker_
Definition: ESRawToDigi.h:36
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:113
std::string ESdigiCollection_
Definition: ESRawToDigi.h:27
bool regional_
Definition: ESRawToDigi.h:32
bool isValid() const
Definition: HandleBase.h:76
void interpretRawData(int fedId, const FEDRawData &rawData, ESRawDataCollection &dccs, ESLocalRawDataCollection &kchips, ESDigiCollection &digis)
Definition: ESUnpacker.cc:53
edm::EDGetTokenT< ESListOfFEDS > fedsToken_
Definition: ESRawToDigi.h:29
tuple cout
Definition: gather_cfg.py:121
dictionary rawdata
Definition: lumiPlot.py:393

Member Data Documentation

edm::EDGetTokenT<FEDRawDataCollection> ESRawToDigi::dataToken_
private

Definition at line 28 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

bool ESRawToDigi::debug_
private

Definition at line 34 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 36 of file ESRawToDigi.h.

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

edm::EDGetTokenT<ESListOfFEDS> ESRawToDigi::fedsToken_
private

Definition at line 29 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

bool ESRawToDigi::regional_
private

Definition at line 32 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().