CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 40 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.

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

Definition at line 23 of file CastorLEDMonitor.cc.

23 { }

Member Function Documentation

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

Definition at line 25 of file CastorLEDMonitor.cc.

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

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

Definition at line 45 of file CastorLEDMonitor.cc.

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

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

Referenced by CastorLEDMonitor(), and processEvent().

MonitorElement * CastorLEDMonitor::h2meanMap
private

Definition at line 54 of file CastorLEDMonitor.h.

Referenced by bookHistograms(), and processEvent().

MonitorElement* CastorLEDMonitor::h2qMap
private

Definition at line 54 of file CastorLEDMonitor.h.

Referenced by bookHistograms(), and processEvent().

int CastorLEDMonitor::ievt_
private

Definition at line 50 of file CastorLEDMonitor.h.

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

std::string CastorLEDMonitor::subsystemname
private

Definition at line 51 of file CastorLEDMonitor.h.

Referenced by bookHistograms(), and CastorLEDMonitor().