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 hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () 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::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 62 of file CTPPSPixelDigiToRaw.cc.

Constructor & Destructor Documentation

◆ CTPPSPixelDigiToRaw()

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

Definition at line 96 of file CTPPSPixelDigiToRaw.cc.

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

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

◆ ~CTPPSPixelDigiToRaw()

CTPPSPixelDigiToRaw::~CTPPSPixelDigiToRaw ( )
override

Definition at line 108 of file CTPPSPixelDigiToRaw.cc.

108 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 169 of file CTPPSPixelDigiToRaw.cc.

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

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), HLT_2018_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ produce()

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

Definition at line 115 of file CTPPSPixelDigiToRaw.cc.

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

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::get(), get, iEvent, LogDebug, taus_updatedMVAIds_cff::mapping, eostools::move(), CTPPSPixelDataFormatter::nDigis(), CTPPSPixelDataFormatter::nWords(), AlCaHLTBitMon_ParallelJobs::p, recordWatcher_, findQualityFiles::size, tCTPPSPixelDigi_, and v_iDdet2fed_.

Member Data Documentation

◆ allDigiCounter_

int CTPPSPixelDigiToRaw::allDigiCounter_
private

Definition at line 74 of file CTPPSPixelDigiToRaw.cc.

Referenced by produce().

◆ allWordCounter_

int CTPPSPixelDigiToRaw::allWordCounter_
private

Definition at line 75 of file CTPPSPixelDigiToRaw.cc.

Referenced by produce().

◆ debug_

bool CTPPSPixelDigiToRaw::debug_
private

Definition at line 76 of file CTPPSPixelDigiToRaw.cc.

Referenced by produce().

◆ eventCounter_

unsigned long CTPPSPixelDigiToRaw::eventCounter_
private

Definition at line 73 of file CTPPSPixelDigiToRaw.cc.

Referenced by produce().

◆ fedIds_

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

Definition at line 77 of file CTPPSPixelDigiToRaw.cc.

Referenced by produce().

◆ fPos_

CTPPSPixelFramePosition CTPPSPixelDigiToRaw::fPos_
private

Definition at line 82 of file CTPPSPixelDigiToRaw.cc.

◆ mappingLabel_

std::string CTPPSPixelDigiToRaw::mappingLabel_
private

Definition at line 78 of file CTPPSPixelDigiToRaw.cc.

◆ recordWatcher_

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

Definition at line 79 of file CTPPSPixelDigiToRaw.cc.

Referenced by produce().

◆ tCTPPSPixelDigi_

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

Definition at line 80 of file CTPPSPixelDigiToRaw.cc.

Referenced by CTPPSPixelDigiToRaw(), and produce().

◆ v_iDdet2fed_

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

Definition at line 81 of file CTPPSPixelDigiToRaw.cc.

Referenced by produce().

edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
CTPPSPixelDigiToRaw::eventCounter_
unsigned long eventCounter_
Definition: CTPPSPixelDigiToRaw.cc:73
CTPPSPixelDigiToRaw::allWordCounter_
int allWordCounter_
Definition: CTPPSPixelDigiToRaw.cc:75
CTPPSPixelDigiToRaw::debug_
bool debug_
Definition: CTPPSPixelDigiToRaw.cc:76
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
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:81
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
l1t_dqm_sourceclient-live_cfg.fedRawData
fedRawData
Definition: l1t_dqm_sourceclient-live_cfg.py:182
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::ESHandle
Definition: DTSurvey.h:22
CTPPSPixelDAQMappingRcd
Definition: CTPPSPixelDAQMappingRcd.h:23
CTPPSPixelDigiToRaw::fedIds_
std::set< unsigned int > fedIds_
Definition: CTPPSPixelDigiToRaw.cc:77
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:78
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSPixelDataFormatter::compare
static bool compare(const PPSPixelIndex &a, const PPSPixelIndex &b)
Definition: CTPPSPixelDataFormatter.h:91
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
CTPPSPixelDigiToRaw::allDigiCounter_
int allDigiCounter_
Definition: CTPPSPixelDigiToRaw.cc:74
CTPPSPixelDataFormatter::Digis
std::unordered_map< cms_uint32_t, DetDigis > Digis
Definition: CTPPSPixelDataFormatter.h:66
iEvent
int iEvent
Definition: GenABIO.cc:224
apvshotsanalyzer_cfi.digiCollection
digiCollection
Definition: apvshotsanalyzer_cfi.py:4
get
#define get
CTPPSPixelDigiToRaw::tCTPPSPixelDigi_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tCTPPSPixelDigi_
Definition: CTPPSPixelDigiToRaw.cc:80
CTPPSPixelDataFormatter
Definition: CTPPSPixelDataFormatter.h:53
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
CTPPSPixelDigiToRaw::recordWatcher_
edm::ESWatcher< CTPPSPixelDAQMappingRcd > recordWatcher_
Definition: CTPPSPixelDigiToRaw.cc:79
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:28
edm::InputTag
Definition: InputTag.h:15
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443