3 // Contains only the useful quantities computed on the event
4 // which can be used for event mixing, or for direct output
5 // when doing analysis w.r. to multiplicity or event plane, for example.
7 // Author: A. Pulvirenti
10 #include "AliRsnMiniParticle.h"
11 #include "AliRsnMiniEvent.h"
13 ClassImp(AliRsnMiniEvent)
15 //__________________________________________________________________________________________________
16 void AliRsnMiniEvent::AddParticle(AliRsnMiniParticle copy)
19 // Add a new particle to the list and returns a pointer to it,
20 // in order to allow to se its parameters.
23 Int_t n = fParticles.GetEntries();
24 new (fParticles[n]) AliRsnMiniParticle(copy);
27 //__________________________________________________________________________________________________
28 AliRsnMiniParticle* AliRsnMiniEvent::GetParticle(Int_t i)
31 // Return the leading particle
34 if (i < 0 || i > fParticles.GetEntriesFast()) return 0x0;
36 return (AliRsnMiniParticle*)fParticles[i];
39 //__________________________________________________________________________________________________
40 AliRsnMiniParticle* AliRsnMiniEvent::LeadingParticle()
43 // Return the leading particle
46 if (fLeading < 0) return 0x0;
47 if (fLeading >= fParticles.GetEntriesFast()) return 0x0;
49 return (AliRsnMiniParticle*)fParticles[fLeading];
52 //__________________________________________________________________________________________________
53 Int_t AliRsnMiniEvent::CountParticles(TArrayI &found, Char_t charge, Int_t cutID)
56 // Counts how many particles have the specified charge and cut bit
57 // if charge is not '+', '-' or '0', all charges are considered
58 // if cut bit is < 0, it is not checked
61 Int_t i, npart = fParticles.GetEntriesFast();
63 AliRsnMiniParticle *part = 0x0;
67 for (i = 0; i < npart; i++) {
68 part = (AliRsnMiniParticle*)fParticles[i];
69 if (charge == '+' || charge == '-' || charge == '0') {
70 if (part->Charge() != charge) continue;
73 if (!part->HasCutBit(cutID)) continue;