]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/MUONChallengeTest.C
readers updated (mini header -> data header)
[u/mrichter/AliRoot.git] / MUON / MUONChallengeTest.C
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 /* $Id$ */
17
18 // Macro MUONTracker.C (TO BE COMPILED)
19 // for testing the C++ reconstruction code
20 // Output is using aliroot standard output MUON.Tracks.root
21 // The output is a TClonesArray of AliMUONTracks.
22 // Gines MARTINEZ, Subatech, sep 2003
23
24 #if !defined(__CINT__) || defined(__MAKECINT__)
25 #include <TClonesArray.h>
26
27 #include "AliRun.h"
28 #include "AliESD.h"
29 #include "AliMUON.h"
30 #include "AliMUONData.h"
31 #include "AliMUONEventReconstructor.h"
32 #include "AliMUONTrack.h"
33 #include "AliMUONTrackHit.h"
34 #include "AliMUONTrackParam.h"
35 #endif
36
37 void MUONESDTest (Text_t *FileName = "galice.root", Int_t FirstEvent = 0, Int_t LastEvent = 9999)
38 {
39
40   // Creating Run Loader and openning file containing Hits, Digits and RecPoints
41   AliRunLoader * RunLoader = AliRunLoader::Open(FileName,"Event","UPDATE");
42   if (RunLoader ==0x0) {
43     printf(">>> Error : Error Opening %s file \n",FileName);
44     return;
45   }
46   // Loading AliRun master
47   if (RunLoader->GetAliRun() == 0x0) RunLoader->LoadgAlice();
48   gAlice = RunLoader->GetAliRun();
49   
50   // Loading MUON subsystem
51   AliMUON * MUON = (AliMUON *) gAlice->GetDetector("MUON");
52
53   Int_t nevents;
54   nevents = RunLoader->GetNumberOfEvents();
55  
56   if  (LastEvent>nevents) LastEvent=nevents;
57
58   // Loop over events
59   for (Int_t event = FirstEvent; event < LastEvent; event++) {
60     AliESD *esd = new AliESD();
61     MUON->FillESD(esd);
62
63   } // Event loop
64 }
65
66 void MUONRecoTest (Text_t *FileName = "galice.root")
67 {
68
69   // Creating Run Loader and openning file containing Hits, Digits and RecPoints
70   AliRunLoader * RunLoader = AliRunLoader::Open(FileName,"Event","UPDATE");
71   if (RunLoader ==0x0) {
72     printf(">>> Error : Error Opening %s file \n",FileName);
73     return;
74   }
75   // Loading AliRun master
76   if (RunLoader->GetAliRun() == 0x0) RunLoader->LoadgAlice();
77   gAlice = RunLoader->GetAliRun();
78   
79   // Loading MUON subsystem
80   AliMUON * MUON = (AliMUON *) gAlice->GetDetector("MUON");
81   MUON->Reconstruct();
82
83 }