]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONClusterReconstructor.cxx
Doxygen configuration files (Initial version)
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterReconstructor.cxx
CommitLineData
52c9bc11 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
18////////////////////////////////////
19//
cf464691 20// MUON cluster reconstructor for MUON
52c9bc11 21//
cf464691 22// Should implement a virtual class ClusterFinder to chose between VS and AZ method
52c9bc11 23////////////////////////////////////
24
52c9bc11 25#include "AliMUONClusterReconstructor.h"
cf464691 26#include "AliRun.h" // for gAlice
27#include "AliRunLoader.h"
28#include "AliLoader.h"
29
a713db22 30#include "AliMUON.h"
52c9bc11 31#include "AliMUONDigit.h"
32#include "AliMUONConstants.h"
33#include "AliMUONData.h"
34#include "AliMUONClusterFinderVS.h"
52c9bc11 35#include "AliMUONClusterInput.h"
36#include "AliMUONRawCluster.h"
8c343c7c 37#include "AliLog.h"
cf464691 38
52c9bc11 39ClassImp(AliMUONClusterReconstructor) // Class implementation in ROOT context
40
41//__________________________________________________________________________
1197ff51 42 AliMUONClusterReconstructor::AliMUONClusterReconstructor(AliLoader* loader, AliMUONData* data)
5ac16716 43 : TObject()
52c9bc11 44{
30178c30 45 // Standard Constructor
52c9bc11 46
47 // initialize loader's
48 fLoader = loader;
49
50 // initialize container
1197ff51 51 if (data == 0x0)
5ac16716 52 fMUONData = new AliMUONData(fLoader,"MUON","MUON");
1197ff51 53 else
54 fMUONData = data;
55
7e4a628d 56 // reconstruction model
57 fRecModel = new AliMUONClusterFinderVS();
58 //fRecModel = new AliMUONClusterFinderAZ();
52c9bc11 59
30178c30 60}
52c9bc11 61
30178c30 62//__________________________________________________________________________
63AliMUONClusterReconstructor::AliMUONClusterReconstructor()
64 : TObject(),
30178c30 65 fMUONData(0),
5ac16716 66 fRecModel(0),
30178c30 67 fLoader(0)
68{
69 // Default Constructor
52c9bc11 70}
30178c30 71
52c9bc11 72//_______________________________________________________________________
30178c30 73AliMUONClusterReconstructor::AliMUONClusterReconstructor (const AliMUONClusterReconstructor& rhs)
74 : TObject(rhs)
52c9bc11 75{
30178c30 76// Protected copy constructor
77
8c343c7c 78 AliFatal("Not implemented.");
52c9bc11 79}
80
30178c30 81//_______________________________________________________________________
82AliMUONClusterReconstructor &
83AliMUONClusterReconstructor::operator=(const AliMUONClusterReconstructor& rhs)
52c9bc11 84{
30178c30 85// Protected assignement operator
86
87 if (this == &rhs) return *this;
88
8c343c7c 89 AliFatal("Not implemented.");
30178c30 90
91 return *this;
52c9bc11 92}
93
94//__________________________________________________________________________
95AliMUONClusterReconstructor::~AliMUONClusterReconstructor(void)
96{
7e4a628d 97
52c9bc11 98 if (fMUONData)
99 delete fMUONData;
5ac16716 100 if (fRecModel)
101 delete fRecModel;
52c9bc11 102
103 return;
104}
105//____________________________________________________________________
106void AliMUONClusterReconstructor::Digits2Clusters()
a713db22 107{
108
109 TClonesArray *dig1, *dig2, *digAll;
110 Int_t ndig, k, idDE, idDE_prev;
111 dig1 = new TClonesArray("AliMUONDigit",1000);
112 dig2 = new TClonesArray("AliMUONDigit",1000);
113 digAll = new TClonesArray("AliMUONDigit",2000);
114
115 AliMUONDigit* digit;
116
f7db2071 117 TArrayI id(200); // contains the different IdDE
118
a713db22 119
120// Loop on chambers and on cathode planes
121 TClonesArray* muonDigits;
122 Int_t n2;
123 Int_t n1;
935b9895 124
a713db22 125 for (Int_t ich = 0; ich < AliMUONConstants::NTrackingCh(); ich++) {
f7db2071 126
127 id.Reset();
a713db22 128 n1 = 0;
129 n2 = 0;
935b9895 130 //cathode 0 & 1
a713db22 131 fMUONData->ResetDigits();
935b9895 132 fMUONData->GetDigits();
a713db22 133 muonDigits = fMUONData->Digits(ich);
134 ndig = muonDigits->GetEntriesFast();
135 TClonesArray &lDigit = *digAll;
136
137 idDE_prev = 0;
935b9895 138 muonDigits->Sort();
a713db22 139 for (k = 0; k < ndig; k++) {
140
141 digit = (AliMUONDigit*) muonDigits->UncheckedAt(k);
142 new(lDigit[n1++]) AliMUONDigit(*digit);
143 idDE = digit->DetElemId();
f7db2071 144 if (idDE != idDE_prev) {
a713db22 145 id.AddAt(idDE,n2++);
f7db2071 146 }
a713db22 147 idDE_prev = idDE;
148 }
149
f7db2071 150 Int_t idSize = n2;
a713db22 151
f7db2071 152 // loop over id DE
153 for (idDE = 0; idDE < idSize; idDE++) {
a713db22 154 TClonesArray &lhits1 = *dig1;
52c9bc11 155 TClonesArray &lhits2 = *dig2;
677975f0 156 dig1->Clear();
157 dig2->Clear();
a713db22 158 n1 = n2 = 0;
159
160 for (k = 0; k < digAll->GetEntriesFast(); k++) {
161 digit = (AliMUONDigit*) digAll->UncheckedAt(k);
f7db2071 162 // printf("digit idDE %d\n", digit->DetElemId());
163 if (id[idDE] == digit->DetElemId()) {
677975f0 164 if (digit->Cathode() == 0)
a713db22 165 new(lhits1[n1++]) AliMUONDigit(*digit);
166 else
167 new(lhits2[n2++]) AliMUONDigit(*digit);
f7db2071 168 }
52c9bc11 169 }
170
a713db22 171 // cluster finder
172 if (fRecModel) {
173 AliMUONClusterInput::Instance()->SetDigits(ich, id[idDE], dig1, dig2);
174 fRecModel->FindRawClusters();
52c9bc11 175 }
176 // copy into the container
7e4a628d 177 TClonesArray* tmp = fRecModel->GetRawClusters();
52c9bc11 178 for (Int_t id = 0; id < tmp->GetEntriesFast(); id++) {
179 AliMUONRawCluster* pClus = (AliMUONRawCluster*) tmp->At(id);
180 fMUONData->AddRawCluster(ich, *pClus);
181 }
182 dig1->Delete();
183 dig2->Delete();
f7db2071 184 } // idDE
185 digAll->Delete();
52c9bc11 186 } // for ich
187 delete dig1;
188 delete dig2;
a713db22 189 delete digAll;
52c9bc11 190}
cf464691 191
7e4a628d 192//_______________________________________________________________________
193void AliMUONClusterReconstructor::Trigger2Trigger()
194{
195// copy trigger from TreeD to TreeR
196
197 fMUONData->SetTreeAddress("GLT");
198 fMUONData->GetTriggerD();
199}