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 hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () 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::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<>
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 39 of file TotemVFATRawToDigi.cc.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
ssUndefined 
ssTrackingStrip 
ssTimingDiamond 
ssTotemTiming 

Definition at line 55 of file TotemVFATRawToDigi.cc.

Constructor & Destructor Documentation

◆ TotemVFATRawToDigi()

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

Definition at line 68 of file TotemVFATRawToDigi.cc.

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 }

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.

◆ ~TotemVFATRawToDigi()

TotemVFATRawToDigi::~TotemVFATRawToDigi ( )
override

Definition at line 130 of file TotemVFATRawToDigi.cc.

130 {}

Member Function Documentation

◆ endStream()

void TotemVFATRawToDigi::endStream ( )
override

◆ produce()

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

Definition at line 132 of file TotemVFATRawToDigi.cc.

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 }

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

◆ run()

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

Definition at line 144 of file TotemVFATRawToDigi.cc.

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 }

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().

Member Data Documentation

◆ analysisMaskToken

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

Definition at line 61 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

◆ fedDataToken

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

Definition at line 59 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

◆ fedIds

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

Definition at line 57 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

◆ rawDataUnpacker

pps::RawDataUnpacker TotemVFATRawToDigi::rawDataUnpacker
private

Definition at line 63 of file TotemVFATRawToDigi.cc.

Referenced by run().

◆ rawToDigiConverter

RawToDigiConverter TotemVFATRawToDigi::rawToDigiConverter
private

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

Referenced by run(), and TotemVFATRawToDigi().

◆ totemMappingToken

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

Definition at line 60 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

edm::DetSetVector
Definition: DetSetVector.h:61
edm::ESInputTag
Definition: ESInputTag.h:87
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:162
FEDNumbering::MAXTotemRPTimingVerticalFEDID
Definition: FEDNumbering.h:42
edm::Handle
Definition: AssociativeIterator.h:50
TotemVFATRawToDigi::fedDataToken
edm::EDGetTokenT< FEDRawDataCollection > fedDataToken
Definition: TotemVFATRawToDigi.cc:59
FEDRawData
Definition: FEDRawData.h:19
FEDNumbering::MAXCTPPSDiamondFEDID
Definition: FEDNumbering.h:38
TotemVFATRawToDigi::totemMappingToken
edm::ESGetToken< TotemDAQMapping, TotemReadoutRcd > totemMappingToken
Definition: TotemVFATRawToDigi.cc:60
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::ssTotemTiming
Definition: TotemVFATRawToDigi.cc:55
TotemVFATRawToDigi::analysisMaskToken
edm::ESGetToken< TotemAnalysisMask, TotemReadoutRcd > analysisMaskToken
Definition: TotemVFATRawToDigi.cc:61
FEDNumbering::MINTotemRPHorizontalFEDID
Definition: FEDNumbering.h:35
sistriplas_dqm_sourceclient-live_cfg.DigiType
DigiType
Definition: sistriplas_dqm_sourceclient-live_cfg.py:51
edmPickEvents.event
event
Definition: edmPickEvents.py:273
SimpleVFATFrameCollection
Definition: SimpleVFATFrameCollection.h:19
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
TotemVFATRawToDigi::subSystem
enum TotemVFATRawToDigi::@463 subSystem
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:88
TotemVFATRawToDigi::subSystemName
std::string subSystemName
Definition: TotemVFATRawToDigi.cc:53
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::ssTimingDiamond
Definition: TotemVFATRawToDigi.cc:55
TotemVFATRawToDigi::fedIds
std::vector< unsigned int > fedIds
Definition: TotemVFATRawToDigi.cc:57
Exception
Definition: hltDiff.cc:246
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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
TotemVFATRawToDigi::ssTrackingStrip
Definition: TotemVFATRawToDigi.cc:55
TotemVFATRawToDigi::ssUndefined
Definition: TotemVFATRawToDigi.cc:55
TotemVFATRawToDigi::rawDataUnpacker
pps::RawDataUnpacker rawDataUnpacker
Definition: TotemVFATRawToDigi.cc:63
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:29
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:2128
TotemVFATRawToDigi::rawToDigiConverter
RawToDigiConverter rawToDigiConverter
Definition: TotemVFATRawToDigi.cc:64