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.6 2000/11/12 17:17:03 pcrochet
19 BuildGeometry of AliMUON for trigger chambers delegated to AliMUONSegmentationTriggerX (same strategy as for tracking chambers)
21 Revision 1.5 2000/10/02 16:58:29 egangler
22 Cleaning of the code :
25 -> some useless includes removed or replaced by "class" statement
27 Revision 1.4 2000/06/29 12:34:09 morsch
28 AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
29 it usable with any other geometry class. The link to the object to which it belongs is
30 established via an index. This assumes that there exists a global geometry manager
31 from which the pointer to the parent object can be obtained (in our case gAlice).
33 Revision 1.3 2000/06/26 10:00:14 pcrochet
34 global variables removed, problem with HP compiler solved (PH)
36 Revision 1.2 2000/06/15 07:58:48 morsch
37 Code from MUON-dev joined
39 Revision 1.1.2.1 2000/06/09 21:47:24 morsch
40 Code from AliMUONSegResTrigger.cxx
46 AliMUONSegResTrigger.cxx,v $
47 Revision 1.1.2.3 2000/04/26 12:32:39 morsch
49 - adapted to the new Trigger chamber geometry
50 - method SetZScale removed
52 Revision 1.1.2.2 2000/02/21 16:13:33 morsch
53 Full cluster simulation activated by uncommenting corresponding lines in IntXY()
55 Revision 1.1.2.1 2000/02/17 14:32:40 morsch
56 Draft version from P. Crochet
60 #include "AliMUONSegmentationTrigger.h"
61 #include "AliMUONTriggerConstants.h"
67 #include "AliMUONChamber.h"
70 ClassImp(AliMUONSegmentationTrigger)
72 //------------------------------------------------------------------
73 void AliMUONSegmentationTrigger::Init(Int_t chamber)
75 // initialize Module geometry
76 AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON");
77 AliMUONChamber* iChamber=&(pMUON->Chamber(chamber));
79 if(pMUON->GetDebug()) cout << ClassName() << ": Initialize Trigger Chamber Module Geometry " << "\n";
81 Float_t zPos=iChamber->Z();
89 Float_t z1PosPlus=z1Pos+dz/2.;
90 Float_t z1PosMinus=z1Pos-dz/2.;
92 Float_t z1pm=z1PosPlus/z1PosMinus;
93 Float_t z1mp=z1PosMinus/z1PosPlus;
95 if(pMUON->GetDebug()) cout << ClassName() << ": fZscale = " << fZscale << "\n";
97 // calculate yCmin and fYcmax
99 for (i=62; i>=0; i--) {
100 Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left
101 if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==5) { // start with middle chamber
102 if (AliMUONTriggerConstants::ModuleId(i)==51) { // special case (empty module)
103 fYcmin[i]=fYcmax[i]=fYcmin[j]=fYcmax[j]=0.;
105 y1Cmin[i]=y1Cmin[j]=-34;
106 y1Cmax[i]=y1Cmax[j]=34;
107 fYcmin[i]=fYcmin[j]=-34.;
109 fYcmax[i]=fYcmax[j]=34.;
111 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==4) { // up
112 if (AliMUONTriggerConstants::ModuleId(i)!=41) {
113 y1Cmin[i]=y1Cmax[i+7]*z1pm;
114 y1Cmax[i]=y1Cmin[i]+68.;
116 fYcmax[i]=fYcmin[i]+68.;
118 y1Cmin[j]=y1Cmax[j+7]*z1mp;
119 y1Cmax[j]=y1Cmin[j]+68.;
121 fYcmax[j]=fYcmin[j]+68.;
123 y1Cmin[i]=y1Cmin[ModuleNumber(42)]+17;
124 y1Cmax[i]=y1Cmin[i]+51.;
126 fYcmax[i]=fYcmin[i]+51.;
128 y1Cmin[j]=y1Cmin[ModuleNumber(-42)]+17;
129 y1Cmax[j]=y1Cmin[j]+51.;
131 fYcmax[j]=fYcmin[j]+51.;
133 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==3) {
134 y1Cmin[i]=y1Cmax[i+7]*z1mp;
135 y1Cmax[i]=y1Cmin[i]+68.;
137 fYcmax[i]=fYcmin[i]+68.;
139 y1Cmin[j]=y1Cmax[j+7]*z1pm;
140 y1Cmax[j]=y1Cmin[j]+68.;
142 fYcmax[j]=fYcmin[j]+68.;
143 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==2) {
144 y1Cmin[i]=y1Cmax[i+7]*z1pm;
145 y1Cmax[i]=y1Cmin[i]+68.;
147 fYcmax[i]=fYcmin[i]+68.;
149 y1Cmin[j]=y1Cmax[j+7]*z1mp;
150 y1Cmax[j]=y1Cmin[j]+68.;
152 fYcmax[j]=fYcmin[j]+68.;
153 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==1) {
154 y1Cmin[i]=y1Cmax[i+7]*z1mp;
155 y1Cmax[i]=y1Cmin[i]+68.;
157 fYcmax[i]=fYcmin[i]+68.;
159 y1Cmin[j]=y1Cmax[j+7]*z1pm;
160 y1Cmax[j]=y1Cmin[j]+68.;
162 fYcmax[j]=fYcmin[j]+68.;
166 for (i=0; i<63; i++) { // second loop (fill lower part)
167 Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left
168 if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==6) {
169 fYcmin[i]=-fYcmax[i-14];
170 fYcmax[i]=-fYcmin[i-14];
171 fYcmin[j]=-fYcmax[j-14];
172 fYcmax[j]=-fYcmin[j-14];
173 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==7) {
174 fYcmin[i]=-fYcmax[i-28];
175 fYcmax[i]=-fYcmin[i-28];
176 fYcmin[j]=-fYcmax[j-28];
177 fYcmax[j]=-fYcmin[j-28];
178 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==8) {
179 fYcmin[i]=-fYcmax[i-42];
180 fYcmax[i]=-fYcmin[i-42];
181 fYcmin[j]=-fYcmax[j-42];
182 fYcmax[j]=-fYcmin[j-42];
183 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==9) {
184 fYcmin[i]=-fYcmax[i-56];
185 fYcmax[i]=-fYcmin[i-56];
186 fYcmin[j]=-fYcmax[j-56];
187 fYcmax[j]=-fYcmin[j-56];
194 // Set parent chamber number
195 fChamber=&(pMUON->Chamber(chamber));
198 if(pMUON->GetDebug()) cout << ClassName() << ": ---------------------------------------------------- \n";
202 //------------------------------------------------------------------
203 Int_t AliMUONSegmentationTrigger::ModuleNumber(Int_t imodule){
204 // returns module number (from 0 to 126) corresponding to module imodule
206 for (Int_t i=0; i<AliMUONTriggerConstants::Nmodule(); i++) {
207 if (AliMUONTriggerConstants::ModuleId(i)==imodule) {
215 //------------------------------------------------------------------
216 Float_t AliMUONSegmentationTrigger::StripSizeX(Int_t imodule){
217 // Returns x-strip size for given module imodule
219 Int_t absimodule=TMath::Abs(imodule);
220 Int_t moduleNum=ModuleNumber(imodule);
221 if (absimodule==51) {
224 return TMath::Abs((fYcmax[moduleNum]-fYcmin[moduleNum])/
225 AliMUONTriggerConstants::NstripX(moduleNum));
229 //------------------------------------------------------------------
230 Float_t AliMUONSegmentationTrigger::StripSizeY(Int_t imodule){
231 // Returns y-strip size for given module imodule
233 Int_t absimodule=TMath::Abs(imodule);
234 Int_t moduleNum=ModuleNumber(imodule);
235 if (absimodule==51) {
238 return TMath::Abs((AliMUONTriggerConstants::XcMax(moduleNum) -
239 AliMUONTriggerConstants::XcMin(moduleNum)) /
240 AliMUONTriggerConstants::NstripY(moduleNum));
244 //------------------------------------------------------------------
245 void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit)
247 // Sets virtual hit position, needed for evaluating pad response
248 // outside the tracking program