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__)
19 //#include "iostream.h"
21 #include <TClassTable.h>
22 #include <TClonesArray.h>
24 #include <TParticle.h>
28 #include "AliHeader.h"
33 #include "AliMUONClusterFinderVS.h"
34 //#include "AliMUONClusterFinderAZ.h"
35 #include "AliMUONClusterReconstructor.h"
38 void MUONrawclusters (char* filename="galice.root", Int_t evNumber1=0,Int_t evNumber2=9999)
40 // Creating Run Loader and openning file containing Hits
41 AliRunLoader* RunLoader = AliRunLoader::Open(filename,"MUONLoader","UPDATE");
42 if (RunLoader ==0x0) {
43 printf(">>> Error : Error Opening %s file \n",filename);
46 if (RunLoader->GetAliRun() == 0x0) RunLoader->LoadgAlice();
48 // Loading MUON subsystem
49 AliLoader* MUONLoader = RunLoader->GetLoader("MUONLoader");
51 MUONLoader->LoadDigits("READ");
52 MUONLoader->LoadRecPoints("UPDATE");
54 Int_t ievent, nevents;
55 nevents = RunLoader->GetNumberOfEvents();
57 AliMUONClusterReconstructor* Reco = new AliMUONClusterReconstructor(MUONLoader);
58 AliMUONData* muondata = Reco->GetMUONData();
60 for (Int_t i=0; i<10; i++) {
61 AliMUONClusterFinderVS* RecModel = new AliMUONClusterFinderVS();
62 // RecModel->SetTracks(16,17);
63 // RecModel->SetTracks(266,267);
64 RecModel->SetGhostChi2Cut(10);
65 Reco->SetReconstructionModel(i,RecModel);
68 // Testing if RawClusterisation has already been done
69 RunLoader->GetEvent(0);
70 if (MUONLoader->TreeR()) {
71 if (muondata->IsRawClusterBranchesInTree()) {
72 MUONLoader->UnloadRecPoints();
73 MUONLoader->LoadRecPoints("RECREATE");
74 printf("Recreating RecPoints files\n");
78 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
79 if (evNumber2 > nevents) evNumber2 = nevents;
81 for(ievent = evNumber1; ievent < evNumber2; ievent++) {
82 printf("event %d\n",ievent);
83 RunLoader->GetEvent(ievent);
85 // Test if rawcluster has already been done before
86 if (MUONLoader->TreeR() == 0x0)
87 MUONLoader->MakeRecPointsContainer();
89 if (muondata->IsRawClusterBranchesInTree()){
90 // Test if rawcluster has already been done before
91 if (ievent == evNumber1) MUONLoader->UnloadRecPoints();
92 MUONLoader->MakeRecPointsContainer(); // Redoing clusterisation
93 Info("RecPointsContainer",
94 "Recreating RecPointsContainer and deleting previous ones");
97 muondata->MakeBranch("RC");
98 muondata->SetTreeAddress("D,RC");
100 Reco->Digits2Clusters();
102 muondata->Fill("RC"); //Filling Reconstructed Cluster
103 MUONLoader->WriteRecPoints("OVERWRITE");
104 muondata->ResetRawClusters();
105 muondata->ResetDigits();
107 MUONLoader->UnloadDigits();
108 MUONLoader->UnloadRecPoints();