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::one::EDAnalyzer< edm::one::SharedResources, edm::one::WatchLuminosityBlocks > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase 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::one::EDAnalyzer< edm::one::SharedResources, edm::one::WatchLuminosityBlocks >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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)
 

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 endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 EndLuminosityBlock. More...
 
void reset (void)
 Reset. More...
 
- 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)
 

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_
 
edm::ESGetToken< RunInfo, RunInfoRcdrunInfoToken_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

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.

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

29  {
30  usesResource("DQMStore");
32  runInfoToken_ = esConsumes<edm::Transition::BeginLuminosityBlock>();
33  prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
34 
35  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
36 
37  ESFedRangeMin_ = ps.getUntrackedParameter<int>("ESFedRangeMin", 520);
38  ESFedRangeMax_ = ps.getUntrackedParameter<int>("ESFedRangeMax", 575);
39 
40  meESDaqFraction_ = nullptr;
41  meESDaqActiveMap_ = nullptr;
42  meESDaqError_ = nullptr;
43 
44  for (int i = 0; i < 56; i++) {
45  meESDaqActive_[i] = nullptr;
46  }
47 
48  if (ps.exists("esMapping")) {
49  edm::ParameterSet esMap = ps.getParameter<edm::ParameterSet>("esMapping");
50  es_mapping_ = new ESElectronicsMapper(esMap);
51  } else {
52  edm::LogError("ESDaqInfoTask") << "preshower mapping pointer not initialized. Temporary.";
53  es_mapping_ = nullptr;
54  }
55 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string prefixME_
Definition: ESDaqInfoTask.h:44
bool exists(std::string const &parameterName) const
checks if a parameter exists
MonitorElement * meESDaqActiveMap_
Definition: ESDaqInfoTask.h:50
Log< level::Error, false > LogError
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
Definition: ESDaqInfoTask.h:43
MonitorElement * meESDaqError_
Definition: ESDaqInfoTask.h:52
DQMStore * dqmStore_
Definition: ESDaqInfoTask.h:42
MonitorElement * meESDaqActive_[56]
Definition: ESDaqInfoTask.h:49
MonitorElement * meESDaqFraction_
Definition: ESDaqInfoTask.h:48
ESElectronicsMapper * es_mapping_
Definition: ESDaqInfoTask.h:57

◆ ~ESDaqInfoTask()

ESDaqInfoTask::~ESDaqInfoTask ( )
override

Destructor.

Definition at line 57 of file ESDaqInfoTask.cc.

57 { delete es_mapping_; }
ESElectronicsMapper * es_mapping_
Definition: ESDaqInfoTask.h:57

Member Function Documentation

◆ analyze()

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

Analyze.

Implements edm::one::EDAnalyzerBase.

Definition at line 183 of file ESDaqInfoTask.cc.

183 {}

◆ beginJob()

void ESDaqInfoTask::beginJob ( void  )
overrideprotectedvirtual

BeginJob.

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 59 of file ESDaqInfoTask.cc.

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

59  {
60  char histo[200];
61 
62  if (dqmStore_) {
63  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
64 
65  sprintf(histo, "DAQSummary");
67  meESDaqFraction_->Fill(0.0);
68 
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);
73 
74  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo/DAQContents");
75 
76  for (int i = 0; i < 56; i++) {
77  sprintf(histo, "EcalPreshower_%d", ESFedRangeMin_ + i);
79  meESDaqActive_[i]->Fill(0.0);
80 
81  ESOnFed_[i] = false;
82  for (int x = 0; x < 80; x++) {
83  for (int y = 0; y < 80; y++) {
84  if (getFEDNumber(x, y) == ESFedRangeMin_ + i) {
85  ESOnFed_[i] = true;
86  break;
87  }
88  }
89  if (ESOnFed_[i] == true)
90  break;
91  }
92  }
93 
94  dqmStore_->setCurrentFolder(prefixME_ + "/ESIntegrityTask");
95  sprintf(histo, "DAQError");
97  meESDaqError_->setAxisTitle("FedID", 1);
98  }
99 }
bool ESOnFed_[56]
Definition: ESDaqInfoTask.h:59
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
int getFEDNumber(const int x, const int y)
Definition: ESDaqInfoTask.h:61
std::string prefixME_
Definition: ESDaqInfoTask.h:44
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:646
MonitorElement * meESDaqActiveMap_
Definition: ESDaqInfoTask.h:50
void Fill(long long x)
MonitorElement * meESDaqError_
Definition: ESDaqInfoTask.h:52
DQMStore * dqmStore_
Definition: ESDaqInfoTask.h:42
MonitorElement * meESDaqActive_[56]
Definition: ESDaqInfoTask.h:49
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:212
MonitorElement * meESDaqFraction_
Definition: ESDaqInfoTask.h:48
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ beginLuminosityBlock()

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

BeginLuminosityBlock.

Definition at line 103 of file ESDaqInfoTask.cc.

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

103  {
104  this->reset();
105 
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);
110  else
111  meESDaqActiveMap_->setBinContent(x + 1, y + 1, -1.0);
112  }
113  }
114 
115  for (int i = 0; i < 56; i++) {
116  if (meESDaqError_)
118  }
119 
120  if (auto runInfoRec = iSetup.tryToGet<RunInfoRcd>()) {
121  const auto& sumFED = runInfoRec->getHandle(runInfoToken_);
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 }
bool ESOnFed_[56]
Definition: ESDaqInfoTask.h:59
int getFEDNumber(const int x, const int y)
Definition: ESDaqInfoTask.h:61
std::optional< T > tryToGet() const
Definition: EventSetup.h:100
MonitorElement * meESDaqActiveMap_
Definition: ESDaqInfoTask.h:50
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
Definition: ESDaqInfoTask.h:43
void Fill(long long x)
void reset(void)
Reset.
MonitorElement * meESDaqError_
Definition: ESDaqInfoTask.h:52
MonitorElement * meESDaqActive_[56]
Definition: ESDaqInfoTask.h:49
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * meESDaqFraction_
Definition: ESDaqInfoTask.h:48
Log< level::Warning, false > LogWarning

◆ endJob()

void ESDaqInfoTask::endJob ( void  )
overrideprotectedvirtual

EndJob.

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 101 of file ESDaqInfoTask.cc.

101 {}

◆ endLuminosityBlock()

void ESDaqInfoTask::endLuminosityBlock ( const edm::LuminosityBlock ,
const edm::EventSetup  
)
overrideprotected

EndLuminosityBlock.

Definition at line 165 of file ESDaqInfoTask.cc.

165 {}

◆ getFEDNumber()

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

Definition at line 61 of file ESDaqInfoTask.h.

References x, and y.

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

◆ reset()

void ESDaqInfoTask::reset ( void  )
protected

Reset.

Definition at line 167 of file ESDaqInfoTask.cc.

References mps_fire::i.

167  {
168  if (meESDaqFraction_)
170 
171  for (int i = 0; i < 56; i++) {
172  if (meESDaqActive_[i])
173  meESDaqActive_[i]->Reset();
174  }
175 
176  if (meESDaqActiveMap_)
178 
179  if (meESDaqError_)
180  meESDaqError_->Reset();
181 }
MonitorElement * meESDaqActiveMap_
Definition: ESDaqInfoTask.h:50
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
MonitorElement * meESDaqError_
Definition: ESDaqInfoTask.h:52
MonitorElement * meESDaqActive_[56]
Definition: ESDaqInfoTask.h:49
MonitorElement * meESDaqFraction_
Definition: ESDaqInfoTask.h:48

Member Data Documentation

◆ dqmStore_

DQMStore* ESDaqInfoTask::dqmStore_
private

Definition at line 42 of file ESDaqInfoTask.h.

◆ es_mapping_

ESElectronicsMapper* ESDaqInfoTask::es_mapping_
private

Definition at line 57 of file ESDaqInfoTask.h.

◆ ESFedRangeMax_

int ESDaqInfoTask::ESFedRangeMax_
private

Definition at line 55 of file ESDaqInfoTask.h.

◆ ESFedRangeMin_

int ESDaqInfoTask::ESFedRangeMin_
private

Definition at line 54 of file ESDaqInfoTask.h.

◆ ESOnFed_

bool ESDaqInfoTask::ESOnFed_[56]
private

Definition at line 59 of file ESDaqInfoTask.h.

◆ meESDaqActive_

MonitorElement* ESDaqInfoTask::meESDaqActive_[56]
private

Definition at line 49 of file ESDaqInfoTask.h.

◆ meESDaqActiveMap_

MonitorElement* ESDaqInfoTask::meESDaqActiveMap_
private

Definition at line 50 of file ESDaqInfoTask.h.

◆ meESDaqError_

MonitorElement* ESDaqInfoTask::meESDaqError_
private

Definition at line 52 of file ESDaqInfoTask.h.

◆ meESDaqFraction_

MonitorElement* ESDaqInfoTask::meESDaqFraction_
private

Definition at line 48 of file ESDaqInfoTask.h.

◆ mergeRuns_

bool ESDaqInfoTask::mergeRuns_
private

Definition at line 46 of file ESDaqInfoTask.h.

◆ prefixME_

std::string ESDaqInfoTask::prefixME_
private

Definition at line 44 of file ESDaqInfoTask.h.

◆ runInfoToken_

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

Definition at line 43 of file ESDaqInfoTask.h.