ATLAS Offline Software
Loading...
Searching...
No Matches
ZDC_SimFiberHit.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ZDC_FIBER_SIMHIT
6#define ZDC_FIBER_SIMHIT
7
8#include "Identifier/Identifier.h"
9
11{
12 public:
13
18 : m_ID(Identifier()),
19 m_Nphotons(-1),
20 m_Edep(-1)
21 {}
22
29 ZDC_SimFiberHit(Identifier id, int nphot, double edep)
30 : m_ID(id),
31 m_Nphotons(nphot),
32 m_Edep(edep)
33 {}
34
37 : m_ID (right.m_ID),
38 m_Nphotons (right.m_Nphotons),
39 m_Edep (right.m_Edep)
40 {
41 }
42
43
44 Identifier getID () const { return m_ID; }
45 double getEdep () const { return m_Edep; }
46 int getNPhotons() const { return m_Nphotons; }
47
52 {
53 m_ID = right.m_ID;
54 m_Nphotons = right.m_Nphotons;
55 m_Edep = right.m_Edep;
56 return *this;
57 }
58
62 bool operator == (const ZDC_SimFiberHit& h) const {
63 return (m_ID == h.m_ID);
64 }
65
71 bool operator < (const ZDC_SimFiberHit& h) const {
72 if(m_ID != h.m_ID){
73 return m_ID < h.m_ID;
74 }else{
75 return m_Nphotons < h.m_Nphotons;
76 }
77 }
78
85 return ZDC_SimFiberHit(m_ID, m_Nphotons + h.m_Nphotons, m_Edep + h.m_Edep);
86 }
87
94 m_Nphotons += h.m_Nphotons;
95 m_Edep += h.m_Edep;
96 return *this;
97 }
98
99 void Add(int nphot, double edep){
100 m_Nphotons += nphot;
101 m_Edep += edep;
102 }
103
105 m_Nphotons += h.m_Nphotons;
106 m_Edep += h.m_Edep;
107 }
108
109
110 bool Equals(const ZDC_SimFiberHit& h) const {
111 return (m_ID == h.m_ID);
112 };
113
114
115 private:
116
119 double m_Edep;
120};
121
122#endif
123
124
Header file for AthHistogramAlgorithm.
void Add(ZDC_SimFiberHit &h)
int getNPhotons() const
void Add(int nphot, double edep)
Identifier getID() const
double getEdep() const
ZDC_SimFiberHit & operator=(const ZDC_SimFiberHit &right)
Assignment operator.
ZDC_SimFiberHit operator+=(const ZDC_SimFiberHit &h)
ZDC_SimFiberHit(Identifier id, int nphot, double edep)
Standard constructor.
ZDC_SimFiberHit()
Default constructor.
bool operator==(const ZDC_SimFiberHit &h) const
Just for checking if the ID is the same.
ZDC_SimFiberHit(const ZDC_SimFiberHit &right)
Copy constructor.
bool Equals(const ZDC_SimFiberHit &h) const
ZDC_SimFiberHit operator+(const ZDC_SimFiberHit &h)
Addition operator.
bool operator<(const ZDC_SimFiberHit &h) const
Check if the ID is less than the compared hit.