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 //********************************************************************
8 #if !defined( __CINT__) || defined(__MAKECINT__)
15 #include "TStopwatch.h"
20 extern TStyle *gStyle;
22 Int_t AliPMDesdanal() {
25 gStyle->SetOptStat(111110);
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);
37 //******* The loop over events
38 while (tree->GetEvent(n)) {
39 cout<<endl<<"Processing event number : "<<n++<<endl;
42 Int_t npmdcl=event->GetNumberOfPmdTracks();
43 cout<<"Number of PMD tracks : "<<npmdcl<<endl;
45 //****** The loop over PMD clusters
47 AliESDPmdTrack *pmdtr = event->GetPmdTrack(npmdcl);
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();