]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSegmentationTrigger.cxx
Double inclusion of AliResponse removed.
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentationTrigger.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15
16 /*
17 $Log$
18 Revision 1.4  2000/06/29 12:34:09  morsch
19 AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
20 it usable with any other geometry class. The link to the object to which it belongs is
21 established via an index. This assumes that there exists a global geometry manager
22 from which the pointer to the parent object can be obtained (in our case gAlice).
23
24 Revision 1.3  2000/06/26 10:00:14  pcrochet
25 global variables removed, problem with HP compiler solved (PH)
26
27 Revision 1.2  2000/06/15 07:58:48  morsch
28 Code from MUON-dev joined
29
30 Revision 1.1.2.1  2000/06/09 21:47:24  morsch
31 Code from AliMUONSegResTrigger.cxx
32
33 */
34
35 /*
36 old Log:
37 AliMUONSegResTrigger.cxx,v $
38 Revision 1.1.2.3  2000/04/26 12:32:39  morsch
39 Mods by P. Crochet:
40 - adapted to the new Trigger chamber geometry
41 - method SetZScale removed
42
43 Revision 1.1.2.2  2000/02/21 16:13:33  morsch
44 Full cluster simulation activated by uncommenting corresponding lines in IntXY()
45
46 Revision 1.1.2.1  2000/02/17 14:32:40  morsch
47 Draft version from P. Crochet
48
49 */
50
51 #include "AliMUONSegmentationTrigger.h"
52 #include "AliMUONTriggerConstants.h"
53 #include "AliRun.h"
54 #include "AliMUON.h"
55 #include <TMath.h>
56 #include <TRandom.h>
57 #include <TArc.h>
58 #include "AliMUONChamber.h"
59 #include <iostream.h>
60  
61 ClassImp(AliMUONSegmentationTrigger)
62
63 //------------------------------------------------------------------
64 void AliMUONSegmentationTrigger::Init(Int_t chamber)
65 {
66   // initialize Module geometry
67   cout << "Initialize Trigger Chamber Module Geometry " << "\n";    
68
69   AliMUON *pMUON  = (AliMUON *) gAlice->GetModule("MUON");
70   AliMUONChamber* iChamber=&(pMUON->Chamber(chamber));
71
72   Float_t zPos=iChamber->Z();
73   Float_t z1Pos=1603.5;
74   fZscale = zPos/z1Pos;
75
76   Float_t y1Cmin[126];
77   Float_t y1Cmax[126];
78
79   Float_t dz=7.2;
80   Float_t z1PosPlus=z1Pos+dz/2.;
81   Float_t z1PosMinus=z1Pos-dz/2.;
82
83   Float_t z1pm=z1PosPlus/z1PosMinus;
84   Float_t z1mp=z1PosMinus/z1PosPlus;
85
86   cout << " fZscale = " << fZscale << "\n";
87   
88 // calculate yCmin and fYcmax 
89   Int_t i;  
90   for (i=62; i>=0; i--) {
91     Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i));  // i == right, j == left 
92     if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==5) {  // start with middle chamber
93       if (AliMUONTriggerConstants::ModuleId(i)==51) {         // special case (empty module)
94         fYcmin[i]=fYcmax[i]=fYcmin[j]=fYcmax[j]=0.;
95       } else {
96         y1Cmin[i]=y1Cmin[j]=-34;
97         y1Cmax[i]=y1Cmax[j]=34;
98         fYcmin[i]=fYcmin[j]=-34.;
99
100         fYcmax[i]=fYcmax[j]=34.;
101       }
102     } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==4) { // up
103       if (AliMUONTriggerConstants::ModuleId(i)!=41) {       
104         y1Cmin[i]=y1Cmax[i+7]*z1pm;
105         y1Cmax[i]=y1Cmin[i]+68.;
106         fYcmin[i]=y1Cmin[i];
107         fYcmax[i]=fYcmin[i]+68.;
108
109         y1Cmin[j]=y1Cmax[j+7]*z1mp;
110         y1Cmax[j]=y1Cmin[j]+68.;
111         fYcmin[j]=y1Cmin[j];
112         fYcmax[j]=fYcmin[j]+68.;
113       } else { 
114         y1Cmin[i]=y1Cmin[ModuleNumber(42)]+17;
115         y1Cmax[i]=y1Cmin[i]+51.;
116         fYcmin[i]=y1Cmin[i];
117         fYcmax[i]=fYcmin[i]+51.;
118
119         y1Cmin[j]=y1Cmin[ModuleNumber(-42)]+17;
120         y1Cmax[j]=y1Cmin[j]+51.;
121         fYcmin[j]=y1Cmin[j];
122         fYcmax[j]=fYcmin[j]+51.;
123       }
124     } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==3) { 
125       y1Cmin[i]=y1Cmax[i+7]*z1mp;
126       y1Cmax[i]=y1Cmin[i]+68.;
127       fYcmin[i]=y1Cmin[i];
128       fYcmax[i]=fYcmin[i]+68.;
129
130       y1Cmin[j]=y1Cmax[j+7]*z1pm;
131       y1Cmax[j]=y1Cmin[j]+68.;
132       fYcmin[j]=y1Cmin[j];
133       fYcmax[j]=fYcmin[j]+68.;
134     } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==2) {
135       y1Cmin[i]=y1Cmax[i+7]*z1pm;
136       y1Cmax[i]=y1Cmin[i]+68.;
137       fYcmin[i]=y1Cmin[i];
138       fYcmax[i]=fYcmin[i]+68.;
139
140       y1Cmin[j]=y1Cmax[j+7]*z1mp;
141       y1Cmax[j]=y1Cmin[j]+68.;
142       fYcmin[j]=y1Cmin[j];
143       fYcmax[j]=fYcmin[j]+68.;
144     } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==1) {
145       y1Cmin[i]=y1Cmax[i+7]*z1mp;
146       y1Cmax[i]=y1Cmin[i]+68.;
147       fYcmin[i]=y1Cmin[i];
148       fYcmax[i]=fYcmin[i]+68.;
149
150       y1Cmin[j]=y1Cmax[j+7]*z1pm;
151       y1Cmax[j]=y1Cmin[j]+68.;
152       fYcmin[j]=y1Cmin[j];
153       fYcmax[j]=fYcmin[j]+68.;
154     }
155   }
156
157   for (i=0; i<63; i++) {      // second loop (fill lower part)
158     Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i));  // i == right, j == left 
159     if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==6) { 
160       fYcmin[i]=-fYcmax[i-14];
161       fYcmax[i]=-fYcmin[i-14];
162       fYcmin[j]=-fYcmax[j-14];
163       fYcmax[j]=-fYcmin[j-14];
164     } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==7) { 
165       fYcmin[i]=-fYcmax[i-28];
166       fYcmax[i]=-fYcmin[i-28];
167       fYcmin[j]=-fYcmax[j-28];
168       fYcmax[j]=-fYcmin[j-28];
169     } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==8) { 
170       fYcmin[i]=-fYcmax[i-42];
171       fYcmax[i]=-fYcmin[i-42];
172       fYcmin[j]=-fYcmax[j-42];
173       fYcmax[j]=-fYcmin[j-42];
174     } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==9) { 
175       fYcmin[i]=-fYcmax[i-56];
176       fYcmax[i]=-fYcmin[i-56];
177       fYcmin[j]=-fYcmax[j-56];
178       fYcmax[j]=-fYcmin[j-56];
179     } 
180   }
181
182   fNpx=124;
183   fNpy=64;  
184
185   cout << "---------------------------------------------------- \n";   
186
187 }
188
189 //------------------------------------------------------------------
190 Int_t AliMUONSegmentationTrigger::ModuleNumber(Int_t imodule){
191 // returns module number (from 0 to 126) corresponding to module imodule
192   Int_t imod=0;
193   for (Int_t i=0; i<AliMUONTriggerConstants::Nmodule(); i++) {
194     if (AliMUONTriggerConstants::ModuleId(i)==imodule) { 
195       imod=i;
196       break;
197     }
198   }
199   return imod;
200 }
201
202 //------------------------------------------------------------------
203 Float_t AliMUONSegmentationTrigger::StripSizeX(Int_t imodule){
204 // Returns x-strip size for given module imodule
205
206   Int_t absimodule=TMath::Abs(imodule); 
207   Int_t moduleNum=ModuleNumber(imodule);
208   if (absimodule==51) {
209     return 0; 
210   } else {
211     return TMath::Abs((fYcmax[moduleNum]-fYcmin[moduleNum])/
212                       AliMUONTriggerConstants::NstripX(moduleNum));
213   }  
214 }
215
216 //------------------------------------------------------------------
217 Float_t AliMUONSegmentationTrigger::StripSizeY(Int_t imodule){
218 // Returns y-strip size for given module imodule
219         
220   Int_t absimodule=TMath::Abs(imodule); 
221   Int_t moduleNum=ModuleNumber(imodule);
222   if (absimodule==51) {
223     return 0;
224   } else {
225       return TMath::Abs((AliMUONTriggerConstants::XcMax(moduleNum) - 
226                          AliMUONTriggerConstants::XcMin(moduleNum)) / 
227                         AliMUONTriggerConstants::NstripY(moduleNum));
228   }
229 }
230
231 //------------------------------------------------------------------   
232 void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit)
233 {
234     // Sets virtual hit position, needed for evaluating pad response 
235     // outside the tracking program 
236     
237   fXhit=xhit;
238   fYhit=yhit;
239 }
240
241
242
243
244
245
246
247
248