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 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_
 
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 22 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 
27 {
28  FEDRawDataCollection_ = consumes<FEDRawDataCollection>(config_.getParameter<edm::InputTag>("inputLabel"));
29  CTPPSPixelDAQMapping_ = esConsumes<CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcd>();
30 
31  produces<edm::DetSetVector<CTPPSPixelDigi>>();
32 
33  isRun3_ = config_.getParameter<bool>("isRun3");
34  includeErrors_ = config_.getParameter<bool>("includeErrors");
35  mappingLabel_ = config_.getParameter<std::string>("mappingLabel");
36 
37  if (includeErrors_) {
38  produces<edm::DetSetVector<CTPPSPixelDataError>>();
39  }
40 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ParameterSet config_
edm::ESGetToken< CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcd > CTPPSPixelDAQMapping_
edm::EDGetTokenT< FEDRawDataCollection > FEDRawDataCollection_

◆ ~CTPPSPixelRawToDigi()

CTPPSPixelRawToDigi::~CTPPSPixelRawToDigi ( )
override

Definition at line 42 of file CTPPSPixelRawToDigi.cc.

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

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 46 of file CTPPSPixelRawToDigi.cc.

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

46  {
48  desc.add<bool>("isRun3", true);
49  desc.add<bool>("includeErrors", true);
50  desc.add<edm::InputTag>("inputLabel", edm::InputTag("rawDataCollector"));
51  desc.add<std::string>("mappingLabel", "RPix");
52  descriptions.add("ctppsPixelDigis", desc);
53 }
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 55 of file CTPPSPixelRawToDigi.cc.

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

55  {
57  ev.getByToken(FEDRawDataCollection_, buffers);
58 
60 
61  bool data_exist = false;
63  const FEDRawData& tempRawData = buffers->FEDData(fed);
64  if (tempRawData.size() != 0) {
65  data_exist = true;
66  break;
67  }
68  }
70  auto collection = std::make_unique<edm::DetSetVector<CTPPSPixelDigi>>();
71 
72  auto errorcollection = std::make_unique<edm::DetSetVector<CTPPSPixelDataError>>();
73 
74  if (data_exist) {
76 
77  fedIds_ = mapping->fedIds();
78 
80  formatter.setErrorStatus(includeErrors_);
81 
82  bool errorsInEvent = false;
84 
85  for (auto aFed = fedIds_.begin(); aFed != fedIds_.end(); ++aFed) {
86  int fedId = *aFed;
87 
88  edm::LogInfo("CTPPSPixelRawToDigi") << " PRODUCE DIGI FOR FED: " << dec << fedId << endl;
89 
92  const FEDRawData& fedRawData = buffers->FEDData(fedId);
93 
94  formatter.interpretRawData(isRun3_, errorsInEvent, fedId, fedRawData, *collection, errors);
95 
96  if (includeErrors_) {
97  for (auto const& is : errors) {
98  uint32_t errordetid = is.first;
100  if (errordetid == RPixErrorChecker::dummyDetId) {
101  nodeterrors.insert(nodeterrors.end(), errors[errordetid].begin(), errors[errordetid].end());
102  } else {
103  edm::DetSet<CTPPSPixelDataError>& errorDetSet = errorcollection->find_or_insert(errordetid);
104  errorDetSet.data.insert(errorDetSet.data.end(), is.second.begin(), is.second.end());
105  }
106  }
107  }
108  }
109 
110  if (includeErrors_) {
111  errorcollection->find_or_insert(RPixErrorChecker::dummyDetId).data = nodeterrors;
112  }
113  if (errorsInEvent)
114  LogDebug("CTPPSPixelRawToDigi") << "Error words were stored in this event";
115  }
117  ev.put(std::move(collection));
118 
119  if (includeErrors_) {
120  ev.put(std::move(errorcollection));
121  }
122 }
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:151
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
std::vector< CTPPSPixelDataError > DetErrors
Log< level::Info, false > LogInfo
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 34 of file CTPPSPixelRawToDigi.h.

Referenced by CTPPSPixelRawToDigi().

◆ CTPPSPixelDAQMapping_

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

Definition at line 38 of file CTPPSPixelRawToDigi.h.

Referenced by CTPPSPixelRawToDigi(), and produce().

◆ fedIds_

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

Definition at line 40 of file CTPPSPixelRawToDigi.h.

Referenced by produce().

◆ FEDRawDataCollection_

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

Definition at line 36 of file CTPPSPixelRawToDigi.h.

Referenced by CTPPSPixelRawToDigi(), and produce().

◆ includeErrors_

bool CTPPSPixelRawToDigi::includeErrors_
private

Definition at line 46 of file CTPPSPixelRawToDigi.h.

Referenced by CTPPSPixelRawToDigi(), and produce().

◆ isRun3_

bool CTPPSPixelRawToDigi::isRun3_
private

Definition at line 47 of file CTPPSPixelRawToDigi.h.

Referenced by CTPPSPixelRawToDigi(), and produce().

◆ label_

edm::InputTag CTPPSPixelRawToDigi::label_
private

◆ mappingLabel_

std::string CTPPSPixelRawToDigi::mappingLabel_
private

Definition at line 44 of file CTPPSPixelRawToDigi.h.

Referenced by CTPPSPixelRawToDigi().