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.7 2000/12/21 22:14:38 morsch
19 Clean-up of coding rule violations.
21 Revision 1.6 2000/10/06 09:04:50 morsch
23 - Dummy z-arguments in GetPadI, SetHit, FirstPad replaced by real z-coordinate
24 to make code work with slat chambers.
26 Revision 1.5 2000/10/02 16:58:29 egangler
27 Cleaning of the code :
30 -> some useless includes removed or replaced by "class" statement
32 Revision 1.4 2000/07/03 11:54:57 morsch
33 AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
34 The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
36 Revision 1.3 2000/06/28 15:16:35 morsch
37 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
38 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
39 framework. The changes should have no side effects (mostly dummy arguments).
40 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
41 of chambers with overlapping modules (MakePadHits, Disintegration).
43 Revision 1.2 2000/06/28 12:19:18 morsch
44 More consequent seperation of global input data services (AliMUONClusterInput singleton) and the
45 cluster and hit reconstruction algorithms in AliMUONClusterFinderVS.
46 AliMUONClusterFinderVS becomes the base class for clustering and hit reconstruction.
47 It requires two cathode planes. Small modifications in the code will make it usable for
48 one cathode plane and, hence, more general (for test beam data).
49 AliMUONClusterFinder is now obsolete.
51 Revision 1.1 2000/06/28 08:06:10 morsch
52 Avoid global variables in AliMUONClusterFinderVS by seperating the input data for the fit from the
53 algorithmic part of the class. Input data resides inside the AliMUONClusterInput singleton.
54 It also naturally takes care of the TMinuit instance.
59 #include "AliMUONChamber.h"
60 #include "AliMUONClusterInput.h"
61 #include "AliSegmentation.h"
62 #include "AliMUONResponse.h"
63 #include "AliMUONRawCluster.h"
64 #include "AliMUONDigit.h"
66 #include <TClonesArray.h>
69 ClassImp(AliMUONClusterInput)
71 AliMUONClusterInput* AliMUONClusterInput::fgClusterInput = 0;
72 TMinuit* AliMUONClusterInput::fgMinuit = 0;
74 AliMUONClusterInput::AliMUONClusterInput(){
85 AliMUONClusterInput* AliMUONClusterInput::Instance()
87 // return pointer to the singleton instance
88 if (fgClusterInput == 0) {
89 fgClusterInput = new AliMUONClusterInput();
90 fgMinuit = new TMinuit(8);
93 return fgClusterInput;
96 void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig1, TClonesArray* dig2)
98 // Set pointer to digits with corresponding segmentations and responses (two cathode planes)
102 fNDigits[0]=dig1->GetEntriesFast();
103 fNDigits[1]=dig2->GetEntriesFast();
106 AliMUONChamber* iChamber;
108 pMUON = (AliMUON*) gAlice->GetModule("MUON");
109 iChamber = &(pMUON->Chamber(chamber));
111 fSegmentation[0]=iChamber->SegmentationModel(1);
112 fSegmentation[1]=iChamber->SegmentationModel(2);
113 fResponse=iChamber->ResponseModel();
117 void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig)
119 // Set pointer to digits with corresponding segmentations and responses (one cathode plane)
122 AliMUONChamber* iChamber;
124 pMUON = (AliMUON*) gAlice->GetModule("MUON");
125 iChamber = &(pMUON->Chamber(chamber));
127 fSegmentation[0]=iChamber->SegmentationModel(1);
128 fResponse=iChamber->ResponseModel();
132 void AliMUONClusterInput::SetCluster(AliMUONRawCluster* cluster)
134 // Set the current cluster
135 printf("\n %p \n", cluster);
138 Int_t i, cath, ix, iy;
140 fNmul[0]=cluster->fMultiplicity[0];
141 fNmul[1]=cluster->fMultiplicity[1];
142 printf("\n %p %p ", fDigits[0], fDigits[1]);
144 for (cath=0; cath<2; cath++) {
146 for (i=0; i<fNmul[cath]; i++) {
148 digit =(AliMUONDigit*)
149 (fDigits[cath]->UncheckedAt(cluster->fIndexMap[i][cath]));
154 fCharge[i][cath] = digit->fSignal;
155 // pad centre coordinates
156 // fSegmentation[cath]->GetPadCxy(ix, iy, x, y);
157 // globals kUsed in fitting functions
160 // total charge per cluster
161 qtot+=fCharge[i][cath];
164 fSegmentation[cath]->GetPadC(ix,iy,xc,yc,fZ);
165 } // loop over cluster digits
167 fChargeTot[cath]=Int_t(qtot);
168 } // loop over cathodes
173 Float_t AliMUONClusterInput::DiscrChargeS1(Int_t i,Double_t *par)
175 // par[0] x-position of cluster
176 // par[1] y-position of cluster
178 fSegmentation[0]->SetPad(fix[i][0], fiy[i][0]);
180 fSegmentation[0]->SetHit(par[0],par[1],fZ);
181 Float_t q1=fResponse->IntXY(fSegmentation[0]);
183 Float_t value = fQtot[0]*q1;
187 Float_t AliMUONClusterInput::DiscrChargeCombiS1(Int_t i,Double_t *par, Int_t cath)
189 // par[0] x-position of cluster
190 // par[1] y-position of cluster
192 fSegmentation[cath]->SetPad(fix[i][cath], fiy[i][cath]);
194 fSegmentation[cath]->SetHit(par[0],par[1],fZ);
195 Float_t q1=fResponse->IntXY(fSegmentation[cath]);
197 Float_t value = fQtot[cath]*q1;
202 Float_t AliMUONClusterInput::DiscrChargeS2(Int_t i,Double_t *par)
204 // par[0] x-position of first cluster
205 // par[1] y-position of first cluster
206 // par[2] x-position of second cluster
207 // par[3] y-position of second cluster
208 // par[4] charge fraction of first cluster
209 // 1-par[4] charge fraction of second cluster
211 fSegmentation[0]->SetPad(fix[i][0], fiy[i][0]);
213 fSegmentation[0]->SetHit(par[0],par[1],fZ);
214 Float_t q1=fResponse->IntXY(fSegmentation[0]);
217 fSegmentation[0]->SetHit(par[2],par[3],fZ);
218 Float_t q2=fResponse->IntXY(fSegmentation[0]);
220 Float_t value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
224 Float_t AliMUONClusterInput::DiscrChargeCombiS2(Int_t i,Double_t *par, Int_t cath)
226 // par[0] x-position of first cluster
227 // par[1] y-position of first cluster
228 // par[2] x-position of second cluster
229 // par[3] y-position of second cluster
230 // par[4] charge fraction of first cluster
231 // 1-par[4] charge fraction of second cluster
233 fSegmentation[cath]->SetPad(fix[i][cath], fiy[i][cath]);
235 fSegmentation[cath]->SetHit(par[0],par[1],fZ);
236 Float_t q1=fResponse->IntXY(fSegmentation[cath]);
239 fSegmentation[cath]->SetHit(par[2],par[3],fZ);
240 Float_t q2=fResponse->IntXY(fSegmentation[cath]);
243 value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
245 value = fQtot[1]*(par[5]*q1+(1.-par[5])*q2);
250 AliMUONClusterInput& AliMUONClusterInput
251 ::operator = (const AliMUONClusterInput& rhs)
253 // Dummy assignment operator