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.3 2000/06/26 10:00:14 pcrochet
19 global variables removed, problem with HP compiler solved (PH)
21 Revision 1.2 2000/06/15 07:58:48 morsch
22 Code from MUON-dev joined
24 Revision 1.1.2.1 2000/06/09 21:47:24 morsch
25 Code from AliMUONSegResTrigger.cxx
31 AliMUONSegResTrigger.cxx,v $
32 Revision 1.1.2.3 2000/04/26 12:32:39 morsch
34 - adapted to the new Trigger chamber geometry
35 - method SetZScale removed
37 Revision 1.1.2.2 2000/02/21 16:13:33 morsch
38 Full cluster simulation activated by uncommenting corresponding lines in IntXY()
40 Revision 1.1.2.1 2000/02/17 14:32:40 morsch
41 Draft version from P. Crochet
45 #include "AliMUONSegmentationTrigger.h"
46 #include "AliMUONTriggerConstants.h"
52 #include "AliMUONChamber.h"
55 ClassImp(AliMUONSegmentationTrigger)
57 //------------------------------------------------------------------
58 void AliMUONSegmentationTrigger::Init(Int_t chamber)
60 // initialize Module geometry
61 cout << "Initialize Trigger Chamber Module Geometry " << "\n";
63 AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON");
64 AliMUONChamber* iChamber=&(pMUON->Chamber(chamber));
66 Float_t zPos=iChamber->Z();
74 Float_t z1PosPlus=z1Pos+dz/2.;
75 Float_t z1PosMinus=z1Pos-dz/2.;
77 Float_t z1pm=z1PosPlus/z1PosMinus;
78 Float_t z1mp=z1PosMinus/z1PosPlus;
80 cout << " fZscale = " << fZscale << "\n";
82 // calculate yCmin and fYcmax
84 for (i=62; i>=0; i--) {
85 Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left
86 if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==5) { // start with middle chamber
87 if (AliMUONTriggerConstants::ModuleId(i)==51) { // special case (empty module)
88 fYcmin[i]=fYcmax[i]=fYcmin[j]=fYcmax[j]=0.;
90 y1Cmin[i]=y1Cmin[j]=-34;
91 y1Cmax[i]=y1Cmax[j]=34;
92 fYcmin[i]=fYcmin[j]=-34.;
94 fYcmax[i]=fYcmax[j]=34.;
96 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==4) { // up
97 if (AliMUONTriggerConstants::ModuleId(i)!=41) {
98 y1Cmin[i]=y1Cmax[i+7]*z1pm;
99 y1Cmax[i]=y1Cmin[i]+68.;
101 fYcmax[i]=fYcmin[i]+68.;
103 y1Cmin[j]=y1Cmax[j+7]*z1mp;
104 y1Cmax[j]=y1Cmin[j]+68.;
106 fYcmax[j]=fYcmin[j]+68.;
108 y1Cmin[i]=y1Cmin[ModuleNumber(42)]+17;
109 y1Cmax[i]=y1Cmin[i]+51.;
111 fYcmax[i]=fYcmin[i]+51.;
113 y1Cmin[j]=y1Cmin[ModuleNumber(-42)]+17;
114 y1Cmax[j]=y1Cmin[j]+51.;
116 fYcmax[j]=fYcmin[j]+51.;
118 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==3) {
119 y1Cmin[i]=y1Cmax[i+7]*z1mp;
120 y1Cmax[i]=y1Cmin[i]+68.;
122 fYcmax[i]=fYcmin[i]+68.;
124 y1Cmin[j]=y1Cmax[j+7]*z1pm;
125 y1Cmax[j]=y1Cmin[j]+68.;
127 fYcmax[j]=fYcmin[j]+68.;
128 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==2) {
129 y1Cmin[i]=y1Cmax[i+7]*z1pm;
130 y1Cmax[i]=y1Cmin[i]+68.;
132 fYcmax[i]=fYcmin[i]+68.;
134 y1Cmin[j]=y1Cmax[j+7]*z1mp;
135 y1Cmax[j]=y1Cmin[j]+68.;
137 fYcmax[j]=fYcmin[j]+68.;
138 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==1) {
139 y1Cmin[i]=y1Cmax[i+7]*z1mp;
140 y1Cmax[i]=y1Cmin[i]+68.;
142 fYcmax[i]=fYcmin[i]+68.;
144 y1Cmin[j]=y1Cmax[j+7]*z1pm;
145 y1Cmax[j]=y1Cmin[j]+68.;
147 fYcmax[j]=fYcmin[j]+68.;
151 for (i=0; i<63; i++) { // second loop (fill lower part)
152 Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left
153 if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==6) {
154 fYcmin[i]=-fYcmax[i-14];
155 fYcmax[i]=-fYcmin[i-14];
156 fYcmin[j]=-fYcmax[j-14];
157 fYcmax[j]=-fYcmin[j-14];
158 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==7) {
159 fYcmin[i]=-fYcmax[i-28];
160 fYcmax[i]=-fYcmin[i-28];
161 fYcmin[j]=-fYcmax[j-28];
162 fYcmax[j]=-fYcmin[j-28];
163 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==8) {
164 fYcmin[i]=-fYcmax[i-42];
165 fYcmax[i]=-fYcmin[i-42];
166 fYcmin[j]=-fYcmax[j-42];
167 fYcmax[j]=-fYcmin[j-42];
168 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==9) {
169 fYcmin[i]=-fYcmax[i-56];
170 fYcmax[i]=-fYcmin[i-56];
171 fYcmin[j]=-fYcmax[j-56];
172 fYcmax[j]=-fYcmin[j-56];
179 cout << "---------------------------------------------------- \n";
183 //------------------------------------------------------------------
184 Int_t AliMUONSegmentationTrigger::ModuleNumber(Int_t imodule){
185 // returns module number (from 0 to 126) corresponding to module imodule
187 for (Int_t i=0; i<AliMUONTriggerConstants::Nmodule(); i++) {
188 if (AliMUONTriggerConstants::ModuleId(i)==imodule) {
196 //------------------------------------------------------------------
197 Float_t AliMUONSegmentationTrigger::StripSizeX(Int_t imodule){
198 // Returns x-strip size for given module imodule
200 Int_t absimodule=TMath::Abs(imodule);
201 Int_t moduleNum=ModuleNumber(imodule);
202 if (absimodule==51) {
205 return TMath::Abs((fYcmax[moduleNum]-fYcmin[moduleNum])/
206 AliMUONTriggerConstants::NstripX(moduleNum));
210 //------------------------------------------------------------------
211 Float_t AliMUONSegmentationTrigger::StripSizeY(Int_t imodule){
212 // Returns y-strip size for given module imodule
214 Int_t absimodule=TMath::Abs(imodule);
215 Int_t moduleNum=ModuleNumber(imodule);
216 if (absimodule==51) {
219 return TMath::Abs((AliMUONTriggerConstants::XcMax(moduleNum) -
220 AliMUONTriggerConstants::XcMin(moduleNum)) /
221 AliMUONTriggerConstants::NstripY(moduleNum));
225 //------------------------------------------------------------------
226 void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit)
228 // Sets virtual hit position, needed for evaluating pad response
229 // outside the tracking program