37UParticle::UParticle() {
39 fIndex = fPdg = fStatus = fParent = fParentDecay = fMate = fDecay = 0;
40 fChild[0] = fChild[1] = 0;
41 fPx = fPy = fPz = fE = 0.;
42 fX = fY = fZ = fT = 0.;
49UParticle::UParticle(Int_t index,
71 fParentDecay = parentDecay;
90UParticle::UParticle(Int_t index,
106 fParentDecay = parentDecay;
109 fChild[0] = child[0];
110 fChild[1] = child[1];
125UParticle::UParticle(
const UParticle& right) {
133UParticle::UParticle(
const TParticle& right) {
141UParticle::~UParticle() {
150 fIndex = right.fIndex;
152 fStatus = right.fStatus;
153 fParent = right.fParent;
154 fParentDecay = right.fParentDecay;
156 fDecay = right.fDecay;
157 fChild[0] = right.fChild[0];
158 fChild[1] = right.fChild[1];
167 fWeight = right.fWeight;
174const UParticle& UParticle::operator=(
const TParticle& right) {
177 fPdg = right.GetPdgCode();
178 fStatus = right.GetStatusCode();
179 fParent = right.GetFirstMother();
183 fChild[0] = right.GetFirstDaughter();
184 fChild[1] = right.GetLastDaughter();
193 fWeight = right.GetWeight();
200const Bool_t UParticle::operator==(
const UParticle& right)
const {
202 return (fIndex == right.fIndex && fPdg == right.fPdg && fStatus == right.fStatus && fParent == right.fParent
203 && fParentDecay == right.fParentDecay && fMate == right.fMate && fDecay == right.fDecay && fChild[0] == right.fChild[0]
204 && fChild[1] == right.fChild[1]
205 && ((TMath::Abs((fPx - right.fPx) / fPx) < 0.0001) || (TMath::Abs(fPx) < 1e-16 && TMath::Abs(right.fPx) < 1e-16))
206 && ((TMath::Abs((fPy - right.fPy) / fPy) < 0.0001) || (TMath::Abs(fPy) < 1e-16 && TMath::Abs(right.fPy) < 1e-16))
207 && ((TMath::Abs((fPz - right.fPz) / fPz) < 0.0001) || (TMath::Abs(fPz) < 1e-16 && TMath::Abs(right.fPz) < 1e-16))
208 && ((TMath::Abs((fE - right.fE) / fE) < 0.0001) || (TMath::Abs(fE) < 1e-16 && TMath::Abs(right.fE) < 1e-16))
209 && ((TMath::Abs((fX - right.fX) / fX) < 0.0001) || (TMath::Abs(fX) < 1e-16 && TMath::Abs(right.fX) < 1e-16))
210 && ((TMath::Abs((fY - right.fY) / fY) < 0.0001) || (TMath::Abs(fY) < 1e-16 && TMath::Abs(right.fY) < 1e-16))
211 && ((TMath::Abs((fZ - right.fZ) / fZ) < 0.0001) || (TMath::Abs(fZ) < 1e-16 && TMath::Abs(right.fZ) < 1e-16))
212 && ((TMath::Abs((fT - right.fT) / fT) < 0.0001) || (TMath::Abs(fT) < 1e-16 && TMath::Abs(right.fT) < 1e-16))
213 && ((TMath::Abs((fWeight - right.fWeight) / fWeight) < 0.0001)
214 || (TMath::Abs(fWeight) < 1e-16 && TMath::Abs(right.fWeight) < 1e-16)));
220void UParticle::Print(Option_t* option) {
222 cout <<
"------------------------------------------------" << endl
223 <<
"-I- Particle -I-" << endl
224 <<
"Index : " << fIndex << endl
225 <<
"PDG code : " << fPdg << endl
226 <<
"Status code : " << fStatus << endl
227 <<
"Parent index : " << fParent << endl
228 <<
"Parent decay index : " << fParentDecay << endl
229 <<
"Last collision partner : " << fMate << endl
230 <<
"Decay index : " << fDecay << endl
231 <<
"First child index : " << fChild[0] << endl
232 <<
"Last child index : " << fChild[1] << endl
233 <<
"Momentum (px, py, pz) (GeV) : (" << fPx <<
", " << fPy <<
", " << fPz <<
")" << endl
234 <<
"Energy (GeV) : " << fE << endl
235 <<
"Position (x, y, z) (fm) : (" << fX <<
", " << fY <<
", " << fZ <<
")" << endl
236 <<
"Creation time (fm) : " << fT << endl
237 <<
"Weight : " << fWeight << endl
238 <<
"------------------------------------------------" << endl;