]>
Commit | Line | Data |
---|---|---|
4e566f2f | 1 | ////////////////////////////////////////////////////////////////////// |
2 | // - old way - | |
3 | ////////////////////////////////////////////////////////////////////// | |
4 | ||
5 | bool kOpen(int evtN=0) | |
6 | { | |
7 | TString fileName = "galice.root" ; | |
8 | AliRunLoader* rl = AliRunLoader::Open(fileName.Data(),"MyEvent","read"); | |
9 | rl->LoadgAlice(); | |
10 | AliRun* gAlice = rl->GetAliRun(); | |
11 | rl->LoadHeader(); | |
12 | rl->LoadKinematics(); | |
13 | Int_t fNumberOfEvents = rl->GetNumberOfEvents() ; | |
14 | cout << " Found : " << fNumberOfEvents << " event(s) ... " << endl ; | |
15 | ||
16 | Int_t exitStatus = rl->GetEvent(evtN) ; if(exitStatus!=0) { return kFALSE ; } | |
17 | ||
18 | TTree* pKTree = (TTree*)rl->TreeK(); // Particles TTree (KineTree) | |
19 | AliStack* pStack = gAlice->Stack(); // Particles Stack (use "Label()" to get the number in the stack) | |
20 | ||
21 | // else if(rl) // opens files one by one (unload and reload) | |
22 | // { | |
23 | // rl->UnloadgAlice() ; | |
24 | // rl->UnloadHeader() ; | |
25 | // rl->UnloadKinematics() ; | |
26 | // delete rl ; rl = 0 ; | |
27 | // } | |
28 | ||
29 | Int_t fNumberOfParticles = pKTree->GetEntries() ; | |
30 | Int_t nPart = pStack->GetNtrack() ; | |
31 | cout << " Event n. " << evtN << " contains : " << fNumberOfParticles << " particles in the TTree ( = " << nPart << " in the stack ) . " << endl ; | |
32 | ||
33 | return kTRUE ; | |
34 | } | |
35 |