1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 #if !defined(__CINT__) || defined(__MAKECINT__)
21 #include <TClassTable.h>
22 #include <TClonesArray.h>
24 #include <TParticle.h>
28 #include "AliHeader.h"
33 #include "AliMUONClusterFinderVS.h"
36 void MUONrawclusters (char* filename="galice.root", Int_t evNumber1=0,Int_t evNumber2=9999)
38 //////////////////////////////////////
40 // ROOT macro for ALICE Dimuon Arm: //
41 // Clusterization of digits //
43 //////////////////////////////////////
45 // Adds the tree TR for raw clusters
46 // to the ROOT file "galice.root"
47 // containing the digits (tree TD).
50 // evNumber1 = first event number to act on in file "galice.root"
51 // evNumber2 = last event number to act on in file "galice.root"
56 //__________________________________________________________________________
58 // // Dynamically link some shared libs
60 //if (gClassTable->GetID("AliRun") < 0) {
61 // gROOT->LoadMacro("$ALICE_ROOT/macros/loadlibs.C");
65 // Creating Run Loader and openning file containing Hits
66 AliRunLoader * RunLoader = AliRunLoader::Open(filename,"MUONFolder","UPDATE");
67 if (RunLoader ==0x0) {
68 printf(">>> Error : Error Opening %s file \n",filename);
72 // Loading AliRun master
73 RunLoader->UnloadgAlice();
74 RunLoader->LoadgAlice();
75 gAlice = RunLoader->GetAliRun();
77 // Loading MUON subsystem
78 AliMUON * MUON = (AliMUON *) gAlice->GetDetector("MUON");
79 AliLoader * MUONLoader = RunLoader->GetLoader("MUONLoader");
80 AliMUONData * muondata = MUON->GetMUONData();
82 Int_t ievent, nevents;
83 nevents = RunLoader->GetNumberOfEvents();
85 for (Int_t i=0; i<10; i++) {
86 //RecModel = new AliMUONClusterFinderVS();
87 AliMUONClusterFinderVS *RecModel = new AliMUONClusterFinderVS();
88 // RecModel->SetTracks(16,17);
89 // RecModel->SetTracks(266,267);
90 RecModel->SetGhostChi2Cut(10);
91 MUON->SetReconstructionModel(i,RecModel);
94 MUONLoader->LoadDigits("READ");
95 MUONLoader->LoadRecPoints("UPDATE");
97 // Testing if RawClusterisation has already been done
98 RunLoader->GetEvent(0);
99 if (MUONLoader->TreeR()) {
100 if (muondata->IsRawClusterBranchesInTree()) {
101 MUONLoader->UnloadRecPoints();
102 MUONLoader->LoadRecPoints("RECREATE");
103 printf("Recreating RecPoints files\n");
111 // gAlice->RunReco("MUON", evNumber1, evNumber2);
112 if (evNumber2>nevents) evNumber2=nevents;
113 for(Int_t ievent=evNumber1; ievent<evNumber2; ievent++) {
114 printf("event %d\n",ievent);
115 RunLoader->GetEvent(ievent);
117 // Test if rawcluster has already been done before
118 if (MUONLoader->TreeR() == 0x0)
119 MUONLoader->MakeRecPointsContainer();
121 if (muondata->IsRawClusterBranchesInTree()){ // Test if rawcluster has already been done before
122 if (ievent==evNumber1) MUONLoader->UnloadRecPoints();
123 MUONLoader->MakeRecPointsContainer(); // Redoing clusterisation
124 Info("RecPointsContainer","Recreating RecPointsContainer and deleting previous ones");
127 muondata->MakeBranch("RC");
128 muondata->SetTreeAddress("D,RC");
131 MUONLoader->UnloadDigits();
132 MUONLoader->UnloadRecPoints();