CMS 3D CMS Logo

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

#include <CastorLEDMonitor.h>

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 

Public Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &)
 
 CastorLEDMonitor (const edm::ParameterSet &ps)
 
void processEvent (const CastorDigiCollection &cast, const CastorDbService &cond)
 
 ~CastorLEDMonitor ()
 

Private Attributes

int fVerbosity
 
MonitorElementh2meanMap
 
MonitorElementh2qMap
 
int ievt_
 
std::string subsystemname
 

Detailed Description

Definition at line 27 of file CastorLEDMonitor.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 29 of file CastorLEDMonitor.h.

◆ MonitorElement

Definition at line 30 of file CastorLEDMonitor.h.

Constructor & Destructor Documentation

◆ CastorLEDMonitor()

CastorLEDMonitor::CastorLEDMonitor ( const edm::ParameterSet ps)

Definition at line 13 of file CastorLEDMonitor.cc.

References gather_cfg::cout, fVerbosity, edm::ParameterSet::getUntrackedParameter(), ievt_, AlCaHLTBitMon_QueryRunRegistry::string, and subsystemname.

13  {
14  fVerbosity = ps.getUntrackedParameter<int>("debug", 0);
15  if (fVerbosity > 0)
16  std::cout << "CastorLEDMonitor Constructor: " << this << std::endl;
17  subsystemname = ps.getUntrackedParameter<std::string>("subSystemFolder", "Castor");
18  ievt_ = 0;
19 }
std::string subsystemname
T getUntrackedParameter(std::string const &, T const &) const

◆ ~CastorLEDMonitor()

CastorLEDMonitor::~CastorLEDMonitor ( )

Definition at line 21 of file CastorLEDMonitor.cc.

21 {}

Member Function Documentation

◆ bookHistograms()

void CastorLEDMonitor::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun 
)

Definition at line 23 of file CastorLEDMonitor.cc.

References dqm::implementation::IBooker::book2D(), h2meanMap, h2qMap, ievt_, alignCSCRings::s, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), dqm::impl::MonitorElement::setOption(), and subsystemname.

23  {
24  char s[60];
25 
26  ibooker.setCurrentFolder(subsystemname + "/CastorLEDMonitor");
27 
28  sprintf(s, "CastorLEDqMap(cumulative)");
29  h2qMap = ibooker.book2D(s, s, 14, 0, 14, 16, 0, 16);
30  h2qMap->setOption("colz");
31  sprintf(s, "CastorLED_QmeanMap");
32  h2meanMap = ibooker.book2D(s, s, 14, 0, 14, 16, 0, 16);
33  h2meanMap->setAxisTitle("moduleZ", /* axis */ 1);
34  h2meanMap->setAxisTitle("sectorPhi", /* axis */ 2);
35  h2meanMap->setOption("colz");
36 
37  ievt_ = 0;
38  return;
39 }
std::string subsystemname
MonitorElement * h2meanMap
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
virtual void setOption(const char *option)
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:221
MonitorElement * h2qMap
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ processEvent()

void CastorLEDMonitor::processEvent ( const CastorDigiCollection cast,
const CastorDbService cond 
)

Definition at line 41 of file CastorLEDMonitor.cc.

References a, HcalQIESample::adc(), RawToDigi_cff::castorDigis, gather_cfg::cout, dqm::impl::MonitorElement::Fill(), fVerbosity, dqm::impl::MonitorElement::getBinContent(), h2meanMap, h2qMap, mps_fire::i, CastorDataFrame::id(), ievt_, dqmiolumiharvest::j, LedMonAdc2fc, mod(), HcalCastorDetId::module(), CastorDataFrame::sample(), fileinputsource_cfi::sec, nano_mu_digi_cff::sector, HcalCastorDetId::sector(), dqm::impl::MonitorElement::setBinContent(), and CastorDataFrame::size().

41  {
42  if (fVerbosity > 0)
43  std::cout << "CastorLEDMonitor::processEvent (start)" << std::endl;
44 
45  /* be implemented
46  edm::Handle<HcalTBTriggerData> trigger_data;
47  iEvent.getByToken(tok_tb_, trigger_data);
48  if(trigger_data.isValid())
49  if(trigger_data->triggerWord()==6) LEDevent=true;
50  */
51 
52  if (castorDigis.empty()) {
53  if (fVerbosity > 0)
54  std::cout << "CastorLEDMonitor::processEvent NO Castor Digis" << std::endl;
55  return;
56  }
57 
58  for (CastorDigiCollection::const_iterator j = castorDigis.begin(); j != castorDigis.end(); j++) {
59  const CastorDataFrame digi = (const CastorDataFrame)(*j);
60  int module = digi.id().module() - 1;
61  int sector = digi.id().sector() - 1;
62  double qsum = 0.;
63  for (int i = 0; i < digi.size(); i++) {
64  int dig = digi.sample(i).adc() & 0x7f;
65  float ets = LedMonAdc2fc[dig] + 0.5;
66  // h2qts->Fill(i,ets);
67  qsum += ets;
68  }
69  // int ind = sector*14 + module;
70  // h2QvsPMT->Fill(ind,qsum);
71  h2qMap->Fill(module, sector, qsum);
72  } // end for(CastorDigiCollection::const_iterator j=castorDigis...
73 
74  ievt_++;
75  if (ievt_ % 100 == 0) {
76  for (int mod = 1; mod <= 14; mod++)
77  for (int sec = 1; sec <= 16; sec++) {
78  double a = h2qMap->getBinContent(mod, sec);
79  h2meanMap->setBinContent(mod, sec, a / double(ievt_));
80  }
81  }
82 
83  if (fVerbosity > 0)
84  std::cout << "CastorLEDMonitor::processEvent(end)" << std::endl;
85  return;
86 }
MonitorElement * h2meanMap
const HcalQIESample & sample(int i) const
access a sample
std::vector< T >::const_iterator const_iterator
void Fill(long long x)
int size() const
total number of samples in the digi
int module() const
get the module (1-2 for EM, 1-12 for HAD)
int sector() const
get the sector (1-16)
const HcalCastorDetId & id() const
static const float LedMonAdc2fc[128]
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
constexpr int adc() const
get the ADC sample
Definition: HcalQIESample.h:43
double a
Definition: hdecay.h:121
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
MonitorElement * h2qMap
virtual double getBinContent(int binx) const
get content of bin (1-D)

Member Data Documentation

◆ fVerbosity

int CastorLEDMonitor::fVerbosity
private

Definition at line 40 of file CastorLEDMonitor.h.

Referenced by CastorLEDMonitor(), and processEvent().

◆ h2meanMap

MonitorElement * CastorLEDMonitor::h2meanMap
private

Definition at line 42 of file CastorLEDMonitor.h.

Referenced by bookHistograms(), and processEvent().

◆ h2qMap

MonitorElement* CastorLEDMonitor::h2qMap
private

Definition at line 42 of file CastorLEDMonitor.h.

Referenced by bookHistograms(), and processEvent().

◆ ievt_

int CastorLEDMonitor::ievt_
private

Definition at line 38 of file CastorLEDMonitor.h.

Referenced by bookHistograms(), CastorLEDMonitor(), and processEvent().

◆ subsystemname

std::string CastorLEDMonitor::subsystemname
private

Definition at line 39 of file CastorLEDMonitor.h.

Referenced by bookHistograms(), and CastorLEDMonitor().