CMS 3D CMS Logo

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

Public Member Functions

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

Private Types

enum  { ssUndefined, ssTrackingStrip, ssTimingDiamond, ssTotemTiming }
 

Private Member Functions

template<typename DigiType >
void run (edm::Event &, const edm::EventSetup &)
 

Private Attributes

edm::EDGetTokenT< FEDRawDataCollectionfedDataToken
 
std::vector< unsigned int > fedIds
 
pps::RawDataUnpacker rawDataUnpacker
 
RawToDigiConverter rawToDigiConverter
 
enum TotemVFATRawToDigi:: { ... }  subSystem
 
std::string subSystemName
 

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

Definition at line 38 of file TotemVFATRawToDigi.cc.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
ssUndefined 
ssTrackingStrip 
ssTimingDiamond 
ssTotemTiming 

Definition at line 54 of file TotemVFATRawToDigi.cc.

Constructor & Destructor Documentation

◆ TotemVFATRawToDigi()

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

Definition at line 65 of file TotemVFATRawToDigi.cc.

66  : subSystemName(conf.getParameter<string>("subSystem")),
68  fedIds(conf.getParameter<vector<unsigned int>>("fedIds")),
69  rawDataUnpacker(conf.getParameterSet("RawUnpacking")),
70  rawToDigiConverter(conf.getParameterSet("RawToDigi")) {
71  fedDataToken = consumes<FEDRawDataCollection>(conf.getParameter<edm::InputTag>("rawDataTag"));
72 
73  // validate chosen subSystem
74  if (subSystemName == "TrackingStrip")
76  else if (subSystemName == "TimingDiamond")
78  else if (subSystemName == "TotemTiming")
80 
81  if (subSystem == ssUndefined)
82  throw cms::Exception("TotemVFATRawToDigi::TotemVFATRawToDigi")
83  << "Unknown sub-system string " << subSystemName << "." << endl;
84 
85  // FED (OptoRx) headers and footers
86  produces<vector<TotemFEDInfo>>(subSystemName);
87 
88  // declare products
90  produces<DetSetVector<TotemRPDigi>>(subSystemName);
91 
92  else if (subSystem == ssTimingDiamond)
93  produces<DetSetVector<CTPPSDiamondDigi>>(subSystemName);
94 
95  else if (subSystem == ssTotemTiming)
96  produces<DetSetVector<TotemTimingDigi>>(subSystemName);
97 
98  // set default IDs
99  if (fedIds.empty()) {
100  if (subSystem == ssTrackingStrip) {
102  fedIds.push_back(id);
103 
105  fedIds.push_back(id);
106  }
107 
108  else if (subSystem == ssTimingDiamond) {
110  fedIds.push_back(id);
111  }
112 
113  else if (subSystem == ssTotemTiming) {
115  ++id)
116  fedIds.push_back(id);
117  }
118  }
119 
120  // conversion status
121  produces<DetSetVector<TotemVFATStatus>>(subSystemName);
122 }

References Exception, fedDataToken, fedIds, edm::ParameterSet::getParameter(), triggerObjects_cff::id, FEDNumbering::MAXCTPPSDiamondFEDID, FEDNumbering::MAXTotemRPHorizontalFEDID, FEDNumbering::MAXTotemRPTimingVerticalFEDID, FEDNumbering::MAXTotemRPVerticalFEDID, FEDNumbering::MINCTPPSDiamondFEDID, FEDNumbering::MINTotemRPHorizontalFEDID, FEDNumbering::MINTotemRPTimingVerticalFEDID, FEDNumbering::MINTotemRPVerticalFEDID, ssTimingDiamond, ssTotemTiming, ssTrackingStrip, ssUndefined, subSystem, and subSystemName.

◆ ~TotemVFATRawToDigi()

TotemVFATRawToDigi::~TotemVFATRawToDigi ( )
override

Definition at line 124 of file TotemVFATRawToDigi.cc.

124 {}

Member Function Documentation

◆ endStream()

void TotemVFATRawToDigi::endStream ( )
override

◆ produce()

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

Definition at line 126 of file TotemVFATRawToDigi.cc.

126  {
127  if (subSystem == ssTrackingStrip)
128  run<DetSetVector<TotemRPDigi>>(event, es);
129 
130  else if (subSystem == ssTimingDiamond)
131  run<DetSetVector<CTPPSDiamondDigi>>(event, es);
132 
133  else if (subSystem == ssTotemTiming)
134  run<DetSetVector<TotemTimingDigi>>(event, es);
135 }

References event(), ssTimingDiamond, ssTotemTiming, ssTrackingStrip, and subSystem.

◆ run()

template<typename DigiType >
void TotemVFATRawToDigi::run ( edm::Event event,
const edm::EventSetup es 
)
private

Definition at line 138 of file TotemVFATRawToDigi.cc.

138  {
139  // get DAQ mapping
142 
143  // get analysis mask to mask channels
144  ESHandle<TotemAnalysisMask> analysisMask;
145  es.get<TotemReadoutRcd>().get(subSystemName, analysisMask);
146 
147  // raw data handle
149  event.getByToken(fedDataToken, rawData);
150 
151  // book output products
152  vector<TotemFEDInfo> fedInfo;
153  DigiType digi;
154  DetSetVector<TotemVFATStatus> conversionStatus;
155 
156  // raw-data unpacking
157  SimpleVFATFrameCollection vfatCollection;
158  for (const auto &fedId : fedIds) {
159  const FEDRawData &data = rawData->FEDData(fedId);
160  if (data.size() > 0)
161  rawDataUnpacker.run(fedId, data, fedInfo, vfatCollection);
162  }
163 
164  // raw-to-digi conversion
165  rawToDigiConverter.run(vfatCollection, *mapping, *analysisMask, digi, conversionStatus);
166 
167  // commit products to event
168  event.put(make_unique<vector<TotemFEDInfo>>(fedInfo), subSystemName);
169  event.put(make_unique<DigiType>(digi), subSystemName);
170  event.put(make_unique<DetSetVector<TotemVFATStatus>>(conversionStatus), subSystemName);
171 }

References data, sistriplas_dqm_sourceclient-live_cfg::DigiType, fedDataToken, l1tstage2_dqm_sourceclient-live_cfg::fedId, fedIds, edm::EventSetup::get(), get, taus_updatedMVAIds_cff::mapping, l1tstage2_dqm_sourceclient-live_cfg::rawData, rawDataUnpacker, rawToDigiConverter, RawToDigiConverter::run(), pps::RawDataUnpacker::run(), and subSystemName.

Referenced by Types.EventID::cppID(), and Types.LuminosityBlockID::cppID().

Member Data Documentation

◆ fedDataToken

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

Definition at line 58 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

◆ fedIds

std::vector<unsigned int> TotemVFATRawToDigi::fedIds
private

Definition at line 56 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

◆ rawDataUnpacker

pps::RawDataUnpacker TotemVFATRawToDigi::rawDataUnpacker
private

Definition at line 60 of file TotemVFATRawToDigi.cc.

Referenced by run().

◆ rawToDigiConverter

RawToDigiConverter TotemVFATRawToDigi::rawToDigiConverter
private

Definition at line 61 of file TotemVFATRawToDigi.cc.

Referenced by endStream(), and run().

◆ subSystem

enum { ... } TotemVFATRawToDigi::subSystem

Referenced by produce(), and TotemVFATRawToDigi().

◆ subSystemName

std::string TotemVFATRawToDigi::subSystemName
private

Definition at line 52 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

edm::DetSetVector
Definition: DetSetVector.h:61
TotemVFATRawToDigi::ssTimingDiamond
Definition: TotemVFATRawToDigi.cc:54
FEDNumbering::MAXTotemRPVerticalFEDID
Definition: FEDNumbering.h:40
FEDNumbering::MINTotemRPVerticalFEDID
Definition: FEDNumbering.h:39
l1tstage2_dqm_sourceclient-live_cfg.rawData
rawData
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:156
FEDNumbering::MAXTotemRPTimingVerticalFEDID
Definition: FEDNumbering.h:42
TotemReadoutRcd
EventSetup record for TOTEM readout-related information.
Definition: TotemReadoutRcd.h:16
edm::Handle
Definition: AssociativeIterator.h:50
TotemVFATRawToDigi::fedDataToken
edm::EDGetTokenT< FEDRawDataCollection > fedDataToken
Definition: TotemVFATRawToDigi.cc:58
FEDRawData
Definition: FEDRawData.h:19
TotemVFATRawToDigi::ssTotemTiming
Definition: TotemVFATRawToDigi.cc:54
FEDNumbering::MAXCTPPSDiamondFEDID
Definition: FEDNumbering.h:38
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
edm::ESHandle
Definition: DTSurvey.h:22
RawToDigiConverter::run
void run(const VFATFrameCollection &coll, const TotemDAQMapping &mapping, const TotemAnalysisMask &mask, edm::DetSetVector< TotemRPDigi > &digi, edm::DetSetVector< TotemVFATStatus > &status)
Creates RP digi.
Definition: RawToDigiConverter.cc:176
TotemVFATRawToDigi::ssUndefined
Definition: TotemVFATRawToDigi.cc:54
FEDNumbering::MINTotemRPHorizontalFEDID
Definition: FEDNumbering.h:35
sistriplas_dqm_sourceclient-live_cfg.DigiType
DigiType
Definition: sistriplas_dqm_sourceclient-live_cfg.py:46
SimpleVFATFrameCollection
Definition: SimpleVFATFrameCollection.h:19
TotemVFATRawToDigi::ssTrackingStrip
Definition: TotemVFATRawToDigi.cc:54
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:82
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
TotemVFATRawToDigi::subSystemName
std::string subSystemName
Definition: TotemVFATRawToDigi.cc:52
FEDNumbering::MINCTPPSDiamondFEDID
Definition: FEDNumbering.h:37
FEDNumbering::MAXTotemRPHorizontalFEDID
Definition: FEDNumbering.h:36
FEDNumbering::MINTotemRPTimingVerticalFEDID
Definition: FEDNumbering.h:41
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
TotemVFATRawToDigi::subSystem
enum TotemVFATRawToDigi::@430 subSystem
TotemVFATRawToDigi::fedIds
std::vector< unsigned int > fedIds
Definition: TotemVFATRawToDigi.cc:56
Exception
Definition: hltDiff.cc:246
pps::RawDataUnpacker::run
int run(int fedId, const FEDRawData &data, std::vector< TotemFEDInfo > &fedInfoColl, SimpleVFATFrameCollection &coll) const
Unpack data from FED with fedId into ‘coll’ collection.
Definition: RawDataUnpacker.cc:20
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
event
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of "!*" before the partial wildcard feature was incorporated). The per-event "cost" of each negative criterion with multiple relevant triggers is about the same as ! *was in the past
TotemVFATRawToDigi::rawDataUnpacker
pps::RawDataUnpacker rawDataUnpacker
Definition: TotemVFATRawToDigi.cc:60
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:28
edm::InputTag
Definition: InputTag.h:15
RawToDigiConverter::printSummaries
void printSummaries() const
Print error summaries.
Definition: RawToDigiConverter.cc:382
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2121
TotemVFATRawToDigi::rawToDigiConverter
RawToDigiConverter rawToDigiConverter
Definition: TotemVFATRawToDigi.cc:61