1 // ----------------------------------------------------//
3 // This macro reads the PMD clusters, //
4 // does photon/hadron discrimination //
5 // and stores in the ESD //
7 // ----------------------------------------------------//
11 Int_t AliPMDesdmake(Int_t nevt = 1)
15 delete AliRunLoader::Instance();
16 delete gAlice;//if everything was OK here it is already NULL
20 AliRunLoader *fRunLoader = AliRunLoader::Open("galice.root");
23 cerr<<"Can't load RunLoader"<<endl;
26 fRunLoader->LoadgAlice();
27 gAlice = fRunLoader->GetAliRun();
29 AliLoader *pmdloader = fRunLoader->GetLoader("PMDLoader");
33 nEvent = fRunLoader->GetNumberOfEvents();
39 cout << " ************ nevent = " << nEvent << endl;
43 cerr<<" ===> Can not find PMD or PMDLoader <===\n";
47 pmdloader->LoadRecPoints("READ");
49 TFile *bf=TFile::Open("AliESDcheck.root","RECREATE");
50 if (!bf || !bf->IsOpen()) {
51 cerr<<"Can't open AliESDcheck.root !\n"; return 1;
56 for (Int_t ievt = 0; ievt < nEvent; ievt++)
59 AliESD *event=new AliESD();
61 event->SetRunNumber(run);
62 event->SetEventNumber(ievt);
64 fRunLoader->GetEvent(ievt);
65 TTree *treeR = pmdloader->TreeR();
68 cout << " Can not get TreeR" << endl;
71 AliPMDtracker *pmdtracker = new AliPMDtracker();
72 pmdtracker->LoadClusters(treeR);
73 pmdtracker->Clusters2Tracks(event);
76 sprintf(ename,"in%d",ievt);
77 event->Write(ename); bf->Flush();