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>

Inheritance diagram for CastorRecHitMonitor:
CastorBaseMonitor

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

Private Attributes

float energyInEachChannel [14][16]
 
TH2F * h2RecHitMap
 
MonitorElementh2RHchan
 
MonitorElementh2RHentriesMap
 
MonitorElementh2RHmap
 
MonitorElementh2RHoccmap
 
MonitorElementh2RHvsSec
 
MonitorElementh2TowerEMhad
 
MonitorElementhallchan
 
MonitorElementhJetEnergy
 
MonitorElementhJetEta
 
MonitorElementhJetPhi
 
MonitorElementhJetsMultipl
 
MonitorElementhRHtime
 
MonitorElementhTowerDepth
 
MonitorElementhTowerE
 
MonitorElementhTowerMultipl
 
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 21 of file CastorRecHitMonitor.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file CastorRecHitMonitor.cc.

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

16 {
18  ps.getUntrackedParameter<std::string>("subSystemFolder","Castor");
19  ievt_=0;
20 }
T getUntrackedParameter(std::string const &, T const &) const
CastorRecHitMonitor::~CastorRecHitMonitor ( )

Definition at line 23 of file CastorRecHitMonitor.cc.

23 { }

Member Function Documentation

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

Definition at line 35 of file CastorRecHitMonitor.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), gather_cfg::cout, create_public_lumi_plots::exp, CastorBaseMonitor::fVerbosity, MonitorElement::getTH1F(), MonitorElement::getTH2F(), h2RHchan, h2RHentriesMap, h2RHmap, h2RHoccmap, h2RHvsSec, h2TowerEMhad, hallchan, hJetEnergy, hJetEta, hJetPhi, hJetsMultipl, hRHtime, hTowerDepth, hTowerE, hTowerMultipl, i, j, cmsBatch::log, alignCSCRings::s, DQMStore::IBooker::setCurrentFolder(), and subsystemname.

Referenced by CastorMonitorModule::bookHistograms().

37 {
38  char s[60];
39  if(fVerbosity>0)
40  std::cout<<"CastorRecHitMonitor::bookHistograms"<<std::endl;
41  ibooker.setCurrentFolder(subsystemname + "/CastorRecHitMonitor");
42 
43  const int N_Sec = 16;
44  const int nySec = 20;
45  float ySec[nySec+1];
46  float xSec[N_Sec+1];
47  double E0sec = 1./1024.;
48  ySec[0] = 0.; ySec[1] = E0sec;
49  double lnBsec = log(2.);
50  for(int j=1; j<nySec; j++) ySec[j+1] = E0sec*exp(j*lnBsec);
51  for(int i=0; i<=N_Sec; i++) xSec[i]=i;
52 
53  sprintf(s,"CastorRecHit by Sectors");
54  h2RHvsSec = ibooker.book2D(s,s, N_Sec, xSec, nySec, ySec);
55  h2RHvsSec->getTH2F()->GetXaxis()->SetTitle("sectorPhi");
56  h2RHvsSec->getTH2F()->GetYaxis()->SetTitle("RecHit / GeV");
57  h2RHvsSec->getTH2F()->SetOption("colz");
58 
59 
60  const int nxCh = 224;
61  const int nyE = 18;
62  float xCh[nxCh+1];
63  float yErh[nyE+1];
64  for(int i=0; i<=nxCh; i++) xCh[i]=i;
65  double E0 = 1./1024.;
66  double lnA = log(2.);
67  yErh[0] = 0.; yErh[1] = E0;
68  for(int j=1; j<nyE; j++) yErh[j+1] = E0*exp(j*lnA);
69 
70  sprintf(s,"CastorTileRecHit");
71  h2RHchan = ibooker.book2D(s,s, nxCh, xCh, nyE, yErh);
72  h2RHchan->getTH2F()->GetXaxis()->SetTitle("sector*14+module");
73  h2RHchan->getTH2F()->GetYaxis()->SetTitle("RecHit / GeV");
74  h2RHchan->getTH2F()->SetOption("colz");
75 
76  sprintf(s,"Reco all tiles");
77  hallchan = ibooker.book1D(s,s,nyE,yErh);
78  hallchan->getTH1F()->GetXaxis()->SetTitle("GeV");
79 
80  sprintf(s,"CastorRecHitMap(cumulative)");
81  h2RHmap = ibooker.book2D(s,s,14, 0,14, 16, 0,16);
82  h2RHmap->getTH2F()->GetXaxis()->SetTitle("moduleZ");
83  h2RHmap->getTH2F()->GetYaxis()->SetTitle("sectorPhi");
84  h2RHmap->getTH2F()->SetOption("colz");
85 
86  sprintf(s,"CastorRecHitOccMap");
87  h2RHoccmap = ibooker.book2D(s,s,14, 0,14, 16, 0,16);
88  h2RHoccmap->getTH2F()->GetXaxis()->SetTitle("moduleZ");
89  h2RHoccmap->getTH2F()->GetYaxis()->SetTitle("sectorPhi");
90  h2RHoccmap->getTH2F()->SetOption("colz");
91 
92  sprintf(s,"CastorRecHitEntriesMap");
93  h2RHentriesMap = ibooker.book2D(s,s,14, 0,14, 16, 0,16);
94  h2RHentriesMap->getTH2F()->GetXaxis()->SetTitle("moduleZ");
95  h2RHentriesMap->getTH2F()->GetYaxis()->SetTitle("sectorPhi");
96  h2RHentriesMap->getTH2F()->SetOption("colz");
97 
98  sprintf(s,"CastorRecHitTime");
99  hRHtime = ibooker.book1D(s,s,301, -101.,200.);
100 
101  sprintf(s,"CASTORTowerDepth");
102  hTowerDepth = ibooker.book1D(s,s,130,-15500.,-14200.);
103  hTowerDepth->getTH1F()->GetXaxis()->SetTitle("mm");
104 
105  sprintf(s,"CASTORTowerMultiplicity");
106  hTowerMultipl = ibooker.book1D(s,s,20,0.,20.);
107 
108  const int NEtow = 20;
109  float EhadTow[NEtow+1];
110  float EMTow[NEtow+1];
111  float ETower[NEtow+2];
112  double E0tow = 1./1024.;
113  EMTow[0] = 0.; EMTow[1] = E0tow;
114  EhadTow[0] = 0.; EhadTow[1] = E0tow;
115  ETower[0] = 0.; ETower[1] = E0tow;
116  double lnBtow = log(2.);
117  for(int j=1; j<NEtow; j++) EMTow[j+1] = E0tow*exp(j*lnBtow);
118  for(int j=1; j<NEtow; j++) EhadTow[j+1] = E0tow*exp(j*lnBtow);
119  for(int j=1; j<=NEtow; j++) ETower[j+1] = E0tow*exp(j*lnBtow);
120 
121  sprintf(s,"CASTORTowerEMvsEhad");
122  h2TowerEMhad = ibooker.book2D(s,s, NEtow, EhadTow, NEtow, EMTow);
123  h2TowerEMhad->getTH2F()->GetXaxis()->SetTitle("Ehad / GeV");
124  h2TowerEMhad->getTH2F()->GetYaxis()->SetTitle("EM / GeV");
125  h2TowerEMhad->getTH2F()->SetOption("colz");
126 
127  sprintf(s,"CASTORTowerTotalEnergy");
128  hTowerE = ibooker.book1D(s,s,NEtow+1,ETower);
129  hTowerE->getTH1F()->GetXaxis()->SetTitle("GeV");
130 
131  sprintf(s,"CASTORJetsMultiplicity");
132  hJetsMultipl = ibooker.book1D(s,s,16, 0.,16.);
133 
134  sprintf(s,"CASTORJetEnergy");
135  hJetEnergy = ibooker.book1D(s,s,5000, 0.,500.);
136 
137  sprintf(s,"CASTORJetEta");
138  hJetEta = ibooker.book1D(s,s,126, -6.3, 6.3);
139 
140  sprintf(s,"CASTORJetPhi");
141  hJetPhi = ibooker.book1D(s,s,63, -3.15,3.15);
142 
143  if(fVerbosity>0)
144  std::cout<<"CastorRecHitMonitor::bookHistograms(end)"<<std::endl;
145  return;
146 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * hJetEta
MonitorElement * hallchan
MonitorElement * h2RHvsSec
MonitorElement * h2RHentriesMap
MonitorElement * hJetEnergy
MonitorElement * hJetsMultipl
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * hRHtime
int j
Definition: DBlmapReader.cc:9
MonitorElement * hTowerDepth
MonitorElement * hTowerE
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * h2RHoccmap
TH1F * getTH1F(void) const
MonitorElement * hJetPhi
MonitorElement * h2TowerEMhad
tuple cout
Definition: gather_cfg.py:121
MonitorElement * h2RHchan
TH2F * getTH2F(void) const
tuple log
Definition: cmsBatch.py:341
MonitorElement * h2RHmap
MonitorElement * hTowerMultipl
void CastorRecHitMonitor::processEvent ( const CastorRecHitCollection castorHits)

Definition at line 165 of file CastorRecHitMonitor.cc.

References a, edm::SortedCollection< T, SORT >::begin(), gather_cfg::cout, CastorBaseMonitor::cpu_timer, edm::SortedCollection< T, SORT >::end(), relval_parameters_module::energy, energyInEachChannel, MonitorElement::Fill(), CastorBaseMonitor::fVerbosity, MonitorElement::getTH2F(), h2RHchan, h2RHentriesMap, h2RHmap, h2RHoccmap, h2RHvsSec, hallchan, hRHtime, ievt_, mod(), python.rootplot.argparse::module, phi, edm::CPUTimer::reset(), CastorBaseMonitor::showTiming, edm::SortedCollection< T, SORT >::size(), edm::CPUTimer::start(), cond::rpcobgas::time, and z.

Referenced by CastorMonitorModule::analyze().

166 {
167  if(fVerbosity>0) std::cout << "CastorRecHitMonitor::processEvent (begin)"<< std::endl;
168  ievt_++;
169  for (int z=0; z<14; z++) for (int phi=0; phi<16; phi++)
170  energyInEachChannel[z][phi] = 0.;
171 
173  if (showTiming) { cpu_timer.reset(); cpu_timer.start(); }
174 
175  if(castorHits.size() <= 0) return;
176 
177  //for(edm::TriggerResults::const_iterator iTrig= hltResults->begin();
178 // iTrig!= hltResults->end(); iTrig++) {;}
179 
180  for(CASTORiter=castorHits.begin(); CASTORiter!=castorHits.end(); ++CASTORiter)
181  {
182  float energy = CASTORiter->energy();
183  float time = CASTORiter->time();
184  float time2 = time;
185  if(time < -100.) time2 = -100.;
186  hRHtime->Fill(time2);
187 
188  HcalCastorDetId id(CASTORiter->detid().rawId());
189  //float zside = id.zside();
190  int module = (int)id.module(); //-- get module
191  int sector = (int)id.sector(); //-- get sector
192 
193  energyInEachChannel[module-1][sector-1] += energy;
194 
195  h2RHentriesMap->Fill(module-1,sector-1);
196  } // end for(CASTORiter=castorHits.begin(); CASTORiter!= ...
197 
198  double etot = 0.;
199  for(int phi=0; phi<16; phi++) {
200  double es = 0.;
201  for (int z=0; z<14; z++) {
202  float rh = energyInEachChannel[z][phi]*0.001;
203  int ind = phi*14 + z +1;
204  h2RHchan->Fill(ind,rh);
205  hallchan->Fill(rh);
206  if(rh < 0.) continue;
207  h2RHmap->Fill(z,phi,rh);
208  es += rh;
209  }
210  h2RHvsSec->Fill(phi,es);
211  etot += es;
212  } // end for(int phi=0;
213 
214  if(ievt_ %100 == 0)
215  for(int mod=1; mod<=14; mod++) for(int sec=1; sec<=16;sec++) {
216  double a= h2RHmap->getTH2F()->GetBinContent(mod,sec);
217  h2RHoccmap->getTH2F()->SetBinContent(mod,sec,a/double(ievt_));
218  }
219 
220  if(fVerbosity>0) std::cout << "CastorRecHitMonitor::processEvent (end)"<< std::endl;
221  return;
222 }
edm::CPUTimer cpu_timer
void start()
Definition: CPUTimer.cc:74
float energyInEachChannel[14][16]
std::vector< CastorRecHit >::const_iterator const_iterator
void reset()
Definition: CPUTimer.cc:107
MonitorElement * hallchan
MonitorElement * h2RHvsSec
MonitorElement * h2RHentriesMap
void Fill(long long x)
MonitorElement * hRHtime
const_iterator end() const
MonitorElement * h2RHoccmap
size_type size() const
double a
Definition: hdecay.h:121
tuple cout
Definition: gather_cfg.py:121
MonitorElement * h2RHchan
TH2F * getTH2F(void) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: vlib.h:208
const_iterator begin() const
MonitorElement * h2RHmap
void CastorRecHitMonitor::processEventJets ( const reco::BasicJetCollection Jets)

Definition at line 224 of file CastorRecHitMonitor.cc.

References relval_parameters_module::energy, MonitorElement::Fill(), hJetEnergy, hJetEta, hJetPhi, and hJetsMultipl.

Referenced by CastorMonitorModule::analyze().

225 {
226  int nJets=0;
227  for(reco::BasicJetCollection::const_iterator ibegin = Jets.begin(),
228  iend = Jets.end(), ijet = ibegin; ijet!= iend; ++ijet) {
229  nJets++;
230  float energy = ijet->energy()*0.001;
231  hJetEnergy->Fill(energy);
232  hJetEta->Fill(ijet->eta());
233  hJetPhi->Fill(ijet->phi());
234  }
235  hJetsMultipl->Fill(nJets);
236 }
MonitorElement * hJetEta
void Fill(long long x)
MonitorElement * hJetEnergy
MonitorElement * hJetsMultipl
tuple Jets
Definition: METSkim_cff.py:17
MonitorElement * hJetPhi
void CastorRecHitMonitor::processEventTowers ( const reco::CastorTowerCollection castorTowers)

Definition at line 148 of file CastorRecHitMonitor.cc.

References MonitorElement::Fill(), h2TowerEMhad, hTowerDepth, hTowerE, hTowerMultipl, and ecaldqm::nTowers.

Referenced by CastorMonitorModule::analyze().

150 {
151  if(castorTowers.size() <= 0) return;
152  int nTowers = 0;
153 
154  for(reco::CastorTowerCollection::const_iterator iTower= castorTowers.begin();
155  iTower!= castorTowers.end(); iTower++) {
156 
157  hTowerE->Fill(iTower->energy()*0.001);
158  h2TowerEMhad->Fill(iTower->hadEnergy()*0.001,iTower->emEnergy()*0.001);
159  hTowerDepth->Fill(iTower->depth());
160  nTowers++;
161  }
162  hTowerMultipl->Fill(nTowers);
163 }
void Fill(long long x)
MonitorElement * hTowerDepth
MonitorElement * hTowerE
MonitorElement * h2TowerEMhad
MonitorElement * hTowerMultipl
void CastorRecHitMonitor::setup ( const edm::ParameterSet ps)
virtual

Reimplemented from CastorBaseMonitor.

Definition at line 27 of file CastorRecHitMonitor.cc.

Referenced by CastorMonitorModule::CastorMonitorModule().

28 {
29 // CastorBaseMonitor::setup(ps);
30  return;
31 }

Member Data Documentation

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

Definition at line 33 of file CastorRecHitMonitor.h.

Referenced by processEvent().

TH2F* CastorRecHitMonitor::h2RecHitMap
private

Definition at line 45 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::h2RHchan
private

Definition at line 46 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEvent().

MonitorElement* CastorRecHitMonitor::h2RHentriesMap
private

Definition at line 50 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEvent().

MonitorElement* CastorRecHitMonitor::h2RHmap
private

Definition at line 48 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEvent().

MonitorElement* CastorRecHitMonitor::h2RHoccmap
private

Definition at line 49 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEvent().

MonitorElement* CastorRecHitMonitor::h2RHvsSec
private

Definition at line 47 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEvent().

MonitorElement* CastorRecHitMonitor::h2TowerEMhad
private

Definition at line 38 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEventTowers().

MonitorElement* CastorRecHitMonitor::hallchan
private

Definition at line 52 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEvent().

MonitorElement* CastorRecHitMonitor::hJetEnergy
private

Definition at line 41 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEventJets().

MonitorElement* CastorRecHitMonitor::hJetEta
private

Definition at line 42 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEventJets().

MonitorElement* CastorRecHitMonitor::hJetPhi
private

Definition at line 43 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEventJets().

MonitorElement* CastorRecHitMonitor::hJetsMultipl
private

Definition at line 40 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEventJets().

MonitorElement* CastorRecHitMonitor::hRHtime
private

Definition at line 51 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEvent().

MonitorElement* CastorRecHitMonitor::hTowerDepth
private

Definition at line 37 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEventTowers().

MonitorElement* CastorRecHitMonitor::hTowerE
private

Definition at line 36 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEventTowers().

MonitorElement* CastorRecHitMonitor::hTowerMultipl
private

Definition at line 39 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEventTowers().

int CastorRecHitMonitor::ievt_
private

Definition at line 32 of file CastorRecHitMonitor.h.

Referenced by CastorRecHitMonitor(), and processEvent().

std::string CastorRecHitMonitor::subsystemname
private

Definition at line 34 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and CastorRecHitMonitor().