2 //////////////////////////////////////////////////////////////////////////
6 // helper class to browse generated particles. //
8 //////////////////////////////////////////////////////////////////////////
11 #include <TParticle.h>
12 #include <TClonesArray.h>
14 #include "AliFBigBang.h"
16 #include "AliFBrowsable.h"
22 //_____________________________________________________________________________
23 AliFBigBang::AliFBigBang()
24 : TNamed("Histograms","Generated particles browser")
29 //_____________________________________________________________________________
30 AliFBigBang::~AliFBigBang()
33 fBrowsables->Delete();
39 //_____________________________________________________________________________
40 void AliFBigBang::Browse(TBrowser *b)
44 TClonesArray *particles = mcarlo->Fruits();
45 Int_t nparticles = particles->GetEntriesFast();
49 if (!fBrowsables) fBrowsables = new TObjArray(2*nparticles);
50 if (fBrowsables->GetSize() < nparticles) fBrowsables->Expand(nparticles);
51 for (Int_t i=0;i<nparticles;i++) {
52 part = (TParticle*)particles->UncheckedAt(i);
53 if (part->GetMother(i)) continue;
54 brow = GetBrowsable(i);
55 sprintf(name,"%s_%d",part->GetName(),i);
57 brow->SetRefObject(part);
63 //_____________________________________________________________________________
64 AliFBrowsable *AliFBigBang::GetBrowsable(Int_t i)
66 AliFBrowsable *brow = (AliFBrowsable*)fBrowsables->At(i);
68 brow = new AliFBrowsable();
69 fBrowsables->AddAt(brow, i);
70 brow->SetBigBang(this);