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
CastorRecHitMonitor Class Reference

#include <CastorRecHitMonitor.h>

Public Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
 
 CastorRecHitMonitor (const edm::ParameterSet &ps)
 
void processEvent (const CastorRecHitCollection &castorHits)
 
void processEventJets (const reco::BasicJetCollection &Jets)
 
void processEventTowers (const reco::CastorTowerCollection &castorTowers)
 
 ~CastorRecHitMonitor ()
 

Private Attributes

float energyInEachChannel [14][16]
 
int fVerbosity = 0
 
TH2F * h2RecHitMap
 
MonitorElementh2RHchan
 
MonitorElementh2RHentriesMap
 
MonitorElementh2RHmap
 
MonitorElementh2RHoccmap
 
MonitorElementh2RHvsSec
 
MonitorElementh2TowerEMhad
 
MonitorElementhallchan
 
MonitorElementhJetEnergy
 
MonitorElementhJetEta
 
MonitorElementhJetPhi
 
MonitorElementhJetsMultipl
 
MonitorElementhRHtime
 
MonitorElementhTowerDepth
 
MonitorElementhTowerE
 
MonitorElementhTowerMultipl
 
int ievt_
 
std::string subsystemname
 

Detailed Description

Definition at line 21 of file CastorRecHitMonitor.h.

Constructor & Destructor Documentation

CastorRecHitMonitor::CastorRecHitMonitor ( const edm::ParameterSet ps)

Definition at line 17 of file CastorRecHitMonitor.cc.

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

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

Definition at line 26 of file CastorRecHitMonitor.cc.

26 {}

Member Function Documentation

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

Definition at line 28 of file CastorRecHitMonitor.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::bookProfile2D(), gather_cfg::cout, JetChargeProducer_cfi::exp, MonitorElement::getTH1F(), MonitorElement::getTH2F(), MonitorElement::getTProfile2D(), mps_fire::i, cmsBatch::log, alignCSCRings::s, and DQMStore::IBooker::setCurrentFolder().

30  {
31  char s[60];
32  if (fVerbosity > 0)
33  std::cout << "CastorRecHitMonitor::bookHistograms" << std::endl;
34  ibooker.setCurrentFolder(subsystemname + "/CastorRecHitMonitor");
35 
36  const int N_Sec = 16;
37  const int nySec = 20;
38  float ySec[nySec + 1];
39  float xSec[N_Sec + 1];
40  double E0sec = 1. / 1024.;
41  ySec[0] = 0.;
42  ySec[1] = E0sec;
43  double lnBsec = log(2.);
44  for (int j = 1; j < nySec; j++) ySec[j + 1] = E0sec * exp(j * lnBsec);
45  for (int i = 0; i <= N_Sec; i++) xSec[i] = i;
46 
47  sprintf(s, "Castor Energy by Sectors #Phi");
48  h2RHvsSec = ibooker.book2D(s, s, N_Sec, xSec, nySec, ySec);
49  h2RHvsSec->getTH2F()->GetXaxis()->SetTitle("sector #Phi");
50  h2RHvsSec->getTH2F()->GetYaxis()->SetTitle("RecHit / GeV");
51  h2RHvsSec->getTH2F()->SetOption("colz");
52 
53  const int nxCh = 224;
54  const int nyE = 18;
55  float xCh[nxCh + 1];
56  float yErh[nyE + 1];
57  for (int i = 0; i <= nxCh; i++) xCh[i] = i;
58  double E0 = 1. / 1024.;
59  double lnA = log(2.);
60  yErh[0] = 0.;
61  yErh[1] = E0;
62  for (int j = 1; j < nyE; j++) yErh[j + 1] = E0 * exp(j * lnA);
63 
64  string st = "Castor Cell Energy Map (cell-wise)";
65  h2RHchan = ibooker.book2D(st, st + ";moduleZ*16 + sector #Phi;RecHit / GeV",
66  nxCh, xCh, nyE, yErh);
67  h2RHchan->getTH2F()->SetOption("colz");
68 
69  sprintf(s, "Castor Cell Energy");
70  hallchan = ibooker.book1D(s, s, nyE, yErh);
71  hallchan->getTH1F()->GetXaxis()->SetTitle("GeV");
72 
73  st = "Castor cell avr Energy per event Map Z-Phi";
74  h2RHoccmap = ibooker.bookProfile2D(st, st + ";module Z;sector Phi", 14, 0, 14,
75  16, 0, 16, 0., 1.e10, "");
76  h2RHoccmap->getTProfile2D()->SetOption("colz");
77 
78  sprintf(s, "CastorRecHitEntriesMap");
79  h2RHentriesMap = ibooker.book2D(s, s, 14, 0, 14, 16, 0, 16);
80  h2RHentriesMap->getTH2F()->GetXaxis()->SetTitle("moduleZ");
81  h2RHentriesMap->getTH2F()->GetYaxis()->SetTitle("sector #Phi");
82  h2RHentriesMap->getTH2F()->SetOption("colz");
83 
84  sprintf(s, "CastorRecHitTime");
85  hRHtime = ibooker.book1D(s, s, 301, -101., 200.);
86 
87  sprintf(s, "CASTORTowerDepth");
88  hTowerDepth = ibooker.book1D(s, s, 130, -15500., -14200.);
89  hTowerDepth->getTH1F()->GetXaxis()->SetTitle("mm");
90 
91  sprintf(s, "CASTORTowerMultiplicity");
92  hTowerMultipl = ibooker.book1D(s, s, 20, 0., 20.);
93 
94  const int NEtow = 20;
95  float EhadTow[NEtow + 1];
96  float EMTow[NEtow + 1];
97  float ETower[NEtow + 2];
98  double E0tow = 1. / 1024.;
99  EMTow[0] = 0.;
100  EMTow[1] = E0tow;
101  EhadTow[0] = 0.;
102  EhadTow[1] = E0tow;
103  ETower[0] = 0.;
104  ETower[1] = E0tow;
105  double lnBtow = log(2.);
106  for (int j = 1; j < NEtow; j++) EMTow[j + 1] = E0tow * exp(j * lnBtow);
107  for (int j = 1; j < NEtow; j++) EhadTow[j + 1] = E0tow * exp(j * lnBtow);
108  for (int j = 1; j <= NEtow; j++) ETower[j + 1] = E0tow * exp(j * lnBtow);
109 
110  sprintf(s, "CASTORTowerEMvsEhad");
111  h2TowerEMhad = ibooker.book2D(s, s, NEtow, EhadTow, NEtow, EMTow);
112  h2TowerEMhad->getTH2F()->GetXaxis()->SetTitle("Ehad / GeV");
113  h2TowerEMhad->getTH2F()->GetYaxis()->SetTitle("EM / GeV");
114  h2TowerEMhad->getTH2F()->SetOption("colz");
115 
116  sprintf(s, "CASTORTowerTotalEnergy");
117  hTowerE = ibooker.book1D(s, s, NEtow + 1, ETower);
118  hTowerE->getTH1F()->GetXaxis()->SetTitle("GeV");
119 
120  sprintf(s, "CASTORJetsMultiplicity");
121  hJetsMultipl = ibooker.book1D(s, s, 16, 0., 16.);
122 
123  sprintf(s, "CASTORJetEnergy");
124  hJetEnergy = ibooker.book1D(s, s, 5000, 0., 500.);
125 
126  sprintf(s, "CASTORJetEta");
127  hJetEta = ibooker.book1D(s, s, 126, -6.3, 6.3);
128 
129  sprintf(s, "CASTORJetPhi");
130  hJetPhi = ibooker.book1D(s, s, 63, -3.15, 3.15);
131 
132  if (fVerbosity > 0)
133  std::cout << "CastorRecHitMonitor::bookHistograms(end)" << std::endl;
134  return;
135 }
TProfile2D * getTProfile2D() const
TH1F * getTH1F() const
MonitorElement * hJetEta
MonitorElement * h2RHvsSec
MonitorElement * h2RHentriesMap
MonitorElement * hJetEnergy
MonitorElement * hJetsMultipl
MonitorElement * hRHtime
MonitorElement * hTowerDepth
TH2F * getTH2F() const
MonitorElement * hTowerE
MonitorElement * h2RHoccmap
MonitorElement * hJetPhi
MonitorElement * h2TowerEMhad
MonitorElement * hallchan
MonitorElement * h2RHchan
MonitorElement * hTowerMultipl
void CastorRecHitMonitor::processEvent ( const CastorRecHitCollection castorHits)

Definition at line 153 of file CastorRecHitMonitor.cc.

References edm::SortedCollection< T, SORT >::begin(), gather_cfg::cout, edm::SortedCollection< T, SORT >::empty(), edm::SortedCollection< T, SORT >::end(), triggerObjects_cff::id, createfilelist::int, and ntuplemaker::time.

154  {
155  if (fVerbosity > 0)
156  std::cout << "CastorRecHitMonitor::processEvent (begin)" << std::endl;
157  ievt_++;
158  for (int z = 0; z < 14; z++)
159  for (int phi = 0; phi < 16; phi++) energyInEachChannel[z][phi] = 0.;
160 
162  // if (showTiming) { cpu_timer.reset(); cpu_timer.start(); }
163 
164  if (castorHits.empty()) return;
165 
166  for (CASTORiter = castorHits.begin(); CASTORiter != castorHits.end();
167  ++CASTORiter) {
168  float energy = CASTORiter->energy();
169  float time = CASTORiter->time();
170  float time2 = time;
171  if (time < -100.) time2 = -100.;
172  hRHtime->Fill(time2);
173 
174  HcalCastorDetId id(CASTORiter->detid().rawId());
175  // float zside = id.zside();
176  int module = (int)id.module(); //-- get module
177  int sector = (int)id.sector(); //-- get sector
178 
179  energyInEachChannel[module - 1][sector - 1] += energy;
180 
181  h2RHentriesMap->Fill(module - 1, sector - 1);
182  } // end for(CASTORiter=castorHits.begin(); CASTORiter!= ...
183 
184  double etot = 0.;
185  for (int phi = 0; phi < 16; phi++) {
186  double es = 0.;
187  for (int z = 0; z < 14; z++) {
188  float rh = energyInEachChannel[z][phi] * 0.001;
189  int ind = z * 16 + phi + 1;
190  // int ind = phi*14 + z +1;
191  h2RHchan->Fill(ind, rh);
192  hallchan->Fill(rh);
193  if (rh < 0.) continue;
194  h2RHoccmap->Fill(z, phi, rh);
195  es += rh;
196  }
197  h2RHvsSec->Fill(phi, es);
198  etot += es;
199  } // end for(int phi=0;
200 
201  if (fVerbosity > 0)
202  std::cout << "CastorRecHitMonitor::processEvent (end)" << std::endl;
203  return;
204 }
float energyInEachChannel[14][16]
std::vector< CastorRecHit >::const_iterator const_iterator
MonitorElement * h2RHvsSec
MonitorElement * h2RHentriesMap
void Fill(long long x)
MonitorElement * hRHtime
const_iterator end() const
MonitorElement * h2RHoccmap
MonitorElement * hallchan
MonitorElement * h2RHchan
Definition: vlib.h:208
const_iterator begin() const
void CastorRecHitMonitor::processEventJets ( const reco::BasicJetCollection Jets)

Definition at line 206 of file CastorRecHitMonitor.cc.

207  {
208  int nJets = 0;
209  for (reco::BasicJetCollection::const_iterator ibegin = Jets.begin(),
210  iend = Jets.end(),
211  ijet = ibegin;
212  ijet != iend; ++ijet) {
213  nJets++;
214  float energy = ijet->energy() * 0.001;
215  hJetEnergy->Fill(energy);
216  hJetEta->Fill(ijet->eta());
217  hJetPhi->Fill(ijet->phi());
218  }
219  hJetsMultipl->Fill(nJets);
220 }
MonitorElement * hJetEta
void Fill(long long x)
MonitorElement * hJetEnergy
MonitorElement * hJetsMultipl
MonitorElement * hJetPhi
void CastorRecHitMonitor::processEventTowers ( const reco::CastorTowerCollection castorTowers)

Definition at line 137 of file CastorRecHitMonitor.cc.

References ecaldqm::nTowers.

138  {
139  if (castorTowers.empty()) return;
140  int nTowers = 0;
141 
142  for (reco::CastorTowerCollection::const_iterator iTower =
143  castorTowers.begin();
144  iTower != castorTowers.end(); iTower++) {
145  hTowerE->Fill(iTower->energy() * 0.001);
146  h2TowerEMhad->Fill(iTower->hadEnergy() * 0.001, iTower->emEnergy() * 0.001);
147  hTowerDepth->Fill(iTower->depth());
148  nTowers++;
149  }
150  hTowerMultipl->Fill(nTowers);
151 }
void Fill(long long x)
MonitorElement * hTowerDepth
MonitorElement * hTowerE
MonitorElement * h2TowerEMhad
MonitorElement * hTowerMultipl

Member Data Documentation

float CastorRecHitMonitor::energyInEachChannel[14][16]
private

Definition at line 33 of file CastorRecHitMonitor.h.

int CastorRecHitMonitor::fVerbosity = 0
private

Definition at line 31 of file CastorRecHitMonitor.h.

TH2F* CastorRecHitMonitor::h2RecHitMap
private

Definition at line 45 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::h2RHchan
private

Definition at line 46 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::h2RHentriesMap
private

Definition at line 50 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::h2RHmap
private

Definition at line 48 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::h2RHoccmap
private

Definition at line 49 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::h2RHvsSec
private

Definition at line 47 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::h2TowerEMhad
private

Definition at line 38 of file CastorRecHitMonitor.h.

MonitorElement * CastorRecHitMonitor::hallchan
private

Definition at line 51 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::hJetEnergy
private

Definition at line 41 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::hJetEta
private

Definition at line 42 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::hJetPhi
private

Definition at line 43 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::hJetsMultipl
private

Definition at line 40 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::hRHtime
private

Definition at line 51 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::hTowerDepth
private

Definition at line 37 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::hTowerE
private

Definition at line 36 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::hTowerMultipl
private

Definition at line 39 of file CastorRecHitMonitor.h.

int CastorRecHitMonitor::ievt_
private

Definition at line 32 of file CastorRecHitMonitor.h.

std::string CastorRecHitMonitor::subsystemname
private

Definition at line 34 of file CastorRecHitMonitor.h.