MUONrawcluster ready to compile
[u/mrichter/AliRoot.git] / MUON / MUONrawclusters.C
CommitLineData
a897a37a 1#include "iostream.h"
2
fb76e306 3#include <TClassTable.h>
4#include <TClonesArray.h>
5#include <TFile.h>
6#include <TParticle.h>
7#include <TROOT.h>
8#include <TTree.h>
9
10#include "AliHeader.h"
11#include "AliRun.h"
12
13#include "AliMUON.h"
14
15#include "AliMUONClusterFinderVS.h"
16
88cb7938 17void MUONrawclusters (char* filename, Int_t evNumber1=0,Int_t evNumber2=0)
a897a37a 18{
a9e2aefa 19 //////////////////////////////////////
20 // //
21 // ROOT macro for ALICE Dimuon Arm: //
22 // Clusterization of digits //
23 // //
24 //////////////////////////////////////
25 //
26 // Adds the tree TR for raw clusters
27 // to the ROOT file "galice.root"
28 // containing the digits (tree TD).
29 //
30 // Arguments:
31 // evNumber1 = first event number to act on in file "galice.root"
32 // evNumber2 = last event number to act on in file "galice.root"
33 //
34 // Input/output file:
35 // "galice.root"
36 //
37 //__________________________________________________________________________
a897a37a 38
88cb7938 39// // Dynamically link some shared libs
a897a37a 40
88cb7938 41 //if (gClassTable->GetID("AliRun") < 0) {
42 // gROOT->LoadMacro("$ALICE_ROOT/macros/loadlibs.C");
43 // loadlibs();
44 // }
a897a37a 45
88cb7938 46 // Creating Run Loader and openning file containing Hits
47 AliRunLoader * RunLoader = AliRunLoader::Open(filename,"MUONFolder","UPDATE");
48 if (RunLoader ==0x0) {
49 printf(">>> Error : Error Opening %s file \n",filename);
50 return;
51 }
a897a37a 52
88cb7938 53 // Loading AliRun master
54 RunLoader->UnloadgAlice();
55 RunLoader->LoadgAlice();
56 gAlice = RunLoader->GetAliRun();
a897a37a 57
88cb7938 58 // Loading MUON subsystem
59 AliMUON * MUON = (AliMUON *) gAlice->GetDetector("MUON");
60 AliLoader * MUONLoader = RunLoader->GetLoader("MUONLoader");
a897a37a 61
88cb7938 62 Int_t ievent, nevents;
63 nevents = RunLoader->GetNumberOfEvents();
a9e2aefa 64
88cb7938 65 for (Int_t i=0; i<10; i++) {
fb76e306 66 //RecModel = new AliMUONClusterFinderVS();
67 AliMUONClusterFinderVS *RecModel = new AliMUONClusterFinderVS();
88cb7938 68 // RecModel->SetTracks(16,17);
69 // RecModel->SetTracks(266,267);
70 RecModel->SetGhostChi2Cut(10);
71 MUON->SetReconstructionModel(i,RecModel);
72 }
a897a37a 73//
74// Loop over events
88cb7938 75 //
a897a37a 76 Int_t Nh=0;
77 Int_t Nh1=0;
88cb7938 78 // gAlice->RunReco("MUON", evNumber1, evNumber2);
79 for(Int_t ievent=evNumber1; ievent<evNumber2; ievent++) {
80 printf("event %d\n",ievent);
81 RunLoader->GetEvent(ievent);
82 MUONLoader->LoadDigits("read");
83 if (MUONLoader->TreeR() == 0x0) MUONLoader->MakeTree("R");
84 MUON->MakeBranch("R");
85 MUON->SetTreeAddress();
86 MUON->Digits2Reco();
87 MUONLoader->UnloadDigits();
88 MUONLoader->UnloadRecPoints();
89 }
90
a897a37a 91}
92
88cb7938 93