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 hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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 13 of file ESRawToDigi.h.

Constructor & Destructor Documentation

◆ ESRawToDigi()

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

Definition at line 15 of file ESRawToDigi.cc.

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

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

◆ ~ESRawToDigi()

ESRawToDigi::~ESRawToDigi ( )
override

Definition at line 34 of file ESRawToDigi.cc.

34 { delete ESUnpacker_; }

References ESUnpacker_.

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 36 of file ESRawToDigi.cc.

36  {
38  desc.add<edm::InputTag>("sourceTag", edm::InputTag("rawDataCollector"));
39  desc.addUntracked<bool>("debugMode", false);
40  desc.add<std::string>("InstanceES", "");
41  desc.add<edm::FileInPath>("LookupTable", edm::FileInPath("EventFilter/ESDigiToRaw/data/ES_lookup_table.dat"));
42  desc.add<std::string>("ESdigiCollection", "");
43  descriptions.add("esRawToDigi", desc);
44 }

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

◆ produce()

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

Definition at line 46 of file ESRawToDigi.cc.

46  {
47  // Input
49  e.getByToken(dataToken_, rawdata);
50  if (!rawdata.isValid()) {
51  LogDebug("") << "ESRawToDigi : Error! can't get rawdata!" << std::endl;
52  }
53 
54  std::vector<int> esFeds_to_unpack;
55  if (regional_) {
57  e.getByToken(fedsToken_, fedslist);
58  esFeds_to_unpack = fedslist->GetList();
59  }
60 
61  // Output
62  auto productDCC = std::make_unique<ESRawDataCollection>();
63  auto productKCHIP = std::make_unique<ESLocalRawDataCollection>();
64  auto productDigis = std::make_unique<ESDigiCollection>();
65 
66  ESDigiCollection digis;
67 
68  if (regional_) {
69  for (unsigned int i = 0; i < esFeds_to_unpack.size(); ++i) {
70  const FEDRawData& fedRawData = rawdata->FEDData(esFeds_to_unpack[i]);
71  ESUnpacker_->interpretRawData(esFeds_to_unpack[i], fedRawData, *productDCC, *productKCHIP, *productDigis);
72 
73  if (debug_)
74  std::cout << "FED : " << esFeds_to_unpack[i] << " Data size : " << fedRawData.size() << " (Bytes)" << std::endl;
75  }
76  } else {
78  const FEDRawData& fedRawData = rawdata->FEDData(fedId);
79  ESUnpacker_->interpretRawData(fedId, fedRawData, *productDCC, *productKCHIP, *productDigis);
80 
81  if (debug_)
82  std::cout << "FED : " << fedId << " Data size : " << fedRawData.size() << " (Bytes)" << std::endl;
83  }
84  }
85 
86  e.put(std::move(productDCC));
87  e.put(std::move(productKCHIP));
88  e.put(std::move(productDigis), ESdigiCollection_);
89 }

References gather_cfg::cout, dataToken_, debug_, MillePedeFileConverter_cfg::e, ESdigiCollection_, ESUnpacker_, FEDRawDataCollection::FEDData(), l1tstage2_dqm_sourceclient-live_cfg::fedId, l1t_dqm_sourceclient-live_cfg::fedRawData, fedsToken_, ESListOfFEDS::GetList(), mps_fire::i, ESUnpacker::interpretRawData(), edm::HandleBase::isValid(), LogDebug, FEDNumbering::MAXPreShowerFEDID, FEDNumbering::MINPreShowerFEDID, eostools::move(), and regional_.

Member Data Documentation

◆ dataToken_

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

Definition at line 24 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

◆ debug_

bool ESRawToDigi::debug_
private

Definition at line 29 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

◆ ESdigiCollection_

std::string ESRawToDigi::ESdigiCollection_
private

Definition at line 23 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

◆ ESUnpacker_

ESUnpacker* ESRawToDigi::ESUnpacker_
private

Definition at line 31 of file ESRawToDigi.h.

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

◆ fedsToken_

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

Definition at line 25 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

◆ regional_

bool ESRawToDigi::regional_
private

Definition at line 27 of file ESRawToDigi.h.

Referenced by ESRawToDigi(), and produce().

mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
ESRawToDigi::dataToken_
edm::EDGetTokenT< FEDRawDataCollection > dataToken_
Definition: ESRawToDigi.h:24
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
FEDNumbering::MINPreShowerFEDID
Definition: FEDNumbering.h:31
ESRawToDigi::ESUnpacker_
ESUnpacker * ESUnpacker_
Definition: ESRawToDigi.h:31
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
ESUnpacker::interpretRawData
void interpretRawData(int fedId, const FEDRawData &rawData, ESRawDataCollection &dccs, ESLocalRawDataCollection &kchips, ESDigiCollection &digis)
Definition: ESUnpacker.cc:49
edm::Handle
Definition: AssociativeIterator.h:50
FEDRawData
Definition: FEDRawData.h:19
edm::FileInPath
Definition: FileInPath.h:64
l1t_dqm_sourceclient-live_cfg.fedRawData
fedRawData
Definition: l1t_dqm_sourceclient-live_cfg.py:182
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
ESRawToDigi::regional_
bool regional_
Definition: ESRawToDigi.h:27
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
ESDigiCollection
Definition: EcalDigiCollections.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ESListOfFEDS::GetList
std::vector< int > GetList() const
Definition: ESListOfFEDS.h:10
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
ESRawToDigi::ESdigiCollection_
std::string ESdigiCollection_
Definition: ESRawToDigi.h:23
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
RawToDigi_cff.sourceTag
sourceTag
Definition: RawToDigi_cff.py:78
FEDNumbering::MAXPreShowerFEDID
Definition: FEDNumbering.h:32
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:82
ESRawToDigi::fedsToken_
edm::EDGetTokenT< ESListOfFEDS > fedsToken_
Definition: ESRawToDigi.h:25
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
ESRawToDigi::debug_
bool debug_
Definition: ESRawToDigi.h:29
edm::InputTag
Definition: InputTag.h:15
ESUnpacker
Definition: ESUnpacker.h:22
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37