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,
  ssTotemT2
}
 

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

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

70  : subSystemName(conf.getParameter<string>("subSystem")),
72  fedIds(conf.getParameter<vector<unsigned int>>("fedIds")),
73  rawDataUnpacker(conf.getParameterSet("RawUnpacking")),
74  rawToDigiConverter(conf.getParameterSet("RawToDigi")) {
75  fedDataToken = consumes<FEDRawDataCollection>(conf.getParameter<edm::InputTag>("rawDataTag"));
76 
77  // validate chosen subSystem
78  if (subSystemName == "TrackingStrip")
80  else if (subSystemName == "TimingDiamond")
82  else if (subSystemName == "TotemTiming")
84  else if (subSystemName == "TotemT2")
86 
87  if (subSystem == ssUndefined)
88  throw cms::Exception("TotemVFATRawToDigi::TotemVFATRawToDigi")
89  << "Unknown sub-system string " << subSystemName << "." << endl;
90 
91  // FED (OptoRx) headers and footers
92  produces<vector<TotemFEDInfo>>(subSystemName);
93 
94  // declare products
96  produces<DetSetVector<TotemRPDigi>>(subSystemName);
97 
98  else if (subSystem == ssTimingDiamond)
99  produces<DetSetVector<CTPPSDiamondDigi>>(subSystemName);
100 
101  else if (subSystem == ssTotemTiming)
102  produces<DetSetVector<TotemTimingDigi>>(subSystemName);
103 
104  else if (subSystem == ssTotemT2)
105  produces<edmNew::DetSetVector<TotemT2Digi>>(subSystemName);
106 
107  // set default IDs
108  if (fedIds.empty()) {
109  if (subSystem == ssTrackingStrip) {
111  fedIds.push_back(id);
112 
114  fedIds.push_back(id);
115  }
116 
117  else if (subSystem == ssTimingDiamond) {
119  fedIds.push_back(id);
120  }
121 
122  else if (subSystem == ssTotemTiming) {
124  ++id)
125  fedIds.push_back(id);
126  }
127 
128  else if (subSystem == ssTotemT2) {
130  fedIds.push_back(id);
131  }
132  }
133 
134  // conversion status
135  produces<DetSetVector<TotemVFATStatus>>(subSystemName);
136 
137  totemMappingToken = esConsumes<TotemDAQMapping, TotemReadoutRcd>(ESInputTag("", subSystemName));
138  analysisMaskToken = esConsumes<TotemAnalysisMask, TotemReadoutRcd>(ESInputTag("", subSystemName));
139 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
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 141 of file TotemVFATRawToDigi.cc.

141 {}

Member Function Documentation

◆ endStream()

void TotemVFATRawToDigi::endStream ( )
override

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

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

143  {
144  if (subSystem == ssTrackingStrip)
145  run<DetSetVector<TotemRPDigi>>(event, es);
146 
147  else if (subSystem == ssTimingDiamond)
148  run<DetSetVector<CTPPSDiamondDigi>>(event, es);
149 
150  else if (subSystem == ssTotemTiming)
151  run<DetSetVector<TotemTimingDigi>>(event, es);
152 
153  else if (subSystem == ssTotemT2)
154  run<edmNew::DetSetVector<TotemT2Digi>>(event, es);
155 }
enum TotemVFATRawToDigi::@504 subSystem

◆ run()

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

Definition at line 158 of file TotemVFATRawToDigi.cc.

References analysisMaskToken, data, ALCARECOTkAlDQM_cff::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().

158  {
159  // get DAQ mapping
161 
162  // get analysis mask to mask channels
164 
165  // raw data handle
167  event.getByToken(fedDataToken, rawData);
168 
169  // book output products
170  vector<TotemFEDInfo> fedInfo;
171  DigiType digi;
172  DetSetVector<TotemVFATStatus> conversionStatus;
173 
174  // raw-data unpacking
175  SimpleVFATFrameCollection vfatCollection;
176  for (const auto &fedId : fedIds) {
177  const FEDRawData &data = rawData->FEDData(fedId);
178  if (data.size() > 0)
179  rawDataUnpacker.run(fedId, data, fedInfo, vfatCollection);
180  }
181 
182  // raw-to-digi conversion
183  rawToDigiConverter.run(vfatCollection, *mapping, *analysisMask, digi, conversionStatus);
184 
185  // commit products to event
186  event.put(make_unique<vector<TotemFEDInfo>>(fedInfo), subSystemName);
187  event.put(make_unique<DigiType>(digi), subSystemName);
188  event.put(make_unique<DetSetVector<TotemVFATStatus>>(conversionStatus), subSystemName);
189 }
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:130
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 57 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

◆ fedDataToken

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

Definition at line 55 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

◆ fedIds

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

Definition at line 53 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

◆ rawDataUnpacker

pps::RawDataUnpacker TotemVFATRawToDigi::rawDataUnpacker
private

Definition at line 59 of file TotemVFATRawToDigi.cc.

Referenced by run().

◆ rawToDigiConverter

RawToDigiConverter TotemVFATRawToDigi::rawToDigiConverter
private

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

Referenced by run(), and TotemVFATRawToDigi().

◆ totemMappingToken

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

Definition at line 56 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().