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>

Inheritance diagram for CastorLEDMonitor:
CastorBaseMonitor

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)
 
void setup (const edm::ParameterSet &ps)
 
 ~CastorLEDMonitor ()
 
- Public Member Functions inherited from CastorBaseMonitor
 CastorBaseMonitor ()
 
virtual ~CastorBaseMonitor ()
 

Private Attributes

MonitorElementh2meanMap
 
MonitorElementh2qMap
 
int ievt_
 
std::string subsystemname
 

Additional Inherited Members

- Protected Attributes inherited from CastorBaseMonitor
std::string baseFolder_
 
edm::CPUTimer cpu_timer
 
int fVerbosity
 
std::string rootFolder_
 
bool showTiming
 

Detailed Description

Definition at line 34 of file CastorLEDMonitor.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file CastorLEDMonitor.cc.

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

15 {
17  ps.getUntrackedParameter<std::string>("subSystemFolder","Castor");
18  ievt_=0;
19 }
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 ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)

Definition at line 34 of file CastorLEDMonitor.cc.

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

Referenced by CastorMonitorModule::bookHistograms().

36 {
37  char s[60];
38  if(fVerbosity>0) std::cout<<"CastorLEDMonitor::bookHistograms"<<std::endl;
39 
40  ibooker.setCurrentFolder(subsystemname + "/CastorLEDMonitor");
41  sprintf(s,"CastorLED_qVsTS(allPMT)");
42  //h2qts = ibooker.book2D(s,s, 10,0,10., 5000,0.,10000.);
43  //h2qts->getTH2F()->GetXaxis()->SetTitle("TS");
44  //h2qts->getTH2F()->GetYaxis()->SetTitle("Qcastor(fC)");
45  //h2qts->getTH2F()->SetOption("colz");
46 
47  sprintf(s,"CastorLED_qVsPMT");
48  //h2QvsPMT = ibooker.book2D(s,s, 224,0,224, 5000,0.,50000.);
49  //h2QvsPMT->getTH2F()->GetXaxis()->SetTitle("sector*14+module");
50  //h2QvsPMT->getTH2F()->GetYaxis()->SetTitle("RecHit");
51  //h2QvsPMT->getTH2F()->SetOption("colz");
52 
53  sprintf(s,"CastorLEDqMap(cumulative)");
54  h2qMap = ibooker.book2D(s,s,14, 0,14, 16, 0,16);
55  h2qMap->getTH2F()->SetOption("colz");
56  sprintf(s,"CastorLED_QmeanMap");
57  h2meanMap = ibooker.book2D(s,s,14, 0,14, 16, 0,16);
58  h2meanMap->getTH2F()->GetXaxis()->SetTitle("moduleZ");
59  h2meanMap->getTH2F()->GetYaxis()->SetTitle("sectorPhi");
60  h2meanMap->getTH2F()->SetOption("colz");
61 
62  ievt_=0;
63  if(fVerbosity>0) std::cout<<"CastorLEDMonitor::beginRun(end)"<<std::endl;
64  return;
65 }
std::string subsystemname
MonitorElement * h2meanMap
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
tuple cout
Definition: gather_cfg.py:145
TH2F * getTH2F(void) const
MonitorElement * h2qMap
void CastorLEDMonitor::processEvent ( const CastorDigiCollection cast,
const CastorDbService cond 
)

Definition at line 68 of file CastorLEDMonitor.cc.

References a, HcalQIESample::adc(), edm::SortedCollection< T, SORT >::begin(), gather_cfg::cout, edm::SortedCollection< T, SORT >::end(), MonitorElement::Fill(), CastorBaseMonitor::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().

Referenced by CastorMonitorModule::analyze().

69  {
70  if(fVerbosity>0) std::cout<<"CastorLEDMonitor::processEvent (start)"<<std::endl;
71 
72 /* be implemented
73  edm::Handle<HcalTBTriggerData> trigger_data;
74  iEvent.getByToken(tok_tb_, trigger_data);
75  if(trigger_data.isValid())
76  if(trigger_data->triggerWord()==6) LEDevent=true;
77 */
78 
79  if(castorDigis.size() <= 0) {
80  if(fVerbosity > 0)
81  std::cout<<"CastorLEDMonitor::processEvent NO Castor Digis"<<std::endl;
82  return;
83  }
84 
86  {
87  const CastorDataFrame digi = (const CastorDataFrame)(*j);
88  int module = digi.id().module()-1;
89  int sector = digi.id().sector()-1;
90  double qsum=0.;
91  for(int i=0; i<digi.size(); i++) {
92  int dig=digi.sample(i).adc() & 0x7f;
93  float ets = LedMonAdc2fc[dig] + 0.5;
94  //h2qts->Fill(i,ets);
95  qsum += ets;
96  }
97  //int ind = sector*14 + module;
98  //h2QvsPMT->Fill(ind,qsum);
99  h2qMap->Fill(module,sector,qsum);
100  } // end for(CastorDigiCollection::const_iterator j=castorDigis...
101 
102  ievt_++;
103  if(ievt_%100 == 0) {
104  for(int mod=1; mod<=14; mod++) for(int sec=1; sec<=16;sec++) {
105  double a= h2qMap->getTH2F()->GetBinContent(mod,sec);
106  h2meanMap->getTH2F()->SetBinContent(mod,sec,a/double(ievt_));
107  }
108  }
109 
110 //if(fVerbosity>0) std::cout<<"CastorLEDMonitor::processEvent(end)"<<std::endl;
111  return;
112 }
int i
Definition: DBlmapReader.cc:9
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
MonitorElement * h2meanMap
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
void CastorLEDMonitor::setup ( const edm::ParameterSet ps)
virtual

Reimplemented from CastorBaseMonitor.

Definition at line 25 of file CastorLEDMonitor.cc.

References gather_cfg::cout, CastorBaseMonitor::fVerbosity, ievt_, and CastorBaseMonitor::setup().

Referenced by CastorMonitorModule::CastorMonitorModule().

26 {
28  ievt_=0;
29  if(fVerbosity>0) std::cout<<"CastorLEDMonitor::setup (end)"<<std::endl;
30  return;
31 }
virtual void setup(const edm::ParameterSet &ps)
tuple cout
Definition: gather_cfg.py:145

Member Data Documentation

MonitorElement* CastorLEDMonitor::h2meanMap
private

Definition at line 50 of file CastorLEDMonitor.h.

Referenced by bookHistograms(), and processEvent().

MonitorElement* CastorLEDMonitor::h2qMap
private

Definition at line 49 of file CastorLEDMonitor.h.

Referenced by bookHistograms(), and processEvent().

int CastorLEDMonitor::ievt_
private

Definition at line 45 of file CastorLEDMonitor.h.

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

std::string CastorLEDMonitor::subsystemname
private

Definition at line 46 of file CastorLEDMonitor.h.

Referenced by bookHistograms(), and CastorLEDMonitor().