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

#include <CastorEventDisplay.h>

Inheritance diagram for CastorEventDisplay:
CastorBaseMonitor

Public Member Functions

 CastorEventDisplay ()
 
void processEvent (const CastorRecHitCollection &castorHits, const CaloGeometry &caloGeometry)
 
void reset ()
 
void setup (const edm::ParameterSet &ps, DQMStore *dbe)
 
 ~CastorEventDisplay ()
 
- 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 allEnergyEvent
 
float energy
 
int ievt_
 
float maxEnergyEvent
 
MonitorElementmeCastor3Dhits
 
MonitorElementmeCastor3DhitsMaxEnergy
 
MonitorElementmeEVT_
 
bool offline_
 
double X_pos
 
double X_pos_maxE
 
double Y_pos
 
double Y_pos_maxE
 
double Z_pos
 
double Z_pos_maxE
 

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 21 of file CastorEventDisplay.h.

Constructor & Destructor Documentation

CastorEventDisplay::CastorEventDisplay ( )

Definition at line 16 of file CastorEventDisplay.cc.

References ievt_.

16  {
17  ievt_=0;
18 }
CastorEventDisplay::~CastorEventDisplay ( )

Definition at line 23 of file CastorEventDisplay.cc.

23  {
24 }

Member Function Documentation

void CastorEventDisplay::processEvent ( const CastorRecHitCollection castorHits,
const CaloGeometry caloGeometry 
)

Definition at line 93 of file CastorEventDisplay.cc.

References abs, allEnergyEvent, edm::SortedCollection< T, SORT >::begin(), gather_cfg::cout, CastorBaseMonitor::cpu_timer, edm::CPUTimer::cpuTime(), edm::SortedCollection< T, SORT >::end(), energy, MonitorElement::Fill(), CastorBaseMonitor::fVerbosity, CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), CaloGeometry::getSubdetectorGeometry(), MonitorElement::getTH3F(), ievt_, CastorBaseMonitor::m_dbe, maxEnergyEvent, meCastor3Dhits, meCastor3DhitsMaxEnergy, meEVT_, edm::CPUTimer::reset(), MonitorElement::Reset(), CastorBaseMonitor::showTiming, edm::SortedCollection< T, SORT >::size(), edm::CPUTimer::start(), edm::CPUTimer::stop(), MonitorElement::update(), PV3DBase< T, PVType, FrameType >::x(), X_pos, X_pos_maxE, PV3DBase< T, PVType, FrameType >::y(), Y_pos, Y_pos_maxE, PV3DBase< T, PVType, FrameType >::z(), Z_pos, and Z_pos_maxE.

Referenced by CastorMonitorModule::analyze().

93  {
94 
95  if(fVerbosity>0) std::cout << "==>CastorEventDisplay::processEvent !!!"<< std::endl;
96 
98  meEVT_->Fill(ievt_);
99 
100  if(!m_dbe) {
101  if(fVerbosity>0) std::cout <<"CastorEventDisplay::processEvent => DQMStore is not instantiated !!!"<<std::endl;
102  return;
103  }
104 
105  allEnergyEvent=0.;
106 
107 
110 
111  if(castorHits.size()>0)
112  {
113  if(fVerbosity>0) std::cout << "==>CastorEventDisplay::processEvent: castorHits.size()>0 !!!" << std::endl;
114 
116  for (CASTORiter=castorHits.begin(); CASTORiter!=castorHits.end(); ++CASTORiter) {
117 
119  energy = CASTORiter->energy();
120 
122  HcalCastorDetId CastorID(CASTORiter->detid().rawId());
123 
125  //const CaloSubdetectorGeometry* subdetectorGeometry=caloGeometry.getSubdetectorGeometry(CastorID) ;
126  //const CaloCellGeometry* cellGeometry = subdetectorGeometry->getGeometry(CastorID) ;
127  //X_pos = cellGeometry->getPosition().x() ; Y_pos = cellGeometry->getPosition().y() ;
128  //Z_pos = cellGeometry->getPosition().z() ;
129 
130  X_pos = caloGeometry.getSubdetectorGeometry(CastorID)->getGeometry(CastorID)->getPosition().x() ;
131  Y_pos = caloGeometry.getSubdetectorGeometry(CastorID)->getGeometry(CastorID)->getPosition().y() ;
132  Z_pos = caloGeometry.getSubdetectorGeometry(CastorID)->getGeometry(CastorID)->getPosition().z() ;
133 
134  if (energy>0){
138  meCastor3Dhits->Fill(std::abs(Z_pos),X_pos,Y_pos, energy);
139  }
140 
141  if(fVerbosity>0) std::cout<<"ENERGY="<< energy <<" X_pos="<< X_pos <<" Y_pos="<< Y_pos <<" Z_pos="<< Z_pos << std::endl;
142  } //-- end of for loop
143 
144 
145  if(fVerbosity>0) std::cout<<"TOTAL ENERGY in an event="<< allEnergyEvent << std::endl;
146 
147 
148 
153  if(fVerbosity>0) std::cout<<"LARGEST ENERGY in an event="<< maxEnergyEvent << std::endl;
154 
156  for (CASTORiter=castorHits.begin(); CASTORiter!=castorHits.end(); ++CASTORiter){
157  HcalCastorDetId CastorID_maxE(CASTORiter->detid().rawId());
158  X_pos_maxE = caloGeometry.getSubdetectorGeometry(CastorID_maxE)->getGeometry(CastorID_maxE)->getPosition().x() ;
159  Y_pos_maxE = caloGeometry.getSubdetectorGeometry(CastorID_maxE)->getGeometry(CastorID_maxE)->getPosition().y() ;
160  Z_pos_maxE = caloGeometry.getSubdetectorGeometry(CastorID_maxE)->getGeometry(CastorID_maxE)->getPosition().z() ;
161  meCastor3DhitsMaxEnergy->Fill(std::abs(Z_pos_maxE),X_pos_maxE,Y_pos_maxE, CASTORiter->energy() );
162  }
163  meCastor3DhitsMaxEnergy->getTH3F()->SetOption("BOX");
165  }
166  }
167 
168  else { if(fVerbosity>0) std::cout<<"CastorEventDisplay::processEvent NO Castor RecHits !!!"<<std::endl; }
169 
170 
171  if (showTiming) {
172  cpu_timer.stop(); std::cout << " TIMER::CastorEventDisplay -> " << cpu_timer.cpuTime() << std::endl;
174  }
175 
177  ievt_++;
178 
179  return;
180 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
edm::CPUTimer cpu_timer
void start()
Definition: CPUTimer.cc:74
std::vector< T >::const_iterator const_iterator
T y() const
Definition: PV3DBase.h:62
TH3F * getTH3F(void) const
#define abs(x)
Definition: mlp_lapack.h:159
void reset()
Definition: CPUTimer.cc:107
MonitorElement * meEVT_
void update(void)
Mark the object updated.
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
void Fill(long long x)
T z() const
Definition: PV3DBase.h:63
MonitorElement * meCastor3DhitsMaxEnergy
Times stop()
Definition: CPUTimer.cc:94
const_iterator end() const
double cpuTime() const
Definition: CPUTimer.cc:157
MonitorElement * meCastor3Dhits
size_type size() const
tuple cout
Definition: gather_cfg.py:121
T x() const
Definition: PV3DBase.h:61
void Reset(void)
reset ME (ie. contents, errors, etc)
const_iterator begin() const
void CastorEventDisplay::reset ( void  )

Definition at line 26 of file CastorEventDisplay.cc.

Referenced by CastorMonitorModule::reset().

26  {
27 }
void CastorEventDisplay::setup ( const edm::ParameterSet ps,
DQMStore dbe 
)
virtual

Reimplemented from CastorBaseMonitor.

Definition at line 34 of file CastorEventDisplay.cc.

References allEnergyEvent, CastorBaseMonitor::baseFolder_, DQMStore::book3D(), DQMStore::bookInt(), gather_cfg::cout, CastorBaseMonitor::fVerbosity, MonitorElement::getTH3F(), edm::ParameterSet::getUntrackedParameter(), ievt_, CastorBaseMonitor::m_dbe, maxEnergyEvent, meCastor3Dhits, meCastor3DhitsMaxEnergy, meEVT_, NULL, offline_, CastorBaseMonitor::rootFolder_, DQMStore::setCurrentFolder(), CastorBaseMonitor::setup(), X_pos, X_pos_maxE, Y_pos, Y_pos_maxE, Z_pos, and Z_pos_maxE.

Referenced by CastorMonitorModule::CastorMonitorModule().

34  {
35 
37  baseFolder_ = rootFolder_+"CastorEventDisplay";
38 
39 
40  offline_ = ps.getUntrackedParameter<bool>("OfflineMode", false);
41 
42  if(fVerbosity>0) std::cout << "CastorEventDisplay::setup (start)" << std::endl;
43 
46  X_pos=0.; Y_pos=0.; Z_pos=0.;
47  X_pos_maxE=0.; Y_pos_maxE=0.; Z_pos_maxE=0.;
48 
49  if ( m_dbe !=NULL ) {
51 
53  meEVT_ = m_dbe->bookInt("EventDisplay Event Number"); // meEVT_->Fill(ievt_);
54 
56  meCastor3Dhits = m_dbe->book3D("CASTOR 3D hits- cumulative", "CASTOR 3D hits - cumulative", 30, 1420, 1600, 35, -35, 35, 35, -35, 35);
57 
58 
59  if( offline_ ){
60  //-- swap z and y axis
61  TH3F* Castor3Dhits = meCastor3Dhits->getTH3F();
62  Castor3Dhits->GetXaxis()->SetTitle("Z [cm]"); //-- also swap x and z
63  Castor3Dhits->GetYaxis()->SetTitle("X [cm]");
64  Castor3Dhits->GetZaxis()->SetTitle("Y [cm]");
65  }
66 
68  meCastor3DhitsMaxEnergy = m_dbe->book3D("CASTOR 3D hits- event with the largest deposited E", "CASTOR 3D hits- event with the largest deposited E", 30, 1420, 1600, 20, -30, 30, 20, -30, 30); //-- swap z and y axis
69 
70  if( offline_ ){
71  TH3F* Castor3DhitsMaxEnergy = meCastor3DhitsMaxEnergy->getTH3F();
72  Castor3DhitsMaxEnergy->GetXaxis()->SetTitle("Z [cm]"); //-- also swap x and z
73  Castor3DhitsMaxEnergy->GetYaxis()->SetTitle("X [cm]");
74  Castor3DhitsMaxEnergy->GetZaxis()->SetTitle("Y [cm]");
75  Castor3DhitsMaxEnergy->SetDrawOption("LEGO2");
76  }
77 
78  }
79 
80  else{
81  if(fVerbosity>0) std::cout << "CastorEventDisplay::setup - NO DQMStore service" << std::endl;
82  }
83 
84  if(fVerbosity>0) std::cout << "CastorEventDisplay::setup (end)" << std::endl;
85 
86  return;
87 }
T getUntrackedParameter(std::string const &, T const &) const
virtual void setup(const edm::ParameterSet &ps, DQMStore *dbe)
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
Definition: DQMStore.cc:979
TH3F * getTH3F(void) const
#define NULL
Definition: scimark2.h:8
MonitorElement * meEVT_
std::string baseFolder_
MonitorElement * meCastor3DhitsMaxEnergy
MonitorElement * meCastor3Dhits
std::string rootFolder_
tuple cout
Definition: gather_cfg.py:121
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:624
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429

Member Data Documentation

float CastorEventDisplay::allEnergyEvent
private

Definition at line 44 of file CastorEventDisplay.h.

Referenced by processEvent(), and setup().

float CastorEventDisplay::energy
private

Definition at line 43 of file CastorEventDisplay.h.

Referenced by processEvent().

int CastorEventDisplay::ievt_
private

Definition at line 34 of file CastorEventDisplay.h.

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

float CastorEventDisplay::maxEnergyEvent
private

Definition at line 45 of file CastorEventDisplay.h.

Referenced by processEvent(), and setup().

MonitorElement* CastorEventDisplay::meCastor3Dhits
private

Definition at line 48 of file CastorEventDisplay.h.

Referenced by processEvent(), and setup().

MonitorElement* CastorEventDisplay::meCastor3DhitsMaxEnergy
private

Definition at line 49 of file CastorEventDisplay.h.

Referenced by processEvent(), and setup().

MonitorElement* CastorEventDisplay::meEVT_
private

Definition at line 50 of file CastorEventDisplay.h.

Referenced by processEvent(), and setup().

bool CastorEventDisplay::offline_
private

Definition at line 42 of file CastorEventDisplay.h.

Referenced by setup().

double CastorEventDisplay::X_pos
private

Definition at line 35 of file CastorEventDisplay.h.

Referenced by processEvent(), and setup().

double CastorEventDisplay::X_pos_maxE
private

Definition at line 38 of file CastorEventDisplay.h.

Referenced by processEvent(), and setup().

double CastorEventDisplay::Y_pos
private

Definition at line 36 of file CastorEventDisplay.h.

Referenced by processEvent(), and setup().

double CastorEventDisplay::Y_pos_maxE
private

Definition at line 39 of file CastorEventDisplay.h.

Referenced by processEvent(), and setup().

double CastorEventDisplay::Z_pos
private

Definition at line 37 of file CastorEventDisplay.h.

Referenced by processEvent(), and setup().

double CastorEventDisplay::Z_pos_maxE
private

Definition at line 40 of file CastorEventDisplay.h.

Referenced by processEvent(), and setup().