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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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_
 
edm::InputTag label_
 
std::string mappingLabel_
 

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 22 of file CTPPSPixelRawToDigi.h.

Constructor & Destructor Documentation

◆ CTPPSPixelRawToDigi()

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

Definition at line 24 of file CTPPSPixelRawToDigi.cc.

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  includeErrors_ = config_.getParameter<bool>("includeErrors");
34  mappingLabel_ = config_.getParameter<std::string>("mappingLabel");
35 
36  if (includeErrors_) {
37  produces<edm::DetSetVector<CTPPSPixelDataError>>();
38  }
39 }

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

◆ ~CTPPSPixelRawToDigi()

CTPPSPixelRawToDigi::~CTPPSPixelRawToDigi ( )
override

Definition at line 41 of file CTPPSPixelRawToDigi.cc.

41  {
42  edm::LogInfo("CTPPSPixelRawToDigi") << " CTPPSPixelRawToDigi destructor!";
43 }

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 45 of file CTPPSPixelRawToDigi.cc.

45  {
47  desc.add<bool>("includeErrors", true);
48  desc.add<edm::InputTag>("inputLabel", edm::InputTag("rawDataCollector"));
49  desc.add<std::string>("mappingLabel", "RPix");
50  descriptions.add("ctppsPixelDigis", desc);
51 }

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

◆ 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 53 of file CTPPSPixelRawToDigi.cc.

53  {
55  ev.getByToken(FEDRawDataCollection_, buffers);
56 
58 
59  bool data_exist = false;
61  const FEDRawData& tempRawData = buffers->FEDData(fed);
62  if (tempRawData.size() != 0) {
63  data_exist = true;
64  break;
65  }
66  }
68  auto collection = std::make_unique<edm::DetSetVector<CTPPSPixelDigi>>();
69 
70  auto errorcollection = std::make_unique<edm::DetSetVector<CTPPSPixelDataError>>();
71 
72  if (data_exist) {
74 
75  fedIds_ = mapping->fedIds();
76 
77  CTPPSPixelDataFormatter formatter(mapping->ROCMapping);
78  formatter.setErrorStatus(includeErrors_);
79 
80  bool errorsInEvent = false;
82 
83  for (auto aFed = fedIds_.begin(); aFed != fedIds_.end(); ++aFed) {
84  int fedId = *aFed;
85 
86  edm::LogInfo("CTPPSPixelRawToDigi") << " PRODUCE DIGI FOR FED: " << dec << fedId << endl;
87 
90  const FEDRawData& fedRawData = buffers->FEDData(fedId);
91 
92  formatter.interpretRawData(errorsInEvent, fedId, fedRawData, *collection, errors);
93 
94  if (includeErrors_) {
95  for (auto const& is : errors) {
96  uint32_t errordetid = is.first;
98  if (errordetid == RPixErrorChecker::dummyDetId) {
99  nodeterrors.insert(nodeterrors.end(), errors[errordetid].begin(), errors[errordetid].end());
100  } else {
101  edm::DetSet<CTPPSPixelDataError>& errorDetSet = errorcollection->find_or_insert(errordetid);
102  errorDetSet.data.insert(errorDetSet.data.end(), is.second.begin(), is.second.end());
103  }
104  }
105  }
106  }
107 
108  if (includeErrors_) {
109  errorcollection->find_or_insert(RPixErrorChecker::dummyDetId).data = nodeterrors;
110  }
111  if (errorsInEvent)
112  LogDebug("CTPPSPixelRawToDigi") << "Error words were stored in this event";
113  }
115  ev.put(std::move(collection));
116 
117  if (includeErrors_) {
118  ev.put(std::move(errorcollection));
119  }
120 }

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

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().

◆ label_

edm::InputTag CTPPSPixelRawToDigi::label_
private

◆ mappingLabel_

std::string CTPPSPixelRawToDigi::mappingLabel_
private

Definition at line 44 of file CTPPSPixelRawToDigi.h.

Referenced by CTPPSPixelRawToDigi().

CTPPSPixelRawToDigi::FEDRawDataCollection_
edm::EDGetTokenT< FEDRawDataCollection > FEDRawDataCollection_
Definition: CTPPSPixelRawToDigi.h:36
CTPPSPixelRawToDigi::config_
edm::ParameterSet config_
Definition: CTPPSPixelRawToDigi.h:34
CTPPSPixelRawToDigi::mappingLabel_
std::string mappingLabel_
Definition: CTPPSPixelRawToDigi.h:44
RPixErrorChecker::dummyDetId
static constexpr Word32 dummyDetId
Definition: RPixErrorChecker.h:39
edm::DetSet
Definition: DetSet.h:23
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle
Definition: AssociativeIterator.h:50
FEDRawData
Definition: FEDRawData.h:19
CTPPSPixelDataFormatter::Errors
std::map< uint32_t, DetErrors > Errors
Definition: CTPPSPixelDataFormatter.h:61
CTPPSPixelRawToDigi::CTPPSPixelDAQMapping_
edm::ESGetToken< CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcd > CTPPSPixelDAQMapping_
Definition: CTPPSPixelRawToDigi.h:38
l1t_dqm_sourceclient-live_cfg.fedRawData
fedRawData
Definition: l1t_dqm_sourceclient-live_cfg.py:188
errors
Definition: errors.py:1
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::ESHandle
Definition: DTSurvey.h:22
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSPixelRawToDigi::fedIds_
std::set< unsigned int > fedIds_
Definition: CTPPSPixelRawToDigi.h:40
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
CTPPSPixelRawToDigi::includeErrors_
bool includeErrors_
Definition: CTPPSPixelRawToDigi.h:46
universalConfigTemplate.collection
collection
Definition: universalConfigTemplate.py:81
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:88
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
FEDNumbering::MAXCTPPSPixelsFEDID
Definition: FEDNumbering.h:122
CTPPSPixelDataFormatter
Definition: CTPPSPixelDataFormatter.h:53
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
edm::DetSet::data
collection_type data
Definition: DetSet.h:80
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CTPPSPixelDataFormatter::DetErrors
std::vector< CTPPSPixelDataError > DetErrors
Definition: CTPPSPixelDataFormatter.h:60
FEDNumbering::MINCTPPSPixelsFEDID
Definition: FEDNumbering.h:121
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:29
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
edm::InputTag
Definition: InputTag.h:15
debug_messages_cfi.errors
errors
Definition: debug_messages_cfi.py:54