]>
Commit | Line | Data |
---|---|---|
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__) | |
24 | #include <TClonesArray.h> | |
25 | ||
26 | #include "AliRun.h" | |
27 | #include "AliMUON.h" | |
28 | #include "AliMUONData.h" | |
29 | #include "AliMUONEventReconstructor.h" | |
30 | #include "AliMUONTriggerTrack.h" | |
31 | #endif | |
32 | ||
33 | void MUONTriggerTracker (Text_t *FileName = "galice.root", Int_t FirstEvent = 0, Int_t LastEvent = 9999) | |
34 | { | |
35 | // | |
36 | cout << "MUONTriggerTracker" << endl; | |
37 | cout << "FirstEvent " << FirstEvent << endl; | |
38 | cout << "LastEvent " << LastEvent << endl; | |
39 | cout << "FileName ``" << FileName << "''" << endl; | |
40 | ||
41 | // Creating Run Loader and openning file containing Hits, Digits and RecPoints | |
42 | AliRunLoader * RunLoader = AliRunLoader::Open(FileName,"Event","UPDATE"); | |
43 | if (RunLoader ==0x0) { | |
44 | printf(">>> Error : Error Opening %s file \n",FileName); | |
45 | return; | |
46 | } | |
c6cd5030 | 47 | |
2295bc99 | 48 | // Loading AliRun master |
49 | RunLoader->LoadgAlice(); | |
50 | gAlice = RunLoader->GetAliRun(); | |
51 | RunLoader->LoadKinematics("READ"); | |
52 | ||
53 | // Loading MUON subsystem | |
54 | AliMUON * MUON = (AliMUON *) gAlice->GetDetector("MUON"); | |
55 | AliLoader * MUONLoader = RunLoader->GetLoader("MUONLoader"); | |
2295bc99 | 56 | AliMUONData * muondata = MUON->GetMUONData(); |
2295bc99 | 57 | |
58 | Int_t nevents; | |
59 | nevents = RunLoader->GetNumberOfEvents(); | |
c6cd5030 | 60 | |
61 | MUONLoader->LoadRecPoints("READ"); | |
62 | MUONLoader->LoadTracks("UPDATE"); | |
63 | ||
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 | ||
2295bc99 | 74 | AliMUONEventReconstructor *Reco = new AliMUONEventReconstructor(); |
75 | ||
76 | Reco->SetPrintLevel(0); | |
c6cd5030 | 77 | cout << "AliMUONEventReconstructor: actual parameters" << endl; |
78 | // Reco->Dump(); | |
2295bc99 | 79 | // gObjectTable->Print(); |
80 | ||
2295bc99 | 81 | if (LastEvent>nevents) LastEvent=nevents; |
82 | // Loop over events | |
83 | for (Int_t event = FirstEvent; event < LastEvent; event++) { | |
c6cd5030 | 84 | cout << "Event: " << event << endl; |
85 | RunLoader->GetEvent(event); | |
86 | if (MUONLoader->TreeT() == 0x0) MUONLoader->MakeTracksContainer(); | |
87 | ||
88 | muondata->MakeBranch("RL"); | |
89 | muondata->SetTreeAddress("RL"); | |
90 | Reco->EventReconstructTrigger(); | |
91 | // Dump current event | |
92 | // Reco->EventDumpTrigger(); | |
93 | ||
94 | // Duplicating rectriggertrack data in muondata for output | |
95 | for(Int_t i=0; i<Reco->GetNRecTriggerTracks(); i++) { | |
96 | AliMUONTriggerTrack * triggertrack = (AliMUONTriggerTrack*) Reco->GetRecTriggerTracksPtr()->At(i); | |
97 | muondata->AddRecTriggerTrack(*triggertrack); | |
2295bc99 | 98 | // printf(">>> TEST TEST event %d Number of hits in the track %d is %d \n",event,i,track->GetNTrackHits()); |
c6cd5030 | 99 | } |
100 | ||
101 | muondata->Fill("RL"); | |
102 | MUONLoader->WriteTracks("OVERWRITE"); | |
103 | muondata->ResetRecTriggerTracks(); | |
104 | muondata->ResetTrigger(); | |
2295bc99 | 105 | } // Event loop |
c6cd5030 | 106 | MUONLoader->UnloadRecPoints(); |
107 | MUONLoader->UnloadTracks(); | |
2295bc99 | 108 | } |