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
 
 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 Types

enum  { ssUndefined, ssTrackingStrip, ssTimingDiamond, ssTotemTiming }
 

Private Member Functions

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

Private Attributes

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

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 39 of file TotemVFATRawToDigi.cc.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

Constructor & Destructor Documentation

◆ TotemVFATRawToDigi()

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

Definition at line 68 of file TotemVFATRawToDigi.cc.

References analysisMaskToken, 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, subSystemName, and totemMappingToken.

69  : subSystemName(conf.getParameter<string>("subSystem")),
71  fedIds(conf.getParameter<vector<unsigned int>>("fedIds")),
72  rawDataUnpacker(conf.getParameterSet("RawUnpacking")),
73  rawToDigiConverter(conf.getParameterSet("RawToDigi")) {
74  fedDataToken = consumes<FEDRawDataCollection>(conf.getParameter<edm::InputTag>("rawDataTag"));
75 
76  // validate chosen subSystem
77  if (subSystemName == "TrackingStrip")
79  else if (subSystemName == "TimingDiamond")
81  else if (subSystemName == "TotemTiming")
83 
84  if (subSystem == ssUndefined)
85  throw cms::Exception("TotemVFATRawToDigi::TotemVFATRawToDigi")
86  << "Unknown sub-system string " << subSystemName << "." << endl;
87 
88  // FED (OptoRx) headers and footers
89  produces<vector<TotemFEDInfo>>(subSystemName);
90 
91  // declare products
93  produces<DetSetVector<TotemRPDigi>>(subSystemName);
94 
95  else if (subSystem == ssTimingDiamond)
96  produces<DetSetVector<CTPPSDiamondDigi>>(subSystemName);
97 
98  else if (subSystem == ssTotemTiming)
99  produces<DetSetVector<TotemTimingDigi>>(subSystemName);
100 
101  // set default IDs
102  if (fedIds.empty()) {
103  if (subSystem == ssTrackingStrip) {
105  fedIds.push_back(id);
106 
108  fedIds.push_back(id);
109  }
110 
111  else if (subSystem == ssTimingDiamond) {
113  fedIds.push_back(id);
114  }
115 
116  else if (subSystem == ssTotemTiming) {
118  ++id)
119  fedIds.push_back(id);
120  }
121  }
122 
123  // conversion status
124  produces<DetSetVector<TotemVFATStatus>>(subSystemName);
125 
126  totemMappingToken = esConsumes<TotemDAQMapping, TotemReadoutRcd>(ESInputTag("", subSystemName));
127  analysisMaskToken = esConsumes<TotemAnalysisMask, TotemReadoutRcd>(ESInputTag("", subSystemName));
128 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< TotemAnalysisMask, TotemReadoutRcd > analysisMaskToken
pps::RawDataUnpacker rawDataUnpacker
edm::ESGetToken< TotemDAQMapping, TotemReadoutRcd > totemMappingToken
enum TotemVFATRawToDigi::@504 subSystem
ParameterSet const & getParameterSet(std::string const &) const
std::vector< unsigned int > fedIds
edm::EDGetTokenT< FEDRawDataCollection > fedDataToken
RawToDigiConverter rawToDigiConverter

◆ ~TotemVFATRawToDigi()

TotemVFATRawToDigi::~TotemVFATRawToDigi ( )
override

Definition at line 130 of file TotemVFATRawToDigi.cc.

130 {}

Member Function Documentation

◆ endStream()

void TotemVFATRawToDigi::endStream ( )
override

Definition at line 177 of file TotemVFATRawToDigi.cc.

References RawToDigiConverter::printSummaries(), and rawToDigiConverter.

void printSummaries() const
Print error summaries.
RawToDigiConverter rawToDigiConverter

◆ produce()

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

Definition at line 132 of file TotemVFATRawToDigi.cc.

References edmPickEvents::event, ssTimingDiamond, ssTotemTiming, ssTrackingStrip, and subSystem.

132  {
133  if (subSystem == ssTrackingStrip)
134  run<DetSetVector<TotemRPDigi>>(event, es);
135 
136  else if (subSystem == ssTimingDiamond)
137  run<DetSetVector<CTPPSDiamondDigi>>(event, es);
138 
139  else if (subSystem == ssTotemTiming)
140  run<DetSetVector<TotemTimingDigi>>(event, es);
141 }
enum TotemVFATRawToDigi::@504 subSystem

◆ run()

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

Definition at line 144 of file TotemVFATRawToDigi.cc.

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

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

144  {
145  // get DAQ mapping
147 
148  // get analysis mask to mask channels
150 
151  // raw data handle
153  event.getByToken(fedDataToken, rawData);
154 
155  // book output products
156  vector<TotemFEDInfo> fedInfo;
157  DigiType digi;
158  DetSetVector<TotemVFATStatus> conversionStatus;
159 
160  // raw-data unpacking
161  SimpleVFATFrameCollection vfatCollection;
162  for (const auto &fedId : fedIds) {
163  const FEDRawData &data = rawData->FEDData(fedId);
164  if (data.size() > 0)
165  rawDataUnpacker.run(fedId, data, fedInfo, vfatCollection);
166  }
167 
168  // raw-to-digi conversion
169  rawToDigiConverter.run(vfatCollection, *mapping, *analysisMask, digi, conversionStatus);
170 
171  // commit products to event
172  event.put(make_unique<vector<TotemFEDInfo>>(fedInfo), subSystemName);
173  event.put(make_unique<DigiType>(digi), subSystemName);
174  event.put(make_unique<DetSetVector<TotemVFATStatus>>(conversionStatus), subSystemName);
175 }
edm::ESGetToken< TotemAnalysisMask, TotemReadoutRcd > analysisMaskToken
pps::RawDataUnpacker rawDataUnpacker
edm::ESGetToken< TotemDAQMapping, TotemReadoutRcd > totemMappingToken
std::vector< unsigned int > fedIds
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
int run(int fedId, const FEDRawData &data, std::vector< TotemFEDInfo > &fedInfoColl, SimpleVFATFrameCollection &coll) const
Unpack data from FED with fedId into ‘coll’ collection.
edm::EDGetTokenT< FEDRawDataCollection > fedDataToken
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
RawToDigiConverter rawToDigiConverter
void run(const VFATFrameCollection &coll, const TotemDAQMapping &mapping, const TotemAnalysisMask &mask, edm::DetSetVector< TotemRPDigi > &digi, edm::DetSetVector< TotemVFATStatus > &status)
Creates RP digi.

Member Data Documentation

◆ analysisMaskToken

edm::ESGetToken<TotemAnalysisMask, TotemReadoutRcd> TotemVFATRawToDigi::analysisMaskToken
private

Definition at line 56 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

◆ fedDataToken

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

Definition at line 54 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

◆ fedIds

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

Definition at line 52 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

◆ rawDataUnpacker

pps::RawDataUnpacker TotemVFATRawToDigi::rawDataUnpacker
private

Definition at line 58 of file TotemVFATRawToDigi.cc.

Referenced by run().

◆ rawToDigiConverter

RawToDigiConverter TotemVFATRawToDigi::rawToDigiConverter
private

Definition at line 59 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 48 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

◆ totemMappingToken

edm::ESGetToken<TotemDAQMapping, TotemReadoutRcd> TotemVFATRawToDigi::totemMappingToken
private

Definition at line 55 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().