CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ScalersRawToDigi Class Reference

#include <EventFilter/ScalersRawToDigi/src/ScalersRawToDigi.cc>

Inheritance diagram for ScalersRawToDigi:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
 ScalersRawToDigi (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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 & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const edm::EDPutTokenT< BeamSpotOnlineCollectionbeamSpotPutToken_
 
const edm::EDPutTokenT< L1AcceptBunchCrossingCollectionbunchPutToken_
 
const edm::EDPutTokenT< DcsStatusCollectiondcsPutToken_
 
const edm::EDGetTokenT< FEDRawDataCollectionfedToken_
 
const edm::EDPutTokenT< L1TriggerScalersCollectionl1ScalerPutToken_
 
const edm::EDPutTokenT< LumiScalersCollectionlumiScalerPutToken_
 
const edm::EDPutTokenT< Level1TriggerScalersCollectionlvl1ScalerPutToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: Unpack FED data to Trigger and Lumi Scalers "bank" These Scalers are in FED id ScalersRaw::SCALERS_FED_ID

Definition at line 40 of file ScalersRawToDigi.cc.

Constructor & Destructor Documentation

◆ ScalersRawToDigi()

ScalersRawToDigi::ScalersRawToDigi ( const edm::ParameterSet iConfig)
explicit

Definition at line 59 of file ScalersRawToDigi.cc.

60  : fedToken_{consumes<FEDRawDataCollection>(iConfig.getParameter<edm::InputTag>("scalersInputTag"))},
61  bunchPutToken_{produces<L1AcceptBunchCrossingCollection>()},
62  l1ScalerPutToken_{produces<L1TriggerScalersCollection>()},
63  lvl1ScalerPutToken_{produces<Level1TriggerScalersCollection>()},
64  lumiScalerPutToken_{produces<LumiScalersCollection>()},
65  beamSpotPutToken_{produces<BeamSpotOnlineCollection>()},
66  dcsPutToken_{produces<DcsStatusCollection>()} {}

References edm::ParameterSet::getParameter().

Member Function Documentation

◆ fillDescriptions()

void ScalersRawToDigi::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 68 of file ScalersRawToDigi.cc.

68  {
70  desc.add<edm::InputTag>("scalersInputTag", edm::InputTag("rawDataCollector"));
71  descriptions.add("scalersRawToDigi", desc);
72 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.

◆ produce()

void ScalersRawToDigi::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overridevirtual

Take a reference to this FED's data

Implements edm::global::EDProducerBase.

Definition at line 75 of file ScalersRawToDigi.cc.

75  {
76  using namespace edm;
77 
78  // Get the FED data collection
79  auto const& rawdata = iEvent.get(fedToken_);
80 
82 
83  L1TriggerScalersCollection pOldTrigger;
84 
86 
88 
89  BeamSpotOnlineCollection pBeamSpotOnline;
90  DcsStatusCollection pDcsStatus;
91 
93  const FEDRawData& fedData = rawdata.FEDData(ScalersRaw::SCALERS_FED_ID);
94  unsigned short int length = fedData.size();
95  if (length > 0) {
96  int nWords = length / 8;
97  int nBytesExtra = 0;
98 
99  const ScalersEventRecordRaw_v6* raw = (struct ScalersEventRecordRaw_v6*)fedData.data();
100  if ((raw->version == 1) || (raw->version == 2)) {
101  pOldTrigger.emplace_back(fedData.data());
102  nBytesExtra = length - sizeof(struct ScalersEventRecordRaw_v1);
103  } else if (raw->version >= 3) {
104  pTrigger.emplace_back(fedData.data());
105  if (raw->version >= 6) {
106  nBytesExtra = ScalersRaw::N_BX_v6 * sizeof(unsigned long long);
107  } else {
108  nBytesExtra = ScalersRaw::N_BX_v2 * sizeof(unsigned long long);
109  }
110  }
111 
112  pLumi.emplace_back(fedData.data());
113 
114  if ((nBytesExtra >= 8) && ((nBytesExtra % 8) == 0)) {
115  unsigned long long const* data = (unsigned long long const*)fedData.data();
116 
117  int nWordsExtra = nBytesExtra / 8;
118  for (int i = 0; i < nWordsExtra; i++) {
119  int index = nWords - (nWordsExtra + 1) + i;
120  pBunch.emplace_back(i, data[index]);
121  }
122  }
123 
124  if (raw->version >= 4) {
125  pBeamSpotOnline.emplace_back(fedData.data());
126 
127  pDcsStatus.emplace_back(fedData.data());
128  }
129  }
130  iEvent.emplace(l1ScalerPutToken_, std::move(pOldTrigger));
131  iEvent.emplace(lvl1ScalerPutToken_, std::move(pTrigger));
132  iEvent.emplace(lumiScalerPutToken_, std::move(pLumi));
133  iEvent.emplace(bunchPutToken_, std::move(pBunch));
134  iEvent.emplace(beamSpotPutToken_, std::move(pBeamSpotOnline));
135  iEvent.emplace(dcsPutToken_, std::move(pDcsStatus));
136 }

References beamSpotPutToken_, bunchPutToken_, FEDRawData::data(), data, dcsPutToken_, fedToken_, mps_fire::i, iEvent, l1ScalerPutToken_, lumiScalerPutToken_, lvl1ScalerPutToken_, eostools::move(), ScalersRaw::N_BX_v2, ScalersRaw::N_BX_v6, ScalersRaw::SCALERS_FED_ID, FEDRawData::size(), and ScalersEventRecordRaw_v6::version.

Member Data Documentation

◆ beamSpotPutToken_

const edm::EDPutTokenT<BeamSpotOnlineCollection> ScalersRawToDigi::beamSpotPutToken_
private

Definition at line 54 of file ScalersRawToDigi.cc.

Referenced by produce().

◆ bunchPutToken_

const edm::EDPutTokenT<L1AcceptBunchCrossingCollection> ScalersRawToDigi::bunchPutToken_
private

Definition at line 50 of file ScalersRawToDigi.cc.

Referenced by produce().

◆ dcsPutToken_

const edm::EDPutTokenT<DcsStatusCollection> ScalersRawToDigi::dcsPutToken_
private

Definition at line 55 of file ScalersRawToDigi.cc.

Referenced by produce().

◆ fedToken_

const edm::EDGetTokenT<FEDRawDataCollection> ScalersRawToDigi::fedToken_
private

Definition at line 49 of file ScalersRawToDigi.cc.

Referenced by produce().

◆ l1ScalerPutToken_

const edm::EDPutTokenT<L1TriggerScalersCollection> ScalersRawToDigi::l1ScalerPutToken_
private

Definition at line 51 of file ScalersRawToDigi.cc.

Referenced by produce().

◆ lumiScalerPutToken_

const edm::EDPutTokenT<LumiScalersCollection> ScalersRawToDigi::lumiScalerPutToken_
private

Definition at line 53 of file ScalersRawToDigi.cc.

Referenced by produce().

◆ lvl1ScalerPutToken_

const edm::EDPutTokenT<Level1TriggerScalersCollection> ScalersRawToDigi::lvl1ScalerPutToken_
private

Definition at line 52 of file ScalersRawToDigi.cc.

Referenced by produce().

mps_fire.i
i
Definition: mps_fire.py:428
L1TriggerScalersCollection
std::vector< L1TriggerScalers > L1TriggerScalersCollection
Definition: L1TriggerScalers.h:132
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ScalersRaw::N_BX_v2
Definition: ScalersRaw.h:33
ScalersEventRecordRaw_v6::version
int version
Definition: ScalersRaw.h:241
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
FEDRawData
Definition: FEDRawData.h:19
ScalersRaw::N_BX_v6
Definition: ScalersRaw.h:34
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
ScalersEventRecordRaw_v1
Definition: ScalersRaw.h:181
L1AcceptBunchCrossingCollection
std::vector< L1AcceptBunchCrossing > L1AcceptBunchCrossingCollection
Definition: L1AcceptBunchCrossing.h:83
ScalersRawToDigi::dcsPutToken_
const edm::EDPutTokenT< DcsStatusCollection > dcsPutToken_
Definition: ScalersRawToDigi.cc:55
LumiScalersCollection
std::vector< LumiScalers > LumiScalersCollection
Definition: LumiScalers.h:144
ScalersRawToDigi::fedToken_
const edm::EDGetTokenT< FEDRawDataCollection > fedToken_
Definition: ScalersRawToDigi.cc:49
ScalersRaw::SCALERS_FED_ID
Definition: ScalersRaw.h:40
ScalersEventRecordRaw_v6
Definition: ScalersRaw.h:239
iEvent
int iEvent
Definition: GenABIO.cc:224
ScalersRawToDigi::lvl1ScalerPutToken_
const edm::EDPutTokenT< Level1TriggerScalersCollection > lvl1ScalerPutToken_
Definition: ScalersRawToDigi.cc:52
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
ScalersRawToDigi::lumiScalerPutToken_
const edm::EDPutTokenT< LumiScalersCollection > lumiScalerPutToken_
Definition: ScalersRawToDigi.cc:53
BeamSpotOnlineCollection
std::vector< BeamSpotOnline > BeamSpotOnlineCollection
Definition: BeamSpotOnline.h:101
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
ScalersRawToDigi::beamSpotPutToken_
const edm::EDPutTokenT< BeamSpotOnlineCollection > beamSpotPutToken_
Definition: ScalersRawToDigi.cc:54
Level1TriggerScalersCollection
std::vector< Level1TriggerScalers > Level1TriggerScalersCollection
Definition: Level1TriggerScalers.h:183
ScalersRawToDigi::bunchPutToken_
const edm::EDPutTokenT< L1AcceptBunchCrossingCollection > bunchPutToken_
Definition: ScalersRawToDigi.cc:50
DcsStatusCollection
std::vector< DcsStatus > DcsStatusCollection
Definition: DcsStatus.h:110
edm::InputTag
Definition: InputTag.h:15
ScalersRawToDigi::l1ScalerPutToken_
const edm::EDPutTokenT< L1TriggerScalersCollection > l1ScalerPutToken_
Definition: ScalersRawToDigi.cc:51