Removing not needed monitor and shift libs from binalimdc.pkg
[u/mrichter/AliRoot.git] / MUON / AliMUONSlatGeometryBuilder.cxx
CommitLineData
d1cd2474 1// $Id$
2//
3// Class AliMUONSlatGeometryBuilder
4// -------------------------------
5// Abstract base class for geometry construction per chamber.
6//
2057e0cc 7// Author: Eric Dumonteil (dumontei@cea.fr)
8
9
c10e6eaf 10// This Builder is designed according to the enveloppe methode. The basic idea is to be able to allow moves
11// of the slats on the support panels.
12// Those moves can be described with a simple set of parameters. The next step should be now to describe all
13// the slats and their places by a unique
14// class, which would make the SlatBuilder far more compact since now only three parameters can define a slat
15// and its position, like:
2057e0cc 16// * Bool_t rounded_shape_slat
17// * Float_t slat_length
18// * Float_t slat_number or Float_t slat_position
19
d1cd2474 20#include <TVirtualMC.h>
d1cd2474 21#include <TGeoMatrix.h>
30178c30 22#include <Riostream.h>
d1cd2474 23
24#include "AliMUONSlatGeometryBuilder.h"
25#include "AliMUON.h"
26#include "AliMUONChamber.h"
27#include "AliMUONChamberGeometry.h"
a432117a 28#include "AliMUONGeometryEnvelopeStore.h"
30178c30 29#include "AliRun.h"
d1cd2474 30
31ClassImp(AliMUONSlatGeometryBuilder)
32
30178c30 33//Int_t ConvertSlatNum(Int_t numslat, Int_t quadnum, Int_t fspq);
d1cd2474 34
35//______________________________________________________________________________
36AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(AliMUON* muon)
a432117a 37 : AliMUONVGeometryBuilder("slat.dat",
38 &muon->Chamber(4), &muon->Chamber(5),
30178c30 39 &muon->Chamber(6), &muon->Chamber(7),
40 &muon->Chamber(8), &muon->Chamber(9)),
d1cd2474 41 fMUON(muon)
42{
43// Standard constructor
44
45}
46
47//______________________________________________________________________________
48AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder()
49 : AliMUONVGeometryBuilder(),
50 fMUON(0)
51{
52// Default constructor
53}
54
55
56//______________________________________________________________________________
57AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(const AliMUONSlatGeometryBuilder& rhs)
58 : AliMUONVGeometryBuilder(rhs)
59{
60 Fatal("Copy constructor",
61 "Copy constructor is not implemented.");
62}
63
64//______________________________________________________________________________
65AliMUONSlatGeometryBuilder::~AliMUONSlatGeometryBuilder() {
66//
67}
68
69//______________________________________________________________________________
70AliMUONSlatGeometryBuilder&
71AliMUONSlatGeometryBuilder::operator = (const AliMUONSlatGeometryBuilder& rhs)
72{
73 // check assignement to self
74 if (this == &rhs) return *this;
75
76 Fatal("operator=",
77 "Assignment operator is not implemented.");
78
79 return *this;
80}
81
82//
83// public methods
84//
85
86//______________________________________________________________________________
87void AliMUONSlatGeometryBuilder::CreateGeometry()
88{
2057e0cc 89// CreateGeometry is the method containing all the informations concerning Stations 345 geometry.
90// It includes description and placements of support panels and slats.
c10e6eaf 91// The code comes directly from what was written in AliMUONv1.cxx before, with modifications concerning
92// the use of Enveloppe method to place the Geant volumes.
93// Now, few changes would allow the creation of a Slat methode where slat could be described by few parameters,
94// and this builder would then be dedicated only to the
2057e0cc 95// placements of the slats. Those modifications could shorten the Station 345 geometry by a non-negligeable factor...
d1cd2474 96
97 Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
98
99 Float_t angle;
100 Float_t *dum=0;
101
102 // define the id of tracking media:
103 Int_t idCopper = idtmed[1110];
104 Int_t idGlass = idtmed[1111];
105 Int_t idCarbon = idtmed[1112];
106 Int_t idRoha = idtmed[1113];
c10e6eaf 107 Int_t idGas = idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
108 Int_t idAir = idtmed[1100]; // medium 1
d1cd2474 109
110 // sensitive area: 40*40 cm**2
2057e0cc 111 const Float_t kSensLength = 40.;
112 const Float_t kSensHeight = 40.;
113 const Float_t kSensWidth = 0.5; // according to TDR fig 2.120
114 const Int_t kSensMaterial = idGas;
115 const Float_t kYoverlap = 1.5;
d1cd2474 116
117 // PCB dimensions in cm; width: 30 mum copper
2057e0cc 118 const Float_t kPcbLength = kSensLength;
119 const Float_t kPcbHeight = 60.;
120 const Float_t kPcbWidth = 0.003;
121 const Int_t kPcbMaterial = idCopper;
d1cd2474 122
123 // Insulating material: 200 mum glass fiber glued to pcb
2057e0cc 124 const Float_t kInsuLength = kPcbLength;
125 const Float_t kInsuHeight = kPcbHeight;
126 const Float_t kInsuWidth = 0.020;
127 const Int_t kInsuMaterial = idGlass;
d1cd2474 128
129 // Carbon fiber panels: 200mum carbon/epoxy skin
2057e0cc 130 const Float_t kPanelLength = kSensLength;
131 const Float_t kPanelHeight = kSensHeight;
132 const Float_t kPanelWidth = 0.020;
133 const Int_t kPanelMaterial = idCarbon;
d1cd2474 134
135 // rohacell between the two carbon panels
2057e0cc 136 const Float_t kRohaLength = kSensLength;
137 const Float_t kRohaHeight = kSensHeight;
138 const Float_t kRohaWidth = 0.5;
139 const Int_t kRohaMaterial = idRoha;
d1cd2474 140
141 // Frame around the slat: 2 sticks along length,2 along height
142 // H: the horizontal ones
2057e0cc 143 const Float_t kHframeLength = kPcbLength;
144 const Float_t kHframeHeight = 1.5;
145 const Float_t kHframeWidth = kSensWidth;
146 const Int_t kHframeMaterial = idGlass;
d1cd2474 147
148 // V: the vertical ones
2057e0cc 149 const Float_t kVframeLength = 4.0;
150 const Float_t kVframeHeight = kSensHeight + kHframeHeight;
151 const Float_t kVframeWidth = kSensWidth;
152 const Int_t kVframeMaterial = idGlass;
d1cd2474 153
154 // B: the horizontal border filled with rohacell
2057e0cc 155 const Float_t kBframeLength = kHframeLength;
156 const Float_t kBframeHeight = (kPcbHeight - kSensHeight)/2. - kHframeHeight;
157 const Float_t kBframeWidth = kHframeWidth;
158 const Int_t kBframeMaterial = idRoha;
d1cd2474 159
160 // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
2057e0cc 161 const Float_t kNulocLength = 2.5;
162 const Float_t kNulocHeight = 7.5;
163 const Float_t kNulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite;
164 const Int_t kNulocMaterial = idCopper;
d1cd2474 165
2057e0cc 166 const Float_t kSlatHeight = kPcbHeight;
167 const Float_t kSlatWidth = kSensWidth + 2.*(kPcbWidth + kInsuWidth +
168 2.* kPanelWidth + kRohaWidth);
169 const Int_t kSlatMaterial = idAir;
4846c3ab 170 const Float_t kDslatLength = 2.5;//kVframeLength; // border on left and right
d1cd2474 171
172 Float_t spar[3];
173 Int_t i, j;
a432117a 174 Int_t detElemId;
d1cd2474 175
176 // the panel volume contains the rohacell
177
2057e0cc 178 Float_t twidth = 2 * kPanelWidth + kRohaWidth;
179 Float_t panelpar[3] = { kPanelLength/2., kPanelHeight/2., twidth/2. };
180 Float_t rohapar[3] = { kRohaLength/2., kRohaHeight/2., kRohaWidth/2. };
d1cd2474 181
182 // insulating material contains PCB-> gas-> 2 borders filled with rohacell
183
2057e0cc 184 twidth = 2*(kInsuWidth + kPcbWidth) + kSensWidth;
185 Float_t insupar[3] = { kInsuLength/2., kInsuHeight/2., twidth/2. };
186 twidth -= 2 * kInsuWidth;
187 Float_t pcbpar[3] = { kPcbLength/2., kPcbHeight/2., twidth/2. };
188 Float_t senspar[3] = { kSensLength/2., kSensHeight/2., kSensWidth/2. };
189 Float_t theight = 2*kHframeHeight + kSensHeight;
190 Float_t hFramepar[3]={kHframeLength/2., theight/2., kHframeWidth/2.};
191 Float_t bFramepar[3]={kBframeLength/2., kBframeHeight/2., kBframeWidth/2.};
192 Float_t vFramepar[3]={kVframeLength/2., kVframeHeight/2., kVframeWidth/2.};
193 Float_t nulocpar[3]={kNulocLength/2., kNulocHeight/2., kNulocWidth/2.};
d1cd2474 194 Float_t xx;
2057e0cc 195 Float_t xxmax = (kBframeLength - kNulocLength)/2.;
d1cd2474 196 Int_t index=0;
197
198 AliMUONChamber *iChamber, *iChamber1, *iChamber2;
199
200 Int_t* fStations = new Int_t[5];
201 for (Int_t i=0; i<5; i++) fStations[i] = 1;
7ddb761c 202 fStations[2] = 1;
d1cd2474 203
204 if (fStations[2])
205 {
d1cd2474 206//********************************************************************
207// Station 3 **
208//********************************************************************
209 // indices 1 and 2 for first and second chambers in the station
210 // iChamber (first chamber) kept for other quanties than Z,
211 // assumed to be the same in both chambers
212
213 iChamber = GetChamber(4);
214 iChamber1 = iChamber;
215 iChamber2 = GetChamber(5);
216
84717edf 217 //iChamber1->GetGeometry()->SetDebug(kTRUE);
d1cd2474 218 //iChamber2->GetGeometry()->SetDebug(kTRUE);
219
220 if (gAlice->GetModule("DIPO")) {
221 // if DIPO is preset, the whole station will be placed in DDIP volume
222 iChamber1->GetGeometry()->SetMotherVolume("DDIP");
223 iChamber2->GetGeometry()->SetMotherVolume("DDIP");
224 }
225
d1cd2474 226
227 // volumes for slat geometry (xx=5,..,10 chamber id):
228 // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes
229 // SxxG --> Sensitive volume (gas)
230 // SxxP --> PCB (copper)
231 // SxxI --> Insulator (vetronite)
232 // SxxC --> Carbon panel
233 // SxxR --> Rohacell
234 // SxxH, SxxV --> Horizontal and Vertical frames (vetronite)
235 // SB5x --> Volumes for the 35 cm long PCB
236 // slat dimensions: slat is a MOTHER volume!!! made of air
237
238 // only for chamber 5: slat 1 has a PCB shorter by 5cm!
239
240 Float_t tlength = 35.;
241 Float_t panelpar2[3] = { tlength/2., panelpar[1], panelpar[2]};
242 Float_t rohapar2[3] = { tlength/2., rohapar[1], rohapar[2]};
243 Float_t insupar2[3] = { tlength/2., insupar[1], insupar[2]};
244 Float_t pcbpar2[3] = { tlength/2., pcbpar[1], pcbpar[2]};
245 Float_t senspar2[3] = { tlength/2., senspar[1], senspar[2]};
246 Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]};
247 Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]};
248 Float_t *dum=0;
7ddb761c 249 Float_t pcbDLength3 = (kPcbLength - tlength);
d1cd2474 250
2057e0cc 251 const Int_t kNslats3 = 5; // number of slats per quadrant
7ddb761c 252 const Int_t kNPCB3[kNslats3] = {4, 4, 4, 3, 2}; // n PCB per slat
c10e6eaf 253 const Float_t kXpos3[kNslats3] = {0., 0., 0., 0., 0.};//{31., 0., 0., 0., 0.};
2057e0cc 254 Float_t slatLength3[kNslats3];
d1cd2474 255
256 // create and position the slat (mother) volumes
257
d1cd2474 258 char idSlatCh5[5];
259 char idSlatCh6[5];
260 Float_t xSlat3;
7ddb761c 261 Float_t ySlat3;
d1cd2474 262 Float_t angle = 0.;
d1cd2474 263 Float_t spar2[3];
c10e6eaf 264 for (i = 0; i < kNslats3; i++){
2057e0cc 265 slatLength3[i] = kPcbLength * kNPCB3[i] + 2. * kDslatLength;
4846c3ab 266 xSlat3 = slatLength3[i]/2. + kVframeLength/2. + kXpos3[i];
7ddb761c 267 ySlat3 = kSensHeight * i - kYoverlap * i;
d1cd2474 268 spar[0] = slatLength3[i]/2.;
2057e0cc 269 spar[1] = kSlatHeight/2.;
270 spar[2] = kSlatWidth/2. * 1.01;
d1cd2474 271 // take away 5 cm from the first slat in chamber 5
7ddb761c 272 if (i == 0 || i == 1 || i == 2) { // 1 pcb is shortened by 5cm
273 spar2[0] = spar[0] - pcbDLength3/2.;
c10e6eaf 274 } else {
d1cd2474 275 spar2[0] = spar[0];
d1cd2474 276 }
277 spar2[1] = spar[1];
278 spar2[2] = spar[2];
279 Float_t dzCh3=spar[2] * 1.01;
280 // zSlat to be checked (odd downstream or upstream?)
281 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
d1cd2474 282
2057e0cc 283 sprintf(idSlatCh5,"LA%d",kNslats3-1+i);
284 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
a432117a 285 detElemId = 500 + i + kNslats3-1;
7ddb761c 286 GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, ySlat3, zSlat+2.*dzCh3),
c10e6eaf 287 TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
d1cd2474 288
2057e0cc 289 sprintf(idSlatCh5,"LA%d",3*kNslats3-2+i);
290 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
a432117a 291 detElemId = 550 + i + kNslats3-1;
7ddb761c 292 GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat-2.*dzCh3),
c10e6eaf 293 TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
294
295 if (i > 0) {
296 sprintf(idSlatCh5,"LA%d",kNslats3-1-i);
c10e6eaf 297 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
a432117a 298 detElemId = 500 - i + kNslats3-1;
7ddb761c 299 GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, zSlat+2.*dzCh3),
c10e6eaf 300 TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
301
302 sprintf(idSlatCh5,"LA%d",3*kNslats3-2-i);
c10e6eaf 303 gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
a432117a 304 detElemId = 550 - i + kNslats3-1;
7ddb761c 305 GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat-2.*dzCh3),
c10e6eaf 306 TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
d1cd2474 307 }
308
c10e6eaf 309 sprintf(idSlatCh6,"LB%d",kNslats3-1+i);
7ddb761c 310 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
a432117a 311 detElemId = 600 + i + kNslats3-1;
7ddb761c 312 GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, ySlat3, zSlat+2.*dzCh3),
c10e6eaf 313 TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
2057e0cc 314 sprintf(idSlatCh6,"LB%d",3*kNslats3-2+i);
7ddb761c 315 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
a432117a 316 detElemId = 650 + i + kNslats3-1;
7ddb761c 317 GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat-2.*dzCh3),
c10e6eaf 318 TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
319
320 if (i > 0) {
321 sprintf(idSlatCh6,"LB%d",kNslats3-1-i);
7ddb761c 322 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
a432117a 323 detElemId = 600 - i + kNslats3-1;
7ddb761c 324 GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, zSlat+2.*dzCh3),
c10e6eaf 325 TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
326
327 sprintf(idSlatCh6,"LB%d",3*kNslats3-2-i);
7ddb761c 328 gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
a432117a 329 detElemId = 650 - i + kNslats3-1;
7ddb761c 330 GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat-2.*dzCh3),
c10e6eaf 331 TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
332 }
333 }
d1cd2474 334
335 // create the panel volume
336
2057e0cc 337 gMC->Gsvolu("S05C","BOX",kPanelMaterial,panelpar,3);
338 gMC->Gsvolu("SB5C","BOX",kPanelMaterial,panelpar2,3);
339 gMC->Gsvolu("S06C","BOX",kPanelMaterial,panelpar,3);
4846c3ab 340
d1cd2474 341 // create the rohacell volume
342
2057e0cc 343 gMC->Gsvolu("S05R","BOX",kRohaMaterial,rohapar,3);
344 gMC->Gsvolu("SB5R","BOX",kRohaMaterial,rohapar2,3);
345 gMC->Gsvolu("S06R","BOX",kRohaMaterial,rohapar,3);
4846c3ab 346
d1cd2474 347 // create the insulating material volume
348
2057e0cc 349 gMC->Gsvolu("S05I","BOX",kInsuMaterial,insupar,3);
350 gMC->Gsvolu("SB5I","BOX",kInsuMaterial,insupar2,3);
351 gMC->Gsvolu("S06I","BOX",kInsuMaterial,insupar,3);
4846c3ab 352
d1cd2474 353 // create the PCB volume
354
2057e0cc 355 gMC->Gsvolu("S05P","BOX",kPcbMaterial,pcbpar,3);
356 gMC->Gsvolu("SB5P","BOX",kPcbMaterial,pcbpar2,3);
357 gMC->Gsvolu("S06P","BOX",kPcbMaterial,pcbpar,3);
d1cd2474 358
359 // create the sensitive volumes,
4846c3ab 360
2057e0cc 361 gMC->Gsvolu("S05G","BOX",kSensMaterial,dum,0);
362 gMC->Gsvolu("S06G","BOX",kSensMaterial,dum,0);
d1cd2474 363
d1cd2474 364 // create the vertical frame volume
365
2057e0cc 366 gMC->Gsvolu("S05V","BOX",kVframeMaterial,vFramepar,3);
367 gMC->Gsvolu("S06V","BOX",kVframeMaterial,vFramepar,3);
d1cd2474 368
369 // create the horizontal frame volume
370
2057e0cc 371 gMC->Gsvolu("S05H","BOX",kHframeMaterial,hFramepar,3);
372 gMC->Gsvolu("SB5H","BOX",kHframeMaterial,hFramepar2,3);
373 gMC->Gsvolu("S06H","BOX",kHframeMaterial,hFramepar,3);
4846c3ab 374
d1cd2474 375 // create the horizontal border volume
376
2057e0cc 377 gMC->Gsvolu("S05B","BOX",kBframeMaterial,bFramepar,3);
378 gMC->Gsvolu("SB5B","BOX",kBframeMaterial,bFramepar2,3);
379 gMC->Gsvolu("S06B","BOX",kBframeMaterial,bFramepar,3);
4846c3ab 380
c10e6eaf 381 index = 0;
2057e0cc 382 for (i = 0; i<kNslats3; i++){
4846c3ab 383 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
c10e6eaf 384
4846c3ab 385 if (i == 0 && quadrant == 2) continue;
386 if (i == 0 && quadrant == 4) continue;
c10e6eaf 387
388 sprintf(idSlatCh5,"LA%d",ConvertSlatNum(i,quadrant,kNslats3-1));
389 sprintf(idSlatCh6,"LB%d",ConvertSlatNum(i,quadrant,kNslats3-1));
390 Float_t xvFrame = (slatLength3[i] - kVframeLength)/2.;
391 Float_t xvFrame2 = xvFrame;
392
7ddb761c 393 if (i == 0 || i == 1 || i == 2) xvFrame2 -= pcbDLength3/2.;
c10e6eaf 394
395 // position the vertical frames
4846c3ab 396 if ( i > 2) {
397 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
398 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
399 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
400 (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
401 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
402 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
403 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
404 (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
405 }
406
407 if (i == 2) {
408 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
409 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
410 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
411 (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
a432117a 412 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
4846c3ab 413 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
a432117a 414 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
4846c3ab 415 (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
416 }
417
418 if (i == 0 || i == 1) { // no rounded spacer for the moment (Ch. Finck)
419 GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5,
420 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
421 GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6,
422 (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
423 }
c10e6eaf 424
c10e6eaf 425 // position the panels and the insulating material
4846c3ab 426 for (j = 0; j < kNPCB3[i]; j++){
427 if (i == 1 && j == 0) continue;
428 if (i == 0 && j == 0) continue;
c10e6eaf 429 index++;
4846c3ab 430 Float_t xx = kSensLength * (-kNPCB3[i]/2. + j + 0.5);
7ddb761c 431 Float_t xx2 = xx - pcbDLength3/2.;
d1cd2474 432
c10e6eaf 433 Float_t zPanel = spar[2] - panelpar[2];
4846c3ab 434
c10e6eaf 435 if ( (i == 0 || i == 1 || i == 2) && j == kNPCB3[i]-1) { // 1 pcb is shortened by 5cm
4846c3ab 436 GetEnvelopes(4)->AddEnvelopeConstituent("SB5C", idSlatCh5, 2*index-1,TGeoTranslation(xx2,0.,zPanel));
437 GetEnvelopes(4)->AddEnvelopeConstituent("SB5C", idSlatCh5, 2*index,TGeoTranslation(xx2,0.,-zPanel));
438 GetEnvelopes(4)->AddEnvelopeConstituent("SB5I", idSlatCh5, index,TGeoTranslation(xx2,0.,0.));
7ddb761c 439 } else {
a432117a 440 GetEnvelopes(4)->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index-1,TGeoTranslation(xx,0.,zPanel));
441 GetEnvelopes(4)->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index,TGeoTranslation(xx,0.,-zPanel));
442 GetEnvelopes(4)->AddEnvelopeConstituent("S05I", idSlatCh5, index,TGeoTranslation(xx,0.,0.));
c10e6eaf 443 }
a432117a 444 GetEnvelopes(5)->AddEnvelopeConstituent("S06C", idSlatCh6, 2*index-1,TGeoTranslation(xx,0.,zPanel));
445 GetEnvelopes(5)->AddEnvelopeConstituent("S06C", idSlatCh6, 2*index,TGeoTranslation(xx,0.,-zPanel));
446 GetEnvelopes(5)->AddEnvelopeConstituent("S06I", idSlatCh6, index,TGeoTranslation(xx,0.,0.));
d1cd2474 447
c10e6eaf 448 }
449 }
d1cd2474 450 }
c10e6eaf 451
d1cd2474 452 // position the rohacell volume inside the panel volume
453 gMC->Gspos("S05R",1,"S05C",0.,0.,0.,0,"ONLY");
454 gMC->Gspos("SB5R",1,"SB5C",0.,0.,0.,0,"ONLY");
455 gMC->Gspos("S06R",1,"S06C",0.,0.,0.,0,"ONLY");
4846c3ab 456
d1cd2474 457 // position the PCB volume inside the insulating material volume
458 gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY");
459 gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY");
460 gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY");
4846c3ab 461
d1cd2474 462 // position the horizontal frame volume inside the PCB volume
463 gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY");
464 gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY");
465 gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY");
4846c3ab 466
d1cd2474 467 // position the sensitive volume inside the horizontal frame volume
468 gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3);
469 gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3);
470 gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3);
4846c3ab 471
472
d1cd2474 473 // position the border volumes inside the PCB volume
2057e0cc 474 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
d1cd2474 475 gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY");
476 gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY");
477 gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY");
478 gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY");
4846c3ab 479
d1cd2474 480 gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY");
481 gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY");
4846c3ab 482
d1cd2474 483 // create the NULOC volume and position it in the horizontal frame
2057e0cc 484 gMC->Gsvolu("S05N","BOX",kNulocMaterial,nulocpar,3);
485 gMC->Gsvolu("S06N","BOX",kNulocMaterial,nulocpar,3);
d1cd2474 486 index = 0;
7ddb761c 487 Float_t xxmax2 = xxmax - pcbDLength3/2.;
c10e6eaf 488 for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) {
d1cd2474 489 index++;
2057e0cc 490 gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
491 gMC->Gspos("S05N",2*index ,"S05B", xx, 0., kBframeWidth/4., 0, "ONLY");
4846c3ab 492 gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
493 gMC->Gspos("S06N",2*index ,"S06B", xx, 0., kBframeWidth/4., 0, "ONLY");
d1cd2474 494 if (xx > -xxmax2 && xx< xxmax2) {
2057e0cc 495 gMC->Gspos("S05N",2*index-1,"SB5B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
496 gMC->Gspos("S05N",2*index ,"SB5B", xx, 0., kBframeWidth/4., 0, "ONLY");
d1cd2474 497 }
d1cd2474 498 }
4846c3ab 499
d1cd2474 500 // position the volumes approximating the circular section of the pipe
2057e0cc 501 Float_t yoffs = kSensHeight/2.-kYoverlap;
d1cd2474 502 Float_t epsilon = 0.001;
c10e6eaf 503 Int_t ndiv = 6;
d1cd2474 504 Double_t divpar[3];
2057e0cc 505 Double_t dydiv= kSensHeight/ndiv;
c10e6eaf 506 Double_t ydiv = yoffs -dydiv/2.;
507 Int_t imax = 0;
d1cd2474 508 imax = 1;
c10e6eaf 509 Double_t rmin = 31.5; // Corrected in sep04 from PQ-LAT-SR2 de CEA-DSM-DAPNIA-SIS/BE ph HARDY 19-Oct-2002 slat
510 Double_t xdiv = 0.;
511 for (Int_t idiv = 0;idiv < ndiv; idiv++){
512 ydiv += dydiv;
513 xdiv = 0.;
514 if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
2057e0cc 515 divpar[0] = (kPcbLength-xdiv)/2.;
d1cd2474 516 divpar[1] = dydiv/2. - epsilon;
2057e0cc 517 divpar[2] = kSensWidth/2.;
c10e6eaf 518 Float_t xvol = (kPcbLength+xdiv)/2.;
519 Float_t yvol = ydiv;
4846c3ab 520
c10e6eaf 521 // Volumes close to the beam pipe for slat i=1 so 4 slats per chamber
522 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
523 sprintf(idSlatCh5,"LA%d",ConvertSlatNum(1,quadrant,kNslats3-1));
524 sprintf(idSlatCh6,"LB%d",ConvertSlatNum(1,quadrant,kNslats3-1));
525
a432117a 526 GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5, quadrant*100+imax+4*idiv+1,
4846c3ab 527 TGeoTranslation(xvol-(kPcbLength * (kNPCB3[1])/2.),yvol-kPcbLength+kYoverlap,0.),3,divpar);
c10e6eaf 528
a432117a 529 GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6, quadrant*100+imax+4*idiv+1,
c10e6eaf 530 TGeoTranslation(xvol-kPcbLength * kNPCB3[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
d1cd2474 531 }
d1cd2474 532 }
c10e6eaf 533
7ddb761c 534 // Volumes close to the beam pipe for slat i=0 so 2 slats per chamber (central slat for station 3)
c10e6eaf 535 // Gines Martinez, Subatech sep 04
536 // 9 box volumes are used to define the PCB closed to the beam pipe of the slat 122000SR1 of chamber 5 and 6 of St3
7ddb761c 537 // Accordingly to plan PQ-LAT-SR1 of CEA-DSM-DAPNIA-SIS/BE ph HARDY 8-Oct-2002
c10e6eaf 538 // Rmin = 31.5 cm
539 Double_t rmin_122000SR1 = 31.5; //in cm
540 ndiv = 9;
541 dydiv = kSensHeight/ndiv; // Vertical size of the box volume approximating the rounded PCB
542 ydiv = -kSensHeight/2 + dydiv/2.-kYoverlap; // Initializing vertical position of the volume from bottom
543 xdiv = 0.; // Initializing horizontal position of the box volumes
544 for (Int_t idiv=0;idiv<ndiv; idiv++){
545 xdiv = TMath::Abs( rmin_122000SR1 * TMath::Sin( TMath::ACos(ydiv/rmin_122000SR1) ) );
546 divpar[0] = (kPcbLength-xdiv)/2.; // Dimension of the box volume
547 divpar[1] = dydiv/2. - epsilon;
548 divpar[2] = kSensWidth/2.;
549 Float_t xvol = (kPcbLength+xdiv)/2.; //2D traslition for positionning of box volume
550 Float_t yvol = ydiv;
551 Int_t side;
552 for (side = 1; side <= 2; side++) {
553 sprintf(idSlatCh5,"LA%d",4);
554 sprintf(idSlatCh6,"LB%d",4);
555 if(side == 2) {
556 sprintf(idSlatCh5,"LA%d",13);
557 sprintf(idSlatCh6,"LB%d",13);
558 }
a432117a 559 GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5,500+side*100+imax+4*idiv+1,
4846c3ab 560 TGeoTranslation(xvol-(kPcbLength * (kNPCB3[0])/2.),yvol+kYoverlap,0.),3,divpar);
c10e6eaf 561
a432117a 562 GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6,500+side*100+imax+4*idiv+1,
c10e6eaf 563 TGeoTranslation(xvol-kPcbLength * kNPCB3[0]/2.,yvol+kYoverlap,0.),3,divpar);
564 }
565 ydiv += dydiv; // Going from bottom to top
566 }
a432117a 567 // cout << "Geometry for Station 3...... done" << endl;
d1cd2474 568 }
569
570 if (fStations[3]) {
571
572
573// //********************************************************************
574// // Station 4 **
575// //********************************************************************
576// // indices 1 and 2 for first and second chambers in the station
577// // iChamber (first chamber) kept for other quanties than Z,
578// // assumed to be the same in both chambers
c10e6eaf 579// corrected geometry (JP. Cussonneau, Ch. Finck)
d1cd2474 580
581 iChamber = GetChamber(6);
582 iChamber1 = iChamber;
583 iChamber2 = GetChamber(7);
584
c10e6eaf 585 const Int_t kNslats4 = 7; // number of slats per quadrant
7ddb761c 586 const Int_t kNPCB4[kNslats4] = {5, 6, 5, 5, 4, 3, 2}; // n PCB per slat
c10e6eaf 587 const Float_t kXpos4[kNslats4] = {38.5, 0., 0., 0., 0., 0., 0.};
2057e0cc 588 Float_t slatLength4[kNslats4];
d1cd2474 589
590// // create and position the slat (mother) volumes
591
592 char idSlatCh7[5];
593 char idSlatCh8[5];
594 Float_t xSlat4;
595 Float_t ySlat4;
596 angle = 0.;
597
2057e0cc 598 for (i = 0; i<kNslats4; i++){
599 slatLength4[i] = kPcbLength * kNPCB4[i] + 2. * kDslatLength;
4846c3ab 600 xSlat4 = slatLength4[i]/2. + kVframeLength/2. + kXpos4[i];
c10e6eaf 601 ySlat4 = kSensHeight * i - kYoverlap *i;
d1cd2474 602
603 spar[0] = slatLength4[i]/2.;
2057e0cc 604 spar[1] = kSlatHeight/2.;
605 spar[2] = kSlatWidth/2.*1.01;
c10e6eaf 606 Float_t dzCh4 = spar[2]*1.01;
d1cd2474 607 // zSlat to be checked (odd downstream or upstream?)
608 Float_t zSlat = (i%2 ==0)? spar[2] : -spar[2];
609
2057e0cc 610 sprintf(idSlatCh7,"LC%d",kNslats4-1+i);
611 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
a432117a 612 detElemId = 700 + i + kNslats4-1;
613 GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, ySlat4, zSlat+2.*dzCh4),
c10e6eaf 614 TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
d1cd2474 615
2057e0cc 616 sprintf(idSlatCh7,"LC%d",3*kNslats4-2+i);
617 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
a432117a 618 detElemId = 750 + i + kNslats4-1;
619 GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(-xSlat4, ySlat4, zSlat-2.*dzCh4),
c10e6eaf 620 TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
d1cd2474 621
c10e6eaf 622 if (i > 0) {
623 sprintf(idSlatCh7,"LC%d",kNslats4-1-i);
c10e6eaf 624 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
a432117a 625 detElemId = 700 - i + kNslats4-1;
626 GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, -ySlat4, zSlat+2.*dzCh4),
c10e6eaf 627 TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
628
629 sprintf(idSlatCh7,"LC%d",3*kNslats4-2-i);
a432117a 630 detElemId = 750 - i + kNslats4-1;
c10e6eaf 631 gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
a432117a 632 GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true,
c10e6eaf 633 TGeoTranslation(-xSlat4, -ySlat4, zSlat-2.*dzCh4),
634 TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
d1cd2474 635 }
636
2057e0cc 637 sprintf(idSlatCh8,"LD%d",kNslats4-1+i);
638 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
a432117a 639 detElemId = 800 + i + kNslats4-1;
640 GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, ySlat4, zSlat+2.*dzCh4),
c10e6eaf 641 TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
a432117a 642
2057e0cc 643 sprintf(idSlatCh8,"LD%d",3*kNslats4-2+i);
a432117a 644 detElemId = 850 + i + kNslats4-1;
2057e0cc 645 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
a432117a 646 GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, ySlat4, zSlat-2.*dzCh4),
c10e6eaf 647 TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
648 if (i > 0) {
649 sprintf(idSlatCh8,"LD%d",kNslats4-1-i);
a432117a 650 detElemId = 800 - i + kNslats4-1;
c10e6eaf 651 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
a432117a 652 GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, -ySlat4, zSlat+2.*dzCh4),
c10e6eaf 653 TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
654 sprintf(idSlatCh8,"LD%d",3*kNslats4-2-i);
a432117a 655 detElemId = 850 - i + kNslats4-1;
c10e6eaf 656 gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
a432117a 657 GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, -ySlat4, zSlat-2.*dzCh4),
c10e6eaf 658 TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
d1cd2474 659 }
660 }
661
d1cd2474 662 // create the panel volume
663
2057e0cc 664 gMC->Gsvolu("S07C","BOX",kPanelMaterial,panelpar,3);
665 gMC->Gsvolu("S08C","BOX",kPanelMaterial,panelpar,3);
d1cd2474 666
667 // create the rohacell volume
668
2057e0cc 669 gMC->Gsvolu("S07R","BOX",kRohaMaterial,rohapar,3);
670 gMC->Gsvolu("S08R","BOX",kRohaMaterial,rohapar,3);
d1cd2474 671
672 // create the insulating material volume
673
2057e0cc 674 gMC->Gsvolu("S07I","BOX",kInsuMaterial,insupar,3);
675 gMC->Gsvolu("S08I","BOX",kInsuMaterial,insupar,3);
d1cd2474 676
677 // create the PCB volume
678
2057e0cc 679 gMC->Gsvolu("S07P","BOX",kPcbMaterial,pcbpar,3);
680 gMC->Gsvolu("S08P","BOX",kPcbMaterial,pcbpar,3);
d1cd2474 681
682 // create the sensitive volumes,
683
2057e0cc 684 gMC->Gsvolu("S07G","BOX",kSensMaterial,dum,0);
685 gMC->Gsvolu("S08G","BOX",kSensMaterial,dum,0);
d1cd2474 686
687 // create the vertical frame volume
688
2057e0cc 689 gMC->Gsvolu("S07V","BOX",kVframeMaterial,vFramepar,3);
690 gMC->Gsvolu("S08V","BOX",kVframeMaterial,vFramepar,3);
d1cd2474 691
692 // create the horizontal frame volume
693
2057e0cc 694 gMC->Gsvolu("S07H","BOX",kHframeMaterial,hFramepar,3);
695 gMC->Gsvolu("S08H","BOX",kHframeMaterial,hFramepar,3);
d1cd2474 696
697 // create the horizontal border volume
698
2057e0cc 699 gMC->Gsvolu("S07B","BOX",kBframeMaterial,bFramepar,3);
700 gMC->Gsvolu("S08B","BOX",kBframeMaterial,bFramepar,3);
d1cd2474 701
c10e6eaf 702 index = 0;
703 for (i = 0; i < kNslats4; i++){
704 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
d1cd2474 705
c10e6eaf 706 if (i == 0 && quadrant == 2) continue;
707 if (i == 0 && quadrant == 4) continue;
d1cd2474 708
c10e6eaf 709 sprintf(idSlatCh7,"LC%d",ConvertSlatNum(i,quadrant,kNslats4-1));
710 sprintf(idSlatCh8,"LD%d",ConvertSlatNum(i,quadrant,kNslats4-1));
711 Float_t xvFrame = (slatLength4[i] - kVframeLength)/2.;
d1cd2474 712
c10e6eaf 713 // position the vertical frames
4846c3ab 714 if (i != 1) {
a432117a 715 GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
716 GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
717 GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
718 GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
4846c3ab 719 } else { // no rounded spacer yet
720 GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
721 // GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
722 GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
723 // GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
c10e6eaf 724 }
725 // position the panels and the insulating material
726 for (j = 0; j < kNPCB4[i]; j++){
727 if (i == 1 && j == 0) continue;
728 index++;
729 Float_t xx = kSensLength * (-kNPCB4[i]/2.+j+.5);
730
731 Float_t zPanel = spar[2] - panelpar[2];
a432117a 732 GetEnvelopes(6)->AddEnvelopeConstituent("S07C", idSlatCh7, 2*index-1,TGeoTranslation(xx,0.,zPanel));
733 GetEnvelopes(6)->AddEnvelopeConstituent("S07C", idSlatCh7, 2*index,TGeoTranslation(xx,0.,-zPanel));
734 GetEnvelopes(6)->AddEnvelopeConstituent("S07I", idSlatCh7, index,TGeoTranslation(xx,0.,0.));
735 GetEnvelopes(7)->AddEnvelopeConstituent("S08C", idSlatCh8, 2*index-1,TGeoTranslation(xx,0.,zPanel));
736 GetEnvelopes(7)->AddEnvelopeConstituent("S08C", idSlatCh8, 2*index,TGeoTranslation(xx,0.,-zPanel));
737 GetEnvelopes(7)->AddEnvelopeConstituent("S08I", idSlatCh8, index,TGeoTranslation(xx,0.,0.));
c10e6eaf 738 }
739 }
d1cd2474 740 }
741
742 // position the rohacell volume inside the panel volume
743 gMC->Gspos("S07R",1,"S07C",0.,0.,0.,0,"ONLY");
744 gMC->Gspos("S08R",1,"S08C",0.,0.,0.,0,"ONLY");
745
746 // position the PCB volume inside the insulating material volume
747 gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY");
748 gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY");
749 // position the horizontal frame volume inside the PCB volume
750 gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY");
751 gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY");
752 // position the sensitive volume inside the horizontal frame volume
753 gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3);
754 gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3);
755 // position the border volumes inside the PCB volume
2057e0cc 756 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
d1cd2474 757 gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY");
758 gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY");
759 gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY");
760 gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY");
761
762// // create the NULOC volume and position it in the horizontal frame
763
2057e0cc 764 gMC->Gsvolu("S07N","BOX",kNulocMaterial,nulocpar,3);
765 gMC->Gsvolu("S08N","BOX",kNulocMaterial,nulocpar,3);
d1cd2474 766 index = 0;
c10e6eaf 767 for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) {
d1cd2474 768 index++;
2057e0cc 769 gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
770 gMC->Gspos("S07N",2*index ,"S07B", xx, 0., kBframeWidth/4., 0, "ONLY");
771 gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
772 gMC->Gspos("S08N",2*index ,"S08B", xx, 0., kBframeWidth/4., 0, "ONLY");
d1cd2474 773 }
774
775// // position the volumes approximating the circular section of the pipe
2057e0cc 776 Float_t yoffs = kSensHeight/2. - kYoverlap;
d1cd2474 777 Float_t epsilon = 0.001;
6296ba34 778 Int_t ndiv = 10;
d1cd2474 779 Double_t divpar[3];
2057e0cc 780 Double_t dydiv= kSensHeight/ndiv;
d1cd2474 781 Double_t ydiv = yoffs -dydiv;
782 Int_t imax=0;
783 imax = 1;
6296ba34 784 Float_t rmin = 39.5;
785 Float_t shiftR = 0.;
c10e6eaf 786 for (Int_t idiv = 0; idiv < ndiv; idiv++){
787 ydiv += dydiv;
d1cd2474 788 Float_t xdiv = 0.;
c10e6eaf 789 if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
6296ba34 790 divpar[0] = (kPcbLength-xdiv-shiftR)/2.;
d1cd2474 791 divpar[1] = dydiv/2. - epsilon;
2057e0cc 792 divpar[2] = kSensWidth/2.;
6296ba34 793 Float_t xvol = (kPcbLength+xdiv)/2.+shiftR;
c10e6eaf 794 Float_t yvol = ydiv + dydiv/2.;
6296ba34 795
c10e6eaf 796 for (Int_t quadrant=1; quadrant<=4; quadrant++) {
797 sprintf(idSlatCh7,"LC%d",ConvertSlatNum(1,quadrant,kNslats4-1));
798 sprintf(idSlatCh8,"LD%d",ConvertSlatNum(1,quadrant,kNslats4-1));
6296ba34 799
a432117a 800 GetEnvelopes(6)->AddEnvelopeConstituentParam("S07G",idSlatCh7, quadrant*100+imax+4*idiv+1,
4846c3ab 801 TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
6296ba34 802
a432117a 803 GetEnvelopes(7)->AddEnvelopeConstituentParam("S08G", idSlatCh8, quadrant*100+imax+4*idiv+1,
4846c3ab 804 TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
d1cd2474 805 }
806 }
a432117a 807 // cout << "Geometry for Station 4...... done" << endl;
d1cd2474 808
809 }
810
811 if (fStations[4]) {
6296ba34 812
d1cd2474 813
814// //********************************************************************
815// // Station 5 **
816// //********************************************************************
817// // indices 1 and 2 for first and second chambers in the station
818// // iChamber (first chamber) kept for other quanties than Z,
819// // assumed to be the same in both chambers
c10e6eaf 820// corrected geometry (JP. Cussonneau, Ch. Finck)
d1cd2474 821
822 iChamber = GetChamber(8);
823 iChamber1 = iChamber;
824 iChamber2 = GetChamber(9);
825
2057e0cc 826 const Int_t kNslats5 = 7; // number of slats per quadrant
7ddb761c 827 const Int_t kNPCB5[kNslats5] = {5, 6, 6, 6, 5, 4, 3}; // n PCB per slat
c10e6eaf 828 const Float_t kXpos5[kNslats5] = {38.5, 0., 0., 0., 0., 0., 0.};
2057e0cc 829 Float_t slatLength5[kNslats5];
d1cd2474 830
831// // create and position the slat (mother) volumes
832
833 char idSlatCh9[5];
834 char idSlatCh10[5];
835 Float_t xSlat5;
836 Float_t ySlat5;
837 angle = 0.;
838
c10e6eaf 839 for (i = 0; i < kNslats5; i++){
2057e0cc 840 slatLength5[i] = kPcbLength * kNPCB5[i] + 2. * kDslatLength;
4846c3ab 841 xSlat5 = slatLength5[i]/2. + kVframeLength/2. +kXpos5[i];
2057e0cc 842 ySlat5 = kSensHeight * i - kYoverlap * i;
d1cd2474 843
844 spar[0] = slatLength5[i]/2.;
2057e0cc 845 spar[1] = kSlatHeight/2.;
846 spar[2] = kSlatWidth/2. * 1.01;
c10e6eaf 847 Float_t dzCh5 = spar[2]*1.01;
d1cd2474 848 // zSlat to be checked (odd downstream or upstream?)
849 Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2];
850
2057e0cc 851 sprintf(idSlatCh9,"LE%d",kNslats5-1+i);
a432117a 852 detElemId = 900 + i + kNslats5-1;
2057e0cc 853 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
a432117a 854 GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, ySlat5, zSlat+2.*dzCh5),
c10e6eaf 855 TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
d1cd2474 856
2057e0cc 857 sprintf(idSlatCh9,"LE%d",3*kNslats5-2+i);
a432117a 858 detElemId = 950 + i + kNslats5-1;
2057e0cc 859 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
a432117a 860 GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat-2.*dzCh5),
c10e6eaf 861 TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
d1cd2474 862
c10e6eaf 863 if (i > 0) {
864 sprintf(idSlatCh9,"LE%d",kNslats5-1-i);
a432117a 865 detElemId = 900 - i + kNslats5-1;
c10e6eaf 866 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
a432117a 867 GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, zSlat+2.*dzCh5),
c10e6eaf 868 TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
869
870 sprintf(idSlatCh9,"LE%d",3*kNslats5-2-i);
a432117a 871 detElemId = 950 - i + kNslats5-1;
c10e6eaf 872 gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
a432117a 873 GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat-2.*dzCh5),
c10e6eaf 874 TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
d1cd2474 875 }
876
2057e0cc 877 sprintf(idSlatCh10,"LF%d",kNslats5-1+i);
a432117a 878 detElemId = 1000 + i + kNslats5-1;
2057e0cc 879 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
a432117a 880 GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, ySlat5, zSlat+2.*dzCh5),
c10e6eaf 881 TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
d1cd2474 882
2057e0cc 883 sprintf(idSlatCh10,"LF%d",3*kNslats5-2+i);
a432117a 884 detElemId = 1050 + i + kNslats5-1;
2057e0cc 885 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
a432117a 886 GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat-2.*dzCh5),
c10e6eaf 887 TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
888
889 if (i > 0) {
890 sprintf(idSlatCh10,"LF%d",kNslats5-1-i);
a432117a 891 detElemId = 1000 - i + kNslats5-1;
c10e6eaf 892 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
a432117a 893 GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, zSlat+2.*dzCh5),
c10e6eaf 894 TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
895 sprintf(idSlatCh10,"LF%d",3*kNslats5-2-i);
a432117a 896 detElemId = 1050 - i + kNslats5-1;
c10e6eaf 897 gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
a432117a 898 GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat-2.*dzCh5),
c10e6eaf 899 TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
900 }
d1cd2474 901 }
c10e6eaf 902 // // create the panel volume
d1cd2474 903
2057e0cc 904 gMC->Gsvolu("S09C","BOX",kPanelMaterial,panelpar,3);
905 gMC->Gsvolu("S10C","BOX",kPanelMaterial,panelpar,3);
d1cd2474 906
907 // create the rohacell volume
908
2057e0cc 909 gMC->Gsvolu("S09R","BOX",kRohaMaterial,rohapar,3);
910 gMC->Gsvolu("S10R","BOX",kRohaMaterial,rohapar,3);
d1cd2474 911
912 // create the insulating material volume
913
2057e0cc 914 gMC->Gsvolu("S09I","BOX",kInsuMaterial,insupar,3);
915 gMC->Gsvolu("S10I","BOX",kInsuMaterial,insupar,3);
d1cd2474 916
917 // create the PCB volume
918
2057e0cc 919 gMC->Gsvolu("S09P","BOX",kPcbMaterial,pcbpar,3);
920 gMC->Gsvolu("S10P","BOX",kPcbMaterial,pcbpar,3);
d1cd2474 921
922 // create the sensitive volumes,
923
2057e0cc 924 gMC->Gsvolu("S09G","BOX",kSensMaterial,dum,0);
925 gMC->Gsvolu("S10G","BOX",kSensMaterial,dum,0);
d1cd2474 926
927 // create the vertical frame volume
928
2057e0cc 929 gMC->Gsvolu("S09V","BOX",kVframeMaterial,vFramepar,3);
930 gMC->Gsvolu("S10V","BOX",kVframeMaterial,vFramepar,3);
d1cd2474 931
932 // create the horizontal frame volume
933
2057e0cc 934 gMC->Gsvolu("S09H","BOX",kHframeMaterial,hFramepar,3);
935 gMC->Gsvolu("S10H","BOX",kHframeMaterial,hFramepar,3);
d1cd2474 936
937 // create the horizontal border volume
938
2057e0cc 939 gMC->Gsvolu("S09B","BOX",kBframeMaterial,bFramepar,3);
940 gMC->Gsvolu("S10B","BOX",kBframeMaterial,bFramepar,3);
d1cd2474 941
c10e6eaf 942 index = 0;
943 for (i = 0; i < kNslats5; i++){
944 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
d1cd2474 945
c10e6eaf 946 if (i == 0 && quadrant == 2) continue;
947 if (i == 0 && quadrant == 4) continue;
d1cd2474 948
c10e6eaf 949 sprintf(idSlatCh9,"LE%d",ConvertSlatNum(i,quadrant,kNslats5-1));
950 sprintf(idSlatCh10,"LF%d",ConvertSlatNum(i,quadrant,kNslats5-1));
951 Float_t xvFrame = (slatLength5[i] - kVframeLength)/2.;
d1cd2474 952
c10e6eaf 953 // position the vertical frames
4846c3ab 954 if (i != 1) {
a432117a 955 GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
956 GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
957 GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
958 GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
4846c3ab 959 } else { // no rounded spacer yet
960 GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
961 // GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
962 GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
963 // GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
c10e6eaf 964 }
4846c3ab 965
c10e6eaf 966 // position the panels and the insulating material
967 for (j = 0; j < kNPCB5[i]; j++){
968 if (i == 1 && j == 0) continue;
969 index++;
970 Float_t xx = kSensLength * (-kNPCB5[i]/2.+j+.5);
971
972 Float_t zPanel = spar[2] - panelpar[2];
a432117a 973 GetEnvelopes(8)->AddEnvelopeConstituent("S09C", idSlatCh9, 2*index-1,TGeoTranslation(xx,0.,zPanel));
974 GetEnvelopes(8)->AddEnvelopeConstituent("S09C", idSlatCh9, 2*index,TGeoTranslation(xx,0.,-zPanel));
975 GetEnvelopes(8)->AddEnvelopeConstituent("S09I", idSlatCh9, index,TGeoTranslation(xx,0.,0.));
976 GetEnvelopes(9)->AddEnvelopeConstituent("S10C", idSlatCh10, 2*index-1,TGeoTranslation(xx,0.,zPanel));
977 GetEnvelopes(9)->AddEnvelopeConstituent("S10C", idSlatCh10, 2*index,TGeoTranslation(xx,0.,-zPanel));
978 GetEnvelopes(9)->AddEnvelopeConstituent("S10I", idSlatCh10, index,TGeoTranslation(xx,0.,0.));
c10e6eaf 979 }
980 }
d1cd2474 981 }
982
983 // position the rohacell volume inside the panel volume
984 gMC->Gspos("S09R",1,"S09C",0.,0.,0.,0,"ONLY");
985 gMC->Gspos("S10R",1,"S10C",0.,0.,0.,0,"ONLY");
986
987 // position the PCB volume inside the insulating material volume
988 gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY");
989 gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY");
990 // position the horizontal frame volume inside the PCB volume
991 gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY");
992 gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY");
993 // position the sensitive volume inside the horizontal frame volume
994 gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3);
995 gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3);
996 // position the border volumes inside the PCB volume
2057e0cc 997 Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.;
d1cd2474 998 gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY");
999 gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY");
1000 gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY");
1001 gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY");
1002
c10e6eaf 1003 // // create the NULOC volume and position it in the horizontal frame
d1cd2474 1004
2057e0cc 1005 gMC->Gsvolu("S09N","BOX",kNulocMaterial,nulocpar,3);
1006 gMC->Gsvolu("S10N","BOX",kNulocMaterial,nulocpar,3);
d1cd2474 1007 index = 0;
c10e6eaf 1008 for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) {
d1cd2474 1009 index++;
2057e0cc 1010 gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
1011 gMC->Gspos("S09N",2*index ,"S09B", xx, 0., kBframeWidth/4., 0, "ONLY");
1012 gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
1013 gMC->Gspos("S10N",2*index ,"S10B", xx, 0., kBframeWidth/4., 0, "ONLY");
d1cd2474 1014 }
1015
c10e6eaf 1016 // // position the volumes approximating the circular section of the pipe
2057e0cc 1017 Float_t yoffs = kSensHeight/2. - kYoverlap;
d1cd2474 1018 Float_t epsilon = 0.001;
6296ba34 1019 Int_t ndiv = 10;
d1cd2474 1020 Double_t divpar[3];
c10e6eaf 1021 Double_t dydiv = kSensHeight/ndiv;
d1cd2474 1022 Double_t ydiv = yoffs -dydiv;
c10e6eaf 1023 Int_t imax = 0;
2057e0cc 1024 // for (Int_t islat=0; islat<kNslats3; islat++) imax += kNPCB3[islat];
d1cd2474 1025 imax = 1;
6296ba34 1026 Float_t rmin = 40.;
1027 Float_t shiftR = 0.;
c10e6eaf 1028 for (Int_t idiv = 0;idiv < ndiv; idiv++){
1029 ydiv += dydiv;
d1cd2474 1030 Float_t xdiv = 0.;
c10e6eaf 1031 if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
6296ba34 1032 divpar[0] = (kPcbLength-xdiv-shiftR)/2.;
d1cd2474 1033 divpar[1] = dydiv/2. - epsilon;
2057e0cc 1034 divpar[2] = kSensWidth/2.;
6296ba34 1035 Float_t xvol = (kPcbLength+xdiv)/2.+ shiftR;
c10e6eaf 1036 Float_t yvol = ydiv + dydiv/2.;
d1cd2474 1037
c10e6eaf 1038 for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
1039 sprintf(idSlatCh9,"LE%d",ConvertSlatNum(1,quadrant,kNslats5-1));
1040 sprintf(idSlatCh10,"LF%d",ConvertSlatNum(1,quadrant,kNslats5-1));
d1cd2474 1041
a432117a 1042 GetEnvelopes(8)->AddEnvelopeConstituentParam("S09G", idSlatCh9, quadrant*100+imax+4*idiv+1,
4846c3ab 1043 TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
a432117a 1044 GetEnvelopes(9)->AddEnvelopeConstituentParam("S10G", idSlatCh10, quadrant*100+imax+4*idiv+1,
4846c3ab 1045 TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
d1cd2474 1046 }
1047 }
a432117a 1048 // cout << "Geometry for Station 5...... done" << endl;
d1cd2474 1049
1050 }
1051}
1052
1053
1054//______________________________________________________________________________
1055void AliMUONSlatGeometryBuilder::SetTransformations()
1056{
1057// Defines the transformations for the station2 chambers.
1058// ---
1059
1060 AliMUONChamber* iChamber1 = GetChamber(4);
1061 Double_t zpos1 = - iChamber1->Z();
1062 iChamber1->GetGeometry()
1063 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
1064
1065 AliMUONChamber* iChamber2 = GetChamber(5);
1066 Double_t zpos2 = - iChamber2->Z();
1067 iChamber2->GetGeometry()
1068 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
1069
1070 iChamber1 = GetChamber(6);
1071 zpos1 = - iChamber1->Z();
1072 iChamber1->GetGeometry()
1073 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
1074
1075 iChamber2 = GetChamber(7);
1076 zpos2 = - iChamber2->Z();
1077 iChamber2->GetGeometry()
1078 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
1079
1080 iChamber1 = GetChamber(8);
1081 zpos1 = - iChamber1->Z();
1082 iChamber1->GetGeometry()
1083 ->SetTranslation(TGeoTranslation(0., 0., zpos1));
1084
1085 iChamber2 = GetChamber(9);
1086 zpos2 = - iChamber2->Z();
1087 iChamber2->GetGeometry()
1088 ->SetTranslation(TGeoTranslation(0., 0., zpos2));
1089
1090}
1091
1092//______________________________________________________________________________
1093void AliMUONSlatGeometryBuilder::SetSensitiveVolumes()
1094{
1095// Defines the sensitive volumes for slat stations chambers.
1096// ---
1097
1098 GetChamber(4)->GetGeometry()->SetSensitiveVolume("S05G");
1099 GetChamber(5)->GetGeometry()->SetSensitiveVolume("S06G");
1100 GetChamber(6)->GetGeometry()->SetSensitiveVolume("S07G");
1101 GetChamber(7)->GetGeometry()->SetSensitiveVolume("S08G");
1102 GetChamber(8)->GetGeometry()->SetSensitiveVolume("S09G");
1103 GetChamber(9)->GetGeometry()->SetSensitiveVolume("S10G");
1104}
1105
1106//______________________________________________________________________________
1107Int_t AliMUONSlatGeometryBuilder::ConvertSlatNum(Int_t numslat, Int_t quadnum, Int_t fspq) const
1108{
2057e0cc 1109// On-line function establishing the correspondance between numslat (the slat number on a particular quadrant (numslat->0....4 for St3))
1110// and slatnum (the slat number on the whole panel (slatnum->1...18 for St3)
c10e6eaf 1111 numslat += 1;
1112 if (quadnum==2 || quadnum==3)
1113 numslat += fspq;
1114 else
1115 numslat = fspq + 2-numslat;
1116 numslat -= 1;
d1cd2474 1117
c10e6eaf 1118 if (quadnum==3 || quadnum==4) numslat += 2*fspq+1;
1119
1120 return numslat;
d1cd2474 1121}