]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PMD/AliPMDesdanal.C
fix AliHLTGlobalEsdConverterComponent
[u/mrichter/AliRoot.git] / PMD / AliPMDesdanal.C
CommitLineData
811dc103 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>
8b462fd8 10 #include "TTree.h"
811dc103 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
20extern TStyle *gStyle;
21
22Int_t AliPMDesdanal() {
23 TStopwatch timer;
24
25 gStyle->SetOptStat(111110);
26 gStyle->SetOptFit(1);
27
28//****** File with the ESD
9f35f7b3 29 TFile *ef=TFile::Open("AliESDs.root");
811dc103 30 if (!ef || !ef->IsOpen()) {cerr<<"Can't AliESDs.root !\n"; return 1;}
9f35f7b3 31 AliESDEvent * event = new AliESDEvent;
8b462fd8 32 TTree* tree = (TTree*) ef->Get("esdTree");
33 if (!tree) {cerr<<"no ESD tree found\n"; return 1;};
9f35f7b3 34 event->ReadFromTree(tree);
811dc103 35 Int_t n=0;
811dc103 36
37//******* The loop over events
8b462fd8 38 while (tree->GetEvent(n)) {
811dc103 39 cout<<endl<<"Processing event number : "<<n++<<endl;
40
811dc103 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
9f35f7b3 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();
811dc103 54 Float_t adc = pmdtr->GetClusterADC();
55 Float_t pid = pmdtr->GetClusterPID();
56
57 }
58 }
9f35f7b3 59
60 delete event;
61
811dc103 62 timer.Stop();
63 timer.Print();
64
65 return 0;
9f35f7b3 66}