30 usesResource(
"DQMStore");
32 runInfoToken_ = esConsumes<edm::Transition::BeginLuminosityBlock>();
40 meESDaqFraction_ =
nullptr;
41 meESDaqActiveMap_ =
nullptr;
42 meESDaqError_ =
nullptr;
44 for (
int i = 0;
i < 56;
i++) {
45 meESDaqActive_[
i] =
nullptr;
48 if (ps.
exists(
"esMapping")) {
52 edm::LogError(
"ESDaqInfoTask") <<
"preshower mapping pointer not initialized. Temporary.";
53 es_mapping_ =
nullptr;
63 dqmStore_->setCurrentFolder(prefixME_ +
"/EventInfo");
65 sprintf(
histo,
"DAQSummary");
66 meESDaqFraction_ = dqmStore_->bookFloat(
histo);
67 meESDaqFraction_->Fill(0.0);
69 sprintf(
histo,
"DAQSummaryMap");
70 meESDaqActiveMap_ = dqmStore_->book2D(
histo,
histo, 80, 0.5, 80.5, 80, 0.5, 80.5);
71 meESDaqActiveMap_->setAxisTitle(
"Si X", 1);
72 meESDaqActiveMap_->setAxisTitle(
"Si Y", 2);
74 dqmStore_->setCurrentFolder(prefixME_ +
"/EventInfo/DAQContents");
76 for (
int i = 0;
i < 56;
i++) {
77 sprintf(
histo,
"EcalPreshower_%d", ESFedRangeMin_ +
i);
78 meESDaqActive_[
i] = dqmStore_->bookFloat(
histo);
79 meESDaqActive_[
i]->Fill(0.0);
82 for (
int x = 0;
x < 80;
x++) {
83 for (
int y = 0; y < 80; y++) {
84 if (getFEDNumber(
x, y) == ESFedRangeMin_ +
i) {
89 if (ESOnFed_[
i] ==
true)
94 dqmStore_->setCurrentFolder(prefixME_ +
"/ESIntegrityTask");
95 sprintf(
histo,
"DAQError");
96 meESDaqError_ = dqmStore_->book1D(
histo,
histo, 56, ESFedRangeMin_ - 0.5, ESFedRangeMax_ + 0.5);
97 meESDaqError_->setAxisTitle(
"FedID", 1);
106 for (
int x = 0;
x < 80; ++
x) {
107 for (
int y = 0; y < 80; ++y) {
108 if (getFEDNumber(
x, y) > 0)
109 meESDaqActiveMap_->setBinContent(
x + 1, y + 1, 0.0);
111 meESDaqActiveMap_->setBinContent(
x + 1, y + 1, -1.0);
115 for (
int i = 0;
i < 56;
i++) {
117 meESDaqError_->setBinContent(
i, 0.0);
121 const auto& sumFED = runInfoRec->getHandle(runInfoToken_);
123 std::vector<int> FedsInIds = sumFED->m_fed_in;
125 float ESFedCount = 0.;
127 for (
unsigned int fedItr = 0; fedItr < FedsInIds.size(); ++fedItr) {
128 int fedID = FedsInIds[fedItr];
130 if (fedID >= ESFedRangeMin_ && fedID <= ESFedRangeMax_) {
131 if (ESOnFed_[fedID - ESFedRangeMin_])
134 if (meESDaqActive_[fedID - ESFedRangeMin_])
135 meESDaqActive_[fedID - ESFedRangeMin_]->Fill(1.0);
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);
146 if (meESDaqFraction_)
147 meESDaqFraction_->Fill(ESFedCount / 40.);
150 for (
int i = 0;
i < 56;
i++) {
151 if (ESOnFed_[fedID - ESFedRangeMin_])
152 meESDaqError_->setBinContent(
i + 1, 1.0);
154 meESDaqError_->setBinContent(
i + 1, 2.0);
161 LogWarning(
"ESDaqInfoTask") <<
"Cannot find any RunInfoRcd" << endl;
168 if (meESDaqFraction_)
169 meESDaqFraction_->Reset();
171 for (
int i = 0;
i < 56;
i++) {
172 if (meESDaqActive_[
i])
173 meESDaqActive_[
i]->Reset();
176 if (meESDaqActiveMap_)
177 meESDaqActiveMap_->Reset();
180 meESDaqError_->Reset();
void endJob(void) override
EndJob.
T getParameter(std::string const &) const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::optional< T > tryToGet() const
void beginJob(void) override
BeginJob.
Log< level::Error, false > LogError
T getUntrackedParameter(std::string const &, T const &) const
~ESDaqInfoTask() override
Destructor.
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
EndLuminosityBlock.
#define DEFINE_FWK_MODULE(type)
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Analyze.
Namespace of DDCMS conversion namespace.
void beginLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup) override
BeginLuminosityBlock.
Log< level::Warning, false > LogWarning
void reset(double vett[256])
ESDaqInfoTask(const edm::ParameterSet &ps)
Constructor.