]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/macros/AliRsnPrintTracks.C
EMCAL Space Frame now included in geometry
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / macros / AliRsnPrintTracks.C
1 //
2 // This macro prints all details of each track for each AliRsnEvent in a file
3 // which is assumed to be saved in the same directory where this is executed.
4 //
5
6 void AliRsnPrintTracks(const char *fileName = "AliRsnEventsESD.root")
7 {
8     // load libraries
9     gSystem->Load("libANALYSIS");
10     gSystem->Load("libANALYSISalice.so");
11     gSystem->Load("libPWG2resonances.so");
12     
13     TFile *file = TFile::Open(fileName);
14     TTree *tree = (TTree*)file->Get("aodTree");
15     
16     Int_t i, last, nEvents = (Int_t)tree->GetEntries();
17     
18     AliRsnEvent *event = 0;
19     tree->SetBranchAddress("rsnEvents", &event);
20     
21     for (i = 0; i < nEvents; i++) {
22         cout << "*** Event " << i << " ***" << endl;
23         tree->GetEntry(i);
24         event->Print("P");
25         last = event->GetLastFastTrack(1.0);
26         cout << endl;
27         if (last > 0) {
28             cout << "...Tracks from 0 to " << last << " have Pt > 1.0 GeV" << endl << endl;
29         }
30         else {
31             cout << "...NO tracks with Pt > 1.0 GeV" << endl << endl;
32         }
33     }
34 }