1 // Macro for testing the new C++ reconstruction code
4 // FirstEvent (default 0)
5 // LastEvent (default 0)
6 // RecGeantHits (1 to reconstruct GEANT hits) (default 0)
7 // FileName (for signal) (default "galice.root")
8 // BkgGeantFileName (for background),
9 // needed only if RecGeantHits = 1 and background to be added
10 void MUONreco (Int_t FirstEvent = 0, Int_t LastEvent = 0, Int_t RecGeantHits = 0, Text_t *FileName = "galice.root", Text_t *BkgGeantFileName = "")
13 cout << "MUONtest_reco" << endl;
14 cout << "FirstEvent " << FirstEvent << endl;
15 cout << "LastEvent " << LastEvent << endl;
16 cout << "RecGeantHits " << RecGeantHits << endl;
17 cout << "FileName ``" << FileName << "''" << endl;
18 cout << "BkgGeantFileName ``" << BkgGeantFileName << "''" << endl;
19 // Dynamically link some shared libs
20 if (gClassTable->GetID("AliRun") < 0) {
21 gROOT->LoadMacro("loadlibs.C");
25 // Connect the Root Galice file containing Geometry, Kine and Hits
26 TFile *file = (TFile*) gROOT->GetListOfFiles()->FindObject(FileName);
28 printf("\n Creating file %s\n", FileName);
29 file = new TFile(FileName);
31 else printf("\n File %s found in file list\n", FileName);
33 // Get AliRun object from file or create it if not on file
35 gAlice = (AliRun*) file->Get("gAlice");
36 if (gAlice) printf("AliRun object found on file\n");
38 printf("\n Create new gAlice object");
39 gAlice = new AliRun("gAlice","Alice test program");
44 // AliMUON *MUON = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
45 AliMUONEventReconstructor *Reco = new AliMUONEventReconstructor();
46 Reco->SetRecGeantHits(RecGeantHits);
48 // The right place for changing AliMUONEventReconstructor parameters
49 // with respect to the default ones
50 // Reco->SetMaxSigma2Distance(100.0);
51 Reco->SetPrintLevel(10);
52 cout << "AliMUONEventReconstructor: actual parameters" << endl;
56 for (Int_t event = FirstEvent; event <= LastEvent; event++) {
57 cout << "Event: " << event << endl;
58 AliMUON *MUON = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
59 Int_t nparticles = gAlice->GetEvent(event);
60 cout << "nparticles: " << nparticles << endl;
61 // prepare background file and/or event if necessary
62 if (RecGeantHits == 1) {
63 if (event == FirstEvent) Reco->SetBkgGeantFile(BkgGeantFileName);
64 if (Reco->GetBkgGeantFile())Reco->NextBkgGeantEvent();
66 Reco->EventReconstruct();