CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ESRawToDigi Class Reference

#include <ESRawToDigi.h>

Inheritance diagram for ESRawToDigi:
edm::stream::EDProducer<>

Public Member Functions

 ESRawToDigi (const edm::ParameterSet &ps)
 
void produce (edm::Event &e, const edm::EventSetup &es) override
 
 ~ESRawToDigi () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< FEDRawDataCollectiondataToken_
 
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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 14 of file ESRawToDigi.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file ESRawToDigi.cc.

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

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

Definition at line 36 of file ESRawToDigi.cc.

References ESUnpacker_.

36  {
37 
38  delete ESUnpacker_;
39 
40 }
ESUnpacker * ESUnpacker_
Definition: ESRawToDigi.h:38

Member Function Documentation

void ESRawToDigi::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 42 of file ESRawToDigi.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), and AlCaHLTBitMon_QueryRunRegistry::string.

42  {
44  desc.add<edm::InputTag>("sourceTag",edm::InputTag("rawDataCollector"));
45  desc.addUntracked<bool>("debugMode",false);
46  desc.add<std::string>("InstanceES","");
47  desc.add<edm::FileInPath>("LookupTable",edm::FileInPath("EventFilter/ESDigiToRaw/data/ES_lookup_table.dat"));
48  desc.add<std::string>("ESdigiCollection","");
49  descriptions.add("esRawToDigi",desc);
50 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void ESRawToDigi::produce ( edm::Event e,
const edm::EventSetup es 
)
override

Definition at line 52 of file ESRawToDigi.cc.

References gather_cfg::cout, dataToken_, debug_, ESdigiCollection_, ESUnpacker_, FEDRawDataCollection::FEDData(), l1t::stage2::layer2::fedId, fedsToken_, edm::Event::getByToken(), ESListOfFEDS::GetList(), mps_fire::i, ESUnpacker::interpretRawData(), edm::HandleBase::isValid(), LogDebug, FEDNumbering::MAXPreShowerFEDID, FEDNumbering::MINPreShowerFEDID, eostools::move(), edm::Event::put(), matplotRender::rawdata, regional_, and FEDRawData::size().

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

52  {
53 
54  // Input
56  e.getByToken(dataToken_, rawdata);
57  if (!rawdata.isValid()) {
58  LogDebug("") << "ESRawToDigi : Error! can't get rawdata!" << std::endl;
59  }
60 
61  std::vector<int> esFeds_to_unpack;
62  if (regional_) {
64  e.getByToken(fedsToken_, fedslist);
65  esFeds_to_unpack = fedslist->GetList();
66  }
67 
68  // Output
69  auto productDCC = std::make_unique<ESRawDataCollection>();
70  auto productKCHIP = std::make_unique<ESLocalRawDataCollection>();
71  auto productDigis = std::make_unique<ESDigiCollection>();
72 
73  ESDigiCollection digis;
74 
75  if (regional_) {
76  for (unsigned int i=0; i<esFeds_to_unpack.size(); ++i) {
77 
78  const FEDRawData& fedRawData = rawdata->FEDData(esFeds_to_unpack[i]);
79  ESUnpacker_->interpretRawData(esFeds_to_unpack[i], fedRawData, *productDCC, *productKCHIP, *productDigis);
80 
81  if (debug_) std::cout<<"FED : "<<esFeds_to_unpack[i]<<" Data size : "<<fedRawData.size()<<" (Bytes)"<<std::endl;
82  }
83  } else {
85 
86  const FEDRawData& fedRawData = rawdata->FEDData(fedId);
87  ESUnpacker_->interpretRawData(fedId, fedRawData, *productDCC, *productKCHIP, *productDigis);
88 
89  if (debug_) std::cout<<"FED : "<<fedId<<" Data size : "<<fedRawData.size()<<" (Bytes)"<<std::endl;
90  }
91  }
92 
93  e.put(std::move(productDCC));
94  e.put(std::move(productKCHIP));
95  e.put(std::move(productDigis), ESdigiCollection_);
96 }
#define LogDebug(id)
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
Definition: ESRawToDigi.h:30
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
ESUnpacker * ESUnpacker_
Definition: ESRawToDigi.h:38
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
std::vector< int > GetList() const
Definition: ESListOfFEDS.h:10
std::string ESdigiCollection_
Definition: ESRawToDigi.h:29
bool regional_
Definition: ESRawToDigi.h:34
bool isValid() const
Definition: HandleBase.h:74
void interpretRawData(int fedId, const FEDRawData &rawData, ESRawDataCollection &dccs, ESLocalRawDataCollection &kchips, ESDigiCollection &digis)
Definition: ESUnpacker.cc:53
edm::EDGetTokenT< ESListOfFEDS > fedsToken_
Definition: ESRawToDigi.h:31
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

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

Definition at line 30 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

bool ESRawToDigi::debug_
private

Definition at line 36 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

std::string ESRawToDigi::ESdigiCollection_
private

Definition at line 29 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

ESUnpacker* ESRawToDigi::ESUnpacker_
private

Definition at line 38 of file ESRawToDigi.h.

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

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

Definition at line 31 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

bool ESRawToDigi::regional_
private

Definition at line 34 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().