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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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
 
ctpps::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 40 of file TotemVFATRawToDigi.cc.

Member Enumeration Documentation

anonymous enum
private

Constructor & Destructor Documentation

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

Definition at line 72 of file TotemVFATRawToDigi.cc.

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.

72  :
73  subSystemName(conf.getParameter<string>("subSystem")),
75  fedIds(conf.getParameter< vector<unsigned int> >("fedIds")),
76  rawDataUnpacker(conf.getParameterSet("RawUnpacking")),
77  rawToDigiConverter(conf.getParameterSet("RawToDigi"))
78 {
79  fedDataToken = consumes<FEDRawDataCollection>(conf.getParameter<edm::InputTag>("rawDataTag"));
80 
81  // validate chosen subSystem
82  if (subSystemName == "TrackingStrip")
84  else if (subSystemName == "TimingDiamond")
86  else if (subSystemName == "TotemTiming")
88 
89  if (subSystem == ssUndefined)
90  throw cms::Exception("TotemVFATRawToDigi::TotemVFATRawToDigi") << "Unknown sub-system string " << subSystemName << "." << endl;
91 
92  // FED (OptoRx) headers and footers
93  produces< vector<TotemFEDInfo> >(subSystemName);
94 
95  // declare products
97  produces< DetSetVector<TotemRPDigi> >(subSystemName);
98 
99  else if (subSystem == ssTimingDiamond)
100  produces< DetSetVector<CTPPSDiamondDigi> >(subSystemName);
101 
102  else if (subSystem == ssTotemTiming)
103  produces< DetSetVector<TotemTimingDigi> >(subSystemName);
104 
105  // set default IDs
106  if (fedIds.empty()) {
107  if (subSystem == ssTrackingStrip) {
109  fedIds.push_back(id);
110 
112  fedIds.push_back(id);
113  }
114 
115  else if (subSystem == ssTimingDiamond) {
117  fedIds.push_back(id);
118  }
119 
120  else if (subSystem == ssTotemTiming) {
122  fedIds.push_back(id);
123  }
124  }
125 
126  // conversion status
127  produces< DetSetVector<TotemVFATStatus> >(subSystemName);
128 }
T getParameter(std::string const &) const
std::vector< unsigned int > fedIds
ParameterSet const & getParameterSet(std::string const &) const
edm::EDGetTokenT< FEDRawDataCollection > fedDataToken
enum TotemVFATRawToDigi::@437 subSystem
ctpps::RawDataUnpacker rawDataUnpacker
RawToDigiConverter rawToDigiConverter
TotemVFATRawToDigi::~TotemVFATRawToDigi ( )
override

Definition at line 132 of file TotemVFATRawToDigi.cc.

133 {
134 }

Member Function Documentation

void TotemVFATRawToDigi::endStream ( )
override

Definition at line 192 of file TotemVFATRawToDigi.cc.

References DEFINE_FWK_MODULE, RawToDigiConverter::printSummaries(), and rawToDigiConverter.

193 {
195 }
void printSummaries() const
Print error summaries.
RawToDigiConverter rawToDigiConverter
void TotemVFATRawToDigi::produce ( edm::Event event,
const edm::EventSetup es 
)
override

Definition at line 138 of file TotemVFATRawToDigi.cc.

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

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

139 {
140  if (subSystem == ssTrackingStrip)
141  run< DetSetVector<TotemRPDigi> >(event, es);
142 
143  else if (subSystem == ssTimingDiamond)
144  run< DetSetVector<CTPPSDiamondDigi> >(event, es);
145 
146  else if (subSystem == ssTotemTiming)
147  run< DetSetVector<TotemTimingDigi> >(event, es);
148 }
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
enum TotemVFATRawToDigi::@437 subSystem
template<typename DigiType >
void TotemVFATRawToDigi::run ( edm::Event event,
const edm::EventSetup es 
)
private

Definition at line 153 of file TotemVFATRawToDigi.cc.

References data, FEDRawDataCollection::FEDData(), fedDataToken, l1t::stage2::layer2::fedId, fedIds, edm::EventSetup::get(), taus_updatedMVAIds_cff::mapping, rawDataUnpacker, rawToDigiConverter, RawToDigiConverter::run(), ctpps::RawDataUnpacker::run(), FEDRawData::size(), and subSystemName.

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

154 {
155  // get DAQ mapping
157  es.get<TotemReadoutRcd>().get(subSystemName, mapping);
158 
159  // get analysis mask to mask channels
160  ESHandle<TotemAnalysisMask> analysisMask;
161  es.get<TotemReadoutRcd>().get(subSystemName, analysisMask);
162 
163  // raw data handle
165  event.getByToken(fedDataToken, rawData);
166 
167  // book output products
168  vector<TotemFEDInfo> fedInfo;
169  DigiType digi;
170  DetSetVector<TotemVFATStatus> conversionStatus;
171 
172  // raw-data unpacking
173  SimpleVFATFrameCollection vfatCollection;
174  for (const auto &fedId : fedIds)
175  {
176  const FEDRawData &data = rawData->FEDData(fedId);
177  if (data.size() > 0)
178  rawDataUnpacker.run(fedId, data, fedInfo, vfatCollection);
179  }
180 
181  // raw-to-digi conversion
182  rawToDigiConverter.run(vfatCollection, *mapping, *analysisMask, digi, conversionStatus);
183 
184  // commit products to event
185  event.put(make_unique<vector<TotemFEDInfo>>(fedInfo), subSystemName);
186  event.put(make_unique<DigiType>(digi), subSystemName);
187  event.put(make_unique<DetSetVector<TotemVFATStatus>>(conversionStatus), subSystemName);
188 }
EventSetup record for TOTEM readout-related information.
int run(int fedId, const FEDRawData &data, std::vector< TotemFEDInfo > &fedInfoColl, SimpleVFATFrameCollection &coll) const
Unpack data from FED with fedId into `coll&#39; collection.
std::vector< unsigned int > fedIds
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
edm::EDGetTokenT< FEDRawDataCollection > fedDataToken
ctpps::RawDataUnpacker rawDataUnpacker
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
T get() const
Definition: EventSetup.h:68
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

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

Definition at line 56 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

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

Definition at line 54 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

ctpps::RawDataUnpacker TotemVFATRawToDigi::rawDataUnpacker
private

Definition at line 58 of file TotemVFATRawToDigi.cc.

Referenced by run().

RawToDigiConverter TotemVFATRawToDigi::rawToDigiConverter
private

Definition at line 59 of file TotemVFATRawToDigi.cc.

Referenced by endStream(), and run().

enum { ... } TotemVFATRawToDigi::subSystem

Referenced by produce(), and TotemVFATRawToDigi().

std::string TotemVFATRawToDigi::subSystemName
private

Definition at line 50 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().