1 // Macro MUONreco.C for testing the 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
11 void MUONreco (Int_t FirstEvent = 0, Int_t LastEvent = 0, Int_t RecGeantHits = 0, Text_t *FileName = "galice.root", Text_t *BkgGeantFileName = "")
14 cout << "MUONreco" << endl;
15 cout << "FirstEvent " << FirstEvent << endl;
16 cout << "LastEvent " << LastEvent << endl;
17 cout << "RecGeantHits " << RecGeantHits << endl;
18 cout << "FileName ``" << FileName << "''" << endl;
19 cout << "BkgGeantFileName ``" << BkgGeantFileName << "''" << endl;
20 // Dynamically link some shared libs
21 if (gClassTable->GetID("AliRun") < 0) {
22 gROOT->LoadMacro("loadlibs.C");
26 // Connect the Root Galice file containing Geometry, Kine, Hits
27 // and eventually RawClusters
28 TFile *file = (TFile*) gROOT->GetListOfFiles()->FindObject(FileName);
30 printf("\n Creating file %s\n", FileName);
31 file = new TFile(FileName);
33 else printf("\n File %s found in file list\n", FileName);
35 // Get AliRun object from file or create it if not on file
37 gAlice = (AliRun*) file->Get("gAlice");
38 if (gAlice) printf("AliRun object found on file\n");
40 printf("\n Create new gAlice object");
41 gAlice = new AliRun("gAlice","Alice test program");
46 // AliMUON *MUON = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
47 AliMUONEventReconstructor *Reco = new AliMUONEventReconstructor();
48 //Reco->SetTrackMethod(2); //AZ - use Kalman
49 Reco->SetRecGeantHits(RecGeantHits);
51 // The right place for changing AliMUONEventReconstructor parameters
52 // with respect to the default ones
53 // Reco->SetMaxSigma2Distance(100.0);
54 //Reco->SetPrintLevel(10);
55 //Reco->SetPrintLevel(2);
56 //Reco-> SetChamberThicknessInX0(0.05);
57 //Reco->SetEfficiency(1.); //0.95);
58 cout << "AliMUONEventReconstructor: actual parameters" << endl;
62 for (Int_t event = FirstEvent; event <= LastEvent; event++) {
63 cout << "Event: " << event << endl;
64 // AliMUON *MUON = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
65 Int_t nparticles = gAlice->GetEvent(event);
66 cout << "nparticles: " << nparticles << endl;
67 // prepare background file and/or event if necessary
68 if (RecGeantHits == 1) {
69 if (event == FirstEvent) Reco->SetBkgGeantFile(BkgGeantFileName);
70 if (Reco->GetBkgGeantFile())Reco->NextBkgGeantEvent();
72 Reco->EventReconstruct();
73 // Write this event in a tree