CMS 3D CMS Logo

CaloG4Hit.cc
Go to the documentation of this file.
1 // File: CaloG4Hit.cc
3 // Description: Transient Hit class for the calorimeters
7 #include <iostream>
8 
9 #include "G4SystemOfUnits.hh"
10 
11 G4ThreadLocal G4Allocator<CaloG4Hit>* fpCaloG4HitAllocator = nullptr;
12 
14  setEntry(0., 0., 0.);
15  setEntryLocal(0., 0., 0.);
16  elem = 0.;
17  hadr = 0.;
18  theIncidentEnergy = 0.;
19 }
20 
22 
24  entry = right.entry;
25  entryLocal = right.entryLocal;
26  pos = right.pos;
27  elem = right.elem;
28  hadr = right.hadr;
30  hitID = right.hitID;
31 }
32 
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  elem += em;
47  hadr += hd;
48 }
49 
50 void CaloG4Hit::addEnergyDeposit(const CaloG4Hit& aHit) { addEnergyDeposit(aHit.getEM(), aHit.getHadr()); }
51 
52 void CaloG4Hit::Print() { edm::LogVerbatim("CaloSim") << (*this); }
53 
54 std::ostream& operator<<(std::ostream& os, const CaloG4Hit& hit) {
55  os << " Data of this CaloG4Hit are:"
56  << "\n"
57  << " HitID: " << hit.getID() << "\n"
58  << " EnergyDeposit of EM particles = " << hit.getEM() << "\n"
59  << " EnergyDeposit of HD particles = " << hit.getHadr() << "\n"
60  << " Energy of primary particle = " << hit.getIncidentEnergy() / MeV << " (MeV)"
61  << "\n"
62  << " Entry point in Calorimeter (global) : " << hit.getEntry() << " (local) " << hit.getEntryLocal() << "\n"
63  << " Position of Hit (global) : " << hit.getPosition() << "\n"
64  << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
65  return os;
66 }
MessageLogger.h
pos
Definition: PixelAliasList.h:18
fpCaloG4HitAllocator
G4ThreadLocal G4Allocator< CaloG4Hit > * fpCaloG4HitAllocator
Definition: CaloG4Hit.cc:11
MeV
const double MeV
CaloG4Hit::elem
double elem
Definition: CaloG4Hit.h:83
CaloG4Hit::pos
math::XYZPoint pos
Definition: CaloG4Hit.h:82
CaloG4Hit::hadr
double hadr
Definition: CaloG4Hit.h:84
operator<<
std::ostream & operator<<(std::ostream &os, const CaloG4Hit &hit)
Definition: CaloG4Hit.cc:54
CaloG4Hit::entry
math::XYZPoint entry
Definition: CaloG4Hit.h:80
CaloG4Hit::entryLocal
math::XYZPoint entryLocal
Definition: CaloG4Hit.h:81
CaloG4Hit::hitID
CaloHitID hitID
Definition: CaloG4Hit.h:86
CaloG4Hit::getEM
double getEM() const
Definition: CaloG4Hit.h:55
CaloG4Hit::CaloG4Hit
CaloG4Hit()
Definition: CaloG4Hit.cc:13
CaloG4Hit::setEntryLocal
void setEntryLocal(double x, double y, double z)
Definition: CaloG4Hit.h:50
CaloG4Hit::theIncidentEnergy
double theIncidentEnergy
Definition: CaloG4Hit.h:85
CaloG4Hit::setEntry
void setEntry(double x, double y, double z)
Definition: CaloG4Hit.h:47
CaloG4Hit
Definition: CaloG4Hit.h:32
CaloG4Hit::~CaloG4Hit
~CaloG4Hit() override
Definition: CaloG4Hit.cc:21
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
CaloG4Hit::operator=
const CaloG4Hit & operator=(const CaloG4Hit &right)
Definition: CaloG4Hit.cc:33
CaloG4Hit::getHadr
double getHadr() const
Definition: CaloG4Hit.h:58
CaloG4Hit.h
CaloG4Hit::Print
void Print() override
Definition: CaloG4Hit.cc:52
CaloG4Hit::addEnergyDeposit
void addEnergyDeposit(double em, double hd)
Definition: CaloG4Hit.cc:45
hit
Definition: SiStripHitEffFromCalibTree.cc:88