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 }
 

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

Member Enumeration Documentation

anonymous enum
private
Enumerator
ssUndefined 
ssTrackingStrip 
ssTimingDiamond 

Definition at line 50 of file TotemVFATRawToDigi.cc.

Constructor & Destructor Documentation

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

Definition at line 70 of file TotemVFATRawToDigi.cc.

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

70  :
71  subSystemName(conf.getParameter<string>("subSystem")),
73  fedIds(conf.getParameter< vector<unsigned int> >("fedIds")),
74  rawDataUnpacker(conf.getParameterSet("RawUnpacking")),
75  rawToDigiConverter(conf.getParameterSet("RawToDigi"))
76 {
77  fedDataToken = consumes<FEDRawDataCollection>(conf.getParameter<edm::InputTag>("rawDataTag"));
78 
79  // validate chosen subSystem
80  if (subSystemName == "TrackingStrip")
82  if (subSystemName == "TimingDiamond")
84 
85  if (subSystem == ssUndefined)
86  throw cms::Exception("TotemVFATRawToDigi::TotemVFATRawToDigi") << "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 
96  produces< DetSetVector<CTPPSDiamondDigi> >(subSystemName);
97 
98  // set default IDs
99  if (fedIds.empty())
100  {
101  if (subSystem == ssTrackingStrip)
102  {
104  fedIds.push_back(id);
105 
107  fedIds.push_back(id);
108  }
109 
110  if (subSystem == ssTimingDiamond)
111  {
112 
114  fedIds.push_back(id);
115  }
116  }
117 
118  // conversion status
119  produces< DetSetVector<TotemVFATStatus> >(subSystemName);
120 }
T getParameter(std::string const &) const
enum TotemVFATRawToDigi::@389 subSystem
std::vector< unsigned int > fedIds
ParameterSet const & getParameterSet(std::string const &) const
edm::EDGetTokenT< FEDRawDataCollection > fedDataToken
ctpps::RawDataUnpacker rawDataUnpacker
RawToDigiConverter rawToDigiConverter
TotemVFATRawToDigi::~TotemVFATRawToDigi ( )
override

Definition at line 124 of file TotemVFATRawToDigi.cc.

125 {
126 }

Member Function Documentation

void TotemVFATRawToDigi::endStream ( )
override

Definition at line 181 of file TotemVFATRawToDigi.cc.

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

182 {
184 }
void PrintSummaries() const
Print error summaries.
RawToDigiConverter rawToDigiConverter
void TotemVFATRawToDigi::produce ( edm::Event event,
const edm::EventSetup es 
)
override

Definition at line 130 of file TotemVFATRawToDigi.cc.

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

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

131 {
132  if (subSystem == ssTrackingStrip)
133  run< DetSetVector<TotemRPDigi> >(event, es);
134 
135  if (subSystem == ssTimingDiamond)
136  run< DetSetVector<CTPPSDiamondDigi> >(event, es);
137 }
enum TotemVFATRawToDigi::@389 subSystem
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
template<typename DigiType >
void TotemVFATRawToDigi::run ( edm::Event event,
const edm::EventSetup es 
)
private

Definition at line 142 of file TotemVFATRawToDigi.cc.

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

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

143 {
144  // get DAQ mapping
146  es.get<TotemReadoutRcd>().get(subSystemName, mapping);
147 
148  // get analysis mask to mask channels
149  ESHandle<TotemAnalysisMask> analysisMask;
150  es.get<TotemReadoutRcd>().get(subSystemName, analysisMask);
151 
152  // raw data handle
154  event.getByToken(fedDataToken, rawData);
155 
156  // book output products
157  vector<TotemFEDInfo> fedInfo;
158  DigiType digi;
159  DetSetVector<TotemVFATStatus> conversionStatus;
160 
161  // raw-data unpacking
162  SimpleVFATFrameCollection vfatCollection;
163  for (const auto &fedId : fedIds)
164  {
165  const FEDRawData &data = rawData->FEDData(fedId);
166  if (data.size() > 0)
167  rawDataUnpacker.Run(fedId, data, fedInfo, vfatCollection);
168  }
169 
170  // raw-to-digi conversion
171  rawToDigiConverter.Run(vfatCollection, *mapping, *analysisMask, digi, conversionStatus);
172 
173  // commit products to event
174  event.put(make_unique<vector<TotemFEDInfo>>(fedInfo), subSystemName);
175  event.put(make_unique<DigiType>(digi), subSystemName);
176  event.put(make_unique<DetSetVector<TotemVFATStatus>>(conversionStatus), subSystemName);
177 }
void Run(const VFATFrameCollection &coll, const TotemDAQMapping &mapping, const TotemAnalysisMask &mask, edm::DetSetVector< TotemRPDigi > &digi, edm::DetSetVector< TotemVFATStatus > &status)
Creates RP digi.
EventSetup record for TOTEM readout-related information.
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
const T & get() const
Definition: EventSetup.h:59
ctpps::RawDataUnpacker rawDataUnpacker
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
RawToDigiConverter rawToDigiConverter
int Run(int fedId, const FEDRawData &data, std::vector< TotemFEDInfo > &fedInfoColl, SimpleVFATFrameCollection &coll) const
Unpack data from FED with fedId into `coll&#39; collection.

Member Data Documentation

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

Definition at line 54 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

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

Definition at line 52 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

ctpps::RawDataUnpacker TotemVFATRawToDigi::rawDataUnpacker
private

Definition at line 56 of file TotemVFATRawToDigi.cc.

Referenced by run().

RawToDigiConverter TotemVFATRawToDigi::rawToDigiConverter
private

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

Referenced by run(), and TotemVFATRawToDigi().