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 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 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::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 59 of file CTPPSTotemDigiToRaw.cc.

Constructor & Destructor Documentation

◆ CTPPSTotemDigiToRaw()

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

Definition at line 94 of file CTPPSTotemDigiToRaw.cc.

96  //register your products
97  tTotemRPDigi_ = consumes<edm::DetSetVector<TotemRPDigi>>(iConfig.getParameter<edm::InputTag>("InputLabel"));
98  produces<FEDRawDataCollection>();
99 }

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

◆ ~CTPPSTotemDigiToRaw()

CTPPSTotemDigiToRaw::~CTPPSTotemDigiToRaw ( )
override

Definition at line 101 of file CTPPSTotemDigiToRaw.cc.

101  {
102  edm::LogInfo("CTPPSTotemDigiToRaw") << " CTPPSTotemDigiToRaw destructor!";
103 }

Member Function Documentation

◆ beginStream()

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

Definition at line 171 of file CTPPSTotemDigiToRaw.cc.

171 {}

◆ fillDescriptions()

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

Definition at line 174 of file CTPPSTotemDigiToRaw.cc.

174  {
176  desc.add<edm::InputTag>("InputLabel", edm::InputTag("RPSiDetDigitizer"));
177  descriptions.add("ctppsTotemRawData", desc);
178 }

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

◆ produce()

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

Definition at line 110 of file CTPPSTotemDigiToRaw.cc.

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

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

Member Data Documentation

◆ allDigiCounter_

int CTPPSTotemDigiToRaw::allDigiCounter_
private

Definition at line 72 of file CTPPSTotemDigiToRaw.cc.

Referenced by produce().

◆ allWordCounter_

int CTPPSTotemDigiToRaw::allWordCounter_
private

Definition at line 73 of file CTPPSTotemDigiToRaw.cc.

Referenced by produce().

◆ debug_

bool CTPPSTotemDigiToRaw::debug_
private

Definition at line 74 of file CTPPSTotemDigiToRaw.cc.

Referenced by produce().

◆ eventCounter_

unsigned long CTPPSTotemDigiToRaw::eventCounter_
private

Definition at line 70 of file CTPPSTotemDigiToRaw.cc.

Referenced by produce().

◆ fedIds_

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

Definition at line 71 of file CTPPSTotemDigiToRaw.cc.

Referenced by produce().

◆ fPos_

TotemFramePosition CTPPSTotemDigiToRaw::fPos_
private

Definition at line 78 of file CTPPSTotemDigiToRaw.cc.

◆ recordWatcher_

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

Definition at line 75 of file CTPPSTotemDigiToRaw.cc.

Referenced by produce().

◆ tTotemRPDigi_

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

Definition at line 76 of file CTPPSTotemDigiToRaw.cc.

Referenced by CTPPSTotemDigiToRaw(), and produce().

◆ v_iDdet2fed_

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

Definition at line 77 of file CTPPSTotemDigiToRaw.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
CTPPSTotemDigiToRaw::tTotemRPDigi_
edm::EDGetTokenT< edm::DetSetVector< TotemRPDigi > > tTotemRPDigi_
Definition: CTPPSTotemDigiToRaw.cc:76
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::LogInfo
Definition: MessageLogger.h:254
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CTPPSTotemDigiToRaw::allDigiCounter_
int allDigiCounter_
Definition: CTPPSTotemDigiToRaw.cc:72
CTPPSTotemDataFormatter::Digis
std::unordered_map< cms_uint32_t, DetDigis > Digis
Definition: CTPPSTotemDataFormatter.h:49
CTPPSTotemDataFormatter::PPSStripIndex
Definition: CTPPSTotemDataFormatter.h:56
TotemReadoutRcd
EventSetup record for TOTEM readout-related information.
Definition: TotemReadoutRcd.h:16
edm::Handle
Definition: AssociativeIterator.h:50
CTPPSTotemDigiToRaw::recordWatcher_
edm::ESWatcher< TotemReadoutRcd > recordWatcher_
Definition: CTPPSTotemDigiToRaw.cc:75
FEDRawData
Definition: FEDRawData.h:19
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
CTPPSTotemDigiToRaw::eventCounter_
unsigned long eventCounter_
Definition: CTPPSTotemDigiToRaw.cc:70
edm::ESHandle
Definition: DTSurvey.h:22
CTPPSTotemDataFormatter::RawData
std::unordered_map< int, FEDRawData > RawData
Definition: CTPPSTotemDataFormatter.h:47
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
CTPPSTotemDataFormatter::compare
static bool compare(const PPSStripIndex &a, const PPSStripIndex &b)
Definition: CTPPSTotemDataFormatter.h:69
iEvent
int iEvent
Definition: GenABIO.cc:224
CTPPSTotemDigiToRaw::allWordCounter_
int allWordCounter_
Definition: CTPPSTotemDigiToRaw.cc:73
CTPPSTotemDigiToRaw::v_iDdet2fed_
std::vector< CTPPSTotemDataFormatter::PPSStripIndex > v_iDdet2fed_
Definition: CTPPSTotemDigiToRaw.cc:77
apvshotsanalyzer_cfi.digiCollection
digiCollection
Definition: apvshotsanalyzer_cfi.py:4
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
CTPPSTotemDigiToRaw::fedIds_
std::set< unsigned int > fedIds_
Definition: CTPPSTotemDigiToRaw.cc:71
CTPPSTotemDataFormatter
Definition: CTPPSTotemDataFormatter.h:37
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:28
CTPPSTotemDigiToRaw::debug_
bool debug_
Definition: CTPPSTotemDigiToRaw.cc:74
edm::InputTag
Definition: InputTag.h:15
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443