]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/MUONrawclusters.C
some more overlaps cured
[u/mrichter/AliRoot.git] / MUON / MUONrawclusters.C
CommitLineData
52639e17 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
a897a37a 18#include "iostream.h"
19
fb76e306 20#include <TClassTable.h>
21#include <TClonesArray.h>
22#include <TFile.h>
23#include <TParticle.h>
24#include <TROOT.h>
25#include <TTree.h>
26
27#include "AliHeader.h"
28#include "AliRun.h"
29
30#include "AliMUON.h"
31
32#include "AliMUONClusterFinderVS.h"
33
bf17dbfd 34void MUONrawclusters (char* filename="galice.root", Int_t evNumber1=0,Int_t evNumber2=9999)
a897a37a 35{
a9e2aefa 36 //////////////////////////////////////
37 // //
38 // ROOT macro for ALICE Dimuon Arm: //
39 // Clusterization of digits //
40 // //
41 //////////////////////////////////////
42 //
43 // Adds the tree TR for raw clusters
44 // to the ROOT file "galice.root"
45 // containing the digits (tree TD).
46 //
47 // Arguments:
48 // evNumber1 = first event number to act on in file "galice.root"
49 // evNumber2 = last event number to act on in file "galice.root"
50 //
51 // Input/output file:
52 // "galice.root"
53 //
54 //__________________________________________________________________________
a897a37a 55
88cb7938 56// // Dynamically link some shared libs
a897a37a 57
88cb7938 58 //if (gClassTable->GetID("AliRun") < 0) {
59 // gROOT->LoadMacro("$ALICE_ROOT/macros/loadlibs.C");
60 // loadlibs();
61 // }
a897a37a 62
88cb7938 63 // Creating Run Loader and openning file containing Hits
64 AliRunLoader * RunLoader = AliRunLoader::Open(filename,"MUONFolder","UPDATE");
65 if (RunLoader ==0x0) {
66 printf(">>> Error : Error Opening %s file \n",filename);
67 return;
68 }
a897a37a 69
88cb7938 70 // Loading AliRun master
71 RunLoader->UnloadgAlice();
72 RunLoader->LoadgAlice();
73 gAlice = RunLoader->GetAliRun();
a897a37a 74
88cb7938 75 // Loading MUON subsystem
76 AliMUON * MUON = (AliMUON *) gAlice->GetDetector("MUON");
77 AliLoader * MUONLoader = RunLoader->GetLoader("MUONLoader");
ce3f5e87 78 AliMUONData * muondata = MUON->GetMUONData();
a897a37a 79
88cb7938 80 Int_t ievent, nevents;
81 nevents = RunLoader->GetNumberOfEvents();
a9e2aefa 82
88cb7938 83 for (Int_t i=0; i<10; i++) {
fb76e306 84 //RecModel = new AliMUONClusterFinderVS();
85 AliMUONClusterFinderVS *RecModel = new AliMUONClusterFinderVS();
88cb7938 86 // RecModel->SetTracks(16,17);
87 // RecModel->SetTracks(266,267);
88 RecModel->SetGhostChi2Cut(10);
89 MUON->SetReconstructionModel(i,RecModel);
346357f4 90 }
91
92 MUONLoader->LoadDigits("READ");
93 MUONLoader->LoadRecPoints("UPDATE");
1391e633 94
95 // Testing if RawClusterisation has already been done
96 RunLoader->GetEvent(0);
97 if (MUONLoader->TreeR()) {
98 if (muondata->IsRawClusterBranchesInTree()) {
99 MUONLoader->UnloadRecPoints();
100 MUONLoader->LoadRecPoints("RECREATE");
101 printf("Recreating RecPoints files\n");
102 }
103 }
a897a37a 104//
105// Loop over events
88cb7938 106 //
a897a37a 107 Int_t Nh=0;
108 Int_t Nh1=0;
88cb7938 109 // gAlice->RunReco("MUON", evNumber1, evNumber2);
bf17dbfd 110 if (evNumber2>nevents) evNumber2=nevents;
88cb7938 111 for(Int_t ievent=evNumber1; ievent<evNumber2; ievent++) {
112 printf("event %d\n",ievent);
113 RunLoader->GetEvent(ievent);
346357f4 114
115 // Test if rawcluster has already been done before
116 if (MUONLoader->TreeR() == 0x0)
117 MUONLoader->MakeRecPointsContainer();
118 else {
119 if (muondata->IsRawClusterBranchesInTree()){ // Test if rawcluster has already been done before
50837721 120 if (ievent==evNumber1) MUONLoader->UnloadRecPoints();
346357f4 121 MUONLoader->MakeRecPointsContainer(); // Redoing clusterisation
122 Info("RecPointsContainer","Recreating RecPointsContainer and deleting previous ones");
123 }
124 }
ce3f5e87 125 muondata->MakeBranch("RC");
126 muondata->SetTreeAddress("D,RC");
88cb7938 127 MUON->Digits2Reco();
88cb7938 128 }
346357f4 129 MUONLoader->UnloadDigits();
130 MUONLoader->UnloadRecPoints();
a897a37a 131}
132
88cb7938 133