]>
Commit | Line | Data |
---|---|---|
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 | 34 | void 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"); | |
a897a37a | 94 | // |
95 | // Loop over events | |
88cb7938 | 96 | // |
a897a37a | 97 | Int_t Nh=0; |
98 | Int_t Nh1=0; | |
88cb7938 | 99 | // gAlice->RunReco("MUON", evNumber1, evNumber2); |
bf17dbfd | 100 | if (evNumber2>nevents) evNumber2=nevents; |
88cb7938 | 101 | for(Int_t ievent=evNumber1; ievent<evNumber2; ievent++) { |
102 | printf("event %d\n",ievent); | |
103 | RunLoader->GetEvent(ievent); | |
346357f4 | 104 | |
105 | // Test if rawcluster has already been done before | |
106 | if (MUONLoader->TreeR() == 0x0) | |
107 | MUONLoader->MakeRecPointsContainer(); | |
108 | else { | |
109 | if (muondata->IsRawClusterBranchesInTree()){ // Test if rawcluster has already been done before | |
50837721 | 110 | if (ievent==evNumber1) MUONLoader->UnloadRecPoints(); |
346357f4 | 111 | MUONLoader->MakeRecPointsContainer(); // Redoing clusterisation |
112 | Info("RecPointsContainer","Recreating RecPointsContainer and deleting previous ones"); | |
113 | } | |
114 | } | |
ce3f5e87 | 115 | muondata->MakeBranch("RC"); |
116 | muondata->SetTreeAddress("D,RC"); | |
88cb7938 | 117 | MUON->Digits2Reco(); |
88cb7938 | 118 | } |
346357f4 | 119 | MUONLoader->UnloadDigits(); |
120 | MUONLoader->UnloadRecPoints(); | |
a897a37a | 121 | } |
122 | ||
88cb7938 | 123 |