CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &) override
 
 ScalersRawToDigi (const edm::ParameterSet &)
 
 ~ScalersRawToDigi ()
 
- 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 ()
 

Static Public Member Functions

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

Private Attributes

edm::EDGetTokenT
< FEDRawDataCollection
fedToken_
 
edm::InputTag inputTag_
 

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

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 ( const edm::ParameterSet iConfig)
explicit

Definition at line 56 of file ScalersRawToDigi.cc.

References edm::ParameterSet::exists(), fedToken_, edm::ParameterSet::getParameter(), and inputTag_.

56  :
57  inputTag_((char const *)"rawDataCollector")
58 {
59  produces<L1AcceptBunchCrossingCollection>();
60  produces<L1TriggerScalersCollection>();
61  produces<Level1TriggerScalersCollection>();
62  produces<LumiScalersCollection>();
63  produces<BeamSpotOnlineCollection>();
64  produces<DcsStatusCollection>();
65  if ( iConfig.exists("scalersInputTag") )
66  {
67  inputTag_ = iConfig.getParameter<edm::InputTag>("scalersInputTag");
68  }
69  fedToken_=consumes<FEDRawDataCollection>(inputTag_);
70 
71 }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::InputTag inputTag_
edm::EDGetTokenT< FEDRawDataCollection > fedToken_
ScalersRawToDigi::~ScalersRawToDigi ( )

Definition at line 74 of file ScalersRawToDigi.cc.

74 {}

Member Function Documentation

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

Definition at line 76 of file ScalersRawToDigi.cc.

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

76  {
78  desc.add<edm::InputTag>("scalersInputTag",edm::InputTag("rawDataCollector"));
79  descriptions.add("scalersRawToDigi",desc);
80 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void ScalersRawToDigi::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Take a reference to this FED's data

Implements edm::stream::EDProducerBase.

Definition at line 83 of file ScalersRawToDigi.cc.

References AlCaHLTBitMon_QueryRunRegistry::data, fedToken_, edm::Event::getByToken(), i, cmsHarvester::index, ScalersRaw::N_BX_v2, ScalersRaw::N_BX_v6, edm::Event::put(), lumiPlot::rawdata, ScalersRaw::SCALERS_FED_ID, and ScalersEventRecordRaw_v6::version.

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

85 {
86  using namespace edm;
87 
88  // Get a handle to the FED data collection
90  iEvent.getByToken(fedToken_, rawdata);
91 
92  std::auto_ptr<LumiScalersCollection> pLumi(new LumiScalersCollection());
93 
94  std::auto_ptr<L1TriggerScalersCollection>
95  pOldTrigger(new L1TriggerScalersCollection());
96 
97  std::auto_ptr<Level1TriggerScalersCollection>
98  pTrigger(new Level1TriggerScalersCollection());
99 
100  std::auto_ptr<L1AcceptBunchCrossingCollection>
101  pBunch(new L1AcceptBunchCrossingCollection());
102 
103  std::auto_ptr<BeamSpotOnlineCollection> pBeamSpotOnline(new BeamSpotOnlineCollection());
104  std::auto_ptr<DcsStatusCollection> pDcsStatus(new DcsStatusCollection());
105 
107  const FEDRawData & fedData = rawdata->FEDData(ScalersRaw::SCALERS_FED_ID);
108  unsigned short int length = fedData.size();
109  if ( length > 0 )
110  {
111  int nWords = length / 8;
112  int nBytesExtra = 0;
113 
114  const ScalersEventRecordRaw_v6 * raw
115  = (struct ScalersEventRecordRaw_v6 *)fedData.data();
116  if ( ( raw->version == 1 ) || ( raw->version == 2 ) )
117  {
118  L1TriggerScalers oldTriggerScalers(fedData.data());
119  pOldTrigger->push_back(oldTriggerScalers);
120  nBytesExtra = length - sizeof(struct ScalersEventRecordRaw_v1);
121  }
122  else if ( raw->version >= 3 )
123  {
124  Level1TriggerScalers triggerScalers(fedData.data());
125  pTrigger->push_back(triggerScalers);
126  if ( raw->version >= 6 )
127  {
128  nBytesExtra = ScalersRaw::N_BX_v6 * sizeof(unsigned long long);
129  }
130  else
131  {
132  nBytesExtra = ScalersRaw::N_BX_v2 * sizeof(unsigned long long);
133  }
134  }
135 
136  LumiScalers lumiScalers(fedData.data());
137  pLumi->push_back(lumiScalers);
138 
139  if (( nBytesExtra >= 8 ) && (( nBytesExtra % 8 ) == 0 ))
140  {
141  unsigned long long * data =
142  (unsigned long long *)fedData.data();
143 
144  int nWordsExtra = nBytesExtra / 8;
145  for ( int i=0; i<nWordsExtra; i++)
146  {
147  int index = nWords - (nWordsExtra + 1) + i;
148  L1AcceptBunchCrossing bc(i,data[index]);
149  pBunch->push_back(bc);
150  }
151  }
152 
153  if ( raw->version >= 4 )
154  {
155  BeamSpotOnline beamSpotOnline(fedData.data());
156  pBeamSpotOnline->push_back(beamSpotOnline);
157 
158  DcsStatus dcsStatus(fedData.data());
159  pDcsStatus->push_back(dcsStatus);
160  }
161  }
162  iEvent.put(pOldTrigger);
163  iEvent.put(pTrigger);
164  iEvent.put(pLumi);
165  iEvent.put(pBunch);
166  iEvent.put(pBeamSpotOnline);
167  iEvent.put(pDcsStatus);
168 }
std::vector< BeamSpotOnline > BeamSpotOnlineCollection
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
std::vector< L1AcceptBunchCrossing > L1AcceptBunchCrossingCollection
std::vector< DcsStatus > DcsStatusCollection
Definition: DcsStatus.h:116
std::vector< Level1TriggerScalers > Level1TriggerScalersCollection
edm::EDGetTokenT< FEDRawDataCollection > fedToken_
std::vector< LumiScalers > LumiScalersCollection
Definition: LumiScalers.h:160
std::vector< L1TriggerScalers > L1TriggerScalersCollection
dictionary rawdata
Definition: lumiPlot.py:393

Member Data Documentation

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

Definition at line 51 of file ScalersRawToDigi.cc.

Referenced by produce(), and ScalersRawToDigi().

edm::InputTag ScalersRawToDigi::inputTag_
private

Definition at line 50 of file ScalersRawToDigi.cc.

Referenced by ScalersRawToDigi().