1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 // Macro MUONTriggerTracker.C (TO BE COMPILED)
19 // for testing the C++ trigger reconstruction code
20 // Output is using aliroot standard output MUON.Tracks.root
21 // The output is a TClonesArray of AliMUONTriggerTracks.
23 #if !defined(__CINT__) || defined(__MAKECINT__)
27 #include "AliMUONData.h"
28 #include "AliMUONEventReconstructor.h"
31 void MUONTriggerTracker (Text_t *FileName = "galice.root", Int_t FirstEvent = 0, Int_t LastEvent = 9999)
34 cout << "MUONTriggerTracker" << endl;
35 cout << "FirstEvent " << FirstEvent << endl;
36 cout << "LastEvent " << LastEvent << endl;
37 cout << "FileName ``" << FileName << "''" << endl;
39 // Creating Run Loader and openning file containing Hits, Digits and RecPoints
40 AliRunLoader * RunLoader = AliRunLoader::Open(FileName,"MUONLoader","UPDATE");
41 if (RunLoader ==0x0) {
42 printf(">>> Error : Error Opening %s file \n",FileName);
46 // Loading AliRun master
47 if (RunLoader->GetAliRun() == 0x0) RunLoader->LoadgAlice();
48 gAlice = RunLoader->GetAliRun();
49 // RunLoader->LoadKinematics("READ");
51 // Loading MUON subsystem
52 AliLoader * MUONLoader = RunLoader->GetLoader("MUONLoader");
55 nevents = RunLoader->GetNumberOfEvents();
57 MUONLoader->LoadRecPoints("READ");
58 MUONLoader->LoadTracks("UPDATE");
61 AliMUONEventReconstructor *Reco = new AliMUONEventReconstructor(MUONLoader);
62 AliMUONData* muondata = Reco->GetMUONData();
64 // Testing if Trigger Tracking has already been done
65 RunLoader->GetEvent(0);
66 if (MUONLoader->TreeT()) {
67 if (muondata->IsTriggerTrackBranchesInTree()) {
68 MUONLoader->UnloadTracks();
69 MUONLoader->LoadTracks("RECREATE");
70 printf("Recreating Tracks files\n");
74 Reco->SetPrintLevel(0);
75 if (LastEvent>nevents) LastEvent=nevents;
78 for (Int_t event = FirstEvent; event < LastEvent; event++) {
79 cout << "Event: " << event << endl;
80 RunLoader->GetEvent(event);
81 if (MUONLoader->TreeT() == 0x0) MUONLoader->MakeTracksContainer();
83 muondata->MakeBranch("RL");
84 muondata->SetTreeAddress("RL");
85 Reco->EventReconstructTrigger();
88 MUONLoader->WriteTracks("OVERWRITE");
89 muondata->ResetRecTriggerTracks();
90 muondata->ResetTrigger();
93 MUONLoader->UnloadRecPoints();
94 MUONLoader->UnloadTracks();