CMS 3D CMS Logo

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

#include <CastorLEDMonitor.h>

Public Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup 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 28 of file CastorLEDMonitor.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file CastorLEDMonitor.cc.

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

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

Definition at line 22 of file CastorLEDMonitor.cc.

22 {}

Member Function Documentation

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

Definition at line 24 of file CastorLEDMonitor.cc.

References DQMStore::IBooker::book2D(), MonitorElement::getTH2F(), h2meanMap, h2qMap, ievt_, alignCSCRings::s, DQMStore::IBooker::setCurrentFolder(), and subsystemname.

24  {
25  char s[60];
26 
27  ibooker.setCurrentFolder(subsystemname + "/CastorLEDMonitor");
28 
29  sprintf(s, "CastorLEDqMap(cumulative)");
30  h2qMap = ibooker.book2D(s, s, 14, 0, 14, 16, 0, 16);
31  h2qMap->getTH2F()->SetOption("colz");
32  sprintf(s, "CastorLED_QmeanMap");
33  h2meanMap = ibooker.book2D(s, s, 14, 0, 14, 16, 0, 16);
34  h2meanMap->getTH2F()->GetXaxis()->SetTitle("moduleZ");
35  h2meanMap->getTH2F()->GetYaxis()->SetTitle("sectorPhi");
36  h2meanMap->getTH2F()->SetOption("colz");
37 
38  ievt_ = 0;
39  return;
40 }
std::string subsystemname
MonitorElement * h2meanMap
TH2F * getTH2F() const
MonitorElement * h2qMap
void CastorLEDMonitor::processEvent ( const CastorDigiCollection cast,
const CastorDbService cond 
)

Definition at line 42 of file CastorLEDMonitor.cc.

References a, HcalQIESample::adc(), edm::SortedCollection< T, SORT >::begin(), gather_cfg::cout, edm::SortedCollection< T, SORT >::empty(), edm::SortedCollection< T, SORT >::end(), MonitorElement::Fill(), fVerbosity, MonitorElement::getTH2F(), h2meanMap, h2qMap, mps_fire::i, CastorDataFrame::id(), ievt_, LedMonAdc2fc, mod(), HcalCastorDetId::module(), CastorDataFrame::sample(), HcalCastorDetId::sector(), and CastorDataFrame::size().

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

Member Data Documentation

int CastorLEDMonitor::fVerbosity
private

Definition at line 39 of file CastorLEDMonitor.h.

Referenced by CastorLEDMonitor(), and processEvent().

MonitorElement * CastorLEDMonitor::h2meanMap
private

Definition at line 41 of file CastorLEDMonitor.h.

Referenced by bookHistograms(), and processEvent().

MonitorElement* CastorLEDMonitor::h2qMap
private

Definition at line 41 of file CastorLEDMonitor.h.

Referenced by bookHistograms(), and processEvent().

int CastorLEDMonitor::ievt_
private

Definition at line 37 of file CastorLEDMonitor.h.

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

std::string CastorLEDMonitor::subsystemname
private

Definition at line 38 of file CastorLEDMonitor.h.

Referenced by bookHistograms(), and CastorLEDMonitor().