]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSegmentationTrigger.cxx
Save pythia default decay table at first initialization. Reload at each
[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.5  2000/10/02 16:58:29  egangler
19 Cleaning of the code :
20 -> coding conventions
21 -> void Streamers
22 -> some useless includes removed or replaced by "class" statement
23
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).
29
30 Revision 1.3  2000/06/26 10:00:14  pcrochet
31 global variables removed, problem with HP compiler solved (PH)
32
33 Revision 1.2  2000/06/15 07:58:48  morsch
34 Code from MUON-dev joined
35
36 Revision 1.1.2.1  2000/06/09 21:47:24  morsch
37 Code from AliMUONSegResTrigger.cxx
38
39 */
40
41 /*
42 old Log:
43 AliMUONSegResTrigger.cxx,v $
44 Revision 1.1.2.3  2000/04/26 12:32:39  morsch
45 Mods by P. Crochet:
46 - adapted to the new Trigger chamber geometry
47 - method SetZScale removed
48
49 Revision 1.1.2.2  2000/02/21 16:13:33  morsch
50 Full cluster simulation activated by uncommenting corresponding lines in IntXY()
51
52 Revision 1.1.2.1  2000/02/17 14:32:40  morsch
53 Draft version from P. Crochet
54
55 */
56
57 #include "AliMUONSegmentationTrigger.h"
58 #include "AliMUONTriggerConstants.h"
59 #include "AliRun.h"
60 #include "AliMUON.h"
61 #include <TMath.h>
62 #include <TRandom.h>
63 #include <TArc.h>
64 #include "AliMUONChamber.h"
65 #include <iostream.h>
66
67 ClassImp(AliMUONSegmentationTrigger)
68
69 //------------------------------------------------------------------
70 void AliMUONSegmentationTrigger::Init(Int_t chamber)
71 {
72   // initialize Module geometry
73   cout << "Initialize Trigger Chamber Module Geometry " << "\n";    
74
75   AliMUON *pMUON  = (AliMUON *) gAlice->GetModule("MUON");
76   AliMUONChamber* iChamber=&(pMUON->Chamber(chamber));
77
78   Float_t zPos=iChamber->Z();
79   Float_t z1Pos=1603.5;
80   fZscale = zPos/z1Pos;
81
82   Float_t y1Cmin[126];
83   Float_t y1Cmax[126];
84
85   Float_t dz=7.2;
86   Float_t z1PosPlus=z1Pos+dz/2.;
87   Float_t z1PosMinus=z1Pos-dz/2.;
88
89   Float_t z1pm=z1PosPlus/z1PosMinus;
90   Float_t z1mp=z1PosMinus/z1PosPlus;
91
92   cout << " fZscale = " << fZscale << "\n";
93   
94 // calculate yCmin and fYcmax 
95   Int_t i;  
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.;
101       } else {
102         y1Cmin[i]=y1Cmin[j]=-34;
103         y1Cmax[i]=y1Cmax[j]=34;
104         fYcmin[i]=fYcmin[j]=-34.;
105
106         fYcmax[i]=fYcmax[j]=34.;
107       }
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.;
112         fYcmin[i]=y1Cmin[i];
113         fYcmax[i]=fYcmin[i]+68.;
114
115         y1Cmin[j]=y1Cmax[j+7]*z1mp;
116         y1Cmax[j]=y1Cmin[j]+68.;
117         fYcmin[j]=y1Cmin[j];
118         fYcmax[j]=fYcmin[j]+68.;
119       } else { 
120         y1Cmin[i]=y1Cmin[ModuleNumber(42)]+17;
121         y1Cmax[i]=y1Cmin[i]+51.;
122         fYcmin[i]=y1Cmin[i];
123         fYcmax[i]=fYcmin[i]+51.;
124
125         y1Cmin[j]=y1Cmin[ModuleNumber(-42)]+17;
126         y1Cmax[j]=y1Cmin[j]+51.;
127         fYcmin[j]=y1Cmin[j];
128         fYcmax[j]=fYcmin[j]+51.;
129       }
130     } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==3) { 
131       y1Cmin[i]=y1Cmax[i+7]*z1mp;
132       y1Cmax[i]=y1Cmin[i]+68.;
133       fYcmin[i]=y1Cmin[i];
134       fYcmax[i]=fYcmin[i]+68.;
135
136       y1Cmin[j]=y1Cmax[j+7]*z1pm;
137       y1Cmax[j]=y1Cmin[j]+68.;
138       fYcmin[j]=y1Cmin[j];
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.;
143       fYcmin[i]=y1Cmin[i];
144       fYcmax[i]=fYcmin[i]+68.;
145
146       y1Cmin[j]=y1Cmax[j+7]*z1mp;
147       y1Cmax[j]=y1Cmin[j]+68.;
148       fYcmin[j]=y1Cmin[j];
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.;
153       fYcmin[i]=y1Cmin[i];
154       fYcmax[i]=fYcmin[i]+68.;
155
156       y1Cmin[j]=y1Cmax[j+7]*z1pm;
157       y1Cmax[j]=y1Cmin[j]+68.;
158       fYcmin[j]=y1Cmin[j];
159       fYcmax[j]=fYcmin[j]+68.;
160     }
161   }
162
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];
185     } 
186   }
187
188   fNpx=124;
189   fNpy=64;  
190
191 // Set parent chamber number
192   fChamber=&(pMUON->Chamber(chamber));
193   fId=chamber;
194
195   cout << "---------------------------------------------------- \n";   
196
197 }
198
199 //------------------------------------------------------------------
200 Int_t AliMUONSegmentationTrigger::ModuleNumber(Int_t imodule){
201 // returns module number (from 0 to 126) corresponding to module imodule
202   Int_t imod=0;
203   for (Int_t i=0; i<AliMUONTriggerConstants::Nmodule(); i++) {
204     if (AliMUONTriggerConstants::ModuleId(i)==imodule) { 
205       imod=i;
206       break;
207     }
208   }
209   return imod;
210 }
211
212 //------------------------------------------------------------------
213 Float_t AliMUONSegmentationTrigger::StripSizeX(Int_t imodule){
214 // Returns x-strip size for given module imodule
215
216   Int_t absimodule=TMath::Abs(imodule); 
217   Int_t moduleNum=ModuleNumber(imodule);
218   if (absimodule==51) {
219     return 0; 
220   } else {
221     return TMath::Abs((fYcmax[moduleNum]-fYcmin[moduleNum])/
222                       AliMUONTriggerConstants::NstripX(moduleNum));
223   }  
224 }
225
226 //------------------------------------------------------------------
227 Float_t AliMUONSegmentationTrigger::StripSizeY(Int_t imodule){
228 // Returns y-strip size for given module imodule
229         
230   Int_t absimodule=TMath::Abs(imodule); 
231   Int_t moduleNum=ModuleNumber(imodule);
232   if (absimodule==51) {
233     return 0;
234   } else {
235       return TMath::Abs((AliMUONTriggerConstants::XcMax(moduleNum) - 
236                          AliMUONTriggerConstants::XcMin(moduleNum)) / 
237                         AliMUONTriggerConstants::NstripY(moduleNum));
238   }
239 }
240
241 //------------------------------------------------------------------   
242 void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit)
243 {
244     // Sets virtual hit position, needed for evaluating pad response 
245     // outside the tracking program 
246     
247   fXhit=xhit;
248   fYhit=yhit;
249 }
250
251
252
253
254
255
256
257
258