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
 
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 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_
 
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<>
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

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 98 of file CTPPSPixelDigiToRaw.cc.

99  : eventCounter_(0),
100  allDigiCounter_(0),
101  allWordCounter_(0),
102  mappingLabel_(iConfig.getParameter<std::string>("mappingLabel")) {
103  //register your products
104  tCTPPSPixelDigi_ = consumes<edm::DetSetVector<CTPPSPixelDigi>>(iConfig.getParameter<edm::InputTag>("InputLabel"));
105  tCTPPSPixelDAQMapping_ = esConsumes<CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcd>();
106 
107  // Define EDProduct type
108  produces<FEDRawDataCollection>();
109 }

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

◆ ~CTPPSPixelDigiToRaw()

CTPPSPixelDigiToRaw::~CTPPSPixelDigiToRaw ( )
override

Definition at line 111 of file CTPPSPixelDigiToRaw.cc.

111 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 172 of file CTPPSPixelDigiToRaw.cc.

172  {
174  desc.add<edm::InputTag>("InputLabel", edm::InputTag("RPixDetDigitizer"));
175  desc.add<std::string>("mappingLabel", "RPix");
176  descriptions.add("ctppsPixelRawData", desc);
177 }

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

◆ produce()

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

Definition at line 118 of file CTPPSPixelDigiToRaw.cc.

118  {
119  using namespace edm;
120  using namespace std;
121 
122  eventCounter_++;
123 
126 
129 
130  int digiCounter = 0;
131  for (auto const& di : *digiCollection) {
132  digiCounter += (di.data).size();
133  digis[di.id] = di.data;
134  }
135  allDigiCounter_ += digiCounter;
137  if (recordWatcher_.check(iSetup)) {
139  for (const auto& p : mapping->ROCMapping)
141  p.second.iD, p.second.roc, p.first.getROC(), p.first.getFEDId(), p.first.getChannelIdx()});
142  fedIds_ = mapping->fedIds();
143  }
144  CTPPSPixelDataFormatter formatter(mapping->ROCMapping);
145 
146  // create product (raw data)
147  auto buffers = std::make_unique<FEDRawDataCollection>();
148 
150 
151  // convert data to raw
152  formatter.formatRawData(iEvent.id().event(), rawdata, digis, v_iDdet2fed_);
153 
154  // pack raw data into collection
155  for (auto it = fedIds_.begin(); it != fedIds_.end(); it++) {
156  FEDRawData& fedRawData = buffers->FEDData(*it);
157  CTPPSPixelDataFormatter::RawData::iterator fedbuffer = rawdata.find(*it);
158  if (fedbuffer != rawdata.end())
159  fedRawData = fedbuffer->second;
160  }
161  allWordCounter_ += formatter.nWords();
162 
163  if (debug_)
164  LogDebug("CTPPSPixelDigiToRaw") << "Words/Digis this iEvent: " << digiCounter << "(fm:" << formatter.nDigis()
165  << ")/" << formatter.nWords() << " all: " << allDigiCounter_ << "/"
166  << allWordCounter_;
167 
168  iEvent.put(std::move(buffers));
169 }

References allDigiCounter_, allWordCounter_, edm::ESWatcher< T >::check(), CTPPSPixelDataFormatter::compare(), debug_, apvshotsanalyzer_cfi::digiCollection, eventCounter_, fedIds_, l1t_dqm_sourceclient-live_cfg::fedRawData, CTPPSPixelDataFormatter::formatRawData(), edm::EventSetup::getHandle(), iEvent, LogDebug, taus_updatedMVAIds_cff::mapping, eostools::move(), CTPPSPixelDataFormatter::nDigis(), CTPPSPixelDataFormatter::nWords(), AlCaHLTBitMon_ParallelJobs::p, recordWatcher_, findQualityFiles::size, jetUpdater_cfi::sort, tCTPPSPixelDAQMapping_, tCTPPSPixelDigi_, and v_iDdet2fed_.

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.

◆ 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.

Referenced by produce().

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

edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
CTPPSPixelDigiToRaw::eventCounter_
unsigned long eventCounter_
Definition: CTPPSPixelDigiToRaw.cc:74
CTPPSPixelDigiToRaw::allWordCounter_
int allWordCounter_
Definition: CTPPSPixelDigiToRaw.cc:76
CTPPSPixelDigiToRaw::debug_
bool debug_
Definition: CTPPSPixelDigiToRaw.cc:77
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Handle
Definition: AssociativeIterator.h:50
FEDRawData
Definition: FEDRawData.h:19
CTPPSPixelDigiToRaw::v_iDdet2fed_
std::vector< CTPPSPixelDataFormatter::PPSPixelIndex > v_iDdet2fed_
Definition: CTPPSPixelDigiToRaw.cc:83
l1t_dqm_sourceclient-live_cfg.fedRawData
fedRawData
Definition: l1t_dqm_sourceclient-live_cfg.py:188
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::ESHandle
Definition: DTSurvey.h:22
CTPPSPixelDigiToRaw::fedIds_
std::set< unsigned int > fedIds_
Definition: CTPPSPixelDigiToRaw.cc:78
CTPPSPixelDataFormatter::PPSPixelIndex
Definition: CTPPSPixelDataFormatter.h:78
CTPPSPixelDataFormatter::RawData
std::unordered_map< int, FEDRawData > RawData
Definition: CTPPSPixelDataFormatter.h:57
CTPPSPixelDigiToRaw::mappingLabel_
std::string mappingLabel_
Definition: CTPPSPixelDigiToRaw.cc:79
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSPixelDataFormatter::compare
static bool compare(const PPSPixelIndex &a, const PPSPixelIndex &b)
Definition: CTPPSPixelDataFormatter.h:91
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
CTPPSPixelDigiToRaw::allDigiCounter_
int allDigiCounter_
Definition: CTPPSPixelDigiToRaw.cc:75
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
CTPPSPixelDataFormatter::Digis
std::unordered_map< cms_uint32_t, DetDigis > Digis
Definition: CTPPSPixelDataFormatter.h:66
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
apvshotsanalyzer_cfi.digiCollection
digiCollection
Definition: apvshotsanalyzer_cfi.py:4
CTPPSPixelDigiToRaw::tCTPPSPixelDigi_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tCTPPSPixelDigi_
Definition: CTPPSPixelDigiToRaw.cc:81
CTPPSPixelDataFormatter
Definition: CTPPSPixelDataFormatter.h:53
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
CTPPSPixelDigiToRaw::recordWatcher_
edm::ESWatcher< CTPPSPixelDAQMappingRcd > recordWatcher_
Definition: CTPPSPixelDigiToRaw.cc:80
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CTPPSPixelDigiToRaw::tCTPPSPixelDAQMapping_
edm::ESGetToken< CTPPSPixelDAQMapping, CTPPSPixelDAQMappingRcd > tCTPPSPixelDAQMapping_
Definition: CTPPSPixelDigiToRaw.cc:82
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:29
edm::InputTag
Definition: InputTag.h:15
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443