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"
30 #include "AliMUONDigit.h"
31 #include "AliMUONConstants.h"
32 #include "AliMUONData.h"
33 #include "AliMUONClusterFinderVS.h"
34 #include "AliMUONClusterInput.h"
35 #include "AliMUONRawCluster.h"
36 #include "AliRawReader.h" // for raw data
40 const Int_t AliMUONClusterReconstructor::fgkDefaultPrintLevel = 0;
42 ClassImp(AliMUONClusterReconstructor) // Class implementation in ROOT context
44 //__________________________________________________________________________
45 AliMUONClusterReconstructor::AliMUONClusterReconstructor(AliLoader* loader)
48 fPrintLevel(fgkDefaultPrintLevel),
51 // Standard Constructor
53 // initialize loader's
56 // initialize container
57 fMUONData = new AliMUONData(fLoader,"MUON","MUON");
59 // reconstruction model
60 fRecModel = new AliMUONClusterFinderVS();
61 //fRecModel = new AliMUONClusterFinderAZ();
65 //__________________________________________________________________________
66 AliMUONClusterReconstructor::AliMUONClusterReconstructor()
69 fPrintLevel(fgkDefaultPrintLevel),
73 // Default Constructor
76 //_______________________________________________________________________
77 AliMUONClusterReconstructor::AliMUONClusterReconstructor (const AliMUONClusterReconstructor& rhs)
80 // Protected copy constructor
82 AliFatal("Not implemented.");
85 //_______________________________________________________________________
86 AliMUONClusterReconstructor &
87 AliMUONClusterReconstructor::operator=(const AliMUONClusterReconstructor& rhs)
89 // Protected assignement operator
91 if (this == &rhs) return *this;
93 AliFatal("Not implemented.");
98 //__________________________________________________________________________
99 AliMUONClusterReconstructor::~AliMUONClusterReconstructor(void)
107 //____________________________________________________________________
108 void AliMUONClusterReconstructor::Digits2Clusters()
111 // Perform cluster finding
113 TClonesArray *dig1, *dig2;
115 dig1 = new TClonesArray("AliMUONDigit",1000);
116 dig2 = new TClonesArray("AliMUONDigit",1000);
119 // Loop on chambers and on cathode planes
120 TClonesArray * muonDigits;
122 for (Int_t ich = 0; ich < 10; ich++) {
124 fMUONData->ResetDigits();
125 fMUONData->GetCathode(0);
127 muonDigits = fMUONData->Digits(ich);
128 ndig=muonDigits->GetEntriesFast();
129 AliDebug(1,Form("1 Found %d digits in %p chamber %d", ndig, (void*)muonDigits,ich));
130 TClonesArray &lhits1 = *dig1;
132 for (k = 0; k < ndig; k++) {
133 digit = (AliMUONDigit*) muonDigits->UncheckedAt(k);
134 if (fRecModel->TestTrack(digit->Track(0)))
135 new(lhits1[n++]) AliMUONDigit(*digit);
137 fMUONData->ResetDigits();
138 fMUONData->GetCathode(1);
139 muonDigits = fMUONData->Digits(ich);
140 ndig=muonDigits->GetEntriesFast();
141 AliDebug(1,Form("2 Found %d digits in %p %d", ndig, (void*)muonDigits, ich));
142 TClonesArray &lhits2 = *dig2;
145 for (k=0; k<ndig; k++) {
146 digit= (AliMUONDigit*) muonDigits->UncheckedAt(k);
147 if (fRecModel->TestTrack(digit->Track(0)))
148 new(lhits2[n++]) AliMUONDigit(*digit);
152 AliMUONClusterInput::Instance()->SetDigits(ich, dig1, dig2);
153 fRecModel->FindRawClusters();
155 // copy into the container
156 TClonesArray* tmp = fRecModel->GetRawClusters();
157 for (Int_t id = 0; id < tmp->GetEntriesFast(); id++) {
158 AliMUONRawCluster* pClus = (AliMUONRawCluster*) tmp->At(id);
159 fMUONData->AddRawCluster(ich, *pClus);
168 //____________________________________________________________________
169 void AliMUONClusterReconstructor::Digits2Clusters(AliRawReader* /*rawReader*/)
172 // Perform cluster finding form raw data
174 AliFatal("clusterization not implemented for raw data input");
176 //_______________________________________________________________________
177 void AliMUONClusterReconstructor::Trigger2Trigger()
179 // copy trigger from TreeD to TreeR
181 fMUONData->SetTreeAddress("GLT");
182 fMUONData->GetTriggerD();
184 //_______________________________________________________________________
185 void AliMUONClusterReconstructor::Trigger2Trigger(AliRawReader* /*rawReader*/)
187 // call the Trigger Algorithm from raw data and fill TreeR
189 AliFatal("Trigger not implemented for raw data input");