10 #include "TGeVSimEvent.h"
11 #include "TParticle.h"
12 #include "TGeVSimParams.h"
20 TGeVSimEvent::TGeVSimEvent(Int_t numParts) {
29 evParts =
new TClonesArray(
"TParticle", numParts);
30 evParams =
new TObjArray(10, 0);
36 TGeVSimEvent::~TGeVSimEvent() {
41 if (evParts)
delete evParts;
46 Double_t TGeVSimEvent::MeanPt()
const {
53 for(Int_t i=0; i<evParts->GetEntries(); i++) {
54 TParticle *p = (TParticle*)evParts->At(i);
58 sum /= evParts->GetEntries();
64 Int_t TGeVSimEvent::GetMult()
const {
72 mult = evParts->GetEntriesFast();
75 Error(
"GetMult",
"No array defined");
85 void TGeVSimEvent::NextEvent() {
98 void TGeVSimEvent::Print(Option_t* option)
const {
103 cout <<
"Event Number " << evNum << endl;
104 cout <<
"Multiplicity: " << GetMult() << endl;
106 printf(
"Reaction Plane: %3.2f\n", evPsi*180/3.142);
107 cout <<
"Mean Pt: " << MeanPt() << endl;
109 cout <<
"Particle Parameters:" << endl;
110 for(Int_t i=0; i<evParams->GetEntries(); i++)
113 if (i==0) par->PrintHeader();
116 cout << endl << endl;