22#include "TClonesArray.h"
48 fParticles =
new TClonesArray(
"UParticle", 100);
54UEvent::UEvent(
const UEvent& right) {
56 fEventNr = right.fEventNr;
60 fStepNr = right.fStepNr;
61 fStepT = right.fStepT;
62 fComment = right.fComment;
64 fParticles =
new TClonesArray(
"UParticle", 100);
66 for (Int_t i = 0; i < fNpa; i++) {
77 fEventNr = right.fEventNr;
81 fStepNr = right.fStepNr;
82 fStepT = right.fStepT;
84 fComment = right.fComment;
87 for (Int_t i = 0; i < fNpa; i++) {
107void UEvent::Print(Option_t* option) {
109 cout <<
"---------------------------------------------" << endl
110 <<
"-I- Event -I-" << endl
111 <<
"Event number : " << fEventNr << endl
112 <<
"Impact parameter (fm) : " << fB << endl
113 <<
"Reaction plane angle (rad) : " << fPhi << endl
114 <<
"Number of time steps : " << fNes << endl
115 <<
"Time step number : " << fStepNr << endl
116 <<
"Time of the time step (fm) : " << fStepT << endl
117 <<
"Number of particles : " << fNpa << endl
120 TString opt = option;
121 if (opt.Contains(
"all")) {
123 for (Int_t iPa = 0; iPa < fNpa; iPa++) {
124 particle = (
UParticle*) fParticles->At(iPa);
125 particle->Print(option);
128 cout <<
"---------------------------------------------" << endl;
134UParticle* UEvent::GetParticle(Int_t index)
const {
137 if (index < 0) {
return NULL; }
138 if (index >= fNpa) {
return NULL; }
139 return ((
UParticle*) fParticles->At(index));
145void UEvent::AddParticle(Int_t index,
163 new ((*fParticles)[fNpa])
164 UParticle(index, pdg, status, parent, parentDecay, mate, decay, child, px, py, pz, e, x, y, z, t, weight);
171void UEvent::AddParticle(Int_t index,
183 new ((*fParticles)[fNpa])
UParticle(index, pdg, status, parent, parentDecay, mate, decay, child, mom, pos, weight);
190void UEvent::AddParticle(
const UParticle& particle) {
192 new ((*fParticles)[fNpa])
UParticle(particle);
199void UEvent::SetParameters(Int_t eventNr,
205 const char* comment) {
219void UEvent::Clear() {
228void UEvent::RemoveAt(Int_t i) {
232 fParticles->RemoveAt(i);
233 fParticles->Compress();