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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void endStream () override
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 TotemVFATRawToDigi (const edm::ParameterSet &)
 
 ~TotemVFATRawToDigi ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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(), hcalTTPDigis_cfi::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
std::vector< unsigned int > fedIds
enum TotemVFATRawToDigi::@332 subSystem
RawDataUnpacker rawDataUnpacker
ParameterSet const & getParameterSet(std::string const &) const
edm::EDGetTokenT< FEDRawDataCollection > fedDataToken
RawToDigiConverter rawToDigiConverter
TotemVFATRawToDigi::~TotemVFATRawToDigi ( )

Definition at line 124 of file TotemVFATRawToDigi.cc.

125 {
126 }

Member Function Documentation

void TotemVFATRawToDigi::endStream ( )
overridevirtual

Reimplemented from edm::stream::EDProducerBase.

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 
)
overridevirtual

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::@332 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, fedIds, edm::EventSetup::get(), HPSPFTaus_cff::mapping, rawDataUnpacker, rawToDigiConverter, RawToDigiConverter::Run(), 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
RawDataUnpacker rawDataUnpacker
edm::EDGetTokenT< FEDRawDataCollection > fedDataToken
const T & get() const
Definition: EventSetup.h:56
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().

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