CMS 3D CMS Logo

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

#include <CTPPSPixelRawToDigi.h>

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

Public Member Functions

 CTPPSPixelRawToDigi (const edm::ParameterSet &)
 
void endStream () override
 
void produce (edm::Event &, const edm::EventSetup &) override
 get data, convert to digis attach againe to Event More...
 
 ~CTPPSPixelRawToDigi () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::ParameterSet config_
 
edm::ESGetToken< CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcdCTPPSPixelDAQMapping_
 
CTPPSPixelErrorSummary eSummary_
 
std::set< unsigned int > fedIds_
 
edm::EDGetTokenT< FEDRawDataCollectionFEDRawDataCollection_
 
bool includeErrors_
 
bool isRun3_
 
edm::InputTag label_
 
std::string mappingLabel_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 23 of file CTPPSPixelRawToDigi.h.

Constructor & Destructor Documentation

◆ CTPPSPixelRawToDigi()

CTPPSPixelRawToDigi::CTPPSPixelRawToDigi ( const edm::ParameterSet conf)
explicit

Definition at line 24 of file CTPPSPixelRawToDigi.cc.

References config_, CTPPSPixelDAQMapping_, FEDRawDataCollection_, edm::ParameterSet::getParameter(), includeErrors_, isRun3_, mappingLabel_, and AlCaHLTBitMon_QueryRunRegistry::string.

25  : config_(conf),
26  eSummary_("CTPPSPixelDataFormatter", "[ctppsPixelRawToDigi]", edm::isDebugEnabled())
27 
28 {
29  FEDRawDataCollection_ = consumes<FEDRawDataCollection>(config_.getParameter<edm::InputTag>("inputLabel"));
30  CTPPSPixelDAQMapping_ = esConsumes<CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcd>();
31 
32  produces<edm::DetSetVector<CTPPSPixelDigi>>();
33 
34  isRun3_ = config_.getParameter<bool>("isRun3");
35  includeErrors_ = config_.getParameter<bool>("includeErrors");
36  mappingLabel_ = config_.getParameter<std::string>("mappingLabel");
37 
38  if (includeErrors_) {
39  produces<edm::DetSetVector<CTPPSPixelDataError>>();
40  }
41 }
bool isDebugEnabled()
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ParameterSet config_
edm::ESGetToken< CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcd > CTPPSPixelDAQMapping_
CTPPSPixelErrorSummary eSummary_
edm::EDGetTokenT< FEDRawDataCollection > FEDRawDataCollection_

◆ ~CTPPSPixelRawToDigi()

CTPPSPixelRawToDigi::~CTPPSPixelRawToDigi ( )
override

Definition at line 43 of file CTPPSPixelRawToDigi.cc.

43  {
44  edm::LogInfo("CTPPSPixelRawToDigi") << " CTPPSPixelRawToDigi destructor!";
45 }
Log< level::Info, false > LogInfo

Member Function Documentation

◆ endStream()

void CTPPSPixelRawToDigi::endStream ( )
override

Definition at line 125 of file CTPPSPixelRawToDigi.cc.

References eSummary_, and CTPPSPixelErrorSummary::printSummary().

125 { eSummary_.printSummary(); }
CTPPSPixelErrorSummary eSummary_

◆ fillDescriptions()

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

Definition at line 47 of file CTPPSPixelRawToDigi.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

47  {
49  desc.add<bool>("isRun3", true);
50  desc.add<bool>("includeErrors", true);
51  desc.add<edm::InputTag>("inputLabel", edm::InputTag("rawDataCollector"));
52  desc.add<std::string>("mappingLabel", "RPix");
53  descriptions.add("ctppsPixelDigis", desc);
54 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void CTPPSPixelRawToDigi::produce ( edm::Event ev,
const edm::EventSetup es 
)
override

get data, convert to digis attach againe to Event

create product (digis & errors)

get event data for this fed

errors given dummy detId must be sorted by Fed

send digis and errors back to framework

Definition at line 56 of file CTPPSPixelRawToDigi.cc.

References universalConfigTemplate::collection, CTPPSPixelDAQMapping_, edm::DetSet< T >::data, TauDecayModes::dec, RPixErrorChecker::dummyDetId, nano_mu_digi_cff::errors, eSummary_, makeMEIFBenchmarkPlots::ev, FEDRawDataCollection::FEDData(), l1tstage2_dqm_sourceclient-live_cfg::fedId, fedIds_, l1t_dqm_sourceclient-live_cfg::fedRawData, FEDRawDataCollection_, edm::EventSetup::getHandle(), includeErrors_, CTPPSPixelDataFormatter::interpretRawData(), isRun3_, LogDebug, taus_updatedMVAIds_cff::mapping, FEDNumbering::MAXCTPPSPixelsFEDID, FEDNumbering::MINCTPPSPixelsFEDID, eostools::move(), CTPPSPixelDataFormatter::setErrorStatus(), and FEDRawData::size().

56  {
58  ev.getByToken(FEDRawDataCollection_, buffers);
59 
61 
62  bool data_exist = false;
64  const FEDRawData& tempRawData = buffers->FEDData(fed);
65  if (tempRawData.size() != 0) {
66  data_exist = true;
67  break;
68  }
69  }
71  auto collection = std::make_unique<edm::DetSetVector<CTPPSPixelDigi>>();
72 
73  auto errorcollection = std::make_unique<edm::DetSetVector<CTPPSPixelDataError>>();
74 
75  if (data_exist) {
77 
78  fedIds_ = mapping->fedIds();
79 
80  CTPPSPixelDataFormatter formatter(mapping->ROCMapping, eSummary_);
81  formatter.setErrorStatus(includeErrors_);
82 
83  bool errorsInEvent = false;
85 
86  for (auto aFed = fedIds_.begin(); aFed != fedIds_.end(); ++aFed) {
87  int fedId = *aFed;
88 
89  edm::LogInfo("CTPPSPixelRawToDigi") << " PRODUCE DIGI FOR FED: " << dec << fedId << endl;
90 
93  const FEDRawData& fedRawData = buffers->FEDData(fedId);
94 
95  formatter.interpretRawData(isRun3_, errorsInEvent, fedId, fedRawData, *collection, errors);
96 
97  if (includeErrors_) {
98  for (auto const& is : errors) {
99  uint32_t errordetid = is.first;
101  if (errordetid == RPixErrorChecker::dummyDetId) {
102  nodeterrors.insert(nodeterrors.end(), errors[errordetid].begin(), errors[errordetid].end());
103  } else {
104  edm::DetSet<CTPPSPixelDataError>& errorDetSet = errorcollection->find_or_insert(errordetid);
105  errorDetSet.data.insert(errorDetSet.data.end(), is.second.begin(), is.second.end());
106  }
107  }
108  }
109  }
110 
111  if (includeErrors_) {
112  errorcollection->find_or_insert(RPixErrorChecker::dummyDetId).data = nodeterrors;
113  }
114  if (errorsInEvent)
115  LogDebug("CTPPSPixelRawToDigi") << "Error words were stored in this event";
116  }
118  ev.put(std::move(collection));
119 
120  if (includeErrors_) {
121  ev.put(std::move(errorcollection));
122  }
123 }
std::map< uint32_t, DetErrors > Errors
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
std::set< unsigned int > fedIds_
edm::ESGetToken< CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcd > CTPPSPixelDAQMapping_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
std::vector< CTPPSPixelDataError > DetErrors
Log< level::Info, false > LogInfo
CTPPSPixelErrorSummary eSummary_
static constexpr Word32 dummyDetId
collection_type data
Definition: DetSet.h:80
Definition: errors.py:1
edm::EDGetTokenT< FEDRawDataCollection > FEDRawDataCollection_
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

Member Data Documentation

◆ config_

edm::ParameterSet CTPPSPixelRawToDigi::config_
private

Definition at line 37 of file CTPPSPixelRawToDigi.h.

Referenced by CTPPSPixelRawToDigi().

◆ CTPPSPixelDAQMapping_

edm::ESGetToken<CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcd> CTPPSPixelRawToDigi::CTPPSPixelDAQMapping_
private

Definition at line 41 of file CTPPSPixelRawToDigi.h.

Referenced by CTPPSPixelRawToDigi(), and produce().

◆ eSummary_

CTPPSPixelErrorSummary CTPPSPixelRawToDigi::eSummary_
private

Definition at line 49 of file CTPPSPixelRawToDigi.h.

Referenced by endStream(), and produce().

◆ fedIds_

std::set<unsigned int> CTPPSPixelRawToDigi::fedIds_
private

Definition at line 43 of file CTPPSPixelRawToDigi.h.

Referenced by produce().

◆ FEDRawDataCollection_

edm::EDGetTokenT<FEDRawDataCollection> CTPPSPixelRawToDigi::FEDRawDataCollection_
private

Definition at line 39 of file CTPPSPixelRawToDigi.h.

Referenced by CTPPSPixelRawToDigi(), and produce().

◆ includeErrors_

bool CTPPSPixelRawToDigi::includeErrors_
private

Definition at line 51 of file CTPPSPixelRawToDigi.h.

Referenced by CTPPSPixelRawToDigi(), and produce().

◆ isRun3_

bool CTPPSPixelRawToDigi::isRun3_
private

Definition at line 52 of file CTPPSPixelRawToDigi.h.

Referenced by CTPPSPixelRawToDigi(), and produce().

◆ label_

edm::InputTag CTPPSPixelRawToDigi::label_
private

◆ mappingLabel_

std::string CTPPSPixelRawToDigi::mappingLabel_
private

Definition at line 47 of file CTPPSPixelRawToDigi.h.

Referenced by CTPPSPixelRawToDigi().