CMS 3D CMS Logo

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

#include <SiPixelDaqInfo.h>

Inheritance diagram for SiPixelDaqInfo:
DQMEDHarvester edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 SiPixelDaqInfo (const edm::ParameterSet &)
 
 ~SiPixelDaqInfo () override
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () 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
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, const edm::LuminosityBlock &, const edm::EventSetup &) override
 

Private Attributes

std::string daqSource_
 
edm::EDGetTokenT< FEDRawDataCollectiondaqSourceToken_
 
std::pair< int, int > FEDRange_
 
int FEDs_ [40]
 
bool firstLumi
 
MonitorElementFraction_
 
MonitorElementFractionBarrel_
 
MonitorElementFractionEndcap_
 
int NEvents_
 
int nFEDsBarrel_
 
int nFEDsEndcap_
 
int NumberOfFeds_
 
edm::ESGetToken< RunInfo, RunInfoRcdrunInfoToken_
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::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
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 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<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)
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 16 of file SiPixelDaqInfo.h.

Constructor & Destructor Documentation

◆ SiPixelDaqInfo()

SiPixelDaqInfo::SiPixelDaqInfo ( const edm::ParameterSet ps)
explicit

Definition at line 9 of file SiPixelDaqInfo.cc.

References edm::ParameterSet::getUntrackedParameter(), and mps_fire::i.

9  {
10  FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumPixelFEDId", 0);
11  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumPixelFEDId", 39);
12  daqSource_ = ps.getUntrackedParameter<string>("daqSource", "source");
13 
14  NumberOfFeds_ = FEDRange_.second - FEDRange_.first + 1;
15 
16  NEvents_ = 0;
17  for (int i = 0; i != 40; i++)
18  FEDs_[i] = 0;
19 
20  firstLumi = true;
21 
22  // set Token(-s)
23  daqSourceToken_ = consumes<FEDRawDataCollection>(ps.getUntrackedParameter<string>("daqSource", "source"));
24  runInfoToken_ = esConsumes<RunInfo, RunInfoRcd, edm::Transition::EndLuminosityBlock>();
25 }
std::string daqSource_
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< FEDRawDataCollection > daqSourceToken_
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
std::pair< int, int > FEDRange_

◆ ~SiPixelDaqInfo()

SiPixelDaqInfo::~SiPixelDaqInfo ( )
override

Definition at line 27 of file SiPixelDaqInfo.cc.

27 {}

Member Function Documentation

◆ dqmEndJob()

void SiPixelDaqInfo::dqmEndJob ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter 
)
overrideprivatevirtual

Implements DQMEDHarvester.

Definition at line 103 of file SiPixelDaqInfo.cc.

103 {}

◆ dqmEndLuminosityBlock()

void SiPixelDaqInfo::dqmEndLuminosityBlock ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDHarvester.

Definition at line 29 of file SiPixelDaqInfo.cc.

References dqm::implementation::IBooker::bookFloat(), dqm::impl::MonitorElement::Fill(), dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getBinContent(), mps_fire::i, RunInfo::m_fed_in, dqm::implementation::NavigatorBase::setCurrentFolder(), and edm::EventSetup::tryToGet().

32  {
33  // Book somethings first time around
34  if (firstLumi) {
35  iBooker.setCurrentFolder("Pixel/EventInfo");
36  Fraction_ = iBooker.bookFloat("DAQSummary");
37  iBooker.setCurrentFolder("Pixel/EventInfo/DAQContents");
38  FractionBarrel_ = iBooker.bookFloat("PixelBarrelFraction");
39  FractionEndcap_ = iBooker.bookFloat("PixelEndcapFraction");
40 
41  firstLumi = false;
42  }
43 
44  if (auto runInfoRec = iSetup.tryToGet<RunInfoRcd>()) {
45  // get fed summary information
46  const RunInfo &sumFED = runInfoRec->get(runInfoToken_);
47  vector<int> FedsInIds = sumFED.m_fed_in;
48 
49  int FedCount = 0;
50  int FedCountBarrel = 0;
51  int FedCountEndcap = 0;
52 
53  // loop on all active feds
54  for (unsigned int fedItr = 0; fedItr < FedsInIds.size(); ++fedItr) {
55  int fedID = FedsInIds[fedItr];
56  // make sure fed id is in allowed range
57  if (fedID >= FEDRange_.first && fedID <= FEDRange_.second) {
58  ++FedCount;
59  if (fedID >= 0 && fedID <= 31)
60  ++FedCountBarrel;
61  else if (fedID >= 32 && fedID <= 39)
62  ++FedCountEndcap;
63  }
64  }
65  // Fill active fed fraction ME
66  if (FedCountBarrel <= 32) {
67  MonitorElement *mefed = iGetter.get("Pixel/EventInfo/DAQContents/fedcounter");
68  FedCountBarrel = 0;
69  FedCountEndcap = 0;
70  FedCount = 0;
71  NumberOfFeds_ = 40;
72  if (mefed) {
73  for (int i = 0; i != 40; i++) {
74  if (i <= 31 && mefed->getBinContent(i + 1) > 0)
75  FedCountBarrel++;
76  if (i >= 32 && mefed->getBinContent(i + 1) > 0)
77  FedCountEndcap++;
78  if (mefed->getBinContent(i + 1) > 0)
79  FedCount++;
80  }
81  }
82  }
83  if (NumberOfFeds_ > 0) {
84  // all Pixel:
85  Fraction_->Fill(FedCount / NumberOfFeds_);
86  // Barrel:
87  FractionBarrel_->Fill(FedCountBarrel / 32.);
88  // Endcap:
89  FractionEndcap_->Fill(FedCountEndcap / 8.);
90  } else {
91  Fraction_->Fill(-1);
92  FractionBarrel_->Fill(-1);
93  FractionEndcap_->Fill(-1);
94  }
95  } else {
96  Fraction_->Fill(-1);
97  FractionBarrel_->Fill(-1);
98  FractionEndcap_->Fill(-1);
99  return;
100  }
101 }
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::optional< T > tryToGet() const
Definition: EventSetup.h:103
void Fill(long long x)
std::vector< int > m_fed_in
Definition: RunInfo.h:25
MonitorElement * Fraction_
MonitorElement * FractionBarrel_
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:690
MonitorElement * FractionEndcap_
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
std::pair< int, int > FEDRange_
virtual double getBinContent(int binx) const
get content of bin (1-D)

Member Data Documentation

◆ daqSource_

std::string SiPixelDaqInfo::daqSource_
private

Definition at line 39 of file SiPixelDaqInfo.h.

◆ daqSourceToken_

edm::EDGetTokenT<FEDRawDataCollection> SiPixelDaqInfo::daqSourceToken_
private

Definition at line 45 of file SiPixelDaqInfo.h.

◆ FEDRange_

std::pair<int, int> SiPixelDaqInfo::FEDRange_
private

Definition at line 32 of file SiPixelDaqInfo.h.

◆ FEDs_

int SiPixelDaqInfo::FEDs_[40]
private

Definition at line 40 of file SiPixelDaqInfo.h.

◆ firstLumi

bool SiPixelDaqInfo::firstLumi
private

Definition at line 42 of file SiPixelDaqInfo.h.

◆ Fraction_

MonitorElement* SiPixelDaqInfo::Fraction_
private

Definition at line 28 of file SiPixelDaqInfo.h.

◆ FractionBarrel_

MonitorElement* SiPixelDaqInfo::FractionBarrel_
private

Definition at line 29 of file SiPixelDaqInfo.h.

◆ FractionEndcap_

MonitorElement* SiPixelDaqInfo::FractionEndcap_
private

Definition at line 30 of file SiPixelDaqInfo.h.

◆ NEvents_

int SiPixelDaqInfo::NEvents_
private

Definition at line 36 of file SiPixelDaqInfo.h.

◆ nFEDsBarrel_

int SiPixelDaqInfo::nFEDsBarrel_
private

Definition at line 37 of file SiPixelDaqInfo.h.

◆ nFEDsEndcap_

int SiPixelDaqInfo::nFEDsEndcap_
private

Definition at line 38 of file SiPixelDaqInfo.h.

◆ NumberOfFeds_

int SiPixelDaqInfo::NumberOfFeds_
private

Definition at line 34 of file SiPixelDaqInfo.h.

◆ runInfoToken_

edm::ESGetToken<RunInfo, RunInfoRcd> SiPixelDaqInfo::runInfoToken_
private

Definition at line 46 of file SiPixelDaqInfo.h.