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.

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 }

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

◆ ~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.

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 }

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

◆ processEvent()

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

Definition at line 41 of file CastorLEDMonitor.cc.

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 }

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(), callgraph::module, CastorDataFrame::sample(), fileinputsource_cfi::sec, HcalCastorDetId::sector(), dqm::impl::MonitorElement::setBinContent(), and CastorDataFrame::size().

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().

mps_fire.i
i
Definition: mps_fire.py:428
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
dqm::impl::MonitorElement::setOption
virtual void setOption(const char *option)
Definition: MonitorElement.cc:878
HcalQIESample::adc
constexpr int adc() const
get the ADC sample
Definition: HcalQIESample.h:43
mod
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
gather_cfg.cout
cout
Definition: gather_cfg.py:144
CastorLEDMonitor::ievt_
int ievt_
Definition: CastorLEDMonitor.h:38
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
CastorLEDMonitor::fVerbosity
int fVerbosity
Definition: CastorLEDMonitor.h:40
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
CastorDataFrame::id
const HcalCastorDetId & id() const
Definition: CastorDataFrame.h:22
alignCSCRings.s
s
Definition: alignCSCRings.py:92
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
RawToDigi_cff.castorDigis
castorDigis
Definition: RawToDigi_cff.py:34
CastorLEDMonitor::h2qMap
MonitorElement * h2qMap
Definition: CastorLEDMonitor.h:42
CastorLEDMonitor::subsystemname
std::string subsystemname
Definition: CastorLEDMonitor.h:39
CastorDataFrame::sample
const HcalQIESample & sample(int i) const
access a sample
Definition: CastorDataFrame.h:39
CastorDataFrame
Definition: CastorDataFrame.h:15
CastorDataFrame::size
int size() const
total number of samples in the digi
Definition: CastorDataFrame.h:26
HcalCastorDetId::module
int module() const
get the module (1-2 for EM, 1-12 for HAD)
Definition: HcalCastorDetId.h:58
a
double a
Definition: hdecay.h:119
CastorLEDMonitor::h2meanMap
MonitorElement * h2meanMap
Definition: CastorLEDMonitor.h:42
HcalCastorDetId::sector
int sector() const
get the sector (1-16)
Definition: HcalCastorDetId.h:62
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
fileinputsource_cfi.sec
sec
Definition: fileinputsource_cfi.py:94
callgraph.module
module
Definition: callgraph.py:61
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:682
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
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
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:791
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:583
LedMonAdc2fc
static const float LedMonAdc2fc[128]
Definition: CastorLEDMonitor.h:11