CMS 3D CMS Logo

CastorLEDMonitor.cc
Go to the documentation of this file.
3 
4 //***************************************************//
5 //********** CastorLEDMonitor ***********************//
6 //********** Author: Dmytro Volyanskyy ************//
7 //********** Date : 20.11.2008 (first version) ******//
8 //---------- last revision: 31.05.2011 (Panos Katsas)
9 //***************************************************//
10 //---- critical revision 26.06.2014 (Vladimir Popov)
11 //==================================================================//
12 
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 }
20 
22 
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 }
40 
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 }
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:887
edm::Run
Definition: Run.h:45
CastorLEDMonitor::processEvent
void processEvent(const CastorDigiCollection &cast, const CastorDbService &cond)
Definition: CastorLEDMonitor.cc:41
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::SortedCollection
Definition: SortedCollection.h:49
DQMStore.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
CastorDataFrame::id
const HcalCastorDetId & id() const
Definition: CastorDataFrame.h:22
CastorLEDMonitor.h
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::~CastorLEDMonitor
~CastorLEDMonitor()
Definition: CastorLEDMonitor.cc:21
CastorLEDMonitor::h2qMap
MonitorElement * h2qMap
Definition: CastorLEDMonitor.h:42
CastorLEDMonitor::subsystemname
std::string subsystemname
Definition: CastorLEDMonitor.h:39
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CastorDataFrame::sample
const HcalQIESample & sample(int i) const
access a sample
Definition: CastorDataFrame.h:39
cond
Definition: plugin.cc:23
CastorDataFrame
Definition: CastorDataFrame.h:15
edm::ParameterSet
Definition: ParameterSet.h:47
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
CastorLEDMonitor::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &)
Definition: CastorLEDMonitor.cc:23
CastorDbService
Definition: CastorDbService.h:28
fileinputsource_cfi.sec
sec
Definition: fileinputsource_cfi.py:87
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
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
dqm::implementation::IBooker
Definition: DQMStore.h:43
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:800
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:592
CastorLEDMonitor::CastorLEDMonitor
CastorLEDMonitor(const edm::ParameterSet &ps)
Definition: CastorLEDMonitor.cc:13
LedMonAdc2fc
static const float LedMonAdc2fc[128]
Definition: CastorLEDMonitor.h:11