CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
TotemTriggerRawToDigi Class Reference
Inheritance diagram for TotemTriggerRawToDigi:
edm::stream::EDProducer<>

Public Member Functions

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

Private Member Functions

int ProcessLoneGFrame (uint64_t *oBuf, unsigned long size, TotemTriggerCounters &data)
 Process one LoneG frame. More...
 

Private Attributes

edm::EDGetTokenT< FEDRawDataCollectionfedDataToken
 
unsigned int fedId
 

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

Definition at line 23 of file TotemTriggerRawToDigi.cc.

Constructor & Destructor Documentation

◆ TotemTriggerRawToDigi()

TotemTriggerRawToDigi::TotemTriggerRawToDigi ( const edm::ParameterSet conf)
explicit

Definition at line 42 of file TotemTriggerRawToDigi.cc.

44  : fedId(conf.getParameter<unsigned int>("fedId")) {
45  fedDataToken = consumes<FEDRawDataCollection>(conf.getParameter<edm::InputTag>("rawDataTag"));
46 
47  if (fedId == 0)
49 
50  produces<TotemTriggerCounters>();

References fedDataToken, fedId, edm::ParameterSet::getParameter(), and FEDNumbering::MINTotemTriggerFEDID.

◆ ~TotemTriggerRawToDigi()

TotemTriggerRawToDigi::~TotemTriggerRawToDigi ( )
override

Definition at line 52 of file TotemTriggerRawToDigi.cc.

Member Function Documentation

◆ ProcessLoneGFrame()

int TotemTriggerRawToDigi::ProcessLoneGFrame ( uint64_t *  oBuf,
unsigned long  size,
TotemTriggerCounters data 
)
private

Process one LoneG frame.

Definition at line 73 of file TotemTriggerRawToDigi.cc.

74  {
75  if (size != 20) {
76  LogError("Totem") << "Error in TotemTriggerRawToDigi::ProcessLoneGFrame > "
77  << "Wrong LoneG frame size: " << size << " (shall be 20)." << endl;
78  return 1;
79  }
80 
81  // buffer mapping: OptoRx buffer --> LoneG buffer
82  uint64_t buf[5];
83  for (unsigned int i = 0; i < 5; i++)
84  buf[i] = 0;
85 
86  for (unsigned int i = 0; i < 20; i++) {
87  int row = i / 4;
88  int col = i % 4;
89  buf[row] |= (oBuf[i] & 0xFFFF) << (col * 16);
90  }
91 
92  td.type = (buf[0] >> 56) & 0xF;
93  td.event_num = (buf[0] >> 32) & 0xFFFFFF;
94  td.bunch_num = (buf[0] >> 20) & 0xFFF;
95  td.src_id = (buf[0] >> 8) & 0xFFF;
96 
97  td.orbit_num = (buf[1] >> 32) & 0xFFFFFFFF;
98  td.revision_num = (buf[1] >> 24) & 0xFF;
99 
100  td.run_num = (buf[2] >> 32) & 0xFFFFFFFF;
101  td.trigger_num = (buf[2] >> 0) & 0xFFFFFFFF;
102 
103  td.inhibited_triggers_num = (buf[3] >> 32) & 0xFFFFFFFF;
104  td.input_status_bits = (buf[3] >> 0) & 0xFFFFFFFF;
105 
106 #ifdef DEBUG
107  printf(">> RawDataUnpacker::ProcessLoneGFrame > size = %li\n", size);
108  printf(
109  "\ttype = %x, event number = %x, bunch number = %x, id = %x\n", td.type, td.event_num, td.bunch_num, td.src_id);
110  printf("\torbit number = %x, revision = %x\n", td.orbit_num, td.revision_num);
111  printf("\trun number = %x, trigger number = %x\n", td.run_num, td.trigger_num);
112  printf("\tinhibited triggers = %x, input status bits = %x\n", td.inhibited_triggers_num, td.input_status_bits);
113 #endif
114 
115  return 0;

References visDQMUpload::buf, TotemTriggerCounters::bunch_num, cuy::col, TotemTriggerCounters::event_num, mps_fire::i, TotemTriggerCounters::inhibited_triggers_num, TotemTriggerCounters::input_status_bits, TotemTriggerCounters::orbit_num, TotemTriggerCounters::revision_num, TotemTriggerCounters::run_num, findQualityFiles::size, TotemTriggerCounters::src_id, TotemTriggerCounters::trigger_num, and TotemTriggerCounters::type.

Referenced by produce().

◆ produce()

void TotemTriggerRawToDigi::produce ( edm::Event event,
const edm::EventSetup es 
)
override

Definition at line 54 of file TotemTriggerRawToDigi.cc.

55  {
56  // raw data handle
58  event.getByToken(fedDataToken, rawData);
59 
60  // book output products
61  TotemTriggerCounters totemTriggerCounters;
62 
63  // unpack trigger data
64  const FEDRawData &data = rawData->FEDData(fedId);
65  uint64_t *buf = (uint64_t *)data.data();
66  unsigned int sizeInWords = data.size() / 8; // bytes -> words
67  if (data.size() > 0)
68  ProcessLoneGFrame(buf + 2, sizeInWords - 4, totemTriggerCounters);
69 
70  // commit products to event
71  event.put(make_unique<TotemTriggerCounters>(totemTriggerCounters));

References visDQMUpload::buf, data, fedDataToken, fedId, ProcessLoneGFrame(), and l1tstage2_dqm_sourceclient-live_cfg::rawData.

Member Data Documentation

◆ fedDataToken

edm::EDGetTokenT<FEDRawDataCollection> TotemTriggerRawToDigi::fedDataToken
private

Definition at line 38 of file TotemTriggerRawToDigi.cc.

Referenced by produce(), and TotemTriggerRawToDigi().

◆ fedId

unsigned int TotemTriggerRawToDigi::fedId
private

Definition at line 36 of file TotemTriggerRawToDigi.cc.

Referenced by produce(), and TotemTriggerRawToDigi().

mps_fire.i
i
Definition: mps_fire.py:428
cuy.col
col
Definition: cuy.py:1009
l1tstage2_dqm_sourceclient-live_cfg.rawData
rawData
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:163
FEDNumbering::MINTotemTriggerFEDID
Definition: FEDNumbering.h:33
TotemTriggerRawToDigi::ProcessLoneGFrame
int ProcessLoneGFrame(uint64_t *oBuf, unsigned long size, TotemTriggerCounters &data)
Process one LoneG frame.
Definition: TotemTriggerRawToDigi.cc:73
edm::Handle< FEDRawDataCollection >
FEDRawData
Definition: FEDRawData.h:19
TotemTriggerRawToDigi::fedId
unsigned int fedId
Definition: TotemTriggerRawToDigi.cc:36
TotemTriggerRawToDigi::fedDataToken
edm::EDGetTokenT< FEDRawDataCollection > fedDataToken
Definition: TotemTriggerRawToDigi.cc:38
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
visDQMUpload.buf
buf
Definition: visDQMUpload.py:160
TotemTriggerCounters
Definition: TotemTriggerCounters.h:14
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
edm::InputTag
Definition: InputTag.h:15
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443