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.4 2000/07/03 11:54:57 morsch
19 AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
20 The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
22 Revision 1.3 2000/06/28 15:16:35 morsch
23 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
24 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
25 framework. The changes should have no side effects (mostly dummy arguments).
26 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
27 of chambers with overlapping modules (MakePadHits, Disintegration).
29 Revision 1.2 2000/06/28 12:19:18 morsch
30 More consequent seperation of global input data services (AliMUONClusterInput singleton) and the
31 cluster and hit reconstruction algorithms in AliMUONClusterFinderVS.
32 AliMUONClusterFinderVS becomes the base class for clustering and hit reconstruction.
33 It requires two cathode planes. Small modifications in the code will make it usable for
34 one cathode plane and, hence, more general (for test beam data).
35 AliMUONClusterFinder is now obsolete.
37 Revision 1.1 2000/06/28 08:06:10 morsch
38 Avoid global variables in AliMUONClusterFinderVS by seperating the input data for the fit from the
39 algorithmic part of the class. Input data resides inside the AliMUONClusterInput singleton.
40 It also naturally takes care of the TMinuit instance.
45 #include "AliMUONChamber.h"
46 #include "AliMUONClusterInput.h"
47 #include "AliSegmentation.h"
48 #include "AliMUONResponse.h"
49 #include "AliMUONRawCluster.h"
50 #include "AliMUONDigit.h"
52 #include <TClonesArray.h>
55 ClassImp(AliMUONClusterInput)
57 AliMUONClusterInput* AliMUONClusterInput::fgClusterInput = 0;
58 TMinuit* AliMUONClusterInput::fgMinuit = 0;
60 AliMUONClusterInput* AliMUONClusterInput::Instance()
62 // return pointer to the singleton instance
63 if (fgClusterInput == 0) {
64 fgClusterInput = new AliMUONClusterInput();
65 fgMinuit = new TMinuit(5);
68 return fgClusterInput;
71 void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig1, TClonesArray* dig2)
73 // Set pointer to digits with corresponding segmentations and responses (two cathode planes)
77 fNDigits[0]=dig1->GetEntriesFast();
78 fNDigits[1]=dig2->GetEntriesFast();
81 AliMUONChamber* iChamber;
83 pMUON = (AliMUON*) gAlice->GetModule("MUON");
84 iChamber = &(pMUON->Chamber(chamber));
86 fSegmentation[0]=iChamber->SegmentationModel(1);
87 fSegmentation[1]=iChamber->SegmentationModel(2);
88 fResponse=iChamber->ResponseModel();
92 void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig)
94 // Set pointer to digits with corresponding segmentations and responses (one cathode plane)
97 AliMUONChamber* iChamber;
99 pMUON = (AliMUON*) gAlice->GetModule("MUON");
100 iChamber = &(pMUON->Chamber(chamber));
102 fSegmentation[0]=iChamber->SegmentationModel(1);
103 fResponse=iChamber->ResponseModel();
107 void AliMUONClusterInput::SetCluster(AliMUONRawCluster* cluster)
109 // Set the current cluster
110 printf("\n %p \n", cluster);
113 Int_t i, cath, ix, iy;
115 fNmul[0]=cluster->fMultiplicity[0];
116 fNmul[1]=cluster->fMultiplicity[1];
117 printf("\n %p %p ", fDigits[0], fDigits[1]);
119 for (cath=0; cath<2; cath++) {
121 for (i=0; i<fNmul[cath]; i++) {
123 digit =(AliMUONDigit*)
124 (fDigits[cath]->UncheckedAt(cluster->fIndexMap[i][cath]));
129 fCharge[i][cath] = digit->fSignal;
130 // pad centre coordinates
131 // fSegmentation[cath]->GetPadCxy(ix, iy, x, y);
132 // globals kUsed in fitting functions
135 // total charge per cluster
136 qtot+=fCharge[i][cath];
137 } // loop over cluster digits
139 fChargeTot[cath]=Int_t(qtot);
140 } // loop over cathodes
145 Float_t AliMUONClusterInput::DiscrChargeS1(Int_t i,Double_t *par)
147 // par[0] x-position of cluster
148 // par[1] y-position of cluster
150 fSegmentation[0]->SetPad(fix[i][0], fiy[i][0]);
152 fSegmentation[0]->SetHit(par[0],par[1],0);
153 Float_t q1=fResponse->IntXY(fSegmentation[0]);
155 Float_t value = fQtot[0]*q1;
159 Float_t AliMUONClusterInput::DiscrChargeCombiS1(Int_t i,Double_t *par, Int_t cath)
161 // par[0] x-position of cluster
162 // par[1] y-position of cluster
164 fSegmentation[cath]->SetPad(fix[i][cath], fiy[i][cath]);
166 fSegmentation[cath]->SetHit(par[0],par[1],0);
167 Float_t q1=fResponse->IntXY(fSegmentation[cath]);
169 Float_t value = fQtot[cath]*q1;
174 Float_t AliMUONClusterInput::DiscrChargeS2(Int_t i,Double_t *par)
176 // par[0] x-position of first cluster
177 // par[1] y-position of first cluster
178 // par[2] x-position of second cluster
179 // par[3] y-position of second cluster
180 // par[4] charge fraction of first cluster
181 // 1-par[4] charge fraction of second cluster
183 fSegmentation[0]->SetPad(fix[i][0], fiy[i][0]);
185 fSegmentation[0]->SetHit(par[0],par[1],0);
186 Float_t q1=fResponse->IntXY(fSegmentation[0]);
189 fSegmentation[0]->SetHit(par[2],par[3],0);
190 Float_t q2=fResponse->IntXY(fSegmentation[0]);
192 Float_t value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
196 Float_t AliMUONClusterInput::DiscrChargeCombiS2(Int_t i,Double_t *par, Int_t cath)
198 // par[0] x-position of first cluster
199 // par[1] y-position of first cluster
200 // par[2] x-position of second cluster
201 // par[3] y-position of second cluster
202 // par[4] charge fraction of first cluster
203 // 1-par[4] charge fraction of second cluster
205 fSegmentation[cath]->SetPad(fix[i][cath], fiy[i][cath]);
207 fSegmentation[cath]->SetHit(par[0],par[1],0);
208 Float_t q1=fResponse->IntXY(fSegmentation[cath]);
211 fSegmentation[cath]->SetHit(par[2],par[3],0);
212 Float_t q2=fResponse->IntXY(fSegmentation[cath]);
215 value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
217 value = fQtot[1]*(par[5]*q1+(1.-par[5])*q2);