ATLAS Offline Software
Loading...
Searching...
No Matches
SiTotalCharge.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6// SiTotalCharge.h
7// Header file for class SiTotalCharge
9// (c) ATLAS Detector software
11// Class which contains the sum and the composition of all bare charges
12// corresponding to a single element
14// Version 1.5 08/06/2001 David Calvet
16
17#ifndef SITRACKEREVENT_SITOTALCHARGE_H
18#define SITRACKEREVENT_SITOTALCHARGE_H
19
20#include <list>
23
25
27 // Public methods:
29public:
30
31 typedef std::vector<SiCharge> list_t;
32
33 // Implicit constructor:
35
36 // Copy constructor:
37 SiTotalCharge(const SiTotalCharge &totalCharge);
38
39 // Destructor:
41
42 // Assignment operator:
43 SiTotalCharge &operator=(const SiTotalCharge &totalCharge);
44
46 // Const methods:
48
49 // total deposited charge in this element:
50 double charge() const;
51
52 // list of individual charges:
53 const list_t &chargeComposition() const;
54
55 // return true if the charge composition contains more than one charge:
56 bool complexCharge() const;
57
58 // return true if the main charge comes from a track (track/diodeX_Talk):
59 bool fromTrack() const;
60
61 // return true if the main charge is extraNoise:
62 bool extraNoise() const;
63
64 // return the barcode of the main charge:
65 int trackBarcode() const;
66
67 // returns the HepMcParticleLink of the main charge
68 const HepMcParticleLink& particleLink() const;
69
70 // return the time of the main charge
71 double time() const;
73 // Non-const methods:
75
76 // add another SiCharge:
77 void add(const SiCharge &charge);
78
79 // add another SiTotalCharge:
80 void add(const SiTotalCharge &totalCharge);
81
82 // remove time information of the SiCharge objects:
84
85 // remove small SiCharge objects:
86 // minimum charge allowed to keep a SiCharge in the composition list
87 void removeSmallCharges(const double minimumCharge);
88
90 // Private methods:
92private:
93
94 // add another SiCharge to the charge composition (not the total value):
95 void addSiCharge(const SiCharge &charge);
96
97 // return the SiCharge corresponding to the process which deposited
98 // the biggest amount of charge (returns dummy charge if list is empty)
99 // (used to be a public method, but this caused problems if the list was empty):
100 const SiCharge& mainCharge() const;
101
103 // Private data:
105private:
106 double m_charge; // total deposited charge in this element
107 list_t m_chargeComposition; // list of individual charges
108 static const HepMcParticleLink m_emptyLink; // An empty link
109};
110
112// Inline methods:
117
118inline double SiTotalCharge::charge() const
119{
120 return m_charge;
121}
122
127
129{
130 return (m_chargeComposition.size()>1);
131}
132
133inline bool SiTotalCharge::extraNoise() const
134{
135 if(m_chargeComposition.empty())
136 {
137 return false;
138 }
139 return (mainCharge().processType()==SiCharge::extraNoise);
140}
141
143{
144 if(m_chargeComposition.empty())
145 {
146 return 0;
147 }
148 return mainCharge().trackBarcode();
149}
150
151inline double SiTotalCharge::time() const
152{
153 if(m_chargeComposition.empty())
154 {
155 return 0.0;
156 }
157 return mainCharge().time();
158}
159
161{
162 if(m_chargeComposition.empty())
163 {
165 }
166 return mainCharge().particleLink();
167}
168
169
171// Input/Output stream functions:
173std::ostream &operator<<(std::ostream &out,const SiTotalCharge &totalCharge);
174
175#endif // SITRACKEREVENT_SITOTALCHARGE_H
STL-style allocator wrapper for ArenaHeapAllocator allowing the heap to be shared between containers.
std::ostream & operator<<(std::ostream &out, const SiTotalCharge &totalCharge)
double time() const
Definition SiCharge.h:114
@ extraNoise
Definition SiCharge.h:28
const HepMcParticleLink & particleLink() const
Definition SiCharge.h:129
int trackBarcode() const
Definition SiCharge.h:124
list_t m_chargeComposition
bool complexCharge() const
std::vector< SiCharge > list_t
static const HepMcParticleLink m_emptyLink
void addSiCharge(const SiCharge &charge)
void removeTimeInformation()
const HepMcParticleLink & particleLink() const
SiTotalCharge & operator=(const SiTotalCharge &totalCharge)
const list_t & chargeComposition() const
int trackBarcode() const
const SiCharge & mainCharge() const
double time() const
bool extraNoise() const
void removeSmallCharges(const double minimumCharge)
bool fromTrack() const
void add(const SiCharge &charge)
double charge() const