Macro to read the ESD event
authorbnandi <bnandi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 29 Mar 2004 15:44:38 +0000 (15:44 +0000)
committerbnandi <bnandi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 29 Mar 2004 15:44:38 +0000 (15:44 +0000)
PMD/AliPMDesdanal.C [new file with mode: 0644]

diff --git a/PMD/AliPMDesdanal.C b/PMD/AliPMDesdanal.C
new file mode 100644 (file)
index 0000000..eee6c8d
--- /dev/null
@@ -0,0 +1,62 @@
+//********************************************************************
+//     Example (very naive for the moment) of the data analysis 
+//                    using the ESD classes
+//     Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+//     Modified by Basanta K. Nandi for PMD analysis
+//********************************************************************
+
+#if !defined( __CINT__) || defined(__MAKECINT__)
+  #include <Riostream.h>
+  #include "TKey.h"
+  #include "TFile.h"
+  #include "TH1F.h"
+  #include "TCanvas.h"
+  #include "TStyle.h"
+  #include "TStopwatch.h"
+
+  #include "AliESD.h"
+#endif
+
+extern TStyle *gStyle;
+
+Int_t AliPMDesdanal() { 
+   TStopwatch timer;
+
+   gStyle->SetOptStat(111110);
+   gStyle->SetOptFit(1);
+
+//****** File with the ESD
+   TFile *ef=TFile::Open("AliESDcheck.root");
+   if (!ef || !ef->IsOpen()) {cerr<<"Can't AliESDs.root !\n"; return 1;}
+
+   Int_t n=0;
+   TKey *key=0;
+   TIter next(ef->GetListOfKeys());
+
+//******* The loop over events
+   while ((key=(TKey*)next())!=0) {
+     cout<<endl<<"Processing event number : "<<n++<<endl;
+
+     AliESD *event=(AliESD*)key->ReadObj();
+
+
+     Int_t npmdcl=event->GetNumberOfPmdTracks();
+     cout<<"Number of PMD tracks : "<<npmdcl<<endl; 
+
+     //****** The loop over PMD clusters
+     while (npmdcl--) {
+       AliESDPmdTrack *pmdtr = event->GetPmdTrack(npmdcl);
+       
+       Int_t   det   = pmdtr->GetDetector();
+       Float_t theta = pmdtr->GetTheta();
+       Float_t phi   = pmdtr->GetPhi();
+       Float_t adc   = pmdtr->GetClusterADC();
+       Float_t pid   = pmdtr->GetClusterPID();
+       
+     }
+   }
+   timer.Stop();
+   timer.Print();
+
+   return 0;
+}