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.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).
24 Revision 1.3 2000/06/26 10:00:14 pcrochet
25 global variables removed, problem with HP compiler solved (PH)
27 Revision 1.2 2000/06/15 07:58:48 morsch
28 Code from MUON-dev joined
30 Revision 1.1.2.1 2000/06/09 21:47:24 morsch
31 Code from AliMUONSegResTrigger.cxx
37 AliMUONSegResTrigger.cxx,v $
38 Revision 1.1.2.3 2000/04/26 12:32:39 morsch
40 - adapted to the new Trigger chamber geometry
41 - method SetZScale removed
43 Revision 1.1.2.2 2000/02/21 16:13:33 morsch
44 Full cluster simulation activated by uncommenting corresponding lines in IntXY()
46 Revision 1.1.2.1 2000/02/17 14:32:40 morsch
47 Draft version from P. Crochet
51 #include "AliMUONSegmentationTrigger.h"
52 #include "AliMUONTriggerConstants.h"
58 #include "AliMUONChamber.h"
61 ClassImp(AliMUONSegmentationTrigger)
63 //------------------------------------------------------------------
64 void AliMUONSegmentationTrigger::Init(Int_t chamber)
66 // initialize Module geometry
67 cout << "Initialize Trigger Chamber Module Geometry " << "\n";
69 AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON");
70 AliMUONChamber* iChamber=&(pMUON->Chamber(chamber));
72 Float_t zPos=iChamber->Z();
80 Float_t z1PosPlus=z1Pos+dz/2.;
81 Float_t z1PosMinus=z1Pos-dz/2.;
83 Float_t z1pm=z1PosPlus/z1PosMinus;
84 Float_t z1mp=z1PosMinus/z1PosPlus;
86 cout << " fZscale = " << fZscale << "\n";
88 // calculate yCmin and fYcmax
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.;
96 y1Cmin[i]=y1Cmin[j]=-34;
97 y1Cmax[i]=y1Cmax[j]=34;
98 fYcmin[i]=fYcmin[j]=-34.;
100 fYcmax[i]=fYcmax[j]=34.;
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.;
107 fYcmax[i]=fYcmin[i]+68.;
109 y1Cmin[j]=y1Cmax[j+7]*z1mp;
110 y1Cmax[j]=y1Cmin[j]+68.;
112 fYcmax[j]=fYcmin[j]+68.;
114 y1Cmin[i]=y1Cmin[ModuleNumber(42)]+17;
115 y1Cmax[i]=y1Cmin[i]+51.;
117 fYcmax[i]=fYcmin[i]+51.;
119 y1Cmin[j]=y1Cmin[ModuleNumber(-42)]+17;
120 y1Cmax[j]=y1Cmin[j]+51.;
122 fYcmax[j]=fYcmin[j]+51.;
124 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==3) {
125 y1Cmin[i]=y1Cmax[i+7]*z1mp;
126 y1Cmax[i]=y1Cmin[i]+68.;
128 fYcmax[i]=fYcmin[i]+68.;
130 y1Cmin[j]=y1Cmax[j+7]*z1pm;
131 y1Cmax[j]=y1Cmin[j]+68.;
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.;
138 fYcmax[i]=fYcmin[i]+68.;
140 y1Cmin[j]=y1Cmax[j+7]*z1mp;
141 y1Cmax[j]=y1Cmin[j]+68.;
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.;
148 fYcmax[i]=fYcmin[i]+68.;
150 y1Cmin[j]=y1Cmax[j+7]*z1pm;
151 y1Cmax[j]=y1Cmin[j]+68.;
153 fYcmax[j]=fYcmin[j]+68.;
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];
185 cout << "---------------------------------------------------- \n";
189 //------------------------------------------------------------------
190 Int_t AliMUONSegmentationTrigger::ModuleNumber(Int_t imodule){
191 // returns module number (from 0 to 126) corresponding to module imodule
193 for (Int_t i=0; i<AliMUONTriggerConstants::Nmodule(); i++) {
194 if (AliMUONTriggerConstants::ModuleId(i)==imodule) {
202 //------------------------------------------------------------------
203 Float_t AliMUONSegmentationTrigger::StripSizeX(Int_t imodule){
204 // Returns x-strip size for given module imodule
206 Int_t absimodule=TMath::Abs(imodule);
207 Int_t moduleNum=ModuleNumber(imodule);
208 if (absimodule==51) {
211 return TMath::Abs((fYcmax[moduleNum]-fYcmin[moduleNum])/
212 AliMUONTriggerConstants::NstripX(moduleNum));
216 //------------------------------------------------------------------
217 Float_t AliMUONSegmentationTrigger::StripSizeY(Int_t imodule){
218 // Returns y-strip size for given module imodule
220 Int_t absimodule=TMath::Abs(imodule);
221 Int_t moduleNum=ModuleNumber(imodule);
222 if (absimodule==51) {
225 return TMath::Abs((AliMUONTriggerConstants::XcMax(moduleNum) -
226 AliMUONTriggerConstants::XcMin(moduleNum)) /
227 AliMUONTriggerConstants::NstripY(moduleNum));
231 //------------------------------------------------------------------
232 void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit)
234 // Sets virtual hit position, needed for evaluating pad response
235 // outside the tracking program