CMS 3D CMS Logo

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 15 of file CastorRecHitMonitor.cc.

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

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

Definition at line 25 of file CastorRecHitMonitor.cc.

25 { }

Member Function Documentation

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

Definition at line 27 of file CastorRecHitMonitor.cc.

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

Referenced by CastorMonitorModule::bookHistograms().

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

Definition at line 157 of file CastorRecHitMonitor.cc.

References a, edm::SortedCollection< T, SORT >::begin(), gather_cfg::cout, edm::SortedCollection< T, SORT >::empty(), edm::SortedCollection< T, SORT >::end(), energyInEachChannel, MonitorElement::Fill(), fVerbosity, MonitorElement::getTH2F(), h2RHchan, h2RHentriesMap, h2RHmap, h2RHoccmap, h2RHvsSec, hallchan, hRHtime, triggerObjects_cff::id, ievt_, createfilelist::int, mod(), phi, ntuplemaker::time, and z.

Referenced by CastorMonitorModule::analyze().

158 {
159  if(fVerbosity>0) std::cout << "CastorRecHitMonitor::processEvent (begin)"<< std::endl;
160  ievt_++;
161  for (int z=0; z<14; z++) for (int phi=0; phi<16; phi++)
162  energyInEachChannel[z][phi] = 0.;
163 
165 // if (showTiming) { cpu_timer.reset(); cpu_timer.start(); }
166 
167  if(castorHits.empty()) return;
168 
169  //for(edm::TriggerResults::const_iterator iTrig= hltResults->begin();
170 // iTrig!= hltResults->end(); iTrig++) {;}
171 
172  for(CASTORiter=castorHits.begin(); CASTORiter!=castorHits.end(); ++CASTORiter)
173  {
174  float energy = CASTORiter->energy();
175  float time = CASTORiter->time();
176  float time2 = time;
177  if(time < -100.) time2 = -100.;
178  hRHtime->Fill(time2);
179 
180  HcalCastorDetId id(CASTORiter->detid().rawId());
181  //float zside = id.zside();
182  int module = (int)id.module(); //-- get module
183  int sector = (int)id.sector(); //-- get sector
184 
185  energyInEachChannel[module-1][sector-1] += energy;
186 
187  h2RHentriesMap->Fill(module-1,sector-1);
188  } // end for(CASTORiter=castorHits.begin(); CASTORiter!= ...
189 
190  double etot = 0.;
191  for(int phi=0; phi<16; phi++) {
192  double es = 0.;
193  for (int z=0; z<14; z++) {
194  float rh = energyInEachChannel[z][phi]*0.001;
195  int ind = phi*14 + z +1;
196  h2RHchan->Fill(ind,rh);
197  hallchan->Fill(rh);
198  if(rh < 0.) continue;
199  h2RHmap->Fill(z,phi,rh);
200  es += rh;
201  }
202  h2RHvsSec->Fill(phi,es);
203  etot += es;
204  } // end for(int phi=0;
205 
206  if(ievt_ %100 == 0)
207  for(int mod=1; mod<=14; mod++)
208  for(int sec=1; sec<=16;sec++) {
209  double a= h2RHmap->getTH2F()->GetBinContent(mod,sec);
210  h2RHoccmap->getTH2F()->SetBinContent(mod,sec,a/double(ievt_));
211  }
212 
213  if(fVerbosity>0) std::cout << "CastorRecHitMonitor::processEvent (end)"<< std::endl;
214  return;
215 }
float energyInEachChannel[14][16]
std::vector< CastorRecHit >::const_iterator const_iterator
MonitorElement * h2RHvsSec
MonitorElement * h2RHentriesMap
void Fill(long long x)
MonitorElement * hRHtime
TH2F * getTH2F() const
const_iterator end() const
MonitorElement * h2RHoccmap
double a
Definition: hdecay.h:121
MonitorElement * hallchan
MonitorElement * h2RHchan
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 217 of file CastorRecHitMonitor.cc.

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

Referenced by CastorMonitorModule::analyze().

218 {
219  int nJets=0;
220  for(reco::BasicJetCollection::const_iterator ibegin = Jets.begin(),
221  iend = Jets.end(), ijet = ibegin; ijet!= iend; ++ijet) {
222  nJets++;
223  float energy = ijet->energy()*0.001;
224  hJetEnergy->Fill(energy);
225  hJetEta->Fill(ijet->eta());
226  hJetPhi->Fill(ijet->phi());
227  }
228  hJetsMultipl->Fill(nJets);
229 }
MonitorElement * hJetEta
void Fill(long long x)
MonitorElement * hJetEnergy
MonitorElement * hJetsMultipl
MonitorElement * hJetPhi
void CastorRecHitMonitor::processEventTowers ( const reco::CastorTowerCollection castorTowers)

Definition at line 140 of file CastorRecHitMonitor.cc.

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

Referenced by CastorMonitorModule::analyze().

142 {
143  if(castorTowers.empty()) return;
144  int nTowers = 0;
145 
146  for(reco::CastorTowerCollection::const_iterator iTower= castorTowers.begin();
147  iTower!= castorTowers.end(); iTower++) {
148 
149  hTowerE->Fill(iTower->energy()*0.001);
150  h2TowerEMhad->Fill(iTower->hadEnergy()*0.001,iTower->emEnergy()*0.001);
151  hTowerDepth->Fill(iTower->depth());
152  nTowers++;
153  }
154  hTowerMultipl->Fill(nTowers);
155 }
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.

Referenced by processEvent().

int CastorRecHitMonitor::fVerbosity = 0
private

Definition at line 31 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), CastorRecHitMonitor(), and 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 51 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().