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 ////////////////////////////////////
20 // MUON cluster reconstructor for MUON
22 // Should implement a virtual class ClusterFinder to chose between VS and AZ method
23 ////////////////////////////////////
25 #include "AliMUONClusterReconstructor.h"
26 #include "AliRun.h" // for gAlice
27 #include "AliRunLoader.h"
28 #include "AliLoader.h"
31 #include "AliMUONDigit.h"
32 #include "AliMUONConstants.h"
33 #include "AliMUONData.h"
34 #include "AliMUONClusterFinderVS.h"
35 #include "AliMUONClusterInput.h"
36 #include "AliMUONRawCluster.h"
39 ClassImp(AliMUONClusterReconstructor) // Class implementation in ROOT context
41 //__________________________________________________________________________
42 AliMUONClusterReconstructor::AliMUONClusterReconstructor(AliLoader* loader, AliMUONData* data)
45 // Standard Constructor
47 // initialize loader's
50 // initialize container
53 // reconstruction model
54 fRecModel = new AliMUONClusterFinderVS();
55 //fRecModel = new AliMUONClusterFinderAZ();
59 //__________________________________________________________________________
60 AliMUONClusterReconstructor::AliMUONClusterReconstructor()
66 // Default Constructor
69 //_______________________________________________________________________
70 AliMUONClusterReconstructor::AliMUONClusterReconstructor (const AliMUONClusterReconstructor& rhs)
73 // Protected copy constructor
75 AliFatal("Not implemented.");
78 //_______________________________________________________________________
79 AliMUONClusterReconstructor &
80 AliMUONClusterReconstructor::operator=(const AliMUONClusterReconstructor& rhs)
82 // Protected assignement operator
84 if (this == &rhs) return *this;
86 AliFatal("Not implemented.");
91 //__________________________________________________________________________
92 AliMUONClusterReconstructor::~AliMUONClusterReconstructor(void)
100 //____________________________________________________________________
101 void AliMUONClusterReconstructor::Digits2Clusters(Int_t chBeg)
104 TClonesArray *dig1, *dig2, *digAll;
105 Int_t ndig, k, idDE, idDEprev;
106 dig1 = new TClonesArray("AliMUONDigit",1000);
107 dig2 = new TClonesArray("AliMUONDigit",1000);
108 digAll = new TClonesArray("AliMUONDigit",2000);
112 TArrayI id(200); // contains the different IdDE
115 // Loop on chambers and on cathode planes
116 TClonesArray* muonDigits;
120 for (Int_t ich = chBeg; ich < AliMUONConstants::NTrackingCh(); ich++) {
127 muonDigits = fMUONData->Digits(ich);
128 ndig = muonDigits->GetEntriesFast();
129 TClonesArray &lDigit = *digAll;
133 for (k = 0; k < ndig; k++) {
135 digit = (AliMUONDigit*) muonDigits->UncheckedAt(k);
136 new(lDigit[n1++]) AliMUONDigit(*digit);
137 idDE = digit->DetElemId();
138 if (idDE != idDEprev) {
147 for (idDE = 0; idDE < idSize; idDE++) {
148 TClonesArray &lhits1 = *dig1;
149 TClonesArray &lhits2 = *dig2;
154 for (k = 0; k < digAll->GetEntriesFast(); k++) {
155 digit = (AliMUONDigit*) digAll->UncheckedAt(k);
156 // printf("digit idDE %d\n", digit->DetElemId());
157 if (id[idDE] == digit->DetElemId()) {
158 if (digit->Cathode() == 0)
159 new(lhits1[n1++]) AliMUONDigit(*digit);
161 new(lhits2[n2++]) AliMUONDigit(*digit);
167 AliMUONClusterInput::Instance()->SetDigits(ich, id[idDE], dig1, dig2);
168 fRecModel->FindRawClusters();
170 // copy into the container
171 TClonesArray* tmp = fRecModel->GetRawClusters();
172 for (Int_t id = 0; id < tmp->GetEntriesFast(); id++) {
173 AliMUONRawCluster* pClus = (AliMUONRawCluster*) tmp->At(id);
174 fMUONData->AddRawCluster(ich, *pClus);
186 //_______________________________________________________________________
187 void AliMUONClusterReconstructor::Trigger2Trigger()
189 // copy trigger from TreeD to TreeR
191 fMUONData->SetTreeAddress("GLT");
192 fMUONData->GetTriggerD();