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.5 2000/10/02 16:58:29 egangler
19 Cleaning of the code :
22 -> some useless includes removed or replaced by "class" statement
24 Revision 1.4 2000/06/29 12:34:09 morsch
25 AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
26 it usable with any other geometry class. The link to the object to which it belongs is
27 established via an index. This assumes that there exists a global geometry manager
28 from which the pointer to the parent object can be obtained (in our case gAlice).
30 Revision 1.3 2000/06/26 10:00:14 pcrochet
31 global variables removed, problem with HP compiler solved (PH)
33 Revision 1.2 2000/06/15 07:58:48 morsch
34 Code from MUON-dev joined
36 Revision 1.1.2.1 2000/06/09 21:47:24 morsch
37 Code from AliMUONSegResTrigger.cxx
43 AliMUONSegResTrigger.cxx,v $
44 Revision 1.1.2.3 2000/04/26 12:32:39 morsch
46 - adapted to the new Trigger chamber geometry
47 - method SetZScale removed
49 Revision 1.1.2.2 2000/02/21 16:13:33 morsch
50 Full cluster simulation activated by uncommenting corresponding lines in IntXY()
52 Revision 1.1.2.1 2000/02/17 14:32:40 morsch
53 Draft version from P. Crochet
57 #include "AliMUONSegmentationTrigger.h"
58 #include "AliMUONTriggerConstants.h"
64 #include "AliMUONChamber.h"
67 ClassImp(AliMUONSegmentationTrigger)
69 //------------------------------------------------------------------
70 void AliMUONSegmentationTrigger::Init(Int_t chamber)
72 // initialize Module geometry
73 cout << "Initialize Trigger Chamber Module Geometry " << "\n";
75 AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON");
76 AliMUONChamber* iChamber=&(pMUON->Chamber(chamber));
78 Float_t zPos=iChamber->Z();
86 Float_t z1PosPlus=z1Pos+dz/2.;
87 Float_t z1PosMinus=z1Pos-dz/2.;
89 Float_t z1pm=z1PosPlus/z1PosMinus;
90 Float_t z1mp=z1PosMinus/z1PosPlus;
92 cout << " fZscale = " << fZscale << "\n";
94 // calculate yCmin and fYcmax
96 for (i=62; i>=0; i--) {
97 Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left
98 if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==5) { // start with middle chamber
99 if (AliMUONTriggerConstants::ModuleId(i)==51) { // special case (empty module)
100 fYcmin[i]=fYcmax[i]=fYcmin[j]=fYcmax[j]=0.;
102 y1Cmin[i]=y1Cmin[j]=-34;
103 y1Cmax[i]=y1Cmax[j]=34;
104 fYcmin[i]=fYcmin[j]=-34.;
106 fYcmax[i]=fYcmax[j]=34.;
108 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==4) { // up
109 if (AliMUONTriggerConstants::ModuleId(i)!=41) {
110 y1Cmin[i]=y1Cmax[i+7]*z1pm;
111 y1Cmax[i]=y1Cmin[i]+68.;
113 fYcmax[i]=fYcmin[i]+68.;
115 y1Cmin[j]=y1Cmax[j+7]*z1mp;
116 y1Cmax[j]=y1Cmin[j]+68.;
118 fYcmax[j]=fYcmin[j]+68.;
120 y1Cmin[i]=y1Cmin[ModuleNumber(42)]+17;
121 y1Cmax[i]=y1Cmin[i]+51.;
123 fYcmax[i]=fYcmin[i]+51.;
125 y1Cmin[j]=y1Cmin[ModuleNumber(-42)]+17;
126 y1Cmax[j]=y1Cmin[j]+51.;
128 fYcmax[j]=fYcmin[j]+51.;
130 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==3) {
131 y1Cmin[i]=y1Cmax[i+7]*z1mp;
132 y1Cmax[i]=y1Cmin[i]+68.;
134 fYcmax[i]=fYcmin[i]+68.;
136 y1Cmin[j]=y1Cmax[j+7]*z1pm;
137 y1Cmax[j]=y1Cmin[j]+68.;
139 fYcmax[j]=fYcmin[j]+68.;
140 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==2) {
141 y1Cmin[i]=y1Cmax[i+7]*z1pm;
142 y1Cmax[i]=y1Cmin[i]+68.;
144 fYcmax[i]=fYcmin[i]+68.;
146 y1Cmin[j]=y1Cmax[j+7]*z1mp;
147 y1Cmax[j]=y1Cmin[j]+68.;
149 fYcmax[j]=fYcmin[j]+68.;
150 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==1) {
151 y1Cmin[i]=y1Cmax[i+7]*z1mp;
152 y1Cmax[i]=y1Cmin[i]+68.;
154 fYcmax[i]=fYcmin[i]+68.;
156 y1Cmin[j]=y1Cmax[j+7]*z1pm;
157 y1Cmax[j]=y1Cmin[j]+68.;
159 fYcmax[j]=fYcmin[j]+68.;
163 for (i=0; i<63; i++) { // second loop (fill lower part)
164 Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left
165 if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==6) {
166 fYcmin[i]=-fYcmax[i-14];
167 fYcmax[i]=-fYcmin[i-14];
168 fYcmin[j]=-fYcmax[j-14];
169 fYcmax[j]=-fYcmin[j-14];
170 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==7) {
171 fYcmin[i]=-fYcmax[i-28];
172 fYcmax[i]=-fYcmin[i-28];
173 fYcmin[j]=-fYcmax[j-28];
174 fYcmax[j]=-fYcmin[j-28];
175 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==8) {
176 fYcmin[i]=-fYcmax[i-42];
177 fYcmax[i]=-fYcmin[i-42];
178 fYcmin[j]=-fYcmax[j-42];
179 fYcmax[j]=-fYcmin[j-42];
180 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==9) {
181 fYcmin[i]=-fYcmax[i-56];
182 fYcmax[i]=-fYcmin[i-56];
183 fYcmin[j]=-fYcmax[j-56];
184 fYcmax[j]=-fYcmin[j-56];
191 // Set parent chamber number
192 fChamber=&(pMUON->Chamber(chamber));
195 cout << "---------------------------------------------------- \n";
199 //------------------------------------------------------------------
200 Int_t AliMUONSegmentationTrigger::ModuleNumber(Int_t imodule){
201 // returns module number (from 0 to 126) corresponding to module imodule
203 for (Int_t i=0; i<AliMUONTriggerConstants::Nmodule(); i++) {
204 if (AliMUONTriggerConstants::ModuleId(i)==imodule) {
212 //------------------------------------------------------------------
213 Float_t AliMUONSegmentationTrigger::StripSizeX(Int_t imodule){
214 // Returns x-strip size for given module imodule
216 Int_t absimodule=TMath::Abs(imodule);
217 Int_t moduleNum=ModuleNumber(imodule);
218 if (absimodule==51) {
221 return TMath::Abs((fYcmax[moduleNum]-fYcmin[moduleNum])/
222 AliMUONTriggerConstants::NstripX(moduleNum));
226 //------------------------------------------------------------------
227 Float_t AliMUONSegmentationTrigger::StripSizeY(Int_t imodule){
228 // Returns y-strip size for given module imodule
230 Int_t absimodule=TMath::Abs(imodule);
231 Int_t moduleNum=ModuleNumber(imodule);
232 if (absimodule==51) {
235 return TMath::Abs((AliMUONTriggerConstants::XcMax(moduleNum) -
236 AliMUONTriggerConstants::XcMin(moduleNum)) /
237 AliMUONTriggerConstants::NstripY(moduleNum));
241 //------------------------------------------------------------------
242 void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit)
244 // Sets virtual hit position, needed for evaluating pad response
245 // outside the tracking program