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::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > 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 beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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
 
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)
 
 ~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
 
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::vector< ModuleDescription const * > &modules, 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
 
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_
 

Additional Inherited Members

- 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::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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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)
 
- Protected Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 27 of file SiPixelDaqInfo.h.

Constructor & Destructor Documentation

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

Definition at line 11 of file SiPixelDaqInfo.cc.

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

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

Definition at line 28 of file SiPixelDaqInfo.cc.

28 {}

Member Function Documentation

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

Implements DQMEDHarvester.

Definition at line 105 of file SiPixelDaqInfo.cc.

105 {}
void SiPixelDaqInfo::dqmEndLuminosityBlock ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 30 of file SiPixelDaqInfo.cc.

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

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

Member Data Documentation

std::string SiPixelDaqInfo::daqSource_
private

Definition at line 50 of file SiPixelDaqInfo.h.

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

Definition at line 56 of file SiPixelDaqInfo.h.

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

Definition at line 43 of file SiPixelDaqInfo.h.

int SiPixelDaqInfo::FEDs_[40]
private

Definition at line 51 of file SiPixelDaqInfo.h.

bool SiPixelDaqInfo::firstLumi
private

Definition at line 53 of file SiPixelDaqInfo.h.

MonitorElement* SiPixelDaqInfo::Fraction_
private

Definition at line 39 of file SiPixelDaqInfo.h.

MonitorElement* SiPixelDaqInfo::FractionBarrel_
private

Definition at line 40 of file SiPixelDaqInfo.h.

MonitorElement* SiPixelDaqInfo::FractionEndcap_
private

Definition at line 41 of file SiPixelDaqInfo.h.

int SiPixelDaqInfo::NEvents_
private

Definition at line 47 of file SiPixelDaqInfo.h.

int SiPixelDaqInfo::nFEDsBarrel_
private

Definition at line 48 of file SiPixelDaqInfo.h.

int SiPixelDaqInfo::nFEDsEndcap_
private

Definition at line 49 of file SiPixelDaqInfo.h.

int SiPixelDaqInfo::NumberOfFeds_
private

Definition at line 45 of file SiPixelDaqInfo.h.