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.8 2002/10/23 07:24:56 alibrary
19 Introducing Riostream.h
21 Revision 1.7 2001/05/16 14:57:17 alibrary
22 New files for folders and Stack
24 Revision 1.6 2000/11/12 17:17:03 pcrochet
25 BuildGeometry of AliMUON for trigger chambers delegated to AliMUONSegmentationTriggerX (same strategy as for tracking chambers)
27 Revision 1.5 2000/10/02 16:58:29 egangler
28 Cleaning of the code :
31 -> some useless includes removed or replaced by "class" statement
33 Revision 1.4 2000/06/29 12:34:09 morsch
34 AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
35 it usable with any other geometry class. The link to the object to which it belongs is
36 established via an index. This assumes that there exists a global geometry manager
37 from which the pointer to the parent object can be obtained (in our case gAlice).
39 Revision 1.3 2000/06/26 10:00:14 pcrochet
40 global variables removed, problem with HP compiler solved (PH)
42 Revision 1.2 2000/06/15 07:58:48 morsch
43 Code from MUON-dev joined
45 Revision 1.1.2.1 2000/06/09 21:47:24 morsch
46 Code from AliMUONSegResTrigger.cxx
52 AliMUONSegResTrigger.cxx,v $
53 Revision 1.1.2.3 2000/04/26 12:32:39 morsch
55 - adapted to the new Trigger chamber geometry
56 - method SetZScale removed
58 Revision 1.1.2.2 2000/02/21 16:13:33 morsch
59 Full cluster simulation activated by uncommenting corresponding lines in IntXY()
61 Revision 1.1.2.1 2000/02/17 14:32:40 morsch
62 Draft version from P. Crochet
66 #include "AliMUONSegmentationTrigger.h"
67 #include "AliMUONTriggerConstants.h"
73 #include "AliMUONChamber.h"
74 #include <Riostream.h>
76 ClassImp(AliMUONSegmentationTrigger)
78 //------------------------------------------------------------------
79 void AliMUONSegmentationTrigger::Init(Int_t chamber)
81 // initialize Module geometry
82 AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON");
83 AliMUONChamber* iChamber=&(pMUON->Chamber(chamber));
85 if(pMUON->GetDebug()>1) printf("%s: Initialize Trigger Chamber Module Geometry\n",ClassName());
87 Float_t zPos=iChamber->Z();
95 Float_t z1PosPlus=z1Pos+dz/2.;
96 Float_t z1PosMinus=z1Pos-dz/2.;
98 Float_t z1pm=z1PosPlus/z1PosMinus;
99 Float_t z1mp=z1PosMinus/z1PosPlus;
101 if(pMUON->GetDebug()>1) printf("%s: fZscale = %f \n",ClassName(),fZscale);
103 // calculate yCmin and fYcmax
105 for (i=62; i>=0; i--) {
106 Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left
107 if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==5) { // start with middle chamber
108 if (AliMUONTriggerConstants::ModuleId(i)==51) { // special case (empty module)
109 fYcmin[i]=fYcmax[i]=fYcmin[j]=fYcmax[j]=0.;
111 y1Cmin[i]=y1Cmin[j]=-34;
112 y1Cmax[i]=y1Cmax[j]=34;
113 fYcmin[i]=fYcmin[j]=-34.;
115 fYcmax[i]=fYcmax[j]=34.;
117 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==4) { // up
118 if (AliMUONTriggerConstants::ModuleId(i)!=41) {
119 y1Cmin[i]=y1Cmax[i+7]*z1pm;
120 y1Cmax[i]=y1Cmin[i]+68.;
122 fYcmax[i]=fYcmin[i]+68.;
124 y1Cmin[j]=y1Cmax[j+7]*z1mp;
125 y1Cmax[j]=y1Cmin[j]+68.;
127 fYcmax[j]=fYcmin[j]+68.;
129 y1Cmin[i]=y1Cmin[ModuleNumber(42)]+17;
130 y1Cmax[i]=y1Cmin[i]+51.;
132 fYcmax[i]=fYcmin[i]+51.;
134 y1Cmin[j]=y1Cmin[ModuleNumber(-42)]+17;
135 y1Cmax[j]=y1Cmin[j]+51.;
137 fYcmax[j]=fYcmin[j]+51.;
139 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==3) {
140 y1Cmin[i]=y1Cmax[i+7]*z1mp;
141 y1Cmax[i]=y1Cmin[i]+68.;
143 fYcmax[i]=fYcmin[i]+68.;
145 y1Cmin[j]=y1Cmax[j+7]*z1pm;
146 y1Cmax[j]=y1Cmin[j]+68.;
148 fYcmax[j]=fYcmin[j]+68.;
149 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==2) {
150 y1Cmin[i]=y1Cmax[i+7]*z1pm;
151 y1Cmax[i]=y1Cmin[i]+68.;
153 fYcmax[i]=fYcmin[i]+68.;
155 y1Cmin[j]=y1Cmax[j+7]*z1mp;
156 y1Cmax[j]=y1Cmin[j]+68.;
158 fYcmax[j]=fYcmin[j]+68.;
159 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==1) {
160 y1Cmin[i]=y1Cmax[i+7]*z1mp;
161 y1Cmax[i]=y1Cmin[i]+68.;
163 fYcmax[i]=fYcmin[i]+68.;
165 y1Cmin[j]=y1Cmax[j+7]*z1pm;
166 y1Cmax[j]=y1Cmin[j]+68.;
168 fYcmax[j]=fYcmin[j]+68.;
172 for (i=0; i<63; i++) { // second loop (fill lower part)
173 Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left
174 if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==6) {
175 fYcmin[i]=-fYcmax[i-14];
176 fYcmax[i]=-fYcmin[i-14];
177 fYcmin[j]=-fYcmax[j-14];
178 fYcmax[j]=-fYcmin[j-14];
179 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==7) {
180 fYcmin[i]=-fYcmax[i-28];
181 fYcmax[i]=-fYcmin[i-28];
182 fYcmin[j]=-fYcmax[j-28];
183 fYcmax[j]=-fYcmin[j-28];
184 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==8) {
185 fYcmin[i]=-fYcmax[i-42];
186 fYcmax[i]=-fYcmin[i-42];
187 fYcmin[j]=-fYcmax[j-42];
188 fYcmax[j]=-fYcmin[j-42];
189 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==9) {
190 fYcmin[i]=-fYcmax[i-56];
191 fYcmax[i]=-fYcmin[i-56];
192 fYcmin[j]=-fYcmax[j-56];
193 fYcmax[j]=-fYcmin[j-56];
200 // Set parent chamber number
201 fChamber=&(pMUON->Chamber(chamber));
206 //------------------------------------------------------------------
207 Int_t AliMUONSegmentationTrigger::ModuleNumber(Int_t imodule){
208 // returns module number (from 0 to 126) corresponding to module imodule
210 for (Int_t i=0; i<AliMUONTriggerConstants::Nmodule(); i++) {
211 if (AliMUONTriggerConstants::ModuleId(i)==imodule) {
219 //------------------------------------------------------------------
220 Float_t AliMUONSegmentationTrigger::StripSizeX(Int_t imodule){
221 // Returns x-strip size for given module imodule
223 Int_t absimodule=TMath::Abs(imodule);
224 Int_t moduleNum=ModuleNumber(imodule);
225 if (absimodule==51) {
228 return TMath::Abs((fYcmax[moduleNum]-fYcmin[moduleNum])/
229 AliMUONTriggerConstants::NstripX(moduleNum));
233 //------------------------------------------------------------------
234 Float_t AliMUONSegmentationTrigger::StripSizeY(Int_t imodule){
235 // Returns y-strip size for given module imodule
237 Int_t absimodule=TMath::Abs(imodule);
238 Int_t moduleNum=ModuleNumber(imodule);
239 if (absimodule==51) {
242 return TMath::Abs((AliMUONTriggerConstants::XcMax(moduleNum) -
243 AliMUONTriggerConstants::XcMin(moduleNum)) /
244 AliMUONTriggerConstants::NstripY(moduleNum));
248 //------------------------------------------------------------------
249 void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit)
251 // Sets virtual hit position, needed for evaluating pad response
252 // outside the tracking program