New MUON data container AliMUONData implementation
[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");
ce3f5e87 61 AliMUONData * muondata = MUON->GetMUONData();
a897a37a 62
88cb7938 63 Int_t ievent, nevents;
64 nevents = RunLoader->GetNumberOfEvents();
a9e2aefa 65
88cb7938 66 for (Int_t i=0; i<10; i++) {
fb76e306 67 //RecModel = new AliMUONClusterFinderVS();
68 AliMUONClusterFinderVS *RecModel = new AliMUONClusterFinderVS();
88cb7938 69 // RecModel->SetTracks(16,17);
70 // RecModel->SetTracks(266,267);
71 RecModel->SetGhostChi2Cut(10);
72 MUON->SetReconstructionModel(i,RecModel);
73 }
a897a37a 74//
75// Loop over events
88cb7938 76 //
a897a37a 77 Int_t Nh=0;
78 Int_t Nh1=0;
88cb7938 79 // gAlice->RunReco("MUON", evNumber1, evNumber2);
80 for(Int_t ievent=evNumber1; ievent<evNumber2; ievent++) {
81 printf("event %d\n",ievent);
82 RunLoader->GetEvent(ievent);
83 MUONLoader->LoadDigits("read");
84 if (MUONLoader->TreeR() == 0x0) MUONLoader->MakeTree("R");
ce3f5e87 85 muondata->MakeBranch("RC");
86 muondata->SetTreeAddress("D,RC");
88cb7938 87 MUON->Digits2Reco();
88 MUONLoader->UnloadDigits();
89 MUONLoader->UnloadRecPoints();
90 }
91
a897a37a 92}
93
88cb7938 94