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 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 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
 
std::string subSystem
 

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.

Constructor & Destructor Documentation

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

Definition at line 67 of file TotemVFATRawToDigi.cc.

References Exception, fedDataToken, fedIds, edm::ParameterSet::getParameter(), FEDNumbering::MAXTotemRPFEDID, FEDNumbering::MINTotemRPFEDID, and subSystem.

67  :
68  subSystem(conf.getParameter<string>("subSystem")),
69  fedIds(conf.getParameter< vector<unsigned int> >("fedIds")),
70  rawDataUnpacker(conf.getParameterSet("RawUnpacking")),
71  rawToDigiConverter(conf.getParameterSet("RawToDigi"))
72 {
73  fedDataToken = consumes<FEDRawDataCollection>(conf.getParameter<edm::InputTag>("rawDataTag"));
74 
75  // validate chosen subSystem
76  if (subSystem != "RP")
77  throw cms::Exception("TotemVFATRawToDigi::TotemVFATRawToDigi") << "Unknown sub-system string " << subSystem << "." << endl;
78 
79  // FED (OptoRx) headers and footers
80  produces< vector<TotemFEDInfo> >(subSystem);
81 
82  // digi
83  if (subSystem == "RP")
84  produces< DetSetVector<TotemRPDigi> >(subSystem);
85 
86  // set default IDs
87  if (fedIds.empty())
88  {
89  if (subSystem == "RP")
90  {
92  fedIds.push_back(id);
93  }
94  }
95 
96  // conversion status
97  produces< DetSetVector<TotemVFATStatus> >(subSystem);
98 }
T getParameter(std::string const &) const
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 102 of file TotemVFATRawToDigi.cc.

103 {
104 }

Member Function Documentation

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

Implements edm::stream::EDProducerBase.

Definition at line 108 of file TotemVFATRawToDigi.cc.

References event(), and subSystem.

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

109 {
110  if (subSystem == "RP")
111  run< DetSetVector<TotemRPDigi> >(event, es);
112 }
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 117 of file TotemVFATRawToDigi.cc.

References data, fedDataToken, stage2BMTFBufferRaw_cfi::fedId, fedIds, edm::EventSetup::get(), rawDataUnpacker, rawToDigiConverter, RawToDigiConverter::Run(), RawDataUnpacker::Run(), FEDRawData::size(), and subSystem.

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

118 {
119  // get DAQ mapping
121  es.get<TotemReadoutRcd>().get(mapping);
122 
123  // get analysis mask to mask channels
124  ESHandle<TotemAnalysisMask> analysisMask;
125  es.get<TotemReadoutRcd>().get(analysisMask);
126 
127  // raw data handle
129  event.getByToken(fedDataToken, rawData);
130 
131  // book output products
132  vector<TotemFEDInfo> fedInfo;
133  DigiType digi;
134  DetSetVector<TotemVFATStatus> conversionStatus;
135 
136  // raw-data unpacking
137  SimpleVFATFrameCollection vfatCollection;
138  for (const auto &fedId : fedIds)
139  {
140  const FEDRawData &data = rawData->FEDData(fedId);
141  if (data.size() > 0)
142  rawDataUnpacker.Run(fedId, data, fedInfo, vfatCollection);
143  }
144 
145  // raw-to-digi conversion
146  rawToDigiConverter.Run(vfatCollection, *mapping, *analysisMask, digi, conversionStatus);
147 
148  // commit products to event
149  event.put(make_unique<vector<TotemFEDInfo>>(fedInfo), subSystem);
150  event.put(make_unique<DigiType>(digi), subSystem);
151  event.put(make_unique<DetSetVector<TotemVFATStatus>>(conversionStatus), subSystem);
152 }
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
int Run(int fedId, const FEDRawData &data, std::vector< TotemFEDInfo > &fedInfoColl, SimpleVFATFrameCollection &coll)
Unpack data from FED with fedId into `coll&#39; collection.
edm::EDGetTokenT< FEDRawDataCollection > fedDataToken
const T & get() const
Definition: EventSetup.h:56
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
RawToDigiConverter rawToDigiConverter

Member Data Documentation

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

Definition at line 51 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

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

Definition at line 49 of file TotemVFATRawToDigi.cc.

Referenced by run(), and TotemVFATRawToDigi().

RawDataUnpacker TotemVFATRawToDigi::rawDataUnpacker
private

Definition at line 53 of file TotemVFATRawToDigi.cc.

Referenced by run().

RawToDigiConverter TotemVFATRawToDigi::rawToDigiConverter
private

Definition at line 54 of file TotemVFATRawToDigi.cc.

Referenced by run().

std::string TotemVFATRawToDigi::subSystem
private

Definition at line 47 of file TotemVFATRawToDigi.cc.

Referenced by produce(), run(), and TotemVFATRawToDigi().