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.8 2001/01/23 18:58:19 hristov
19 Initialisation of some pointers
21 Revision 1.7 2000/12/21 22:14:38 morsch
22 Clean-up of coding rule violations.
24 Revision 1.6 2000/10/06 09:04:50 morsch
26 - Dummy z-arguments in GetPadI, SetHit, FirstPad replaced by real z-coordinate
27 to make code work with slat chambers.
29 Revision 1.5 2000/10/02 16:58:29 egangler
30 Cleaning of the code :
33 -> some useless includes removed or replaced by "class" statement
35 Revision 1.4 2000/07/03 11:54:57 morsch
36 AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
37 The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
39 Revision 1.3 2000/06/28 15:16:35 morsch
40 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
41 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
42 framework. The changes should have no side effects (mostly dummy arguments).
43 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
44 of chambers with overlapping modules (MakePadHits, Disintegration).
46 Revision 1.2 2000/06/28 12:19:18 morsch
47 More consequent seperation of global input data services (AliMUONClusterInput singleton) and the
48 cluster and hit reconstruction algorithms in AliMUONClusterFinderVS.
49 AliMUONClusterFinderVS becomes the base class for clustering and hit reconstruction.
50 It requires two cathode planes. Small modifications in the code will make it usable for
51 one cathode plane and, hence, more general (for test beam data).
52 AliMUONClusterFinder is now obsolete.
54 Revision 1.1 2000/06/28 08:06:10 morsch
55 Avoid global variables in AliMUONClusterFinderVS by seperating the input data for the fit from the
56 algorithmic part of the class. Input data resides inside the AliMUONClusterInput singleton.
57 It also naturally takes care of the TMinuit instance.
62 #include "AliMUONChamber.h"
63 #include "AliMUONClusterInput.h"
64 #include "AliSegmentation.h"
65 #include "AliMUONResponse.h"
66 #include "AliMUONRawCluster.h"
67 #include "AliMUONDigit.h"
69 #include <TClonesArray.h>
72 ClassImp(AliMUONClusterInput)
74 AliMUONClusterInput* AliMUONClusterInput::fgClusterInput = 0;
75 TMinuit* AliMUONClusterInput::fgMinuit = 0;
77 AliMUONClusterInput::AliMUONClusterInput(){
88 AliMUONClusterInput* AliMUONClusterInput::Instance()
90 // return pointer to the singleton instance
91 if (fgClusterInput == 0) {
92 fgClusterInput = new AliMUONClusterInput();
93 fgMinuit = new TMinuit(8);
96 return fgClusterInput;
99 void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig1, TClonesArray* dig2)
101 // Set pointer to digits with corresponding segmentations and responses (two cathode planes)
105 fNDigits[0]=dig1->GetEntriesFast();
106 fNDigits[1]=dig2->GetEntriesFast();
109 AliMUONChamber* iChamber;
111 pMUON = (AliMUON*) gAlice->GetModule("MUON");
112 iChamber = &(pMUON->Chamber(chamber));
114 fSegmentation[0]=iChamber->SegmentationModel(1);
115 fSegmentation[1]=iChamber->SegmentationModel(2);
116 fResponse=iChamber->ResponseModel();
120 void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig)
122 // Set pointer to digits with corresponding segmentations and responses (one cathode plane)
125 AliMUONChamber* iChamber;
127 pMUON = (AliMUON*) gAlice->GetModule("MUON");
128 iChamber = &(pMUON->Chamber(chamber));
130 fSegmentation[0]=iChamber->SegmentationModel(1);
131 fResponse=iChamber->ResponseModel();
135 void AliMUONClusterInput::SetCluster(AliMUONRawCluster* cluster)
137 // Set the current cluster
138 printf("\n %p \n", cluster);
141 Int_t i, cath, ix, iy;
143 fNmul[0]=cluster->fMultiplicity[0];
144 fNmul[1]=cluster->fMultiplicity[1];
145 printf("\n %p %p ", fDigits[0], fDigits[1]);
147 for (cath=0; cath<2; cath++) {
149 for (i=0; i<fNmul[cath]; i++) {
151 digit =(AliMUONDigit*)
152 (fDigits[cath]->UncheckedAt(cluster->fIndexMap[i][cath]));
157 fCharge[i][cath] = digit->Signal();
158 // pad centre coordinates
159 // fSegmentation[cath]->GetPadCxy(ix, iy, x, y);
160 // globals kUsed in fitting functions
163 // total charge per cluster
164 qtot+=fCharge[i][cath];
167 fSegmentation[cath]->GetPadC(ix,iy,xc,yc,fZ);
168 } // loop over cluster digits
170 fChargeTot[cath]=Int_t(qtot);
171 } // loop over cathodes
176 Float_t AliMUONClusterInput::DiscrChargeS1(Int_t i,Double_t *par)
178 // par[0] x-position of cluster
179 // par[1] y-position of cluster
181 fSegmentation[0]->SetPad(fix[i][0], fiy[i][0]);
183 fSegmentation[0]->SetHit(par[0],par[1],fZ);
184 Float_t q1=fResponse->IntXY(fSegmentation[0]);
186 Float_t value = fQtot[0]*q1;
190 Float_t AliMUONClusterInput::DiscrChargeCombiS1(Int_t i,Double_t *par, Int_t cath)
192 // par[0] x-position of cluster
193 // par[1] y-position of cluster
195 fSegmentation[cath]->SetPad(fix[i][cath], fiy[i][cath]);
197 fSegmentation[cath]->SetHit(par[0],par[1],fZ);
198 Float_t q1=fResponse->IntXY(fSegmentation[cath]);
200 Float_t value = fQtot[cath]*q1;
205 Float_t AliMUONClusterInput::DiscrChargeS2(Int_t i,Double_t *par)
207 // par[0] x-position of first cluster
208 // par[1] y-position of first cluster
209 // par[2] x-position of second cluster
210 // par[3] y-position of second cluster
211 // par[4] charge fraction of first cluster
212 // 1-par[4] charge fraction of second cluster
214 fSegmentation[0]->SetPad(fix[i][0], fiy[i][0]);
216 fSegmentation[0]->SetHit(par[0],par[1],fZ);
217 Float_t q1=fResponse->IntXY(fSegmentation[0]);
220 fSegmentation[0]->SetHit(par[2],par[3],fZ);
221 Float_t q2=fResponse->IntXY(fSegmentation[0]);
223 Float_t value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
227 Float_t AliMUONClusterInput::DiscrChargeCombiS2(Int_t i,Double_t *par, Int_t cath)
229 // par[0] x-position of first cluster
230 // par[1] y-position of first cluster
231 // par[2] x-position of second cluster
232 // par[3] y-position of second cluster
233 // par[4] charge fraction of first cluster
234 // 1-par[4] charge fraction of second cluster
236 fSegmentation[cath]->SetPad(fix[i][cath], fiy[i][cath]);
238 fSegmentation[cath]->SetHit(par[0],par[1],fZ);
239 Float_t q1=fResponse->IntXY(fSegmentation[cath]);
242 fSegmentation[cath]->SetHit(par[2],par[3],fZ);
243 Float_t q2=fResponse->IntXY(fSegmentation[cath]);
246 value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
248 value = fQtot[1]*(par[5]*q1+(1.-par[5])*q2);
253 AliMUONClusterInput& AliMUONClusterInput
254 ::operator = (const AliMUONClusterInput& rhs)
256 // Dummy assignment operator