CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
ESDaqInfoTask Class Reference

#include <ESDaqInfoTask.h>

Inheritance diagram for ESDaqInfoTask:
edm::EDAnalyzer edm::EDConsumerBase

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 ESDaqInfoTask (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~ESDaqInfoTask () override
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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
 
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
 
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)
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 Analyze. More...
 
void beginJob (void) override
 BeginJob. More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup) override
 BeginLuminosityBlock. More...
 
void endJob (void) override
 EndJob. More...
 
void reset (void)
 Reset. More...
 
- 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>
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)
 
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)
 

Private Member Functions

int getFEDNumber (const int x, const int y)
 

Private Attributes

DQMStoredqmStore_
 
ESElectronicsMapperes_mapping_
 
int ESFedRangeMax_
 
int ESFedRangeMin_
 
bool ESOnFed_ [56]
 
MonitorElementmeESDaqActive_ [56]
 
MonitorElementmeESDaqActiveMap_
 
MonitorElementmeESDaqError_
 
MonitorElementmeESDaqFraction_
 
bool mergeRuns_
 
std::string prefixME_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Detailed Description

Definition at line 11 of file ESDaqInfoTask.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 14 of file ESDaqInfoTask.h.

◆ MonitorElement

Definition at line 13 of file ESDaqInfoTask.h.

Constructor & Destructor Documentation

◆ ESDaqInfoTask()

ESDaqInfoTask::ESDaqInfoTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 29 of file ESDaqInfoTask.cc.

29  {
30  dqmStore_ = Service<DQMStore>().operator->();
31 
32  prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
33 
34  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
35 
36  ESFedRangeMin_ = ps.getUntrackedParameter<int>("ESFedRangeMin", 520);
37  ESFedRangeMax_ = ps.getUntrackedParameter<int>("ESFedRangeMax", 575);
38 
39  meESDaqFraction_ = nullptr;
40  meESDaqActiveMap_ = nullptr;
41  meESDaqError_ = nullptr;
42 
43  for (int i = 0; i < 56; i++) {
44  meESDaqActive_[i] = nullptr;
45  }
46 
47  if (ps.exists("esMapping")) {
48  edm::ParameterSet esMap = ps.getParameter<edm::ParameterSet>("esMapping");
49  es_mapping_ = new ESElectronicsMapper(esMap);
50  } else {
51  edm::LogError("ESDaqInfoTask") << "preshower mapping pointer not initialized. Temporary.";
52  es_mapping_ = nullptr;
53  }
54 }

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

◆ ~ESDaqInfoTask()

ESDaqInfoTask::~ESDaqInfoTask ( )
override

Destructor.

Definition at line 56 of file ESDaqInfoTask.cc.

56 { delete es_mapping_; }

Member Function Documentation

◆ analyze()

void ESDaqInfoTask::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotectedvirtual

Analyze.

Implements edm::EDAnalyzer.

Definition at line 181 of file ESDaqInfoTask.cc.

181 {}

◆ beginJob()

void ESDaqInfoTask::beginJob ( void  )
overrideprotectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 58 of file ESDaqInfoTask.cc.

58  {
59  char histo[200];
60 
61  if (dqmStore_) {
62  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
63 
64  sprintf(histo, "DAQSummary");
66  meESDaqFraction_->Fill(0.0);
67 
68  sprintf(histo, "DAQSummaryMap");
69  meESDaqActiveMap_ = dqmStore_->book2D(histo, histo, 80, 0.5, 80.5, 80, 0.5, 80.5);
70  meESDaqActiveMap_->setAxisTitle("Si X", 1);
71  meESDaqActiveMap_->setAxisTitle("Si Y", 2);
72 
73  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo/DAQContents");
74 
75  for (int i = 0; i < 56; i++) {
76  sprintf(histo, "EcalPreshower_%d", ESFedRangeMin_ + i);
78  meESDaqActive_[i]->Fill(0.0);
79 
80  ESOnFed_[i] = false;
81  for (int x = 0; x < 80; x++) {
82  for (int y = 0; y < 80; y++) {
83  if (getFEDNumber(x, y) == ESFedRangeMin_ + i) {
84  ESOnFed_[i] = true;
85  break;
86  }
87  }
88  if (ESOnFed_[i] == true)
89  break;
90  }
91  }
92 
93  dqmStore_->setCurrentFolder(prefixME_ + "/ESIntegrityTask");
94  sprintf(histo, "DAQError");
96  meESDaqError_->setAxisTitle("FedID", 1);
97  }
98 }

References timingPdfMaker::histo, and mps_fire::i.

◆ beginLuminosityBlock()

void ESDaqInfoTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
overrideprotectedvirtual

BeginLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 102 of file ESDaqInfoTask.cc.

102  {
103  this->reset();
104 
105  for (int x = 0; x < 80; ++x) {
106  for (int y = 0; y < 80; ++y) {
107  if (getFEDNumber(x, y) > 0)
108  meESDaqActiveMap_->setBinContent(x + 1, y + 1, 0.0);
109  else
110  meESDaqActiveMap_->setBinContent(x + 1, y + 1, -1.0);
111  }
112  }
113 
114  for (int i = 0; i < 56; i++) {
115  if (meESDaqError_)
117  }
118 
119  if (auto runInfoRec = iSetup.tryToGet<RunInfoRcd>()) {
120  edm::ESHandle<RunInfo> sumFED;
121  runInfoRec->get(sumFED);
122 
123  std::vector<int> FedsInIds = sumFED->m_fed_in;
124 
125  float ESFedCount = 0.;
126 
127  for (unsigned int fedItr = 0; fedItr < FedsInIds.size(); ++fedItr) {
128  int fedID = FedsInIds[fedItr];
129 
130  if (fedID >= ESFedRangeMin_ && fedID <= ESFedRangeMax_) {
131  if (ESOnFed_[fedID - ESFedRangeMin_])
132  ESFedCount++;
133 
134  if (meESDaqActive_[fedID - ESFedRangeMin_])
135  meESDaqActive_[fedID - ESFedRangeMin_]->Fill(1.0);
136 
137  if (meESDaqActiveMap_) {
138  for (int x = 0; x < 80; x++) {
139  for (int y = 0; y < 80; y++) {
140  if (fedID == getFEDNumber(x, y))
141  meESDaqActiveMap_->setBinContent(x + 1, y + 1, 1.0);
142  }
143  }
144  }
145 
146  if (meESDaqFraction_)
147  meESDaqFraction_->Fill(ESFedCount / 40.);
148 
149  if (meESDaqError_) {
150  for (int i = 0; i < 56; i++) {
151  if (ESOnFed_[fedID - ESFedRangeMin_])
152  meESDaqError_->setBinContent(i + 1, 1.0);
153  else
154  meESDaqError_->setBinContent(i + 1, 2.0);
155  }
156  }
157  }
158  }
159 
160  } else {
161  LogWarning("ESDaqInfoTask") << "Cannot find any RunInfoRcd" << endl;
162  }
163 }

References mps_fire::i, RunInfo::m_fed_in, reset(), and edm::EventSetup::tryToGet().

◆ endJob()

void ESDaqInfoTask::endJob ( void  )
overrideprotectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 100 of file ESDaqInfoTask.cc.

100 {}

◆ getFEDNumber()

int ESDaqInfoTask::getFEDNumber ( const int  x,
const int  y 
)
inlineprivate

Definition at line 58 of file ESDaqInfoTask.h.

58  {
59  int iz = (x < 40) ? 1 : 2;
60  int ip = (y >= 40) ? 1 : 2;
61  int ix = (x < 40) ? x : x - 40;
62  int iy = (y < 40) ? y : y - 40;
63  return (*es_mapping_).getFED(iz, ip, ix + 1, iy + 1);
64  }

References x, and y.

◆ reset()

void ESDaqInfoTask::reset ( void  )
protected

Reset.

Definition at line 165 of file ESDaqInfoTask.cc.

165  {
166  if (meESDaqFraction_)
168 
169  for (int i = 0; i < 56; i++) {
170  if (meESDaqActive_[i])
171  meESDaqActive_[i]->Reset();
172  }
173 
174  if (meESDaqActiveMap_)
176 
177  if (meESDaqError_)
178  meESDaqError_->Reset();
179 }

References mps_fire::i.

Member Data Documentation

◆ dqmStore_

DQMStore* ESDaqInfoTask::dqmStore_
private

Definition at line 39 of file ESDaqInfoTask.h.

◆ es_mapping_

ESElectronicsMapper* ESDaqInfoTask::es_mapping_
private

Definition at line 54 of file ESDaqInfoTask.h.

◆ ESFedRangeMax_

int ESDaqInfoTask::ESFedRangeMax_
private

Definition at line 52 of file ESDaqInfoTask.h.

◆ ESFedRangeMin_

int ESDaqInfoTask::ESFedRangeMin_
private

Definition at line 51 of file ESDaqInfoTask.h.

◆ ESOnFed_

bool ESDaqInfoTask::ESOnFed_[56]
private

Definition at line 56 of file ESDaqInfoTask.h.

◆ meESDaqActive_

MonitorElement* ESDaqInfoTask::meESDaqActive_[56]
private

Definition at line 46 of file ESDaqInfoTask.h.

◆ meESDaqActiveMap_

MonitorElement* ESDaqInfoTask::meESDaqActiveMap_
private

Definition at line 47 of file ESDaqInfoTask.h.

◆ meESDaqError_

MonitorElement* ESDaqInfoTask::meESDaqError_
private

Definition at line 49 of file ESDaqInfoTask.h.

◆ meESDaqFraction_

MonitorElement* ESDaqInfoTask::meESDaqFraction_
private

Definition at line 45 of file ESDaqInfoTask.h.

◆ mergeRuns_

bool ESDaqInfoTask::mergeRuns_
private

Definition at line 43 of file ESDaqInfoTask.h.

◆ prefixME_

std::string ESDaqInfoTask::prefixME_
private

Definition at line 41 of file ESDaqInfoTask.h.

ESDaqInfoTask::meESDaqError_
MonitorElement * meESDaqError_
Definition: ESDaqInfoTask.h:49
DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:355
dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
ESDaqInfoTask::meESDaqActive_
MonitorElement * meESDaqActive_[56]
Definition: ESDaqInfoTask.h:46
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
RunInfo::m_fed_in
std::vector< int > m_fed_in
Definition: RunInfo.h:25
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DDAxes::x
ESDaqInfoTask::dqmStore_
DQMStore * dqmStore_
Definition: ESDaqInfoTask.h:39
ESDaqInfoTask::meESDaqFraction_
MonitorElement * meESDaqFraction_
Definition: ESDaqInfoTask.h:45
edm::EventSetup::tryToGet
std::optional< T > tryToGet() const
Definition: EventSetup.h:94
ESElectronicsMapper
Definition: ESElectronicsMapper.h:14
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
dqm::impl::MonitorElement::Reset
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
Definition: MonitorElement.cc:354
edm::ESHandle
Definition: DTSurvey.h:22
ESDaqInfoTask::mergeRuns_
bool mergeRuns_
Definition: ESDaqInfoTask.h:43
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
RunInfoRcd
Definition: RunSummaryRcd.h:26
ESDaqInfoTask::es_mapping_
ESElectronicsMapper * es_mapping_
Definition: ESDaqInfoTask.h:54
ESDaqInfoTask::ESFedRangeMax_
int ESFedRangeMax_
Definition: ESDaqInfoTask.h:52
edm::LogWarning
Definition: MessageLogger.h:141
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:674
ESDaqInfoTask::meESDaqActiveMap_
MonitorElement * meESDaqActiveMap_
Definition: ESDaqInfoTask.h:47
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
ESDaqInfoTask::ESFedRangeMin_
int ESFedRangeMin_
Definition: ESDaqInfoTask.h:51
edm::Service
Definition: Service.h:30
ESDaqInfoTask::reset
void reset(void)
Reset.
Definition: ESDaqInfoTask.cc:165
ESDaqInfoTask::prefixME_
std::string prefixME_
Definition: ESDaqInfoTask.h:41
ESDaqInfoTask::getFEDNumber
int getFEDNumber(const int x, const int y)
Definition: ESDaqInfoTask.h:58
ESDaqInfoTask::ESOnFed_
bool ESOnFed_[56]
Definition: ESDaqInfoTask.h:56
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98