Add some charmed and bottom baryons to the particle list (TDatabasePDG). This
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentationTriggerX.cxx
CommitLineData
a9e2aefa 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/*
17$Log$
3f2cdba8 18Revision 1.2 2000/06/15 07:58:48 morsch
19Code from MUON-dev joined
20
a9e2aefa 21Revision 1.1.2.1 2000/06/09 21:51:03 morsch
22Code from AliMUONSegResTrigger.cxx
23
24*/
25
26
3f2cdba8 27
a9e2aefa 28/*
29Old Log:
30Revision 1.1.2.4 2000/04/26 12:33:25 morsch
31Minor changes in some methods (CP)
32
33Revision 1.1.2.3 2000/03/20 18:14:16 morsch
34Missing sector added.
35
36Revision 1.1.2.2 2000/02/20 07:50:49 morsch
37Bugs in Dpx, Dpy and ISector methods corrected (P.C.)
38
39Revision 1.1.2.1 2000/02/17 14:33:49 morsch
40Draft version from P. Crochet
41
42*/
43
44#include "AliMUONSegmentationTriggerX.h"
3f2cdba8 45#include "AliMUONTriggerConstants.h"
a9e2aefa 46#include "TMath.h"
47#include "TRandom.h"
48#include "TArc.h"
49#include "AliMUONChamber.h"
50#include <iostream.h>
51ClassImp(AliMUONSegmentationTriggerX)
3f2cdba8 52
53//------------------------------------------------------------------
a9e2aefa 54void AliMUONSegmentationTriggerX::Init(AliMUONChamber* Chamber)
55{
3f2cdba8 56// intialize X segmentation
a9e2aefa 57 cout << "Initialize Trigger Chamber Geometry X " << "\n";
58 AliMUONSegmentationTrigger::Init(Chamber);
59
60// calculate x & y position of X strips
3f2cdba8 61 Int_t nModule=AliMUONTriggerConstants::Nmodule();
62 for (Int_t imodule=0; imodule<nModule; imodule++) {
63 Float_t width=StripSizeX(AliMUONTriggerConstants::ModuleId(imodule));
64 Int_t nStrip=AliMUONTriggerConstants::NstripX(imodule);
65 for (Int_t istrip=0; istrip<nStrip; istrip++){
66 fXofxsmin[imodule][istrip] = AliMUONTriggerConstants::XcMin(imodule)*fZscale;
67 fXofxsmax[imodule][istrip] = AliMUONTriggerConstants::XcMax(imodule)*fZscale;
a9e2aefa 68
3f2cdba8 69 fYofxsmin[imodule][istrip] = (fYcmin[imodule]+width*(istrip))*fZscale;
70 fYofxsmax[imodule][istrip] = (fYcmin[imodule]+width*(istrip+1))*fZscale;
a9e2aefa 71 }
72 }
73}
74
75//------------------------------------------------------------------
76void AliMUONSegmentationTriggerX::GetPadIxy(Float_t x,Float_t y,Int_t &ix,Int_t &iy){
77// Returns pad coordinates (ix,iy) for given real coordinates (x,y)
78// x,y = real coordinates; ix = module number , iy = strip number
79 ix = 0;
80 iy = 0;
3f2cdba8 81 Int_t nModule=AliMUONTriggerConstants::Nmodule();
82 for (Int_t imodule=0; imodule<nModule; imodule++) {
83 Int_t nStrip=AliMUONTriggerConstants::NstripX(imodule);
84 for (Int_t istrip=0; istrip<nStrip; istrip++){
85 if (x>fXofxsmin[imodule][istrip]&&x<fXofxsmax[imodule][istrip]&&
86 y>fYofxsmin[imodule][istrip]&&y<fYofxsmax[imodule][istrip]){
87 ix = AliMUONTriggerConstants::ModuleId(imodule);
88 iy = istrip;
89 }
a9e2aefa 90 }
a9e2aefa 91 }
92}
93
94//------------------------------------------------------------------
95void AliMUONSegmentationTriggerX::GetPadCxy(Int_t ix, Int_t iy, Float_t &x, Float_t &y){
96// Returns real coordinates (x,y) for given pad coordinates (ix,iy)
97// ix = module number , iy = strip number; x,y = center of strip
98 x = 0.;
99 y = 0.;
3f2cdba8 100 Int_t nModule=AliMUONTriggerConstants::Nmodule();
101
102 for (Int_t imodule=0; imodule<nModule; imodule++) {
103 if (AliMUONTriggerConstants::ModuleId(imodule)==ix){
a9e2aefa 104 x=fXofxsmin[imodule][iy]+(fXofxsmax[imodule][iy]-fXofxsmin[imodule][iy])/2.;
105 y=fYofxsmin[imodule][iy]+(fYofxsmax[imodule][iy]-fYofxsmin[imodule][iy])/2.;
106 }
107 }
108}
109
110//------------------------------------------------------------------
111void AliMUONSegmentationTriggerX::SetPadSize(Float_t p1, Float_t p2)
112{
113// Sets the padsize
114//
115 fDpx=p1;
116 fDpy=p2;
117}
118
119//------------------------------------------------------------------
120void AliMUONSegmentationTriggerX::
121Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[2], Int_t Ylist[2]){
122// Returns list of next neighbours for given Pad (ix, iy)
123
124 Int_t absiX=TMath::Abs(iX);
125 *Nlist = 0;
126
127 if (absiX!=0) {
128 Int_t numModule=ModuleNumber(absiX);
129
3f2cdba8 130 if (iY<AliMUONTriggerConstants::NstripX(numModule)-1) { // strip up in same module
a9e2aefa 131 *Nlist=1;
132 Xlist[0]=absiX;
133 Ylist[0]=iY+1;
134 }
135
136 if (iY>0) { // strip down in same module
137 *Nlist=*Nlist+1;
138 Xlist[*Nlist-1]=absiX;
139 Ylist[*Nlist-1]=iY-1;
140 }
141
142 if (iX<0) { // left side of chamber
143 for (Int_t i=0; i<*Nlist; i++) {Xlist[i]=-Xlist[i];}
144 }
145 }
146}
147
148//------------------------------------------------------------------
149void AliMUONSegmentationTriggerX::SetPad(Int_t ix, Int_t iy)
150{
151 // Sets virtual pad coordinates, needed for evaluating pad response
152 // outside the tracking program
153 GetPadCxy(ix,iy,fx,fy);
154 GetPadIxy(fx,fy,fix,fiy);
155 fSector=Sector(ix,iy);
156}
157
158//------------------------------------------------------------------
159Int_t AliMUONSegmentationTriggerX::ISector()
160{ return fSector;}
161
162//------------------------------------------------------------------
163Int_t AliMUONSegmentationTriggerX::Ix()
164{ return fix;}
165
166//------------------------------------------------------------------
167Int_t AliMUONSegmentationTriggerX::Iy()
168{ return fiy;}
169
170//------------------------------------------------------------------
171Float_t AliMUONSegmentationTriggerX::Dpx(Int_t isec)
3f2cdba8 172{
173// returns x size of x strips for sector isec
a9e2aefa 174
175 if (isec==1) {
176 return 17.0*fZscale;
177 } else if (isec==2) {
178 return 34.0*fZscale;
179 } else if (isec==3) {
180 return 34.0*fZscale;
181 } else if (isec==4) {
182 return 34.0*fZscale;
183 } else if (isec==5) {
184 return 34.0*fZscale;
185 } else if (isec==6) {
186 return 68.0*fZscale;
187 } else {
188 return 0.;
189 }
190}
191
192//------------------------------------------------------------------
193Float_t AliMUONSegmentationTriggerX::Dpy(Int_t isec)
3f2cdba8 194{
195// returns y size of x strips for sector isec
a9e2aefa 196
197 if (isec==1) {
198 return 1.0625*fZscale;
199 } else if (isec==2) {
200 return 1.0625*fZscale;
201 } else if (isec==3) {
202 return 1.0625*fZscale;
203 } else if (isec==4) {
204 return 2.125*fZscale;
205 } else if (isec==5) {
206 return 4.25*fZscale;
207 } else if (isec==6) {
208 return 4.25*fZscale;
209 } else {
210 return 0.;
211 }
212}
213
214//------------------------------------------------------------------
215void AliMUONSegmentationTriggerX::SetHit(Float_t xhit, Float_t yhit)
3f2cdba8 216{
217// set hit during disIntegration
218AliMUONSegmentationTrigger::SetHit(xhit,yhit);
219}
a9e2aefa 220
221//------------------------------------------------------------------
222Int_t AliMUONSegmentationTriggerX::Sector(Int_t ix, Int_t iy)
223{
224// Returns sector number for given module
225//
3f2cdba8 226
a9e2aefa 227 Int_t absix=TMath::Abs(ix);
228 Int_t iwidth=Int_t(StripSizeX(absix));
3f2cdba8 229
a9e2aefa 230 if (absix==52) {
231 return 1;
232 } else if (absix==41||absix==61) {
233 return 2;
234 } else if (iwidth==1) {
235 return 3;
236 } else if (iwidth==2) {
237 return 4;
238 } else if ((absix>=11&&absix<17)||(absix>=91&&absix<97)) {
239 return 5;
240 } else if (iwidth==4) {
241 return 6;
242 } else {
243 return 0;
244 }
245}
246
247//------------------------------------------------------------------
248void AliMUONSegmentationTriggerX::
249IntegrationLimits(Float_t& x1, Float_t& x2, Float_t& x3, Float_t& width)
3f2cdba8 250{
251// returns quantities needed to evaluate neighbour strip response
252
a9e2aefa 253 Int_t ix,iy;
254 Float_t xstrip,ystrip;
255 GetPadIxy(fxhit,fyhit,ix,iy);
256 GetPadCxy(ix,iy,xstrip,ystrip);
257 x1=fyhit; // hit y position
258 x2=ystrip; // y coordinate of the main strip
259 x3=fy; // current strip real y coordinate
260 width=StripSizeX(ix); // width of the main strip
261}
262
263
264
265
266
267
268
269