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
52 fMUONData = new AliMUONData(fLoader,"MUON","MUON");
56 // reconstruction model
57 fRecModel = new AliMUONClusterFinderVS();
58 //fRecModel = new AliMUONClusterFinderAZ();
62 //__________________________________________________________________________
63 AliMUONClusterReconstructor::AliMUONClusterReconstructor()
69 // Default Constructor
72 //_______________________________________________________________________
73 AliMUONClusterReconstructor::AliMUONClusterReconstructor (const AliMUONClusterReconstructor& rhs)
76 // Protected copy constructor
78 AliFatal("Not implemented.");
81 //_______________________________________________________________________
82 AliMUONClusterReconstructor &
83 AliMUONClusterReconstructor::operator=(const AliMUONClusterReconstructor& rhs)
85 // Protected assignement operator
87 if (this == &rhs) return *this;
89 AliFatal("Not implemented.");
94 //__________________________________________________________________________
95 AliMUONClusterReconstructor::~AliMUONClusterReconstructor(void)
105 //____________________________________________________________________
106 void AliMUONClusterReconstructor::Digits2Clusters()
109 TClonesArray *dig1, *dig2, *digAll;
110 Int_t ndig, k, idDE, idDEprev;
111 dig1 = new TClonesArray("AliMUONDigit",1000);
112 dig2 = new TClonesArray("AliMUONDigit",1000);
113 digAll = new TClonesArray("AliMUONDigit",2000);
117 TArrayI id(200); // contains the different IdDE
120 // Loop on chambers and on cathode planes
121 TClonesArray* muonDigits;
125 for (Int_t ich = 0; ich < AliMUONConstants::NTrackingCh(); ich++) {
131 fMUONData->ResetDigits();
132 fMUONData->GetDigits();
133 muonDigits = fMUONData->Digits(ich);
134 ndig = muonDigits->GetEntriesFast();
135 TClonesArray &lDigit = *digAll;
139 for (k = 0; k < ndig; k++) {
141 digit = (AliMUONDigit*) muonDigits->UncheckedAt(k);
142 new(lDigit[n1++]) AliMUONDigit(*digit);
143 idDE = digit->DetElemId();
144 if (idDE != idDEprev) {
153 for (idDE = 0; idDE < idSize; idDE++) {
154 TClonesArray &lhits1 = *dig1;
155 TClonesArray &lhits2 = *dig2;
160 for (k = 0; k < digAll->GetEntriesFast(); k++) {
161 digit = (AliMUONDigit*) digAll->UncheckedAt(k);
162 // printf("digit idDE %d\n", digit->DetElemId());
163 if (id[idDE] == digit->DetElemId()) {
164 if (digit->Cathode() == 0)
165 new(lhits1[n1++]) AliMUONDigit(*digit);
167 new(lhits2[n2++]) AliMUONDigit(*digit);
173 AliMUONClusterInput::Instance()->SetDigits(ich, id[idDE], dig1, dig2);
174 fRecModel->FindRawClusters();
176 // copy into the container
177 TClonesArray* tmp = fRecModel->GetRawClusters();
178 for (Int_t id = 0; id < tmp->GetEntriesFast(); id++) {
179 AliMUONRawCluster* pClus = (AliMUONRawCluster*) tmp->At(id);
180 fMUONData->AddRawCluster(ich, *pClus);
192 //_______________________________________________________________________
193 void AliMUONClusterReconstructor::Trigger2Trigger()
195 // copy trigger from TreeD to TreeR
196 fMUONData->GetTriggerD();