CMS 3D CMS Logo

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

#include <temp/CTPPSTotemDigiToRaw/plugins/CTPPSTotemDigiToRaw.cc>

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

Public Member Functions

 CTPPSTotemDigiToRaw (const edm::ParameterSet &)
 
 ~CTPPSTotemDigiToRaw () 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 beginStream (edm::StreamID) override
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

int allDigiCounter_
 
int allWordCounter_
 
bool debug_
 
unsigned long eventCounter_
 
std::set< unsigned int > fedIds_
 
TotemFramePosition fPos_
 
edm::ESWatcher< TotemReadoutRcdrecordWatcher_
 
edm::ESGetToken< TotemDAQMapping, TotemReadoutRcdtTotemDAQMapping_
 
edm::EDGetTokenT< edm::DetSetVector< TotemRPDigi > > tTotemRPDigi_
 
std::vector< CTPPSTotemDataFormatter::PPSStripIndexv_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 60 of file CTPPSTotemDigiToRaw.cc.

Constructor & Destructor Documentation

◆ CTPPSTotemDigiToRaw()

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

Definition at line 96 of file CTPPSTotemDigiToRaw.cc.

98  //register your products
99  tTotemRPDigi_ = consumes<edm::DetSetVector<TotemRPDigi>>(iConfig.getParameter<edm::InputTag>("InputLabel"));
100  tTotemDAQMapping_ = esConsumes<TotemDAQMapping, TotemReadoutRcd>();
101  produces<FEDRawDataCollection>();
102 }

References edm::ParameterSet::getParameter(), tTotemDAQMapping_, and tTotemRPDigi_.

◆ ~CTPPSTotemDigiToRaw()

CTPPSTotemDigiToRaw::~CTPPSTotemDigiToRaw ( )
override

Definition at line 104 of file CTPPSTotemDigiToRaw.cc.

104  {
105  edm::LogInfo("CTPPSTotemDigiToRaw") << " CTPPSTotemDigiToRaw destructor!";
106 }

Member Function Documentation

◆ beginStream()

void CTPPSTotemDigiToRaw::beginStream ( edm::StreamID  )
overrideprivate

Definition at line 174 of file CTPPSTotemDigiToRaw.cc.

174 {}

◆ fillDescriptions()

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

Definition at line 177 of file CTPPSTotemDigiToRaw.cc.

177  {
179  desc.add<edm::InputTag>("InputLabel", edm::InputTag("RPSiDetDigitizer"));
180  descriptions.add("ctppsTotemRawData", desc);
181 }

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

◆ produce()

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

Definition at line 113 of file CTPPSTotemDigiToRaw.cc.

113  {
114  using namespace edm;
115  using namespace std;
116  eventCounter_++;
117 
119  iEvent.getByToken(tTotemRPDigi_, digiCollection);
120 
123 
124  int digiCounter = 0;
125  for (auto const& di : *digiCollection) {
126  digiCounter += (di.data).size();
127  digis[di.detId()] = di.data;
128  }
129  allDigiCounter_ += digiCounter;
131  // label of the CTPPS sub-system
132  if (recordWatcher_.check(iSetup)) {
134  for (const auto& p : mapping->VFATMapping) {
135  //get TotemVFATInfo information
136  fedIds_.emplace(p.first.getFEDId());
137  CTPPSTotemDataFormatter::PPSStripIndex iDdet2fed = {(p.second.symbolicID).symbolicID,
138  p.second.hwID,
139  p.first.getFEDId(),
140  p.first.getIdxInFiber(),
141  p.first.getGOHId()};
142  v_iDdet2fed_.emplace_back(iDdet2fed);
143  }
144  }
145 
146  CTPPSTotemDataFormatter formatter(mapping->VFATMapping);
147 
148  // create product (raw data)
149  auto buffers = std::make_unique<FEDRawDataCollection>();
150 
152 
153  // convert data to raw
154  formatter.formatRawData(iEvent.id().event(), rawdata, digis, v_iDdet2fed_);
155 
156  // pack raw data into collection
157  for (auto it : fedIds_) {
158  FEDRawData& fedRawData = buffers->FEDData(it);
159  CTPPSTotemDataFormatter::RawData::iterator fedbuffer = rawdata.find(it);
160  if (fedbuffer != rawdata.end())
161  fedRawData = fedbuffer->second;
162  }
163  allWordCounter_ += formatter.nWords();
164 
165  if (debug_)
166  LogDebug("CTPPSTotemDigiToRaw") << "Words/Digis this iEvent: " << digiCounter << "(fm:" << formatter.nDigis()
167  << ")/" << formatter.nWords() << " all: " << allDigiCounter_ << "/"
168  << allWordCounter_;
169 
170  iEvent.put(std::move(buffers));
171 }

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

Member Data Documentation

◆ allDigiCounter_

int CTPPSTotemDigiToRaw::allDigiCounter_
private

Definition at line 73 of file CTPPSTotemDigiToRaw.cc.

Referenced by produce().

◆ allWordCounter_

int CTPPSTotemDigiToRaw::allWordCounter_
private

Definition at line 74 of file CTPPSTotemDigiToRaw.cc.

Referenced by produce().

◆ debug_

bool CTPPSTotemDigiToRaw::debug_
private

Definition at line 75 of file CTPPSTotemDigiToRaw.cc.

Referenced by produce().

◆ eventCounter_

unsigned long CTPPSTotemDigiToRaw::eventCounter_
private

Definition at line 71 of file CTPPSTotemDigiToRaw.cc.

Referenced by produce().

◆ fedIds_

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

Definition at line 72 of file CTPPSTotemDigiToRaw.cc.

Referenced by produce().

◆ fPos_

TotemFramePosition CTPPSTotemDigiToRaw::fPos_
private

Definition at line 80 of file CTPPSTotemDigiToRaw.cc.

◆ recordWatcher_

edm::ESWatcher<TotemReadoutRcd> CTPPSTotemDigiToRaw::recordWatcher_
private

Definition at line 76 of file CTPPSTotemDigiToRaw.cc.

Referenced by produce().

◆ tTotemDAQMapping_

edm::ESGetToken<TotemDAQMapping, TotemReadoutRcd> CTPPSTotemDigiToRaw::tTotemDAQMapping_
private

Definition at line 78 of file CTPPSTotemDigiToRaw.cc.

Referenced by CTPPSTotemDigiToRaw(), and produce().

◆ tTotemRPDigi_

edm::EDGetTokenT<edm::DetSetVector<TotemRPDigi> > CTPPSTotemDigiToRaw::tTotemRPDigi_
private

Definition at line 77 of file CTPPSTotemDigiToRaw.cc.

Referenced by CTPPSTotemDigiToRaw(), and produce().

◆ v_iDdet2fed_

std::vector<CTPPSTotemDataFormatter::PPSStripIndex> CTPPSTotemDigiToRaw::v_iDdet2fed_
private

Definition at line 79 of file CTPPSTotemDigiToRaw.cc.

Referenced by produce().

edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
CTPPSTotemDigiToRaw::tTotemRPDigi_
edm::EDGetTokenT< edm::DetSetVector< TotemRPDigi > > tTotemRPDigi_
Definition: CTPPSTotemDigiToRaw.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:89353
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CTPPSTotemDigiToRaw::allDigiCounter_
int allDigiCounter_
Definition: CTPPSTotemDigiToRaw.cc:73
CTPPSTotemDataFormatter::Digis
std::unordered_map< cms_uint32_t, DetDigis > Digis
Definition: CTPPSTotemDataFormatter.h:49
CTPPSTotemDataFormatter::PPSStripIndex
Definition: CTPPSTotemDataFormatter.h:56
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle
Definition: AssociativeIterator.h:50
CTPPSTotemDigiToRaw::recordWatcher_
edm::ESWatcher< TotemReadoutRcd > recordWatcher_
Definition: CTPPSTotemDigiToRaw.cc:76
FEDRawData
Definition: FEDRawData.h:19
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
CTPPSTotemDigiToRaw::eventCounter_
unsigned long eventCounter_
Definition: CTPPSTotemDigiToRaw.cc:71
edm::ESHandle
Definition: DTSurvey.h:22
CTPPSTotemDataFormatter::RawData
std::unordered_map< int, FEDRawData > RawData
Definition: CTPPSTotemDataFormatter.h:47
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
CTPPSTotemDataFormatter::compare
static bool compare(const PPSStripIndex &a, const PPSStripIndex &b)
Definition: CTPPSTotemDataFormatter.h:69
iEvent
int iEvent
Definition: GenABIO.cc:224
CTPPSTotemDigiToRaw::tTotemDAQMapping_
edm::ESGetToken< TotemDAQMapping, TotemReadoutRcd > tTotemDAQMapping_
Definition: CTPPSTotemDigiToRaw.cc:78
CTPPSTotemDigiToRaw::allWordCounter_
int allWordCounter_
Definition: CTPPSTotemDigiToRaw.cc:74
CTPPSTotemDigiToRaw::v_iDdet2fed_
std::vector< CTPPSTotemDataFormatter::PPSStripIndex > v_iDdet2fed_
Definition: CTPPSTotemDigiToRaw.cc:79
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
apvshotsanalyzer_cfi.digiCollection
digiCollection
Definition: apvshotsanalyzer_cfi.py:4
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
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
CTPPSTotemDigiToRaw::fedIds_
std::set< unsigned int > fedIds_
Definition: CTPPSTotemDigiToRaw.cc:72
CTPPSTotemDataFormatter
Definition: CTPPSTotemDataFormatter.h:37
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:29
CTPPSTotemDigiToRaw::debug_
bool debug_
Definition: CTPPSTotemDigiToRaw.cc:75
edm::InputTag
Definition: InputTag.h:15
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443