CMS 3D CMS Logo

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

#include <CTPPSPixelDigiToRaw.cc>

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

Public Member Functions

 CTPPSPixelDigiToRaw (const edm::ParameterSet &)
 
 ~CTPPSPixelDigiToRaw () 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 Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

int allDigiCounter_
 
int allWordCounter_
 
bool debug_
 
unsigned long eventCounter_
 
std::set< unsigned int > fedIds_
 
CTPPSPixelFramePosition fPos_
 
bool isRun3_
 
std::string mappingLabel_
 
edm::ESWatcher< CTPPSPixelDAQMappingRcdrecordWatcher_
 
edm::ESGetToken< CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcdtCTPPSPixelDAQMapping_
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tCTPPSPixelDigi_
 
std::vector< CTPPSPixelDataFormatter::PPSPixelIndexv_iDdet2fed_
 

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

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 63 of file CTPPSPixelDigiToRaw.cc.

Constructor & Destructor Documentation

◆ CTPPSPixelDigiToRaw()

CTPPSPixelDigiToRaw::CTPPSPixelDigiToRaw ( const edm::ParameterSet iConfig)
explicit

Definition at line 99 of file CTPPSPixelDigiToRaw.cc.

References edm::ParameterSet::getParameter(), isRun3_, tCTPPSPixelDAQMapping_, and tCTPPSPixelDigi_.

100  : eventCounter_(0),
101  allDigiCounter_(0),
102  allWordCounter_(0),
103  debug_(false),
104  mappingLabel_(iConfig.getParameter<std::string>("mappingLabel")) {
105  //register your products
106  tCTPPSPixelDigi_ = consumes<edm::DetSetVector<CTPPSPixelDigi>>(iConfig.getParameter<edm::InputTag>("InputLabel"));
107  tCTPPSPixelDAQMapping_ = esConsumes<CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcd>();
108 
109  // Define EDProduct type
110  produces<FEDRawDataCollection>();
111 
112  isRun3_ = iConfig.getParameter<bool>("isRun3");
113 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tCTPPSPixelDigi_
edm::ESGetToken< CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcd > tCTPPSPixelDAQMapping_

◆ ~CTPPSPixelDigiToRaw()

CTPPSPixelDigiToRaw::~CTPPSPixelDigiToRaw ( )
override

Definition at line 115 of file CTPPSPixelDigiToRaw.cc.

115 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 176 of file CTPPSPixelDigiToRaw.cc.

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

176  {
178  desc.add<bool>("isRun3", true);
179  desc.add<edm::InputTag>("InputLabel", edm::InputTag("RPixDetDigitizer"));
180  desc.add<std::string>("mappingLabel", "RPix");
181  descriptions.add("ctppsPixelRawData", desc);
182 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void CTPPSPixelDigiToRaw::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 122 of file CTPPSPixelDigiToRaw.cc.

References allDigiCounter_, allWordCounter_, CTPPSPixelDataFormatter::compare(), debug_, apvshotsanalyzer_cfi::digiCollection, eventCounter_, fedIds_, l1t_dqm_sourceclient-live_cfg::fedRawData, postprocess-scan-build::formatter, edm::EventSetup::getHandle(), iEvent, isRun3_, LogDebug, taus_updatedMVAIds_cff::mapping, eostools::move(), AlCaHLTBitMon_ParallelJobs::p, findQualityFiles::size, jetUpdater_cfi::sort, tCTPPSPixelDAQMapping_, tCTPPSPixelDigi_, and v_iDdet2fed_.

122  {
123  using namespace edm;
124  using namespace std;
125 
126  eventCounter_++;
127 
130 
133 
134  int digiCounter = 0;
135  for (auto const& di : *digiCollection) {
136  digiCounter += (di.data).size();
137  digis[di.id] = di.data;
138  }
139  allDigiCounter_ += digiCounter;
141 
143  for (const auto& p : mapping->ROCMapping)
145  p.second.iD, p.second.roc, p.first.getROC(), p.first.getFEDId(), p.first.getChannelIdx()});
146  fedIds_ = mapping->fedIds();
147 
149 
150  // create product (raw data)
151  auto buffers = std::make_unique<FEDRawDataCollection>();
152 
154 
155  // convert data to raw
156  formatter.formatRawData(isRun3_, iEvent.id().event(), rawdata, digis, v_iDdet2fed_);
157 
158  // pack raw data into collection
159  for (auto it = fedIds_.begin(); it != fedIds_.end(); it++) {
160  FEDRawData& fedRawData = buffers->FEDData(*it);
161  CTPPSPixelDataFormatter::RawData::iterator fedbuffer = rawdata.find(*it);
162  if (fedbuffer != rawdata.end())
163  fedRawData = fedbuffer->second;
164  }
165  allWordCounter_ += formatter.nWords();
166 
167  if (debug_)
168  LogDebug("CTPPSPixelDigiToRaw") << "Words/Digis this iEvent: " << digiCounter << "(fm:" << formatter.nDigis()
169  << ")/" << formatter.nWords() << " all: " << allDigiCounter_ << "/"
170  << allWordCounter_;
171 
172  iEvent.put(std::move(buffers));
173 }
size
Write out results.
std::unordered_map< int, FEDRawData > RawData
static bool compare(const PPSPixelIndex &a, const PPSPixelIndex &b)
int iEvent
Definition: GenABIO.cc:224
std::unordered_map< cms_uint32_t, DetDigis > Digis
std::vector< CTPPSPixelDataFormatter::PPSPixelIndex > v_iDdet2fed_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tCTPPSPixelDigi_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
edm::ESGetToken< CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcd > tCTPPSPixelDAQMapping_
std::set< unsigned int > fedIds_
HLT enums.
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

Member Data Documentation

◆ allDigiCounter_

int CTPPSPixelDigiToRaw::allDigiCounter_
private

Definition at line 75 of file CTPPSPixelDigiToRaw.cc.

Referenced by produce().

◆ allWordCounter_

int CTPPSPixelDigiToRaw::allWordCounter_
private

Definition at line 76 of file CTPPSPixelDigiToRaw.cc.

Referenced by produce().

◆ debug_

bool CTPPSPixelDigiToRaw::debug_
private

Definition at line 77 of file CTPPSPixelDigiToRaw.cc.

Referenced by produce().

◆ eventCounter_

unsigned long CTPPSPixelDigiToRaw::eventCounter_
private

Definition at line 74 of file CTPPSPixelDigiToRaw.cc.

Referenced by produce().

◆ fedIds_

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

Definition at line 78 of file CTPPSPixelDigiToRaw.cc.

Referenced by produce().

◆ fPos_

CTPPSPixelFramePosition CTPPSPixelDigiToRaw::fPos_
private

Definition at line 84 of file CTPPSPixelDigiToRaw.cc.

◆ isRun3_

bool CTPPSPixelDigiToRaw::isRun3_
private

Definition at line 85 of file CTPPSPixelDigiToRaw.cc.

Referenced by CTPPSPixelDigiToRaw(), and produce().

◆ mappingLabel_

std::string CTPPSPixelDigiToRaw::mappingLabel_
private

Definition at line 79 of file CTPPSPixelDigiToRaw.cc.

◆ recordWatcher_

edm::ESWatcher<CTPPSPixelDAQMappingRcd> CTPPSPixelDigiToRaw::recordWatcher_
private

Definition at line 80 of file CTPPSPixelDigiToRaw.cc.

◆ tCTPPSPixelDAQMapping_

edm::ESGetToken<CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcd> CTPPSPixelDigiToRaw::tCTPPSPixelDAQMapping_
private

Definition at line 82 of file CTPPSPixelDigiToRaw.cc.

Referenced by CTPPSPixelDigiToRaw(), and produce().

◆ tCTPPSPixelDigi_

edm::EDGetTokenT<edm::DetSetVector<CTPPSPixelDigi> > CTPPSPixelDigiToRaw::tCTPPSPixelDigi_
private

Definition at line 81 of file CTPPSPixelDigiToRaw.cc.

Referenced by CTPPSPixelDigiToRaw(), and produce().

◆ v_iDdet2fed_

std::vector<CTPPSPixelDataFormatter::PPSPixelIndex> CTPPSPixelDigiToRaw::v_iDdet2fed_
private

Definition at line 83 of file CTPPSPixelDigiToRaw.cc.

Referenced by produce().