1 //This script is a skeleton for RICH analisys. It consequently reads events in a givent set of directories and provides
2 //resulting RANA.root file in home directory which contains all the requested hists.
3 #if !defined( __CINT__) || defined(__MAKECINT__)
8 #include <AliESDtrack.h>
17 pMassLen2=new TH2F("masslen","Particle mass versus track length;cm;GeV",200,0,600,200,0,1.2);
19 //__________________________________________________________________________________________________
20 void HistFill(AliESDtrack *pTrack)
22 pMassLen2->Fill(pTrack->GetIntegratedLength(),pTrack->GetMass());
25 //__________________________________________________________________________________________________
28 TCanvas *pC=new TCanvas("RICH analisys");
31 TFile outFile("~/RANA.root","RECREATE"); pC->Write(); outFile.Close();
33 //__________________________________________________________________________________________________
34 void Analyse(char *sDirName)
36 //Analyse info from single directory
37 ::Info("","Tring to open from %s",sDirName);
38 TFile *pFile=TFile::Open(Form("%s/AliESDs.root",sDirName));if(!pFile || !pFile->IsOpen()) return;//open AliESDs.root
39 TTree* pTree = (TTree*) pFile->Get("esdTree"); if(!pTree) return;//get ESD tree
41 AliESD *pESD=new AliESD; pTree->SetBranchAddress("ESD", &pESD);
43 Int_t iNevents=pTree->GetEntries(); //how many events in this given directory
44 ::Info("","have %i events",iNevents);
45 for(Int_t iEventN=0;iEventN<iNevents;iEventN++){//ESD events loop
46 pTree->GetEvent(iEventN);
47 Int_t iNtracks=pESD->GetNumberOfTracks();
48 for(Int_t iTrackN=0;iTrackN<iNtracks;iTrackN++){//ESD tracks loop
49 HistFill(pESD->GetTrack(iTrackN));
53 delete pESD; pFile->Close();//close AliESDs.root
55 //__________________________________________________________________________________________________
56 void RichAna(Int_t iDirFirst=1,Int_t iDirLast=4)
58 gBenchmark->Start("RICHanalisys");
62 for(Int_t iDirN=iDirFirst;iDirN<=iDirLast;iDirN++) Analyse(Form("Ev%04i",iDirN)); //analise for single directory
66 gBenchmark->Stop("RICHanalisys");
67 gBenchmark->Show("RICHanalisys");