31 runInfoToken_ = esConsumes<edm::Transition::BeginLuminosityBlock>();
39 meESDaqFraction_ =
nullptr;
40 meESDaqActiveMap_ =
nullptr;
41 meESDaqError_ =
nullptr;
43 for (
int i = 0;
i < 56;
i++) {
44 meESDaqActive_[
i] =
nullptr;
47 if (ps.
exists(
"esMapping")) {
51 edm::LogError(
"ESDaqInfoTask") <<
"preshower mapping pointer not initialized. Temporary.";
52 es_mapping_ =
nullptr;
62 dqmStore_->setCurrentFolder(prefixME_ +
"/EventInfo");
64 sprintf(histo,
"DAQSummary");
65 meESDaqFraction_ = dqmStore_->bookFloat(histo);
66 meESDaqFraction_->Fill(0.0);
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);
73 dqmStore_->setCurrentFolder(prefixME_ +
"/EventInfo/DAQContents");
75 for (
int i = 0;
i < 56;
i++) {
76 sprintf(histo,
"EcalPreshower_%d", ESFedRangeMin_ +
i);
77 meESDaqActive_[
i] = dqmStore_->bookFloat(histo);
78 meESDaqActive_[
i]->Fill(0.0);
81 for (
int x = 0;
x < 80;
x++) {
82 for (
int y = 0; y < 80; y++) {
83 if (getFEDNumber(
x, y) == ESFedRangeMin_ +
i) {
88 if (ESOnFed_[
i] ==
true)
93 dqmStore_->setCurrentFolder(prefixME_ +
"/ESIntegrityTask");
94 sprintf(histo,
"DAQError");
95 meESDaqError_ = dqmStore_->book1D(histo, histo, 56, ESFedRangeMin_ - 0.5, ESFedRangeMax_ + 0.5);
96 meESDaqError_->setAxisTitle(
"FedID", 1);
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);
110 meESDaqActiveMap_->setBinContent(
x + 1, y + 1, -1.0);
114 for (
int i = 0;
i < 56;
i++) {
116 meESDaqError_->setBinContent(
i, 0.0);
120 const auto& sumFED = runInfoRec->getHandle(runInfoToken_);
122 std::vector<int> FedsInIds = sumFED->m_fed_in;
124 float ESFedCount = 0.;
126 for (
unsigned int fedItr = 0; fedItr < FedsInIds.size(); ++fedItr) {
127 int fedID = FedsInIds[fedItr];
129 if (fedID >= ESFedRangeMin_ && fedID <= ESFedRangeMax_) {
130 if (ESOnFed_[fedID - ESFedRangeMin_])
133 if (meESDaqActive_[fedID - ESFedRangeMin_])
134 meESDaqActive_[fedID - ESFedRangeMin_]->Fill(1.0);
136 if (meESDaqActiveMap_) {
137 for (
int x = 0;
x < 80;
x++) {
138 for (
int y = 0; y < 80; y++) {
139 if (fedID == getFEDNumber(
x, y))
140 meESDaqActiveMap_->setBinContent(
x + 1, y + 1, 1.0);
145 if (meESDaqFraction_)
146 meESDaqFraction_->Fill(ESFedCount / 40.);
149 for (
int i = 0;
i < 56;
i++) {
150 if (ESOnFed_[fedID - ESFedRangeMin_])
151 meESDaqError_->setBinContent(
i + 1, 1.0);
153 meESDaqError_->setBinContent(
i + 1, 2.0);
160 LogWarning(
"ESDaqInfoTask") <<
"Cannot find any RunInfoRcd" << endl;
165 if (meESDaqFraction_)
166 meESDaqFraction_->Reset();
168 for (
int i = 0;
i < 56;
i++) {
169 if (meESDaqActive_[
i])
170 meESDaqActive_[
i]->Reset();
173 if (meESDaqActiveMap_)
174 meESDaqActiveMap_->Reset();
177 meESDaqError_->Reset();
void endJob(void) override
EndJob.
T getUntrackedParameter(std::string const &, T const &) const
std::optional< T > tryToGet() const
const edm::EventSetup & c
#define DEFINE_FWK_MODULE(type)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void beginJob(void) override
BeginJob.
Log< level::Error, false > LogError
~ESDaqInfoTask() override
Destructor.
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Analyze.
void beginLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup) override
BeginLuminosityBlock.
T getParameter(std::string const &) const
Log< level::Warning, false > LogWarning
void reset(double vett[256])
ESDaqInfoTask(const edm::ParameterSet &ps)
Constructor.