CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloG4Hit.cc
Go to the documentation of this file.
1 // File: CaloG4Hit.cc
3 // Description: Transient Hit class for the calorimeters
6 #include <iostream>
7 
8 G4Allocator<CaloG4Hit> CaloG4HitAllocator;
9 
11 
12  setEntry(0.,0.,0.);
13  setEntryLocal(0.,0.,0.);
14  elem = 0.;
15  hadr = 0.;
16  theIncidentEnergy = 0.;
17 }
18 
20 
22 
23  entry = right.entry;
24  entryLocal = right.entryLocal;
25  pos = right.pos;
26  elem = right.elem;
27  hadr = right.hadr;
29  hitID = right.hitID;
30 }
31 
33 
34  entry = right.entry;
35  entryLocal = right.entryLocal;
36  pos = right.pos;
37  elem = right.elem;
38  hadr = right.hadr;
40  hitID = right.hitID;
41 
42  return *this;
43 }
44 
45 void CaloG4Hit::addEnergyDeposit(double em, double hd) {
46 
47  elem += em ;
48  hadr += hd;
49 }
50 
52 
53  addEnergyDeposit(aHit.getEM(),aHit.getHadr());
54 }
55 
56 
58  LogDebug("CaloSim") << (*this);
59 }
60 
61 std::ostream& operator<<(std::ostream& os, const CaloG4Hit& hit) {
62  os << " Data of this CaloG4Hit are:" << "\n"
63  << " HitID: " << hit.getID() << "\n"
64  << " EnergyDeposit of EM particles = " << hit.getEM() << "\n"
65  << " EnergyDeposit of HD particles = " << hit.getHadr() << "\n"
66  << " Energy of primary particle = " << hit.getIncidentEnergy()/MeV
67  << " (MeV)"<< "\n"
68  << " Entry point in Calorimeter (global) : " << hit.getEntry()
69  << " (local) " << hit.getEntryLocal() << "\n"
70  << " Position of Hit (global) : " << hit.getPosition() << "\n"
71  << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
72  return os;
73 }
74 
75 
#define LogDebug(id)
math::XYZPoint getPosition() const
Definition: CaloG4Hit.h:56
void setEntryLocal(double x, double y, double z)
Definition: CaloG4Hit.h:54
double getIncidentEnergy() const
Definition: CaloG4Hit.h:65
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
CaloHitID getID() const
Definition: CaloG4Hit.h:74
void addEnergyDeposit(double em, double hd)
Definition: CaloG4Hit.cc:45
CaloHitID hitID
Definition: CaloG4Hit.h:91
math::XYZPoint entry
Definition: CaloG4Hit.h:85
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
G4Allocator< CaloG4Hit > CaloG4HitAllocator
Definition: CaloG4Hit.cc:8
const CaloG4Hit & operator=(const CaloG4Hit &right)
Definition: CaloG4Hit.cc:32
double hadr
Definition: CaloG4Hit.h:89
math::XYZPoint entryLocal
Definition: CaloG4Hit.h:86
double getEM() const
Definition: CaloG4Hit.h:59
double theIncidentEnergy
Definition: CaloG4Hit.h:90
math::XYZPoint pos
Definition: CaloG4Hit.h:87
void setEntry(double x, double y, double z)
Definition: CaloG4Hit.h:51
double elem
Definition: CaloG4Hit.h:88
math::XYZPoint getEntryLocal() const
Definition: CaloG4Hit.h:53
math::XYZPoint getEntry() const
Definition: CaloG4Hit.h:50
void Print()
Definition: CaloG4Hit.cc:57
double getHadr() const
Definition: CaloG4Hit.h:62
~CaloG4Hit()
Definition: CaloG4Hit.cc:19