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 Revision 1.6 2000/10/06 09:04:50 morsch
20 - Dummy z-arguments in GetPadI, SetHit, FirstPad replaced by real z-coordinate
21 to make code work with slat chambers.
23 Revision 1.5 2000/10/02 16:58:29 egangler
24 Cleaning of the code :
27 -> some useless includes removed or replaced by "class" statement
29 Revision 1.4 2000/07/03 11:54:57 morsch
30 AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
31 The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
33 Revision 1.3 2000/06/28 15:16:35 morsch
34 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
35 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
36 framework. The changes should have no side effects (mostly dummy arguments).
37 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
38 of chambers with overlapping modules (MakePadHits, Disintegration).
40 Revision 1.2 2000/06/28 12:19:18 morsch
41 More consequent seperation of global input data services (AliMUONClusterInput singleton) and the
42 cluster and hit reconstruction algorithms in AliMUONClusterFinderVS.
43 AliMUONClusterFinderVS becomes the base class for clustering and hit reconstruction.
44 It requires two cathode planes. Small modifications in the code will make it usable for
45 one cathode plane and, hence, more general (for test beam data).
46 AliMUONClusterFinder is now obsolete.
48 Revision 1.1 2000/06/28 08:06:10 morsch
49 Avoid global variables in AliMUONClusterFinderVS by seperating the input data for the fit from the
50 algorithmic part of the class. Input data resides inside the AliMUONClusterInput singleton.
51 It also naturally takes care of the TMinuit instance.
56 #include "AliMUONChamber.h"
57 #include "AliMUONClusterInput.h"
58 #include "AliSegmentation.h"
59 #include "AliMUONResponse.h"
60 #include "AliMUONRawCluster.h"
61 #include "AliMUONDigit.h"
63 #include <TClonesArray.h>
66 ClassImp(AliMUONClusterInput)
68 AliMUONClusterInput* AliMUONClusterInput::fgClusterInput = 0;
69 TMinuit* AliMUONClusterInput::fgMinuit = 0;
71 AliMUONClusterInput* AliMUONClusterInput::Instance()
73 // return pointer to the singleton instance
74 if (fgClusterInput == 0) {
75 fgClusterInput = new AliMUONClusterInput();
76 fgMinuit = new TMinuit(8);
79 return fgClusterInput;
82 void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig1, TClonesArray* dig2)
84 // Set pointer to digits with corresponding segmentations and responses (two cathode planes)
88 fNDigits[0]=dig1->GetEntriesFast();
89 fNDigits[1]=dig2->GetEntriesFast();
92 AliMUONChamber* iChamber;
94 pMUON = (AliMUON*) gAlice->GetModule("MUON");
95 iChamber = &(pMUON->Chamber(chamber));
97 fSegmentation[0]=iChamber->SegmentationModel(1);
98 fSegmentation[1]=iChamber->SegmentationModel(2);
99 fResponse=iChamber->ResponseModel();
103 void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig)
105 // Set pointer to digits with corresponding segmentations and responses (one cathode plane)
108 AliMUONChamber* iChamber;
110 pMUON = (AliMUON*) gAlice->GetModule("MUON");
111 iChamber = &(pMUON->Chamber(chamber));
113 fSegmentation[0]=iChamber->SegmentationModel(1);
114 fResponse=iChamber->ResponseModel();
118 void AliMUONClusterInput::SetCluster(AliMUONRawCluster* cluster)
120 // Set the current cluster
121 printf("\n %p \n", cluster);
124 Int_t i, cath, ix, iy;
126 fNmul[0]=cluster->fMultiplicity[0];
127 fNmul[1]=cluster->fMultiplicity[1];
128 printf("\n %p %p ", fDigits[0], fDigits[1]);
130 for (cath=0; cath<2; cath++) {
132 for (i=0; i<fNmul[cath]; i++) {
134 digit =(AliMUONDigit*)
135 (fDigits[cath]->UncheckedAt(cluster->fIndexMap[i][cath]));
140 fCharge[i][cath] = digit->fSignal;
141 // pad centre coordinates
142 // fSegmentation[cath]->GetPadCxy(ix, iy, x, y);
143 // globals kUsed in fitting functions
146 // total charge per cluster
147 qtot+=fCharge[i][cath];
150 fSegmentation[cath]->GetPadC(ix,iy,xc,yc,fZ);
151 } // loop over cluster digits
153 fChargeTot[cath]=Int_t(qtot);
154 } // loop over cathodes
159 Float_t AliMUONClusterInput::DiscrChargeS1(Int_t i,Double_t *par)
161 // par[0] x-position of cluster
162 // par[1] y-position of cluster
164 fSegmentation[0]->SetPad(fix[i][0], fiy[i][0]);
166 fSegmentation[0]->SetHit(par[0],par[1],fZ);
167 Float_t q1=fResponse->IntXY(fSegmentation[0]);
169 Float_t value = fQtot[0]*q1;
173 Float_t AliMUONClusterInput::DiscrChargeCombiS1(Int_t i,Double_t *par, Int_t cath)
175 // par[0] x-position of cluster
176 // par[1] y-position of cluster
178 fSegmentation[cath]->SetPad(fix[i][cath], fiy[i][cath]);
180 fSegmentation[cath]->SetHit(par[0],par[1],fZ);
181 Float_t q1=fResponse->IntXY(fSegmentation[cath]);
183 Float_t value = fQtot[cath]*q1;
188 Float_t AliMUONClusterInput::DiscrChargeS2(Int_t i,Double_t *par)
190 // par[0] x-position of first cluster
191 // par[1] y-position of first cluster
192 // par[2] x-position of second cluster
193 // par[3] y-position of second cluster
194 // par[4] charge fraction of first cluster
195 // 1-par[4] charge fraction of second cluster
197 fSegmentation[0]->SetPad(fix[i][0], fiy[i][0]);
199 fSegmentation[0]->SetHit(par[0],par[1],fZ);
200 Float_t q1=fResponse->IntXY(fSegmentation[0]);
203 fSegmentation[0]->SetHit(par[2],par[3],fZ);
204 Float_t q2=fResponse->IntXY(fSegmentation[0]);
206 Float_t value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
210 Float_t AliMUONClusterInput::DiscrChargeCombiS2(Int_t i,Double_t *par, Int_t cath)
212 // par[0] x-position of first cluster
213 // par[1] y-position of first cluster
214 // par[2] x-position of second cluster
215 // par[3] y-position of second cluster
216 // par[4] charge fraction of first cluster
217 // 1-par[4] charge fraction of second cluster
219 fSegmentation[cath]->SetPad(fix[i][cath], fiy[i][cath]);
221 fSegmentation[cath]->SetHit(par[0],par[1],fZ);
222 Float_t q1=fResponse->IntXY(fSegmentation[cath]);
225 fSegmentation[cath]->SetHit(par[2],par[3],fZ);
226 Float_t q2=fResponse->IntXY(fSegmentation[cath]);
229 value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
231 value = fQtot[1]*(par[5]*q1+(1.-par[5])*q2);
236 AliMUONClusterInput& AliMUONClusterInput
237 ::operator = (const AliMUONClusterInput& rhs)
239 // Dummy assignment operator