From 91bba962701c36615e42a71eb5de62e344cbb54d Mon Sep 17 00:00:00 2001 From: morsch Date: Wed, 19 Apr 2000 13:38:28 +0000 Subject: [PATCH] Macro for reconstruction (spot) (JB, AM) --- RICH/RICHdetect.C | 62 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 RICH/RICHdetect.C diff --git a/RICH/RICHdetect.C b/RICH/RICHdetect.C new file mode 100644 index 00000000000..6ade2ccfe7f --- /dev/null +++ b/RICH/RICHdetect.C @@ -0,0 +1,62 @@ +RICHdetect (Int_t evNumber1=0,Int_t evNumber2=0) { +// Dynamically link some shared libs + + if (gClassTable->GetID("AliRun") < 0) { + gROOT->LoadMacro("loadlibs.C"); + loadlibs(); + } + else { + //delete gAlice; + gAlice = 0; + } +// Connect the Root Galice file containing Geometry, Kine and Hits + + TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root"); + if (file) file->Close(); + file = new TFile("galice.root","UPDATE"); + file->ls(); + + //printf ("I'm after Map \n"); + +// Get AliRun object from file or create it if not on file + + if (!gAlice) { + gAlice = (AliRun*)file->Get("gAlice"); + if (gAlice) printf("AliRun object found on file\n"); + if (!gAlice) gAlice = new AliRun("gAlice","RICH reconstruction program"); + } else { + delete gAlice; + gAlice = (AliRun*)file->Get("gAlice"); + if (gAlice) printf("AliRun object found on file\n"); + if (!gAlice) gAlice = new AliRun("gAlice","Alice test program"); + } + + //printf ("I'm after gAlice \n"); + + AliRICH *RICH = (AliRICH*) gAlice->GetDetector("RICH"); + + // Create Recontruction algorithm object + AliRICHDetect *detect = new AliRICHDetect("RICH reconstruction algorithm","Reconstruction"); + +// Reconstruct + // Event Loop + // + for (int nev=0; nev<= evNumber2; nev++) { + Int_t nparticles = gAlice->GetEvent(nev); + cout <Detect(); + char hname[30]; + sprintf(hname,"TreeR%d",nev); + gAlice->TreeR()->Write(hname); + gAlice->TreeR()->Reset(); + } // event loop + + //delete gAlice; + printf("\nEnd of Macro *************************************\n"); +} + + + -- 2.31.1