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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
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)
 
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 ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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.

References edm::ParameterSet::getParameter().

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>()} {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::EDPutTokenT< DcsStatusCollection > dcsPutToken_
const edm::EDPutTokenT< BeamSpotOnlineCollection > beamSpotPutToken_
const edm::EDPutTokenT< L1TriggerScalersCollection > l1ScalerPutToken_
const edm::EDPutTokenT< LumiScalersCollection > lumiScalerPutToken_
const edm::EDPutTokenT< L1AcceptBunchCrossingCollection > bunchPutToken_
const edm::EDGetTokenT< FEDRawDataCollection > fedToken_
const edm::EDPutTokenT< Level1TriggerScalersCollection > lvl1ScalerPutToken_

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 68 of file ScalersRawToDigi.cc.

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

68  {
70  desc.add<edm::InputTag>("scalersInputTag", edm::InputTag("rawDataCollector"));
71  descriptions.add("scalersRawToDigi", desc);
72 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ 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.

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, l1ctLayer2EG_cff::nWords, ScalersRaw::SCALERS_FED_ID, FEDRawData::size(), and ScalersEventRecordRaw_v6::version.

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 }
std::vector< BeamSpotOnline > BeamSpotOnlineCollection
const edm::EDPutTokenT< DcsStatusCollection > dcsPutToken_
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
int iEvent
Definition: GenABIO.cc:224
std::vector< L1AcceptBunchCrossing > L1AcceptBunchCrossingCollection
std::vector< DcsStatus > DcsStatusCollection
Definition: DcsStatus.h:110
const edm::EDPutTokenT< BeamSpotOnlineCollection > beamSpotPutToken_
const edm::EDPutTokenT< L1TriggerScalersCollection > l1ScalerPutToken_
std::vector< Level1TriggerScalers > Level1TriggerScalersCollection
const edm::EDPutTokenT< LumiScalersCollection > lumiScalerPutToken_
HLT enums.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
const edm::EDPutTokenT< L1AcceptBunchCrossingCollection > bunchPutToken_
const edm::EDGetTokenT< FEDRawDataCollection > fedToken_
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
std::vector< LumiScalers > LumiScalersCollection
Definition: LumiScalers.h:144
std::vector< L1TriggerScalers > L1TriggerScalersCollection
const edm::EDPutTokenT< Level1TriggerScalersCollection > lvl1ScalerPutToken_
def move(src, dest)
Definition: eostools.py:511

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