CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 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)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

enum  { ssUndefined, ssTrackingStrip, ssTimingDiamond }
 

Private Member Functions

template<typename DigiType >
void run (edm::Event &, const edm::EventSetup &)
 

Private Attributes

edm::EDGetTokenT
< FEDRawDataCollection
fedDataToken
 
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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
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 49 of file TotemVFATRawToDigi.cc.

Constructor & Destructor Documentation

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

Definition at line 69 of file TotemVFATRawToDigi.cc.

References Exception, fedDataToken, fedIds, edm::ParameterSet::getParameter(), FEDNumbering::MAXCTPPSDiamondFEDID, FEDNumbering::MAXTotemRPFEDID, FEDNumbering::MINCTPPSDiamondFEDID, FEDNumbering::MINTotemRPFEDID, ssTimingDiamond, ssTrackingStrip, ssUndefined, subSystem, and subSystemName.

69  :
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 {
76  fedDataToken = consumes<FEDRawDataCollection>(conf.getParameter<edm::InputTag>("rawDataTag"));
77 
78  // validate chosen subSystem
79  if (subSystemName == "TrackingStrip")
81  if (subSystemName == "TimingDiamond")
83 
84  if (subSystem == ssUndefined)
85  throw cms::Exception("TotemVFATRawToDigi::TotemVFATRawToDigi") << "Unknown sub-system string " << subSystemName << "." << endl;
86 
87  // FED (OptoRx) headers and footers
88  produces< vector<TotemFEDInfo> >(subSystemName);
89 
90  // declare products
92  produces< DetSetVector<TotemRPDigi> >(subSystemName);
93 
95  produces< DetSetVector<CTPPSDiamondDigi> >(subSystemName);
96 
97  // set default IDs
98  if (fedIds.empty())
99  {
100  if (subSystem == ssTrackingStrip)
101  {
103  fedIds.push_back(id);
104  }
105 
106  if (subSystem == ssTimingDiamond)
107  {
108 
110  fedIds.push_back(id);
111  }
112  }
113 
114  // conversion status
115  produces< DetSetVector<TotemVFATStatus> >(subSystemName);
116 }
T getParameter(std::string const &) const
enum TotemVFATRawToDigi::@318 subSystem
std::vector< unsigned int > fedIds
RawDataUnpacker rawDataUnpacker
ParameterSet const & getParameterSet(std::string const &) const
edm::EDGetTokenT< FEDRawDataCollection > fedDataToken
RawToDigiConverter rawToDigiConverter
TotemVFATRawToDigi::~TotemVFATRawToDigi ( )

Definition at line 120 of file TotemVFATRawToDigi.cc.

121 {
122 }

Member Function Documentation

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

Implements edm::stream::EDProducerBase.

Definition at line 126 of file TotemVFATRawToDigi.cc.

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

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

127 {
128  if (subSystem == ssTrackingStrip)
129  run< DetSetVector<TotemRPDigi> >(event, es);
130 
131  if (subSystem == ssTimingDiamond)
132  run< DetSetVector<CTPPSDiamondDigi> >(event, es);
133 }
enum TotemVFATRawToDigi::@318 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 138 of file TotemVFATRawToDigi.cc.

References data, fedDataToken, l1tstage2_dqm_sourceclient-live_cfg::fedId, fedIds, edm::EventSetup::get(), rawDataUnpacker, rawToDigiConverter, RawToDigiConverter::Run(), RawDataUnpacker::Run(), FEDRawData::size(), and subSystemName.

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

139 {
140  // get DAQ mapping
142  es.get<TotemReadoutRcd>().get(subSystemName, mapping);
143 
144  // get analysis mask to mask channels
145  ESHandle<TotemAnalysisMask> analysisMask;
146  es.get<TotemReadoutRcd>().get(subSystemName, analysisMask);
147 
148  // raw data handle
150  event.getByToken(fedDataToken, rawData);
151 
152  // book output products
153  vector<TotemFEDInfo> fedInfo;
154  DigiType digi;
155  DetSetVector<TotemVFATStatus> conversionStatus;
156 
157  // raw-data unpacking
158  SimpleVFATFrameCollection vfatCollection;
159  for (const auto &fedId : fedIds)
160  {
161  const FEDRawData &data = rawData->FEDData(fedId);
162  if (data.size() > 0)
163  rawDataUnpacker.Run(fedId, data, fedInfo, vfatCollection);
164  }
165 
166  // raw-to-digi conversion
167  rawToDigiConverter.Run(vfatCollection, *mapping, *analysisMask, digi, conversionStatus);
168 
169  // commit products to event
170  event.put(make_unique<vector<TotemFEDInfo>>(fedInfo), subSystemName);
171  event.put(make_unique<DigiType>(digi), subSystemName);
172  event.put(make_unique<DetSetVector<TotemVFATStatus>>(conversionStatus), subSystemName);
173 }
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
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 53 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

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

Definition at line 51 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

RawDataUnpacker TotemVFATRawToDigi::rawDataUnpacker
private

Definition at line 55 of file TotemVFATRawToDigi.cc.

Referenced by run().

RawToDigiConverter TotemVFATRawToDigi::rawToDigiConverter
private

Definition at line 56 of file TotemVFATRawToDigi.cc.

Referenced by run().

enum { ... } TotemVFATRawToDigi::subSystem

Referenced by produce(), and TotemVFATRawToDigi().

std::string TotemVFATRawToDigi::subSystemName
private

Definition at line 47 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().