]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PMD/AliPMDesdanal.C
DP:Misalignment of CPV added
[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
29 TFile *ef=TFile::Open("AliESDcheck.root");
30 if (!ef || !ef->IsOpen()) {cerr<<"Can't AliESDs.root !\n"; return 1;}
8b462fd8 31 AliESD* event = new AliESD;
32 TTree* tree = (TTree*) ef->Get("esdTree");
33 if (!tree) {cerr<<"no ESD tree found\n"; return 1;};
34 tree->SetBranchAddress("ESD", &event);
811dc103 35
36 Int_t n=0;
811dc103 37
38//******* The loop over events
8b462fd8 39 while (tree->GetEvent(n)) {
811dc103 40 cout<<endl<<"Processing event number : "<<n++<<endl;
41
811dc103 42
43 Int_t npmdcl=event->GetNumberOfPmdTracks();
44 cout<<"Number of PMD tracks : "<<npmdcl<<endl;
45
46 //****** The loop over PMD clusters
47 while (npmdcl--) {
48 AliESDPmdTrack *pmdtr = event->GetPmdTrack(npmdcl);
49
50 Int_t det = pmdtr->GetDetector();
51 Float_t theta = pmdtr->GetTheta();
52 Float_t phi = pmdtr->GetPhi();
53 Float_t adc = pmdtr->GetClusterADC();
54 Float_t pid = pmdtr->GetClusterPID();
55
56 }
57 }
58 timer.Stop();
59 timer.Print();
60
61 return 0;
62}