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.
7 #include <AliESDtrack.h>
14 pMassLen2=new TH2F("masslen","Particle mass versus track length;cm;GeV",200,0,600,200,0,1.2);
16 //__________________________________________________________________________________________________
17 void HistFill(AliESDtrack *pTrack)
19 pMassLen2->Fill(pTrack->GetIntegratedLength(),pTrack->GetMass());
22 //__________________________________________________________________________________________________
25 TCanvas *pC=new TCanvas("RICH analisys");
28 TFile outFile("~/RANA.root","RECREATE"); pC->Write(); outFile.Close();
30 //__________________________________________________________________________________________________
31 void Analyse(char *sDirName)
33 //Analyse info from single directory
34 ::Info("","Tring to open from %s",sDirName);
35 TFile *pFile=TFile::Open(Form("%s/AliESDs.root",sDirName));if(!pFile || !pFile->IsOpen()) return;//open AliESDs.root
36 TTree* pTree = (TTree*) pFile->Get("esdTree"); if(!pTree) return;//get ESD tree
38 AliESD *pESD=new AliESD; pTree->SetBranchAddress("ESD", &pESD);
40 Int_t iNevents=pTree->GetEntries(); //how many events in this given directory
41 ::Info("","have %i events",iNevents);
42 for(Int_t iEventN=0;iEventN<iNevents;iEventN++){//ESD events loop
43 pTree->GetEvent(iEventN);
44 Int_t iNtracks=pESD->GetNumberOfTracks();
45 for(Int_t iTrackN=0;iTrackN<iNtracks;iTrackN++){//ESD tracks loop
46 HistFill(pESD->GetTrack(iTrackN));
50 delete pESD; pFile->Close();//close AliESDs.root
52 //__________________________________________________________________________________________________
53 void RichAna(Int_t iDirFirst=1,Int_t iDirLast=4)
55 // gBenchmark->Start("RICHanalisys");
59 for(Int_t iDirN=iDirFirst;iDirN<=iDirLast;iDirN++) Analyse(Form("Ev%04i",iDirN)); //analise for single directory
63 // gBenchmark->Stop("RICHanalisys");
64 // gBenchmark->Show("RICHanalisys");