]>
Commit | Line | Data |
---|---|---|
1 | //******************************************************************** | |
2 | // Example (very naive for the moment) of the data analysis | |
3 | // using the ESD classes | |
4 | // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch | |
5 | // Modified by Basanta K. Nandi for PMD analysis | |
6 | //******************************************************************** | |
7 | ||
8 | #if !defined( __CINT__) || defined(__MAKECINT__) | |
9 | #include <Riostream.h> | |
10 | #include "TTree.h" | |
11 | #include "TFile.h" | |
12 | #include "TH1F.h" | |
13 | #include "TCanvas.h" | |
14 | #include "TStyle.h" | |
15 | #include "TStopwatch.h" | |
16 | ||
17 | #include "AliESD.h" | |
18 | #endif | |
19 | ||
20 | extern TStyle *gStyle; | |
21 | ||
22 | Int_t AliPMDesdanal() { | |
23 | TStopwatch timer; | |
24 | ||
25 | gStyle->SetOptStat(111110); | |
26 | gStyle->SetOptFit(1); | |
27 | ||
28 | //****** File with the ESD | |
29 | TFile *ef=TFile::Open("AliESDs.root"); | |
30 | if (!ef || !ef->IsOpen()) {cerr<<"Can't AliESDs.root !\n"; return 1;} | |
31 | AliESDEvent * event = new AliESDEvent; | |
32 | TTree* tree = (TTree*) ef->Get("esdTree"); | |
33 | if (!tree) {cerr<<"no ESD tree found\n"; return 1;}; | |
34 | event->ReadFromTree(tree); | |
35 | Int_t n=0; | |
36 | ||
37 | //******* The loop over events | |
38 | while (tree->GetEvent(n)) { | |
39 | cout<<endl<<"Processing event number : "<<n++<<endl; | |
40 | ||
41 | ||
42 | Int_t npmdcl=event->GetNumberOfPmdTracks(); | |
43 | cout<<"Number of PMD tracks : "<<npmdcl<<endl; | |
44 | ||
45 | //****** The loop over PMD clusters | |
46 | while (npmdcl--) { | |
47 | AliESDPmdTrack *pmdtr = event->GetPmdTrack(npmdcl); | |
48 | ||
49 | Int_t det = pmdtr->GetDetector(); | |
50 | Float_t clsX = pmdtr->GetClusterX(); | |
51 | Float_t clsY = pmdtr->GetClusterY(); | |
52 | Float_t clsZ = pmdtr->GetClusterZ(); | |
53 | Float_t ncell = pmdtr->GetClusterCells(); | |
54 | Float_t adc = pmdtr->GetClusterADC(); | |
55 | Float_t pid = pmdtr->GetClusterPID(); | |
56 | ||
57 | } | |
58 | } | |
59 | ||
60 | delete event; | |
61 | ||
62 | timer.Stop(); | |
63 | timer.Print(); | |
64 | ||
65 | return 0; | |
66 | } |