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.7 2001/05/16 14:57:17 alibrary
19 New files for folders and Stack
21 Revision 1.6 2000/11/12 17:17:03 pcrochet
22 BuildGeometry of AliMUON for trigger chambers delegated to AliMUONSegmentationTriggerX (same strategy as for tracking chambers)
24 Revision 1.5 2000/10/02 16:58:29 egangler
25 Cleaning of the code :
28 -> some useless includes removed or replaced by "class" statement
30 Revision 1.4 2000/06/29 12:34:09 morsch
31 AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
32 it usable with any other geometry class. The link to the object to which it belongs is
33 established via an index. This assumes that there exists a global geometry manager
34 from which the pointer to the parent object can be obtained (in our case gAlice).
36 Revision 1.3 2000/06/26 10:00:14 pcrochet
37 global variables removed, problem with HP compiler solved (PH)
39 Revision 1.2 2000/06/15 07:58:48 morsch
40 Code from MUON-dev joined
42 Revision 1.1.2.1 2000/06/09 21:47:24 morsch
43 Code from AliMUONSegResTrigger.cxx
49 AliMUONSegResTrigger.cxx,v $
50 Revision 1.1.2.3 2000/04/26 12:32:39 morsch
52 - adapted to the new Trigger chamber geometry
53 - method SetZScale removed
55 Revision 1.1.2.2 2000/02/21 16:13:33 morsch
56 Full cluster simulation activated by uncommenting corresponding lines in IntXY()
58 Revision 1.1.2.1 2000/02/17 14:32:40 morsch
59 Draft version from P. Crochet
63 #include "AliMUONSegmentationTrigger.h"
64 #include "AliMUONTriggerConstants.h"
70 #include "AliMUONChamber.h"
71 #include <Riostream.h>
73 ClassImp(AliMUONSegmentationTrigger)
75 //------------------------------------------------------------------
76 void AliMUONSegmentationTrigger::Init(Int_t chamber)
78 // initialize Module geometry
79 AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON");
80 AliMUONChamber* iChamber=&(pMUON->Chamber(chamber));
82 if(pMUON->GetDebug()) cout << ClassName() << ": Initialize Trigger Chamber Module Geometry " << "\n";
84 Float_t zPos=iChamber->Z();
92 Float_t z1PosPlus=z1Pos+dz/2.;
93 Float_t z1PosMinus=z1Pos-dz/2.;
95 Float_t z1pm=z1PosPlus/z1PosMinus;
96 Float_t z1mp=z1PosMinus/z1PosPlus;
98 if(pMUON->GetDebug()) cout << ClassName() << ": fZscale = " << fZscale << "\n";
100 // calculate yCmin and fYcmax
102 for (i=62; i>=0; i--) {
103 Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left
104 if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==5) { // start with middle chamber
105 if (AliMUONTriggerConstants::ModuleId(i)==51) { // special case (empty module)
106 fYcmin[i]=fYcmax[i]=fYcmin[j]=fYcmax[j]=0.;
108 y1Cmin[i]=y1Cmin[j]=-34;
109 y1Cmax[i]=y1Cmax[j]=34;
110 fYcmin[i]=fYcmin[j]=-34.;
112 fYcmax[i]=fYcmax[j]=34.;
114 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==4) { // up
115 if (AliMUONTriggerConstants::ModuleId(i)!=41) {
116 y1Cmin[i]=y1Cmax[i+7]*z1pm;
117 y1Cmax[i]=y1Cmin[i]+68.;
119 fYcmax[i]=fYcmin[i]+68.;
121 y1Cmin[j]=y1Cmax[j+7]*z1mp;
122 y1Cmax[j]=y1Cmin[j]+68.;
124 fYcmax[j]=fYcmin[j]+68.;
126 y1Cmin[i]=y1Cmin[ModuleNumber(42)]+17;
127 y1Cmax[i]=y1Cmin[i]+51.;
129 fYcmax[i]=fYcmin[i]+51.;
131 y1Cmin[j]=y1Cmin[ModuleNumber(-42)]+17;
132 y1Cmax[j]=y1Cmin[j]+51.;
134 fYcmax[j]=fYcmin[j]+51.;
136 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==3) {
137 y1Cmin[i]=y1Cmax[i+7]*z1mp;
138 y1Cmax[i]=y1Cmin[i]+68.;
140 fYcmax[i]=fYcmin[i]+68.;
142 y1Cmin[j]=y1Cmax[j+7]*z1pm;
143 y1Cmax[j]=y1Cmin[j]+68.;
145 fYcmax[j]=fYcmin[j]+68.;
146 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==2) {
147 y1Cmin[i]=y1Cmax[i+7]*z1pm;
148 y1Cmax[i]=y1Cmin[i]+68.;
150 fYcmax[i]=fYcmin[i]+68.;
152 y1Cmin[j]=y1Cmax[j+7]*z1mp;
153 y1Cmax[j]=y1Cmin[j]+68.;
155 fYcmax[j]=fYcmin[j]+68.;
156 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==1) {
157 y1Cmin[i]=y1Cmax[i+7]*z1mp;
158 y1Cmax[i]=y1Cmin[i]+68.;
160 fYcmax[i]=fYcmin[i]+68.;
162 y1Cmin[j]=y1Cmax[j+7]*z1pm;
163 y1Cmax[j]=y1Cmin[j]+68.;
165 fYcmax[j]=fYcmin[j]+68.;
169 for (i=0; i<63; i++) { // second loop (fill lower part)
170 Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left
171 if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==6) {
172 fYcmin[i]=-fYcmax[i-14];
173 fYcmax[i]=-fYcmin[i-14];
174 fYcmin[j]=-fYcmax[j-14];
175 fYcmax[j]=-fYcmin[j-14];
176 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==7) {
177 fYcmin[i]=-fYcmax[i-28];
178 fYcmax[i]=-fYcmin[i-28];
179 fYcmin[j]=-fYcmax[j-28];
180 fYcmax[j]=-fYcmin[j-28];
181 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==8) {
182 fYcmin[i]=-fYcmax[i-42];
183 fYcmax[i]=-fYcmin[i-42];
184 fYcmin[j]=-fYcmax[j-42];
185 fYcmax[j]=-fYcmin[j-42];
186 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==9) {
187 fYcmin[i]=-fYcmax[i-56];
188 fYcmax[i]=-fYcmin[i-56];
189 fYcmin[j]=-fYcmax[j-56];
190 fYcmax[j]=-fYcmin[j-56];
197 // Set parent chamber number
198 fChamber=&(pMUON->Chamber(chamber));
201 if(pMUON->GetDebug()) cout << ClassName() << ": ---------------------------------------------------- \n";
205 //------------------------------------------------------------------
206 Int_t AliMUONSegmentationTrigger::ModuleNumber(Int_t imodule){
207 // returns module number (from 0 to 126) corresponding to module imodule
209 for (Int_t i=0; i<AliMUONTriggerConstants::Nmodule(); i++) {
210 if (AliMUONTriggerConstants::ModuleId(i)==imodule) {
218 //------------------------------------------------------------------
219 Float_t AliMUONSegmentationTrigger::StripSizeX(Int_t imodule){
220 // Returns x-strip size for given module imodule
222 Int_t absimodule=TMath::Abs(imodule);
223 Int_t moduleNum=ModuleNumber(imodule);
224 if (absimodule==51) {
227 return TMath::Abs((fYcmax[moduleNum]-fYcmin[moduleNum])/
228 AliMUONTriggerConstants::NstripX(moduleNum));
232 //------------------------------------------------------------------
233 Float_t AliMUONSegmentationTrigger::StripSizeY(Int_t imodule){
234 // Returns y-strip size for given module imodule
236 Int_t absimodule=TMath::Abs(imodule);
237 Int_t moduleNum=ModuleNumber(imodule);
238 if (absimodule==51) {
241 return TMath::Abs((AliMUONTriggerConstants::XcMax(moduleNum) -
242 AliMUONTriggerConstants::XcMin(moduleNum)) /
243 AliMUONTriggerConstants::NstripY(moduleNum));
247 //------------------------------------------------------------------
248 void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit)
250 // Sets virtual hit position, needed for evaluating pad response
251 // outside the tracking program