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.10 2001/03/20 13:33:23 egangler
21 Revision 1.9 2001/01/26 21:38:49 morsch
22 Use access functions to AliMUONDigit member data.
24 Revision 1.8 2001/01/23 18:58:19 hristov
25 Initialisation of some pointers
27 Revision 1.7 2000/12/21 22:14:38 morsch
28 Clean-up of coding rule violations.
30 Revision 1.6 2000/10/06 09:04:50 morsch
32 - Dummy z-arguments in GetPadI, SetHit, FirstPad replaced by real z-coordinate
33 to make code work with slat chambers.
35 Revision 1.5 2000/10/02 16:58:29 egangler
36 Cleaning of the code :
39 -> some useless includes removed or replaced by "class" statement
41 Revision 1.4 2000/07/03 11:54:57 morsch
42 AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
43 The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
45 Revision 1.3 2000/06/28 15:16:35 morsch
46 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
47 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
48 framework. The changes should have no side effects (mostly dummy arguments).
49 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
50 of chambers with overlapping modules (MakePadHits, Disintegration).
52 Revision 1.2 2000/06/28 12:19:18 morsch
53 More consequent seperation of global input data services (AliMUONClusterInput singleton) and the
54 cluster and hit reconstruction algorithms in AliMUONClusterFinderVS.
55 AliMUONClusterFinderVS becomes the base class for clustering and hit reconstruction.
56 It requires two cathode planes. Small modifications in the code will make it usable for
57 one cathode plane and, hence, more general (for test beam data).
58 AliMUONClusterFinder is now obsolete.
60 Revision 1.1 2000/06/28 08:06:10 morsch
61 Avoid global variables in AliMUONClusterFinderVS by seperating the input data for the fit from the
62 algorithmic part of the class. Input data resides inside the AliMUONClusterInput singleton.
63 It also naturally takes care of the TMinuit instance.
68 #include "AliMUONChamber.h"
69 #include "AliMUONClusterInput.h"
70 #include "AliSegmentation.h"
71 #include "AliMUONResponse.h"
72 #include "AliMUONRawCluster.h"
73 #include "AliMUONDigit.h"
75 #include <TClonesArray.h>
78 ClassImp(AliMUONClusterInput)
80 AliMUONClusterInput* AliMUONClusterInput::fgClusterInput = 0;
81 TMinuit* AliMUONClusterInput::fgMinuit = 0;
83 AliMUONClusterInput::AliMUONClusterInput(){
94 AliMUONClusterInput* AliMUONClusterInput::Instance()
96 // return pointer to the singleton instance
97 if (fgClusterInput == 0) {
98 fgClusterInput = new AliMUONClusterInput();
99 fgMinuit = new TMinuit(8);
102 return fgClusterInput;
105 AliMUONClusterInput::~AliMUONClusterInput()
112 void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig1, TClonesArray* dig2)
114 // Set pointer to digits with corresponding segmentations and responses (two cathode planes)
118 fNDigits[0]=dig1->GetEntriesFast();
119 fNDigits[1]=dig2->GetEntriesFast();
122 AliMUONChamber* iChamber;
124 pMUON = (AliMUON*) gAlice->GetModule("MUON");
125 iChamber = &(pMUON->Chamber(chamber));
127 fSegmentation[0]=iChamber->SegmentationModel(1);
128 fSegmentation[1]=iChamber->SegmentationModel(2);
129 fResponse=iChamber->ResponseModel();
133 void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig)
135 // Set pointer to digits with corresponding segmentations and responses (one cathode plane)
138 AliMUONChamber* iChamber;
140 pMUON = (AliMUON*) gAlice->GetModule("MUON");
141 iChamber = &(pMUON->Chamber(chamber));
143 fSegmentation[0]=iChamber->SegmentationModel(1);
144 fResponse=iChamber->ResponseModel();
148 void AliMUONClusterInput::SetCluster(AliMUONRawCluster* cluster)
150 // Set the current cluster
151 printf("\n %p \n", cluster);
154 Int_t i, cath, ix, iy;
156 fNmul[0]=cluster->fMultiplicity[0];
157 fNmul[1]=cluster->fMultiplicity[1];
158 printf("\n %p %p ", fDigits[0], fDigits[1]);
160 for (cath=0; cath<2; cath++) {
162 for (i=0; i<fNmul[cath]; i++) {
164 digit =(AliMUONDigit*)
165 (fDigits[cath]->UncheckedAt(cluster->fIndexMap[i][cath]));
170 fCharge[i][cath] = digit->Signal();
171 // pad centre coordinates
172 // fSegmentation[cath]->GetPadCxy(ix, iy, x, y);
173 // globals kUsed in fitting functions
176 // total charge per cluster
177 qtot+=fCharge[i][cath];
180 fSegmentation[cath]->GetPadC(ix,iy,xc,yc,fZ);
181 } // loop over cluster digits
183 fChargeTot[cath]=Int_t(qtot);
184 } // loop over cathodes
189 Float_t AliMUONClusterInput::DiscrChargeS1(Int_t i,Double_t *par)
191 // Compute the charge on first cathod only.
192 return DiscrChargeCombiS1(i,par,0);
195 Float_t AliMUONClusterInput::DiscrChargeCombiS1(Int_t i,Double_t *par, Int_t cath)
197 // par[0] x-position of cluster
198 // par[1] y-position of cluster
200 fSegmentation[cath]->SetPad(fix[i][cath], fiy[i][cath]);
202 fSegmentation[cath]->SetHit(par[0],par[1],fZ);
203 Float_t q1=fResponse->IntXY(fSegmentation[cath]);
205 Float_t value = fQtot[cath]*q1;
210 Float_t AliMUONClusterInput::DiscrChargeS2(Int_t i,Double_t *par)
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[0]->SetPad(fix[i][0], fiy[i][0]);
221 fSegmentation[0]->SetHit(par[0],par[1],fZ);
222 Float_t q1=fResponse->IntXY(fSegmentation[0]);
225 fSegmentation[0]->SetHit(par[2],par[3],fZ);
226 Float_t q2=fResponse->IntXY(fSegmentation[0]);
228 Float_t value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
232 Float_t AliMUONClusterInput::DiscrChargeCombiS2(Int_t i,Double_t *par, Int_t cath)
234 // par[0] x-position of first cluster
235 // par[1] y-position of first cluster
236 // par[2] x-position of second cluster
237 // par[3] y-position of second cluster
238 // par[4] charge fraction of first cluster - first cathode
239 // 1-par[4] charge fraction of second cluster
240 // par[5] charge fraction of first cluster - second cathode
242 fSegmentation[cath]->SetPad(fix[i][cath], fiy[i][cath]);
244 fSegmentation[cath]->SetHit(par[0],par[1],fZ);
245 Float_t q1=fResponse->IntXY(fSegmentation[cath]);
248 fSegmentation[cath]->SetHit(par[2],par[3],fZ);
249 Float_t q2=fResponse->IntXY(fSegmentation[cath]);
252 value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
254 value = fQtot[1]*(par[5]*q1+(1.-par[5])*q2);
259 AliMUONClusterInput& AliMUONClusterInput
260 ::operator = (const AliMUONClusterInput& rhs)
262 // Dummy assignment operator