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

Private Attributes

float energyInEachChannel [14][16]
 
TH2F * h2RecHitMap
 
MonitorElementh2RHentriesMap
 
MonitorElementh2RHmap
 
MonitorElementh2RHoccmap
 
MonitorElementhallchan
 
MonitorElementhRHtime
 
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 9 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, CastorBaseMonitor::fVerbosity, MonitorElement::getTH2F(), h2RHentriesMap, h2RHmap, h2RHoccmap, hallchan, hRHtime, 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  sprintf(s,"CastorRecHitSumInSectors");
44  //h2RHvsSec = ibooker.book2D(s,s, 16, 0,16, 20000, 0.,200000.);
45  //h2RHvsSec->getTH2F()->GetXaxis()->SetTitle("sectorPhi");
46  //h2RHvsSec->getTH2F()->GetYaxis()->SetTitle("RecHit");
47  //h2RHvsSec->getTH2F()->SetOption("colz");
48 
49  sprintf(s,"CastorTileRecHit");
50  //h2RHchan = ibooker.book2D(s,s, 224, 0,224, 5100, -1000,50000.);
51  //h2RHchan->getTH2F()->GetXaxis()->SetTitle("sector*14+module");
52  //h2RHchan->getTH2F()->GetYaxis()->SetTitle("RecHit");
53  //h2RHchan->getTH2F()->SetOption("colz");
54 
55  sprintf(s,"CastorRecHitMap(cumulative)");
56  h2RHmap = ibooker.book2D(s,s,14, 0,14, 16, 0,16);
57  h2RHmap->getTH2F()->GetXaxis()->SetTitle("moduleZ");
58  h2RHmap->getTH2F()->GetYaxis()->SetTitle("sectorPhi");
59  h2RHmap->getTH2F()->SetOption("colz");
60 
61  sprintf(s,"CastorRecHitOccMap");
62  h2RHoccmap = ibooker.book2D(s,s,14, 0,14, 16, 0,16);
63  h2RHoccmap->getTH2F()->GetXaxis()->SetTitle("moduleZ");
64  h2RHoccmap->getTH2F()->GetYaxis()->SetTitle("sectorPhi");
65  h2RHoccmap->getTH2F()->SetOption("colz");
66 
67  sprintf(s,"CastorRecHitEntriesMap");
68  h2RHentriesMap = ibooker.book2D(s,s,14, 0,14, 16, 0,16);
69  h2RHentriesMap->getTH2F()->GetXaxis()->SetTitle("moduleZ");
70  h2RHentriesMap->getTH2F()->GetYaxis()->SetTitle("sectorPhi");
71  h2RHentriesMap->getTH2F()->SetOption("colz");
72 
73  sprintf(s,"CastorRecHitTime");
74  hRHtime = ibooker.book1D(s,s,301, -101.,200.);
75 
76  sprintf(s,"Reco all tiles");
77  hallchan = ibooker.book1D(s,s,22000,-20000.,200000.);
78 
79  if(fVerbosity>0)
80  std::cout<<"CastorRecHitMonitor::bookHistograms(end)"<<std::endl;
81  return;
82 }
MonitorElement * hallchan
MonitorElement * h2RHentriesMap
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * hRHtime
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * h2RHoccmap
tuple cout
Definition: gather_cfg.py:121
TH2F * getTH2F(void) const
MonitorElement * h2RHmap
void CastorRecHitMonitor::processEvent ( const CastorRecHitCollection castorHits)

Definition at line 85 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(), h2RHentriesMap, h2RHmap, h2RHoccmap, 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 detailsBasic3DVector::z.

Referenced by CastorMonitorModule::analyze().

86 {
87  if(fVerbosity>0) std::cout << "CastorRecHitMonitor::processEvent (begin)"<< std::endl;
88  ievt_++;
89  for (int z=0; z<14; z++) for (int phi=0; phi<16; phi++)
90  energyInEachChannel[z][phi] = 0.;
91 
93  if (showTiming) { cpu_timer.reset(); cpu_timer.start(); }
94 
95  if(castorHits.size() <= 0) return;
96 
97  for(CASTORiter=castorHits.begin(); CASTORiter!=castorHits.end(); ++CASTORiter)
98  {
99  float energy = CASTORiter->energy();
100  float time = CASTORiter->time();
101  float time2 = time;
102  if(time < -100.) time2 = -100.;
103  hRHtime->Fill(time2);
104 
105  HcalCastorDetId id(CASTORiter->detid().rawId());
106  //float zside = id.zside();
107  int module = (int)id.module(); //-- get module
108  int sector = (int)id.sector(); //-- get sector
109 
110  energyInEachChannel[module-1][sector-1] += energy;
111 
112  h2RHentriesMap->Fill(module-1,sector-1);
113  } // end for(CASTORiter=castorHits.begin(); CASTORiter!= ...
114 
115  for(int phi=0; phi<16; phi++) {
116  double es = 0.;
117  for (int z=0; z<14; z++) {
118  //int ind = phi*14 + z +1;
119  float rh = energyInEachChannel[z][phi];
120  //h2RHchan->Fill(ind,rh);
121  hallchan->Fill(rh);
122  if(rh < 0.) continue;
123  h2RHmap->Fill(z,phi,rh);
124  es += rh;
125  }
126  //h2RHvsSec->Fill(phi,es);
127  } // end for(int phi=0;
128 
129  if(ievt_ %100 == 0)
130  for(int mod=1; mod<=14; mod++) for(int sec=1; sec<=16;sec++) {
131  double a= h2RHmap->getTH2F()->GetBinContent(mod,sec);
132  h2RHoccmap->getTH2F()->SetBinContent(mod,sec,a/double(ievt_));
133  }
134 
135  if(fVerbosity>0) std::cout << "CastorRecHitMonitor::processEvent (end)"<< std::endl;
136  return;
137 }
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
float float float z
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
TH2F * getTH2F(void) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: vlib.h:208
const_iterator begin() const
Definition: DDAxes.h:10
MonitorElement * h2RHmap
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 20 of file CastorRecHitMonitor.h.

Referenced by processEvent().

TH2F* CastorRecHitMonitor::h2RecHitMap
private

Definition at line 23 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::h2RHentriesMap
private

Definition at line 28 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEvent().

MonitorElement* CastorRecHitMonitor::h2RHmap
private

Definition at line 26 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEvent().

MonitorElement* CastorRecHitMonitor::h2RHoccmap
private

Definition at line 27 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEvent().

MonitorElement* CastorRecHitMonitor::hallchan
private

Definition at line 30 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEvent().

MonitorElement* CastorRecHitMonitor::hRHtime
private

Definition at line 29 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and processEvent().

int CastorRecHitMonitor::ievt_
private

Definition at line 19 of file CastorRecHitMonitor.h.

Referenced by CastorRecHitMonitor(), and processEvent().

std::string CastorRecHitMonitor::subsystemname
private

Definition at line 21 of file CastorRecHitMonitor.h.

Referenced by bookHistograms(), and CastorRecHitMonitor().