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 beginRun (const edm::EventSetup &iSetup)
 
 CastorRecHitMonitor ()
 
void processEvent (const CastorRecHitCollection &castorHits)
 
void reset ()
 
void setup (const edm::ParameterSet &ps, DQMStore *dbe)
 
 ~CastorRecHitMonitor ()
 
- Public Member Functions inherited from CastorBaseMonitor
 CastorBaseMonitor ()
 
virtual void clearME ()
 
virtual void done ()
 
bool getDiagnostics () const
 
int getVerbosity () const
 
void setDiagnostics (bool myval)
 
void setVerbosity (int verb)
 
bool vetoCell (HcalCastorDetId id)
 
virtual ~CastorBaseMonitor ()
 

Private Attributes

float allEnergyModule [14]
 
float allEnergySector [16]
 
struct {
   MonitorElement *   meCastorRecHitsOccupancy
 
   std::map< HcalCastorDetId,
MonitorElement * >   meRECHIT_E
 
   MonitorElement *   meRECHIT_E_all
 
   MonitorElement *   meRECHIT_E_modules
 
   MonitorElement *   meRECHIT_E_relative_modules
 
   MonitorElement *   meRECHIT_E_relative_sectors
 
   MonitorElement *   meRECHIT_E_sectors
 
   MonitorElement *   meRECHIT_MAP_CHAN_E
 
   MonitorElement *   meRECHIT_N_event
 
   MonitorElement *   meRECHIT_N_modules
 
   MonitorElement *   meRECHIT_N_sectors
 
   std::map< HcalCastorDetId,
MonitorElement * >   meRECHIT_T
 
   MonitorElement *   meRECHIT_T_all
 
castorHists
 
float channel
 
bool doPerChannel_
 
float energy
 
float energyInEachChannel [14][16]
 
int ievt_
 
MonitorElementmeEVT_
 
int module
 
int sector
 
float time
 
float totEnergy
 
int zside
 

Additional Inherited Members

- Protected Attributes inherited from CastorBaseMonitor
std::string baseFolder_
 
edm::CPUTimer cpu_timer
 
int fVerbosity
 
DQMStorem_dbe
 
bool makeDiagnostics
 
std::string rootFolder_
 
bool showTiming
 

Detailed Description

Definition at line 9 of file CastorRecHitMonitor.h.

Constructor & Destructor Documentation

CastorRecHitMonitor::CastorRecHitMonitor ( )

Definition at line 16 of file CastorRecHitMonitor.cc.

References doPerChannel_, and ievt_.

17  {
18 
19  doPerChannel_ = true;
20  // occThresh_ = 1;
21  ievt_=0;
22 
23  }
CastorRecHitMonitor::~CastorRecHitMonitor ( )

Definition at line 28 of file CastorRecHitMonitor.cc.

29  {
30 
31  }

Member Function Documentation

void CastorRecHitMonitor::beginRun ( const edm::EventSetup iSetup)

Definition at line 80 of file CastorRecHitMonitor.cc.

References CastorBaseMonitor::baseFolder_, DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookInt(), castorHists, gather_cfg::cout, CastorBaseMonitor::fVerbosity, CastorBaseMonitor::m_dbe, meEVT_, NULL, and DQMStore::setCurrentFolder().

Referenced by CastorMonitorModule::beginRun().

81  {
82  if(fVerbosity>0) std::cout << "CastorRecHitMonitor::beginRun (start)" << std::endl;
83 
84  if ( m_dbe !=NULL )
85  {
88  meEVT_ = m_dbe->bookInt("RecHit Event Number"); // meEVT_->Fill(ievt_);
90  castorHists.meRECHIT_E_all = m_dbe->book1D("CastorRecHit Energies- above threshold on RecHitEnergy","CastorRecHit Energies- above threshold on RecHitEnergy",150,0,150);
91  castorHists.meRECHIT_T_all = m_dbe->book1D("CastorRecHit Times- above threshold on RecHitEnergy","CastorRecHit Times- above threshold on RecHitEnergy",300,-100,100);
93  castorHists.meRECHIT_MAP_CHAN_E = m_dbe->book1D("CastorRecHit Energy in each channel- above threshold","CastorRecHit Energy in each channel- above threshold",224,0,224);
95  castorHists.meRECHIT_E_modules = m_dbe->book1D("CastorRecHit Energy in modules- above threshold","CastorRecHit Energy in modules- above threshold", 14, 0, 14);
97  castorHists.meRECHIT_E_sectors = m_dbe->book1D("CastorRecHit Energy in sectors- above threshold","CastorRecHit Energy in sectors- above threshold", 16, 0, 16);
98 
100  castorHists.meRECHIT_N_modules = m_dbe->book1D("Number of CastorRecHits in modules- above threshold","Number of CastorRecHits in modules- above threshold", 14, 0, 14);
102  castorHists.meRECHIT_N_sectors = m_dbe->book1D("Number of CastorRecHits in sectors- above threshold","Number of CastorRecHits in sectors- above threshold", 16, 0, 16);
104  castorHists.meCastorRecHitsOccupancy = m_dbe->book2D("CastorRecHits Occupancy Map", "CastorRecHits Occupancy Map", 14, 0,14, 16, 0,16);
106  castorHists.meRECHIT_N_event = m_dbe->book1D("Number of CASTOR RecHits per event- above threshold","Number of CASTOR RecHits per event- above threshold", 23, 0, 230);
107 
108 
109  m_dbe->setCurrentFolder(baseFolder_+"/EnergyFraction");
111  castorHists.meRECHIT_E_relative_modules = m_dbe->book1D("Fraction of the total energy in CASTOR modules","Fraction of the total energy in CASTOR modules", 14, 0, 14);
113  castorHists.meRECHIT_E_relative_sectors = m_dbe->book1D("Fraction of the total energy in CASTOR sectors","Fraction of the total energy in CASTOR sectors", 16, 0, 16);
114  /*
115  castorHists.meRECHIT_E_relative_modules->getTH1F()->GetYaxis()->SetTitle("fraction of the total energy");
116  castorHists.meRECHIT_E_relative_sectors->getTH1F()->GetYaxis()->SetTitle("fraction of the total energy");
117 
118  char ibin1[1024];
119  for(int i=0; i<14; i++)
120  {
121  sprintf(ibin1,"%i", i+1);
122  castorHists.meRECHIT_E_relative_modules->getTH1F()->GetXaxis()->SetBinLabel(i+1,ibin1);
123  }
124  char ibin2[1024];
125  for(int i=0; i<16; i++)
126  {
127  sprintf(ibin2,"%i", i+1);
128  castorHists.meRECHIT_E_relative_sectors->getTH1F()->GetXaxis()->SetBinLabel(i+1,ibin2);
129  }
130 */
131 
132  }
133  else
134  {
135  if(fVerbosity>0) std::cout << "CastorRecHitMonitor::beginRun - NO DQMStore service" << std::endl;
136  }
137 
138 
139  if(fVerbosity>0) std::cout << "CastorRecHitMonitor::beginRun (end)" << std::endl;
140 
141  return;
142 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
MonitorElement * meEVT_
#define NULL
Definition: scimark2.h:8
struct CastorRecHitMonitor::@257 castorHists
std::string baseFolder_
tuple cout
Definition: gather_cfg.py:121
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:849
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1070
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
void CastorRecHitMonitor::processEvent ( const CastorRecHitCollection castorHits)

Definition at line 200 of file CastorRecHitMonitor.cc.

References allEnergyModule, allEnergySector, edm::SortedCollection< T, SORT >::begin(), castorHists, channel, gather_cfg::cout, CastorBaseMonitor::cpu_timer, edm::SortedCollection< T, SORT >::end(), energy, energyInEachChannel, MonitorElement::Fill(), CastorBaseMonitor::fVerbosity, ievt_, CastorBaseMonitor::m_dbe, meEVT_, mod(), module, edm::CPUTimer::reset(), sector, CastorBaseMonitor::showTiming, edm::SortedCollection< T, SORT >::size(), edm::CPUTimer::start(), time, and totEnergy.

Referenced by CastorMonitorModule::analyze().

200  {
201 
202  if(fVerbosity>0) std::cout << "CastorRecHitMonitor::processEvent (begin)"<< std::endl;
203 
204 
206  ievt_++; totEnergy=0.;
207 
209  meEVT_->Fill(ievt_);
210 
211 
212 
213  if(!m_dbe) {
214  if(fVerbosity>0) std::cout <<"CastorRecHitMonitor::processEvent => DQMStore is not instantiated !!!"<<std::endl;
215  return;
216  }
217 
219  if (showTiming) { cpu_timer.reset(); cpu_timer.start(); }
220 
221  //castorHists.meRECHIT_N_event->Fill(castorHits.size());
222  int iHit=0;
223 
224  if(castorHits.size()>0)
225  {
226  if(fVerbosity>1) std::cout << "==>CastorRecHitMonitor::processEvent: castorHits.size()>0 !!!" << std::endl;
227 
229  for (CASTORiter=castorHits.begin(); CASTORiter!=castorHits.end(); ++CASTORiter) {
230 
232  energy = CASTORiter->energy();
233  time = CASTORiter->time();
234 
236  HcalCastorDetId id(CASTORiter->detid().rawId());
237  //float zside = id.zside();
238  module = (int)id.module(); //-- get module
239  sector = (int)id.sector(); //-- get sector
240  channel = 16*(module-1)+sector; //-- define channel
241 
242  if (energy>0.) {
244  castorHists.meRECHIT_E_all->Fill(energy);
245  castorHists.meRECHIT_T_all->Fill(time);
247  castorHists.meRECHIT_MAP_CHAN_E->Fill(channel,energy);
249  castorHists.meRECHIT_E_modules->Fill(module-1, energy);
251  castorHists.meRECHIT_E_sectors->Fill(sector-1, energy);
253  castorHists.meRECHIT_N_modules->Fill(module-1);
255  castorHists.meRECHIT_N_sectors->Fill(sector-1);
256  iHit++;
257  }
258 
260  if(energy<0) energy=0;
261 
263  energyInEachChannel[module-1][sector-1] += energy;
264 
266  castorHists.meCastorRecHitsOccupancy->Fill(module-1,sector-1, energy);
267 
269  castorHists.meRECHIT_N_event->Fill(iHit);
270 
272  // if( doPerChannel_)
273  // CastorRecHitPerChan::perChanHists<CastorRecHit>(*CASTORiter, castorHists.meRECHIT_E, castorHists.meRECHIT_T, m_dbe, baseFolder_);
274  }
275 
277  for(int mod=0; mod<14;mod++)
278  for(int sec=0; sec<16;sec++)
280 
282  for(int mod=0; mod<14;mod++)
287 
289  for(int sec=0; sec<16;sec++)
293  energyInEachChannel[12][sec]+energyInEachChannel[13][sec];
294 
295 
297  for(int mod=0; mod<14;mod++)
298  castorHists.meRECHIT_E_relative_modules->getTH1F()->SetBinContent(mod+1,allEnergyModule[mod]/totEnergy);
299  for(int sec=0; sec<16;sec++)
300  castorHists.meRECHIT_E_relative_sectors->getTH1F()->SetBinContent(sec+1,allEnergySector[sec]/totEnergy);
301 
302 
303 
304  }
305 
306  else { if(fVerbosity>0) std::cout<<"CastorRecHitMonitor::processEvent NO Castor RecHits !!!"<<std::endl; }
307 
308  if(fVerbosity>0) std::cout << "CastorRecHitMonitor::processEvent (end)"<< std::endl;
309 
310  return;
311 }
edm::CPUTimer cpu_timer
void start()
Definition: CPUTimer.cc:74
float energyInEachChannel[14][16]
MonitorElement * meEVT_
std::vector< CastorRecHit >::const_iterator const_iterator
void reset()
Definition: CPUTimer.cc:107
void Fill(long long x)
struct CastorRecHitMonitor::@257 castorHists
const_iterator end() const
size_type size() const
tuple cout
Definition: gather_cfg.py:121
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: vlib.h:208
const_iterator begin() const
void CastorRecHitMonitor::reset ( void  )

Definition at line 38 of file CastorRecHitMonitor.cc.

Referenced by CastorMonitorModule::reset().

39  {
40 
41  }
void CastorRecHitMonitor::setup ( const edm::ParameterSet ps,
DQMStore dbe 
)
virtual

Reimplemented from CastorBaseMonitor.

Definition at line 48 of file CastorRecHitMonitor.cc.

References allEnergyModule, allEnergySector, CastorBaseMonitor::baseFolder_, gather_cfg::cout, doPerChannel_, energyInEachChannel, CastorBaseMonitor::fVerbosity, edm::ParameterSet::getUntrackedParameter(), ievt_, mod(), CastorBaseMonitor::rootFolder_, sector, CastorBaseMonitor::setup(), totEnergy, and zside.

Referenced by CastorMonitorModule::CastorMonitorModule().

49  {
51  if(fVerbosity>0) std::cout << "CastorRecHitMonitor::setup (start)" << std::endl;
52 
53  baseFolder_ = rootFolder_+"CastorRecHitMonitor";
54 
55  if ( ps.getUntrackedParameter<bool>("RecHitsPerChannel", false) ){
56  doPerChannel_ = true;
57  }
58 
59  ievt_=0; module=0; sector=0; zside=0; totEnergy=0.;
60 
61 
63  for (int mod=0; mod<14; mod++){
64  for (int sec=0; sec<16; sec++){
65  energyInEachChannel[mod][sec] = 0.;
67  allEnergySector[sec]=0;
68  }
69  }
70 
71  if(fVerbosity>0) std::cout << "CastorRecHitMonitor::setup (end)" << std::endl;
72 
73  return;
74 }
T getUntrackedParameter(std::string const &, T const &) const
virtual void setup(const edm::ParameterSet &ps, DQMStore *dbe)
float energyInEachChannel[14][16]
std::string baseFolder_
std::string rootFolder_
tuple cout
Definition: gather_cfg.py:121
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: vlib.h:208

Member Data Documentation

float CastorRecHitMonitor::allEnergyModule[14]
private

Definition at line 38 of file CastorRecHitMonitor.h.

Referenced by processEvent(), and setup().

float CastorRecHitMonitor::allEnergySector[16]
private

Definition at line 39 of file CastorRecHitMonitor.h.

Referenced by processEvent(), and setup().

struct { ... } CastorRecHitMonitor::castorHists

Referenced by beginRun(), and processEvent().

float CastorRecHitMonitor::channel
private

Definition at line 29 of file CastorRecHitMonitor.h.

Referenced by processEvent().

bool CastorRecHitMonitor::doPerChannel_
private

Definition at line 21 of file CastorRecHitMonitor.h.

Referenced by CastorRecHitMonitor(), and setup().

float CastorRecHitMonitor::energy
private

Definition at line 32 of file CastorRecHitMonitor.h.

Referenced by processEvent().

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

Definition at line 34 of file CastorRecHitMonitor.h.

Referenced by processEvent(), and setup().

int CastorRecHitMonitor::ievt_
private

Definition at line 23 of file CastorRecHitMonitor.h.

Referenced by CastorRecHitMonitor(), processEvent(), and setup().

MonitorElement* CastorRecHitMonitor::meCastorRecHitsOccupancy

Definition at line 52 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::meEVT_
private

Definition at line 57 of file CastorRecHitMonitor.h.

Referenced by beginRun(), and processEvent().

std::map<HcalCastorDetId, MonitorElement*> CastorRecHitMonitor::meRECHIT_E

Definition at line 54 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::meRECHIT_E_all

Definition at line 43 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::meRECHIT_E_modules

Definition at line 46 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::meRECHIT_E_relative_modules

Definition at line 48 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::meRECHIT_E_relative_sectors

Definition at line 49 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::meRECHIT_E_sectors

Definition at line 47 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::meRECHIT_MAP_CHAN_E

Definition at line 45 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::meRECHIT_N_event

Definition at line 53 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::meRECHIT_N_modules

Definition at line 50 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::meRECHIT_N_sectors

Definition at line 51 of file CastorRecHitMonitor.h.

std::map<HcalCastorDetId, MonitorElement*> CastorRecHitMonitor::meRECHIT_T

Definition at line 54 of file CastorRecHitMonitor.h.

MonitorElement* CastorRecHitMonitor::meRECHIT_T_all

Definition at line 44 of file CastorRecHitMonitor.h.

int CastorRecHitMonitor::module
private

Definition at line 26 of file CastorRecHitMonitor.h.

Referenced by processEvent(), and TreeCrawler.Package::search().

int CastorRecHitMonitor::sector
private

Definition at line 27 of file CastorRecHitMonitor.h.

Referenced by geometryXMLparser.DTAlignable::index(), processEvent(), and setup().

float CastorRecHitMonitor::time
private

Definition at line 33 of file CastorRecHitMonitor.h.

Referenced by processEvent().

float CastorRecHitMonitor::totEnergy
private

Definition at line 35 of file CastorRecHitMonitor.h.

Referenced by processEvent(), and setup().

int CastorRecHitMonitor::zside
private

Definition at line 28 of file CastorRecHitMonitor.h.

Referenced by setup().