]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/MUONTriggerTracker.C
Only with TGeo now (A. Gheata)
[u/mrichter/AliRoot.git] / MUON / MUONTriggerTracker.C
CommitLineData
2295bc99 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/* */
17
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.
22
23#if !defined(__CINT__) || defined(__MAKECINT__)
2295bc99 24
25#include "AliRun.h"
26#include "AliMUON.h"
27#include "AliMUONData.h"
28#include "AliMUONEventReconstructor.h"
2295bc99 29#endif
30
31void MUONTriggerTracker (Text_t *FileName = "galice.root", Int_t FirstEvent = 0, Int_t LastEvent = 9999)
32{
33 //
34 cout << "MUONTriggerTracker" << endl;
35 cout << "FirstEvent " << FirstEvent << endl;
36 cout << "LastEvent " << LastEvent << endl;
37 cout << "FileName ``" << FileName << "''" << endl;
38
39 // Creating Run Loader and openning file containing Hits, Digits and RecPoints
52c9bc11 40 AliRunLoader * RunLoader = AliRunLoader::Open(FileName,"MUONLoader","UPDATE");
2295bc99 41 if (RunLoader ==0x0) {
42 printf(">>> Error : Error Opening %s file \n",FileName);
43 return;
44 }
c6cd5030 45
2295bc99 46 // Loading AliRun master
52c9bc11 47 if (RunLoader->GetAliRun() == 0x0) RunLoader->LoadgAlice();
2295bc99 48 gAlice = RunLoader->GetAliRun();
52c9bc11 49 // RunLoader->LoadKinematics("READ");
2295bc99 50
51 // Loading MUON subsystem
2295bc99 52 AliLoader * MUONLoader = RunLoader->GetLoader("MUONLoader");
52c9bc11 53
2295bc99 54 Int_t nevents;
55 nevents = RunLoader->GetNumberOfEvents();
c6cd5030 56
57 MUONLoader->LoadRecPoints("READ");
58 MUONLoader->LoadTracks("UPDATE");
59
52c9bc11 60
61 AliMUONEventReconstructor *Reco = new AliMUONEventReconstructor(MUONLoader);
62 AliMUONData* muondata = Reco->GetMUONData();
63
c6cd5030 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");
71 }
72 }
73
52c9bc11 74 Reco->SetPrintLevel(0);
2295bc99 75 if (LastEvent>nevents) LastEvent=nevents;
52c9bc11 76
2295bc99 77 // Loop over events
78 for (Int_t event = FirstEvent; event < LastEvent; event++) {
c6cd5030 79 cout << "Event: " << event << endl;
80 RunLoader->GetEvent(event);
81 if (MUONLoader->TreeT() == 0x0) MUONLoader->MakeTracksContainer();
82
83 muondata->MakeBranch("RL");
84 muondata->SetTreeAddress("RL");
85 Reco->EventReconstructTrigger();
52c9bc11 86
c6cd5030 87 muondata->Fill("RL");
88 MUONLoader->WriteTracks("OVERWRITE");
89 muondata->ResetRecTriggerTracks();
90 muondata->ResetTrigger();
2295bc99 91 } // Event loop
52c9bc11 92
c6cd5030 93 MUONLoader->UnloadRecPoints();
94 MUONLoader->UnloadTracks();
2295bc99 95}