]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/MUONrawclusters.C
Independent trigger and cluster reconstruction. Adding Id. Bung in MUONTestTrigger...
[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
bf17dbfd 17void MUONrawclusters (char* filename="galice.root", Int_t evNumber1=0,Int_t evNumber2=9999)
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);
346357f4 73 }
74
75 MUONLoader->LoadDigits("READ");
76 MUONLoader->LoadRecPoints("UPDATE");
a897a37a 77//
78// Loop over events
88cb7938 79 //
a897a37a 80 Int_t Nh=0;
81 Int_t Nh1=0;
88cb7938 82 // gAlice->RunReco("MUON", evNumber1, evNumber2);
bf17dbfd 83 if (evNumber2>nevents) evNumber2=nevents;
88cb7938 84 for(Int_t ievent=evNumber1; ievent<evNumber2; ievent++) {
85 printf("event %d\n",ievent);
86 RunLoader->GetEvent(ievent);
346357f4 87
88 // Test if rawcluster has already been done before
89 if (MUONLoader->TreeR() == 0x0)
90 MUONLoader->MakeRecPointsContainer();
91 else {
92 if (muondata->IsRawClusterBranchesInTree()){ // Test if rawcluster has already been done before
50837721 93 if (ievent==evNumber1) MUONLoader->UnloadRecPoints();
346357f4 94 MUONLoader->MakeRecPointsContainer(); // Redoing clusterisation
95 Info("RecPointsContainer","Recreating RecPointsContainer and deleting previous ones");
96 }
97 }
ce3f5e87 98 muondata->MakeBranch("RC");
99 muondata->SetTreeAddress("D,RC");
88cb7938 100 MUON->Digits2Reco();
88cb7938 101 }
346357f4 102 MUONLoader->UnloadDigits();
103 MUONLoader->UnloadRecPoints();
a897a37a 104}
105
88cb7938 106