Warnings fixed
[u/mrichter/AliRoot.git] / ACORDE / AliACORDEv1.cxx
CommitLineData
b7b24482 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/* $Id: AliACORDEv1.cxx,v 1.2 2007/12/03 08:40:00 hristov Exp $ */
17
18///////////////////////////////////////////////////////////////////////////////
19// //
20// ALICE Cosmic Ray Trigger //
21// //
366f0bf5 22// This class contains the functions for final version of the ALICE Cosmic //
23// Ray Trigger. This version will be used to simulation comic rays in alice //
74696677 24// with all the detectors. It includes the last survey of 2009. //
366f0bf5 25// It include geometry and hits (position and momentum) //
b7b24482 26// //
74696677 27// Author: Mario Rodriguez Cahuantzi, FCFM-BUAP, Puebla, Pue. Mexico //
28// //
b7b24482 29// Send comments to: //
30// //
31// Arturo Fernandez Tellez <afernand@fcfm.buap.mx> //
b7b24482 32// Eleazar Cuautle Flores <ecuautle@nucleares.unam.mx> //
33// Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> //
34// //
35// Puebla, Pue. Mexico December 2007 //
20868cc6 36// //
74696677 37// Last Update: Nov. 17th 2009 //
38// Mario Rodriguez Cahuantzi //
b7b24482 39///////////////////////////////////////////////////////////////////////////////
40
41
b7b24482 42#include <Riostream.h>
43#include <TGeoMatrix.h>
b7b24482 44#include <TMath.h>
b7b24482 45#include <TString.h>
46#include <TSystem.h>
47
48#include "AliConst.h"
49#include "AliRun.h"
50
51#include "TGeoManager.h"
52#include "TGeoVolume.h"
53#include "TGeoPcon.h"
b7b24482 54#include "TGeoPgon.h"
55#include "TGeoTrd1.h"
56#include "TGeoCompositeShape.h"
57#include "TGeoPara.h"
b7b24482 58
59#include "AliACORDEv1.h"
60#include <TClonesArray.h>
61#include <TLorentzVector.h>
62#include <TVirtualMC.h>
63#include <TPDGCode.h>
b7b24482 64
65#include "AliRun.h"
66#include "AliConst.h"
67#include "AliACORDEhit.h"
68#include "AliACORDEConstants.h"
69#include "AliMC.h"
70#include "AliLog.h"
71
72ClassImp(AliACORDEv1)
73
74//_____________________________________________________________________________
75AliACORDEv1::AliACORDEv1()
76 : AliACORDE()
77{
78 //
79 // Default constructor
80 fIshunt = 0;
81 fHits = 0;
82 //
83}
84//_____________________________________________________________________________
85AliACORDEv1::AliACORDEv1(const char *name, const char *title)
86 : AliACORDE(name, title)
87{
88 //
89 // Standard constructor
90 //
91 fIshunt = 1; // All hits are associated with primary particles
92 fHits = new TClonesArray("AliACORDEhit",400);
93 gAlice->GetMCApp()->AddHitList(fHits);
94}
95//_____________________________________________________________________________
96AliACORDEv1::~AliACORDEv1()
97{
98 //
99 // Default destructor
100 //
101}
102//_____________________________________________________________________________
b7b24482 103void AliACORDEv1::CreateGeometry()
104{
105 CreateAcorde();
b7b24482 106}
b7b24482 107void AliACORDEv1::CreateAcorde()
108{
109
b7b24482 110 // Call the global constants for the Modules
111
112 AliACORDEConstants* constants = AliACORDEConstants::Instance();
113
114 // Get the Alice Volume
115
116 TGeoVolume *alice = gGeoManager->GetVolume("ALIC");
117
118 // Define some materials & medium
119
74696677 120 //*** Aluminium ***
b7b24482 121
74696677 122 TGeoMedium* aluminium = gGeoManager->GetMedium("ACORDE_ALU_C0");
b7b24482 123
74696677 124 //*** Scintillator ***
b7b24482 125
74696677 126 TGeoMedium* scintillator = gGeoManager->GetMedium("ACORDE_CPV scint.1");
b7b24482 127
74696677 128 //Define the mother volume for the ACORDE detector
b7b24482 129
74696677 130 TGeoVolume *acorde = new TGeoVolumeAssembly("ACORDE");
b7b24482 131
b7b24482 132
74696677 133 // Define 2 main-daughter volumes for ACORDE
134
135 TGeoVolume *supportBars = new TGeoVolumeAssembly("ACORDE_SUPPORTS_BARS");
136 TGeoVolume *acordeModules = new TGeoVolumeAssembly("ALL_ACORDE_MODULES");
b7b24482 137
b7b24482 138
139 // Define rotation Matrix for Side's faces in Alice
140
141 TGeoRotation *idrotm231 = new TGeoRotation("idrotm231",90, 45, 90, 135, 0, 0);
142 TGeoRotation *idrotm232 = new TGeoRotation("idrotm232",90, 315, 90, 45, 0, 0);
143
74696677 144 // Begin the Geometry for ACORDE
b7b24482 145
146 // *** Definition of ACORDE's Modules ***
147
148 // Define Measures of ACORDE's Modules
149
74696677 150 Float_t acoFrameBox1[3],acoFrameBox2[3];
151
152 acoFrameBox1[0] = constants->ModuleLength()/2;
153 acoFrameBox1[1] = constants->ModuleHeight()/2;
154 acoFrameBox1[2] = 2.50;
155
156 acoFrameBox2[0] = 20.0;
157 acoFrameBox2[1] = constants->ModuleHeight()/2;
158 acoFrameBox2[2] = 10.0;
b7b24482 159
160 // Define Measures of Scintillators
161
74696677 162 Float_t acoScinBox[3];
163 acoScinBox[0] = constants->PlasticLength()/2;
164 acoScinBox[1] = constants->PlasticHeight()/2;
165 acoScinBox[2] = constants->PlasticWidth()/2;
b7b24482 166
167
74696677 168 // Create the Modules of ACORDE, 1 aluminium frame and two scintillator plastics
b7b24482 169
170 //*** Aluminium frame ***
171
74696677 172 TGeoBBox *acordeModFrameBoxL = new TGeoBBox("acordeModFrameBoxL",acoFrameBox1[0],acoFrameBox1[1],acoFrameBox1[2]);
173 TGeoBBox *acordeModFrameBoxH = new TGeoBBox("acordeModFrameBoxH",acoFrameBox2[0],acoFrameBox2[1],acoFrameBox2[2]);
174 TGeoVolume *acordeModFrameVolumeL = new TGeoVolume("ACORDEMODFRAMEVOLUMEL",acordeModFrameBoxL,aluminium);
175 TGeoVolume *acordeModFrameVolumeH = new TGeoVolume("ACORDEMODFRAMEVOLUMEH",acordeModFrameBoxH,aluminium);
176
b7b24482 177
178 //*** Scintillators ***
179
74696677 180 TGeoBBox *acordeScintillatorBox = new TGeoBBox("acordeScintillatorBox",acoScinBox[0],acoScinBox[1],acoScinBox[2]);
181 TGeoVolume *acordeScintillatorVolume = new TGeoVolume("ACORDESCINTILLATORMODULE",acordeScintillatorBox,scintillator);
b7b24482 182
183
74696677 184 // Here I create a single ACORDE module and then we make 60 copies of it
b7b24482 185
74696677 186 TGeoVolume *acordeSingleModule = new TGeoVolumeAssembly("ACORDE_MODULE");
187 acordeSingleModule->AddNode(acordeModFrameVolumeL,1,new TGeoTranslation("acordeFrame_01",0,0,12.5));
188 acordeSingleModule->AddNode(acordeModFrameVolumeL,2,new TGeoTranslation("acordeFrame_02",0,0,-12.5));
189 acordeSingleModule->AddNode(acordeModFrameVolumeH,3,new TGeoTranslation("acordeFrame_03",130,0,0));
190 acordeSingleModule->AddNode(acordeModFrameVolumeH,4,new TGeoTranslation("acordeFrame_04",-130,0,0));
191 acordeSingleModule->AddNode(acordeScintillatorVolume,5, new TGeoTranslation("acordeScintillator_01",0,1,0));
192 acordeSingleModule->AddNode(acordeScintillatorVolume,6, new TGeoTranslation("acordeScintillator_01",0,-1,0));
b7b24482 193
194 // Put the Modules of In-Face
195
74696677 196 for(Int_t iAcordeModule=1;iAcordeModule<9;iAcordeModule++)
197 {
b7b24482 198
74696677 199 Float_t posx = constants->CenterModulePositionX(iAcordeModule);
200 Float_t posy = constants->CenterModulePositionY(iAcordeModule);
201 Float_t posz = constants->CenterModulePositionZ(iAcordeModule);
4490d930 202
74696677 203 acordeModules->AddNode(acordeSingleModule,iAcordeModule,
ee0da434 204 new TGeoCombiTrans("aco01",posx,posy,posz,idrotm232));
b7b24482 205 }
206
74696677 207 for(Int_t iAcordeModule=10;iAcordeModule<20;iAcordeModule++)
208 {
209 Float_t posx = constants->CenterModulePositionX(iAcordeModule);
210 Float_t posy = constants->CenterModulePositionY(iAcordeModule);
211 Float_t posz = constants->CenterModulePositionZ(iAcordeModule);
b7b24482 212
74696677 213 acordeModules->AddNode(acordeSingleModule,iAcordeModule,
ee0da434 214 new TGeoCombiTrans("aco01",posx,posy,posz,idrotm232));
b7b24482 215 }
216
217 // Put he Modules of Up-Face
218
74696677 219 for(Int_t iAcordeModule=20;iAcordeModule<40;iAcordeModule++)
220 {
221 Float_t posx = constants->CenterModulePositionX(iAcordeModule);
222 Float_t posy = constants->CenterModulePositionY(iAcordeModule);
223 Float_t posz = constants->CenterModulePositionZ(iAcordeModule);
b7b24482 224
74696677 225 acordeModules->AddNode(acordeSingleModule,iAcordeModule,new TGeoTranslation("aco01",posx,posy,posz));
b7b24482 226 }
227
228 // Put the Modules of Out-Face
229
74696677 230 for(Int_t iAcordeModule=40;iAcordeModule<50;iAcordeModule++)
231 {
232 Float_t posx = constants->CenterModulePositionX(iAcordeModule);
233 Float_t posy = constants->CenterModulePositionY(iAcordeModule);
234 Float_t posz = constants->CenterModulePositionZ(iAcordeModule);
b7b24482 235
74696677 236 acordeModules->AddNode(acordeSingleModule,iAcordeModule,
ee0da434 237 new TGeoCombiTrans("aco01",posx,posy,posz,idrotm231));
b7b24482 238 }
239
240 // Put the Modules of Out-Face
241
74696677 242 for(Int_t iAcordeModule=51;iAcordeModule<59;iAcordeModule++)
243 {
244 Float_t posx = constants->CenterModulePositionX(iAcordeModule);
245 Float_t posy = constants->CenterModulePositionY(iAcordeModule);
246 Float_t posz = constants->CenterModulePositionZ(iAcordeModule);
247 acordeModules->AddNode(acordeSingleModule,iAcordeModule,
ee0da434 248 new TGeoCombiTrans("aco01",posx,posy,posz,idrotm231));
b7b24482 249 }
250
74696677 251 // Put the 4-central modules (Old-ITS modules)
252 if (Get4CentralModulesGeometry())
253 {
254 acordeModules->AddNode(acordeSingleModule,0,
255 new TGeoTranslation("Mod0_0",constants->CenterModulePositionX(0),constants->CenterModulePositionY(0),constants->CenterModulePositionZ(0)));
256 acordeModules->AddNode(acordeSingleModule,9,
257 new TGeoTranslation("Mod0_9",constants->CenterModulePositionX(9),constants->CenterModulePositionY(9),constants->CenterModulePositionZ(9)));
258 acordeModules->AddNode(acordeSingleModule,50,
259 new TGeoTranslation("Mod0_50",constants->CenterModulePositionX(50),constants->CenterModulePositionY(50),constants->CenterModulePositionZ(50)));
260 acordeModules->AddNode(acordeSingleModule,59,
261 new TGeoTranslation("Mod0_59",constants->CenterModulePositionX(59),constants->CenterModulePositionY(59),constants->CenterModulePositionZ(59)));
262 }
b7b24482 263
74696677 264 // Create a dummy support & bars of Aluminium (it doesn't exist a survey of this structure)
b7b24482 265
74696677 266 Float_t boxLongSupport[3],boxThinSupport[3];
b7b24482 267
74696677 268 boxLongSupport[0]=10.0;
269 boxLongSupport[1]=0.5;
270 boxLongSupport[2]=500.0;
b7b24482 271
74696677 272 boxThinSupport[0]=1.0;
273 boxThinSupport[1]=7.0;
274 boxThinSupport[2]=500.0;
b7b24482 275
74696677 276 TGeoBBox *acordeLongSupport = new TGeoBBox("ACORDELONGSUPPORT",boxLongSupport[0],boxLongSupport[1],boxLongSupport[2]);
277 TGeoBBox *acordeThinSupport = new TGeoBBox("ACORDETHINSUPPORT",boxThinSupport[0],boxThinSupport[1],boxThinSupport[2]);
b7b24482 278
74696677 279 TGeoVolume *acordeLSupport = new TGeoVolume("ACORDELS",acordeLongSupport,aluminium);
280 TGeoVolume *acordeTSupport = new TGeoVolume("ACORDETS",acordeThinSupport,aluminium);
281 TGeoVolume *acordeMainSupport = new TGeoVolumeAssembly("ACORDE_SUPPORT");
282 acordeMainSupport->AddNode(acordeLSupport,1,new TGeoTranslation("ACOLSA",0,7.5,0));
283 acordeMainSupport->AddNode(acordeLSupport,2,new TGeoTranslation("ACOLSB",0,-7.5,0));
284 acordeMainSupport->AddNode(acordeTSupport,3);
b7b24482 285
74696677 286 // Set the values for the bars support
287
288 Float_t boxSingleBar[3];
289 boxSingleBar[0]=10;
290 boxSingleBar[1]=37;//36.722; // Correction to avoid overlaps with the L3 magnet
291 boxSingleBar[2]=10;
292
293 Float_t boxUnionUp[3];
294 boxUnionUp[0]=10;
295 boxUnionUp[1]=0.5;
296 boxUnionUp[2]=15;
297
298 Float_t boxUnionDown[3];
299 boxUnionDown[0]=20;
300 boxUnionDown[1]=1;
301 boxUnionDown[2]=20;
302
303 // Volume and Box for the bar
304
305 TGeoBBox *acordeSingleBarSupport = new TGeoBBox("ACORDESBARS",boxSingleBar[0],boxSingleBar[1],boxSingleBar[2]);
306 TGeoVolume *acordeBarSupport = new TGeoVolume("ACORDEBARSUPPORT",acordeSingleBarSupport,aluminium);
b7b24482 307
74696677 308 // Volume and Box for the bar union with the long support (Up-with supports and Down with L3 magnet)
309
310 TGeoBBox *acordeSingleBoxUnionUp = new TGeoBBox("ACORDEBUP",boxUnionUp[0],boxUnionUp[1],boxUnionUp[2]);
311 TGeoVolume *acordeBoxUnionUp = new TGeoVolume("ACORDEBOXUNIONUP",acordeSingleBoxUnionUp,aluminium);
312
313 TGeoBBox *acordeSingleBoxUnionDown = new TGeoBBox("ACORDEBDOWN",boxUnionDown[0],boxUnionDown[1],boxUnionDown[2]);
314 TGeoVolume *acordeBoxUnionDown = new TGeoVolume("ACORDEBOXUNIONDOWN",acordeSingleBoxUnionDown,aluminium);
315
316 TGeoVolume *acordeMainBar = new TGeoVolumeAssembly("ACORDE_BAR");
317 acordeMainBar->AddNode(acordeBoxUnionUp,1,new TGeoTranslation("ACOBAR01",0,boxSingleBar[1]+boxUnionUp[1],0));
318 acordeMainBar->AddNode(acordeBarSupport,2);
319 acordeMainBar->AddNode(acordeBoxUnionDown,3,new TGeoTranslation("ACOBAR01",0,-boxSingleBar[1]-boxUnionDown[1],0));
320
321 // Volume for the Full support (supports and bars) UP face of L3 Magnet
322 Float_t supportPosXIn = constants->CenterModulePositionX(20);
323 Float_t supportPosY = 859.044-7.5-5.5; // Minimum module position Y less the heigh of the support
324 Float_t supportPosZ = 0;
325 Float_t supportPosXOut = constants->CenterModulePositionX(30);
326 Float_t deltaXA = 120.;
327 Float_t deltaXB = 60.;
328
329 TGeoVolume *acordeFullSupportUpFace = new TGeoVolumeAssembly("ACORDE_FULL_SUPPORT_UPFACE");
330 acordeFullSupportUpFace->AddNode(acordeMainSupport,1,new TGeoTranslation("ACOFSB01",supportPosXIn+deltaXA,supportPosY,supportPosZ));
331 acordeFullSupportUpFace->AddNode(acordeMainSupport,2,new TGeoTranslation("ACOFSB02",supportPosXIn+deltaXB,supportPosY,supportPosZ));
332 acordeFullSupportUpFace->AddNode(acordeMainSupport,3,new TGeoTranslation("ACOFSB03",supportPosXIn-deltaXA,supportPosY,supportPosZ));
333 acordeFullSupportUpFace->AddNode(acordeMainSupport,4,new TGeoTranslation("ACOFSB04",supportPosXIn-deltaXB,supportPosY,supportPosZ));
334 acordeFullSupportUpFace->AddNode(acordeMainSupport,5,new TGeoTranslation("ACOFSB05",supportPosXOut+deltaXA,supportPosY,supportPosZ));
335 acordeFullSupportUpFace->AddNode(acordeMainSupport,6,new TGeoTranslation("ACOFSB06",supportPosXOut+deltaXB,supportPosY,supportPosZ));
336 acordeFullSupportUpFace->AddNode(acordeMainSupport,7,new TGeoTranslation("ACOFSB07",supportPosXOut-deltaXA,supportPosY,supportPosZ));
337 acordeFullSupportUpFace->AddNode(acordeMainSupport,8,new TGeoTranslation("ACOFSB08",supportPosXOut-deltaXB,supportPosY,supportPosZ));
338
339 // Put the bars in the main volume acordeFullSupportUpFace
b7b24482 340
74696677 341 Float_t barPosXIn = constants->CenterModulePositionX(20);
342 Float_t barPosY = supportPosY-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
343 Float_t barPosZ = 0;
344 Int_t barIndex = 9;
345 for(Int_t iBarModule = 20; iBarModule<30; iBarModule+=2)
b7b24482 346 {
74696677 347 barPosZ = constants->CenterModulePositionZ(iBarModule);
348 acordeFullSupportUpFace->AddNode(acordeMainBar,barIndex,new TGeoTranslation("ACOFSB09",barPosXIn+deltaXA,barPosY,barPosZ));
349 acordeFullSupportUpFace->AddNode(acordeMainBar,barIndex+1,new TGeoTranslation("ACOFSB09",barPosXIn+deltaXB,barPosY,barPosZ));
350 acordeFullSupportUpFace->AddNode(acordeMainBar,barIndex+2,new TGeoTranslation("ACOFSB09",barPosXIn-deltaXA,barPosY,barPosZ));
351 acordeFullSupportUpFace->AddNode(acordeMainBar,barIndex+3,new TGeoTranslation("ACOFSB09",barPosXIn-deltaXB,barPosY,barPosZ));
b7b24482 352
74696677 353 barIndex+=4;
b7b24482 354 }
355
74696677 356 Float_t barPosXOut = constants->CenterModulePositionX(30);
357 for(Int_t iBarModule = 30; iBarModule<40; iBarModule+=2)
358 {
359 barPosZ = constants->CenterModulePositionZ(iBarModule);
360 acordeFullSupportUpFace->AddNode(acordeMainBar,barIndex,new TGeoTranslation("ACOFSB09",barPosXOut+deltaXA,barPosY,barPosZ));
361 acordeFullSupportUpFace->AddNode(acordeMainBar,barIndex+1,new TGeoTranslation("ACOFSB09",barPosXOut+deltaXB,barPosY,barPosZ));
362 acordeFullSupportUpFace->AddNode(acordeMainBar,barIndex+2,new TGeoTranslation("ACOFSB09",barPosXOut-deltaXA,barPosY,barPosZ));
363 acordeFullSupportUpFace->AddNode(acordeMainBar,barIndex+3,new TGeoTranslation("ACOFSB09",barPosXOut-deltaXB,barPosY,barPosZ));
b7b24482 364
74696677 365 barIndex+=4;
366 }
b7b24482 367
74696677 368 // Supports and bars for the InSide of L3 Magnet
b7b24482 369
74696677 370 TGeoVolume *acordeFullSupportInFace = new TGeoVolumeAssembly("ACORDE_FULL_SUPPORT_INFACE");
371 Float_t supportPosXInA = constants->CenterModulePositionX(1)+deltaXA;
372 Float_t supportPosYInA = 592.017-7.5-5.5;
373 Float_t x0 = constants->CenterModulePositionX(1);
374 Float_t y0 = constants->CenterModulePositionY(1);
375 Float_t theta = -1*TMath::Pi()/4;
376 Float_t supportPosXInPA = x0+(supportPosXInA-x0)*TMath::Cos(theta)-(supportPosYInA-y0)*TMath::Sin(theta);
377 Float_t supportPosYInPA = y0+(supportPosYInA-y0)*TMath::Cos(theta)+(supportPosXInA-x0)*TMath::Sin(theta);
378 Float_t supportPosZInIn = 0;
b7b24482 379
74696677 380 Float_t supportPosXInB = constants->CenterModulePositionX(1)+deltaXB;
381 Float_t supportPosXInPB = x0+(supportPosXInB-x0)*TMath::Cos(theta)-(supportPosYInA-y0)*TMath::Sin(theta);
382 Float_t supportPosYInPB = y0+(supportPosYInA-y0)*TMath::Cos(theta)+(supportPosXInB-x0)*TMath::Sin(theta);
b7b24482 383
74696677 384 Float_t supportPosXInC = constants->CenterModulePositionX(1)-deltaXA;
385 Float_t supportPosXInPC = x0+(supportPosXInC-x0)*TMath::Cos(theta)-(supportPosYInA-y0)*TMath::Sin(theta);
386 Float_t supportPosYInPC = y0+(supportPosYInA-y0)*TMath::Cos(theta)+(supportPosXInC-x0)*TMath::Sin(theta);
b7b24482 387
74696677 388 Float_t supportPosXInD = constants->CenterModulePositionX(1)-deltaXB;
389 Float_t supportPosXInPD = x0+(supportPosXInD-x0)*TMath::Cos(theta)-(supportPosYInA-y0)*TMath::Sin(theta);
390 Float_t supportPosYInPD = y0+(supportPosYInA-y0)*TMath::Cos(theta)+(supportPosXInD-x0)*TMath::Sin(theta);
b7b24482 391
b7b24482 392
74696677 393 acordeFullSupportInFace->AddNode(acordeMainSupport,1,new TGeoCombiTrans("ACOFSBIN01",supportPosXInPA,supportPosYInPA,supportPosZInIn,idrotm232));
394 acordeFullSupportInFace->AddNode(acordeMainSupport,2,new TGeoCombiTrans("ACOFSBIN02",supportPosXInPB,supportPosYInPB,supportPosZInIn,idrotm232));
395 acordeFullSupportInFace->AddNode(acordeMainSupport,3,new TGeoCombiTrans("ACOFSBIN03",supportPosXInPC,supportPosYInPC,supportPosZInIn,idrotm232));
396 acordeFullSupportInFace->AddNode(acordeMainSupport,4,new TGeoCombiTrans("ACOFSBIN04",supportPosXInPD,supportPosYInPD,supportPosZInIn,idrotm232));
b7b24482 397
74696677 398 Float_t supportPosXInE = constants->CenterModulePositionX(10)+deltaXA;
399 Float_t supportPosYInE = 806.312-7.5-5.5;
400 Float_t x00 = constants->CenterModulePositionX(10);
401 Float_t y00 = constants->CenterModulePositionY(10);
402 Float_t supportPosXInPE = x00+(supportPosXInE-x00)*TMath::Cos(theta)-(supportPosYInE-y00)*TMath::Sin(theta);
403 Float_t supportPosYInPE = y00+(supportPosYInE-y00)*TMath::Cos(theta)+(supportPosXInE-x00)*TMath::Sin(theta);
b7b24482 404
74696677 405 Float_t supportPosXInF = constants->CenterModulePositionX(10)+deltaXB;
406 Float_t supportPosXInPF = x00+(supportPosXInF-x00)*TMath::Cos(theta)-(supportPosYInE-y00)*TMath::Sin(theta);
407 Float_t supportPosYInPF = y00+(supportPosYInE-y00)*TMath::Cos(theta)+(supportPosXInF-x00)*TMath::Sin(theta);
b7b24482 408
74696677 409 Float_t supportPosXInG = constants->CenterModulePositionX(10)-deltaXA+100;
410 Float_t supportPosXInPG = x00+(supportPosXInG-x00)*TMath::Cos(theta)-(supportPosYInE-y00)*TMath::Sin(theta);
411 Float_t supportPosYInPG = y00+(supportPosYInE-y00)*TMath::Cos(theta)+(supportPosXInG-x00)*TMath::Sin(theta);
b7b24482 412
74696677 413 acordeFullSupportInFace->AddNode(acordeMainSupport,5,new TGeoCombiTrans("ACOFSBIN05",supportPosXInPE,supportPosYInPE,supportPosZInIn,idrotm232));
414 acordeFullSupportInFace->AddNode(acordeMainSupport,6,new TGeoCombiTrans("ACOFSBIN06",supportPosXInPF,supportPosYInPF,supportPosZInIn,idrotm232));
415 acordeFullSupportInFace->AddNode(acordeMainSupport,7,new TGeoCombiTrans("ACOFSBIN07",supportPosXInPG,supportPosYInPG,supportPosZInIn,idrotm232));
b7b24482 416
74696677 417 // Put the bars in the main volume acordeFullSupportInFace
b7b24482 418
74696677 419 Int_t barIndexIn = 8;
b7b24482 420
74696677 421 for (Int_t iBarModule=1; iBarModule<9; iBarModule+=2)
b7b24482 422 {
74696677 423 Float_t barPosXInIn = constants->CenterModulePositionX(iBarModule)+deltaXA;
424 Float_t barPosYInIn = supportPosYInA-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
425 Float_t barPosZInIn = constants->CenterModulePositionZ(iBarModule);
426 Float_t barPosXInP = x0+(barPosXInIn-x0)*TMath::Cos(theta)-(barPosYInIn-y0)*TMath::Sin(theta);
427 Float_t barPosYInP = y0+(barPosYInIn-y0)*TMath::Cos(theta)+(barPosXInIn-x0)*TMath::Sin(theta);
428
429 Float_t barPosXInInA = constants->CenterModulePositionX(iBarModule)+deltaXB;
430 Float_t barPosYInInA = supportPosYInA-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
431 Float_t barPosZInInA = constants->CenterModulePositionZ(iBarModule);
432 Float_t barPosXInPA = x0+(barPosXInInA-x0)*TMath::Cos(theta)-(barPosYInInA-y0)*TMath::Sin(theta);
433 Float_t barPosYInPA = y0+(barPosYInInA-y0)*TMath::Cos(theta)+(barPosXInInA-x0)*TMath::Sin(theta);
434
435 Float_t barPosXInInB = constants->CenterModulePositionX(iBarModule)-deltaXA;
436 Float_t barPosYInInB = supportPosYInA-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
437 Float_t barPosZInInB = constants->CenterModulePositionZ(iBarModule);
438 Float_t barPosXInPB = x0+(barPosXInInB-x0)*TMath::Cos(theta)-(barPosYInInB-y0)*TMath::Sin(theta);
439 Float_t barPosYInPB = y0+(barPosYInInB-y0)*TMath::Cos(theta)+(barPosXInInB-x0)*TMath::Sin(theta);
440
441 Float_t barPosXInInC = constants->CenterModulePositionX(iBarModule)-deltaXB;
442 Float_t barPosYInInC = supportPosYInA-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
443 Float_t barPosZInInC = constants->CenterModulePositionZ(iBarModule);
444 Float_t barPosXInPC = x0+(barPosXInInC-x0)*TMath::Cos(theta)-(barPosYInInC-y0)*TMath::Sin(theta);
445 Float_t barPosYInPC = y0+(barPosYInInC-y0)*TMath::Cos(theta)+(barPosXInInC-x0)*TMath::Sin(theta);
446
447 acordeFullSupportInFace->AddNode(acordeMainBar,barIndexIn,new TGeoCombiTrans("ACOFSBIN08",barPosXInP,barPosYInP,barPosZInIn,idrotm232));
448 acordeFullSupportInFace->AddNode(acordeMainBar,barIndexIn+1,new TGeoCombiTrans("ACOFSBIN09",barPosXInPA,barPosYInPA,barPosZInInA,idrotm232));
449 acordeFullSupportInFace->AddNode(acordeMainBar,barIndexIn+2,new TGeoCombiTrans("ACOFSBIN10",barPosXInPB,barPosYInPB,barPosZInInB,idrotm232));
450 acordeFullSupportInFace->AddNode(acordeMainBar,barIndexIn+3,new TGeoCombiTrans("ACOFSBIN11",barPosXInPC,barPosYInPC,barPosZInInC,idrotm232));
451
452 barIndexIn+=4;
b7b24482 453 }
454
74696677 455 for (Int_t iBarModule=10; iBarModule<20; iBarModule+=2)
456 {
457 Float_t barPosXInIn = constants->CenterModulePositionX(iBarModule)+deltaXA;
458 Float_t barPosYInIn = supportPosYInE-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
459 Float_t barPosZInIn = constants->CenterModulePositionZ(iBarModule);
460 Float_t barPosXInP = x00+(barPosXInIn-x00)*TMath::Cos(theta)-(barPosYInIn-y00)*TMath::Sin(theta);
461 Float_t barPosYInP = y00+(barPosYInIn-y00)*TMath::Cos(theta)+(barPosXInIn-x00)*TMath::Sin(theta);
b7b24482 462
74696677 463 Float_t barPosXInInA = constants->CenterModulePositionX(iBarModule)+deltaXB;
464 Float_t barPosYInInA = supportPosYInE-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
465 Float_t barPosZInInA = constants->CenterModulePositionZ(iBarModule);
466 Float_t barPosXInPA = x00+(barPosXInInA-x00)*TMath::Cos(theta)-(barPosYInInA-y00)*TMath::Sin(theta);
467 Float_t barPosYInPA = y00+(barPosYInInA-y00)*TMath::Cos(theta)+(barPosXInInA-x00)*TMath::Sin(theta);
b7b24482 468
74696677 469 Float_t barPosXInInB = constants->CenterModulePositionX(iBarModule)-deltaXA+100;
470 Float_t barPosYInInB = supportPosYInE-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
471 Float_t barPosZInInB = constants->CenterModulePositionZ(iBarModule);
472 Float_t barPosXInPB = x00+(barPosXInInB-x00)*TMath::Cos(theta)-(barPosYInInB-y00)*TMath::Sin(theta);
473 Float_t barPosYInPB = y00+(barPosYInInB-y00)*TMath::Cos(theta)+(barPosXInInB-x00)*TMath::Sin(theta);
b7b24482 474
74696677 475 acordeFullSupportInFace->AddNode(acordeMainBar,barIndexIn,new TGeoCombiTrans("ACOFSBIN08",barPosXInP,barPosYInP,barPosZInIn,idrotm232));
476 acordeFullSupportInFace->AddNode(acordeMainBar,barIndexIn+1,new TGeoCombiTrans("ACOFSBIN09",barPosXInPA,barPosYInPA,barPosZInInA,idrotm232));
477 acordeFullSupportInFace->AddNode(acordeMainBar,barIndexIn+2,new TGeoCombiTrans("ACOFSBIN10",barPosXInPB,barPosYInPB,barPosZInInB,idrotm232));
b7b24482 478
74696677 479 barIndexIn+=4;
480 }
b7b24482 481
b7b24482 482
74696677 483 // Construction of the support and bars for the OutSide
b7b24482 484
b7b24482 485
74696677 486 TGeoVolume *acordeFullSupportOutFace = new TGeoVolumeAssembly("ACORDE_FULL_SUPPORT_OUTFACE");
487 Float_t supportPosXOutA = constants->CenterModulePositionX(45)+deltaXA-90;
488 Float_t supportPosYOutA = 807.2915-7.5-5.5;
489 Float_t x000 = constants->CenterModulePositionX(45);
490 Float_t y000 = constants->CenterModulePositionY(45);
491 Float_t theta1 = 1*TMath::Pi()/4;
b7b24482 492
74696677 493 Float_t supportPosXOutPA = x000+(supportPosXOutA-x000)*TMath::Cos(theta1)-(supportPosYOutA-y000)*TMath::Sin(theta1);
494 Float_t supportPosYOutPA = y000+(supportPosYOutA-y000)*TMath::Cos(theta1)+(supportPosXOutA-x000)*TMath::Sin(theta1);
495 Float_t supportPosZOutIn = 0;
b7b24482 496
497
74696677 498 Float_t supportPosXOutC = constants->CenterModulePositionX(45)-deltaXA;
499 Float_t supportPosXOutPC = x000+(supportPosXOutC-x000)*TMath::Cos(theta1)-(supportPosYOutA-1-y000)*TMath::Sin(theta1);
500 Float_t supportPosYOutPC = y000+(supportPosYOutA-1-y000)*TMath::Cos(theta1)+(supportPosXOutC-x000)*TMath::Sin(theta1);
b7b24482 501
74696677 502 Float_t supportPosXOutD = constants->CenterModulePositionX(45)-deltaXB;
503 Float_t supportPosXOutPD = x000+(supportPosXOutD-x000)*TMath::Cos(theta1)-(supportPosYOutA-1-y000)*TMath::Sin(theta1);
504 Float_t supportPosYOutPD = y000+(supportPosYOutA-1-y000)*TMath::Cos(theta1)+(supportPosXOutD-x000)*TMath::Sin(theta1);
b7b24482 505
b7b24482 506
74696677 507 acordeFullSupportOutFace->AddNode(acordeMainSupport,1,new TGeoCombiTrans("ACOFSBOUT01",supportPosXOutPA,supportPosYOutPA,supportPosZOutIn,idrotm231));
508 acordeFullSupportOutFace->AddNode(acordeMainSupport,2,new TGeoCombiTrans("ACOFSBOUT02",supportPosXOutPC,supportPosYOutPC,supportPosZOutIn,idrotm231));
509 acordeFullSupportOutFace->AddNode(acordeMainSupport,3,new TGeoCombiTrans("ACOFSBOUT03",supportPosXOutPD,supportPosYOutPD,supportPosZOutIn,idrotm231));
510
b7b24482 511
74696677 512 Float_t supportPosXOutE = constants->CenterModulePositionX(52)+deltaXA;
513 Float_t supportPosYOutE = 585.616-7.5-5.5-0.1;
514 Float_t x0000 = constants->CenterModulePositionX(52);
515 Float_t y0000 = constants->CenterModulePositionY(52);
b7b24482 516
74696677 517 Float_t supportPosXOutEP = x0000+(supportPosXOutE-x0000)*TMath::Cos(theta1)-(supportPosYOutE-y0000)*TMath::Sin(theta1);
518 Float_t supportPosYOutEP = y0000+(supportPosYOutE-y0000)*TMath::Cos(theta1)+(supportPosXOutE-x0000)*TMath::Sin(theta1);
519
520 Float_t supportPosXOutF = constants->CenterModulePositionX(52)+deltaXB;
b7b24482 521
74696677 522 Float_t supportPosXOutFP = x0000+(supportPosXOutF-x0000)*TMath::Cos(theta1)-(supportPosYOutE-y0000)*TMath::Sin(theta1);
523 Float_t supportPosYOutFP = y0000+(supportPosYOutE-y0000)*TMath::Cos(theta1)+(supportPosXOutF-x0000)*TMath::Sin(theta1);
b7b24482 524
74696677 525 Float_t supportPosXOutG = constants->CenterModulePositionX(52)-deltaXA;
526 Float_t supportPosXOutGP = x0000+(supportPosXOutG-x0000)*TMath::Cos(theta1)-(supportPosYOutE-y0000)*TMath::Sin(theta1);
527 Float_t supportPosYOutGP = y0000+(supportPosYOutE-y0000)*TMath::Cos(theta1)+(supportPosXOutG-x0000)*TMath::Sin(theta1);
b7b24482 528
74696677 529 Float_t supportPosXOutH = constants->CenterModulePositionX(52)-deltaXB;
530 Float_t supportPosXOutHP = x0000+(supportPosXOutH-x0000)*TMath::Cos(theta1)-(supportPosYOutE-0.4-y0000)*TMath::Sin(theta1);
531 Float_t supportPosYOutHP = y0000+(supportPosYOutE-0.4-y0000)*TMath::Cos(theta1)+(supportPosXOutH-x0000)*TMath::Sin(theta1);
b7b24482 532
b7b24482 533
74696677 534 acordeFullSupportOutFace->AddNode(acordeMainSupport,4,new TGeoCombiTrans("ACOFSBOUT04",supportPosXOutEP,supportPosYOutEP,supportPosZOutIn,idrotm231));
535 acordeFullSupportOutFace->AddNode(acordeMainSupport,5,new TGeoCombiTrans("ACOFSBOUT05",supportPosXOutFP,supportPosYOutFP,supportPosZOutIn,idrotm231));
536 acordeFullSupportOutFace->AddNode(acordeMainSupport,6,new TGeoCombiTrans("ACOFSBOUT06",supportPosXOutGP,supportPosYOutGP,supportPosZOutIn,idrotm231));
537 acordeFullSupportOutFace->AddNode(acordeMainSupport,7,new TGeoCombiTrans("ACOFSBOUT07",supportPosXOutHP,supportPosYOutHP,supportPosZOutIn,idrotm231));
b7b24482 538
74696677 539 // Put the bars of the PutFace Side 2 L3-Magnet
b7b24482 540
541
74696677 542 Int_t indexBar0=8;
543 for(Int_t iAcoBar = 40;iAcoBar < 50 ; iAcoBar+=2)
b7b24482 544 {
74696677 545 Float_t barPosXOutIn = constants->CenterModulePositionX(iAcoBar)+deltaXA-90;
546 Float_t barPosYOutIn = supportPosYOutA-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
547 Float_t barPosZOutIn = constants->CenterModulePositionZ(iAcoBar);
548 Float_t barPosXOutP = x000+(barPosXOutIn-x000)*TMath::Cos(theta1)-(barPosYOutIn-y000)*TMath::Sin(theta1);
549 Float_t barPosYOutP = y000+(barPosYOutIn-y000)*TMath::Cos(theta1)+(barPosXOutIn-x000)*TMath::Sin(theta1);
550
551 Float_t barPosXOutInA = constants->CenterModulePositionX(iAcoBar)-deltaXA;
552 Float_t barPosYOutInA = supportPosYOutA-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5-1.;
553 Float_t barPosZOutInA = constants->CenterModulePositionZ(iAcoBar);
554 Float_t barPosXOutPA = x000+(barPosXOutInA-x000)*TMath::Cos(theta1)-(barPosYOutInA-y000)*TMath::Sin(theta1);
555 Float_t barPosYOutPA = y000+(barPosYOutInA-y000)*TMath::Cos(theta1)+(barPosXOutInA-x000)*TMath::Sin(theta1);
556
557
558 Float_t barPosXOutInB = constants->CenterModulePositionX(iAcoBar)-deltaXB;
559 Float_t barPosYOutInB = supportPosYOutA-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5-1.;
560 Float_t barPosZOutInB = constants->CenterModulePositionZ(iAcoBar);
561 Float_t barPosXOutPB = x000+(barPosXOutInB-x000)*TMath::Cos(theta1)-(barPosYOutInB-y000)*TMath::Sin(theta1);
562 Float_t barPosYOutPB = y000+(barPosYOutInB-y000)*TMath::Cos(theta1)+(barPosXOutInB-x000)*TMath::Sin(theta1);
563
564 acordeFullSupportOutFace->AddNode(acordeMainBar,indexBar0,new TGeoCombiTrans("ACOFSBOUT08",barPosXOutP,barPosYOutP,barPosZOutIn,idrotm231));
565 acordeFullSupportOutFace->AddNode(acordeMainBar,indexBar0+1,new TGeoCombiTrans("ACOFSBOUT08",barPosXOutPA,barPosYOutPA,barPosZOutInA,idrotm231));
566 acordeFullSupportOutFace->AddNode(acordeMainBar,indexBar0+2,new TGeoCombiTrans("ACOFSBOUT08",barPosXOutPB,barPosYOutPB,barPosZOutInB,idrotm231));
b7b24482 567
74696677 568 indexBar0+=4;
b7b24482 569 }
74696677 570 for(Int_t iAcoBar = 51;iAcoBar < 54 ; iAcoBar+=2)
b7b24482 571 {
572
74696677 573 Float_t barPosXOutInC = constants->CenterModulePositionX(iAcoBar)+deltaXA;
574 Float_t barPosYOutInC = supportPosYOutE-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
575 Float_t barPosZOutInC = constants->CenterModulePositionZ(iAcoBar);
576 Float_t barPosXOutPC = x0000+(barPosXOutInC-x0000)*TMath::Cos(theta1)-(barPosYOutInC-y0000)*TMath::Sin(theta1);
577 Float_t barPosYOutPC = y0000+(barPosYOutInC-y0000)*TMath::Cos(theta1)+(barPosXOutInC-x0000)*TMath::Sin(theta1);
578
579
580 Float_t barPosXOutInD = constants->CenterModulePositionX(iAcoBar)+deltaXB;
581 Float_t barPosYOutInD = supportPosYOutE-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
582 Float_t barPosZOutInD = constants->CenterModulePositionZ(iAcoBar);
583 Float_t barPosXOutPD = x0000+(barPosXOutInD-x0000)*TMath::Cos(theta1)-(barPosYOutInD-y0000)*TMath::Sin(theta1);
584 Float_t barPosYOutPD = y0000+(barPosYOutInD-y0000)*TMath::Cos(theta1)+(barPosXOutInD-x0000)*TMath::Sin(theta1);
585
586
587 Float_t barPosXOutInE = constants->CenterModulePositionX(iAcoBar)-deltaXA;
588 Float_t barPosYOutInE = supportPosYOutE-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
589 Float_t barPosZOutInE = constants->CenterModulePositionZ(iAcoBar);
590 Float_t barPosXOutPE = x0000+(barPosXOutInE-x0000)*TMath::Cos(theta1)-(barPosYOutInE-y0000)*TMath::Sin(theta1);
591 Float_t barPosYOutPE = y0000+(barPosYOutInE-y0000)*TMath::Cos(theta1)+(barPosXOutInE-x0000)*TMath::Sin(theta1);
592 Float_t barPosXOutInF = constants->CenterModulePositionX(iAcoBar)-deltaXB;
593 Float_t barPosYOutInF = supportPosYOutE-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
594 Float_t barPosZOutInF = constants->CenterModulePositionZ(iAcoBar);
595 Float_t barPosXOutPF = x0000+(barPosXOutInF-x0000)*TMath::Cos(theta1)-(barPosYOutInF-0.4-y0000)*TMath::Sin(theta1);
596 Float_t barPosYOutPF = y0000+(barPosYOutInF-0.4-y0000)*TMath::Cos(theta1)+(barPosXOutInF-x0000)*TMath::Sin(theta1);
597
598 acordeFullSupportOutFace->AddNode(acordeMainBar,indexBar0,new TGeoCombiTrans("ACOFSBOUT08",barPosXOutPC,barPosYOutPC,barPosZOutInC,idrotm231));
599 acordeFullSupportOutFace->AddNode(acordeMainBar,indexBar0+1,new TGeoCombiTrans("ACOFSBOUT08",barPosXOutPD,barPosYOutPD,barPosZOutInD,idrotm231));
600 acordeFullSupportOutFace->AddNode(acordeMainBar,indexBar0+2,new TGeoCombiTrans("ACOFSBOUT08",barPosXOutPE,barPosYOutPE,barPosZOutInE,idrotm231));
601 acordeFullSupportOutFace->AddNode(acordeMainBar,indexBar0+3,new TGeoCombiTrans("ACOFSBOUT08",barPosXOutPF,barPosYOutPF,barPosZOutInF,idrotm231));
602 indexBar0+=4;
b7b24482 603 }
604
605
74696677 606 for(Int_t iAcoBar = 57;iAcoBar < 58 ; iAcoBar+=2)
b7b24482 607 {
608
74696677 609 Float_t barPosXOutInC = constants->CenterModulePositionX(iAcoBar)+deltaXA;
610 Float_t barPosYOutInC = supportPosYOutE-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
611 Float_t barPosZOutInC = constants->CenterModulePositionZ(iAcoBar);
612 Float_t barPosXOutPC = x0000+(barPosXOutInC-x0000)*TMath::Cos(theta1)-(barPosYOutInC-y0000)*TMath::Sin(theta1);
613 Float_t barPosYOutPC = y0000+(barPosYOutInC-y0000)*TMath::Cos(theta1)+(barPosXOutInC-x0000)*TMath::Sin(theta1);
614
615
616 Float_t barPosXOutInD = constants->CenterModulePositionX(iAcoBar)+deltaXB;
617 Float_t barPosYOutInD = supportPosYOutE-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
618 Float_t barPosZOutInD = constants->CenterModulePositionZ(iAcoBar);
619 Float_t barPosXOutPD = x0000+(barPosXOutInD-x0000)*TMath::Cos(theta1)-(barPosYOutInD-y0000)*TMath::Sin(theta1);
620 Float_t barPosYOutPD = y0000+(barPosYOutInD-y0000)*TMath::Cos(theta1)+(barPosXOutInD-x0000)*TMath::Sin(theta1);
621
622
623 Float_t barPosXOutInE = constants->CenterModulePositionX(iAcoBar)-deltaXA;
624 Float_t barPosYOutInE = supportPosYOutE-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
625 Float_t barPosZOutInE = constants->CenterModulePositionZ(iAcoBar);
626 Float_t barPosXOutPE = x0000+(barPosXOutInE-x0000)*TMath::Cos(theta1)-(barPosYOutInE-y0000)*TMath::Sin(theta1);
627 Float_t barPosYOutPE = y0000+(barPosYOutInE-y0000)*TMath::Cos(theta1)+(barPosXOutInE-x0000)*TMath::Sin(theta1);
628 Float_t barPosXOutInF = constants->CenterModulePositionX(iAcoBar)-deltaXB;
629 Float_t barPosYOutInF = supportPosYOutE-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
630 Float_t barPosZOutInF = constants->CenterModulePositionZ(iAcoBar);
631 Float_t barPosXOutPF = x0000+(barPosXOutInF-x0000)*TMath::Cos(theta1)-(barPosYOutInF-0.4-y0000)*TMath::Sin(theta1);
632 Float_t barPosYOutPF = y0000+(barPosYOutInF-0.4-y0000)*TMath::Cos(theta1)+(barPosXOutInF-x0000)*TMath::Sin(theta1);
633
634 acordeFullSupportOutFace->AddNode(acordeMainBar,indexBar0,new TGeoCombiTrans("ACOFSBOUT08",barPosXOutPC,barPosYOutPC,barPosZOutInC,idrotm231));
635 acordeFullSupportOutFace->AddNode(acordeMainBar,indexBar0+1,new TGeoCombiTrans("ACOFSBOUT08",barPosXOutPD,barPosYOutPD,barPosZOutInD,idrotm231));
636 acordeFullSupportOutFace->AddNode(acordeMainBar,indexBar0+2,new TGeoCombiTrans("ACOFSBOUT08",barPosXOutPE,barPosYOutPE,barPosZOutInE,idrotm231));
637 acordeFullSupportOutFace->AddNode(acordeMainBar,indexBar0+3,new TGeoCombiTrans("ACOFSBOUT08",barPosXOutPF,barPosYOutPF,barPosZOutInF,idrotm231));
638 indexBar0+=4;
b7b24482 639 }
640
641
74696677 642 Float_t barPosXOutInC = constants->CenterModulePositionX(52)+deltaXA;
643 Float_t barPosYOutInC = supportPosYOutE-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
644 Float_t barPosZOutInC = constants->CenterModulePositionZ(55);
645 Float_t barPosXOutPC = x0000+(barPosXOutInC-x0000)*TMath::Cos(theta1)-(barPosYOutInC-y0000)*TMath::Sin(theta1);
646 Float_t barPosYOutPC = y0000+(barPosYOutInC-y0000)*TMath::Cos(theta1)+(barPosXOutInC-x0000)*TMath::Sin(theta1);
b7b24482 647
648
74696677 649 Float_t barPosXOutInD = constants->CenterModulePositionX(52)+deltaXB;
650 Float_t barPosYOutInD = supportPosYOutE-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
651 Float_t barPosXOutPD = x0000+(barPosXOutInD-x0000)*TMath::Cos(theta1)-(barPosYOutInD-y0000)*TMath::Sin(theta1);
652 Float_t barPosYOutPD = y0000+(barPosYOutInD-y0000)*TMath::Cos(theta1)+(barPosXOutInD-x0000)*TMath::Sin(theta1);
b7b24482 653
ee0da434 654
74696677 655 Float_t barPosXOutInE = constants->CenterModulePositionX(52)-deltaXA;
656 Float_t barPosYOutInE = supportPosYOutE-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
657 Float_t barPosXOutPE = x0000+(barPosXOutInE-x0000)*TMath::Cos(theta1)-(barPosYOutInE-y0000)*TMath::Sin(theta1);
658 Float_t barPosYOutPE = y0000+(barPosYOutInE-y0000)*TMath::Cos(theta1)+(barPosXOutInE-x0000)*TMath::Sin(theta1);
659 Float_t barPosXOutInF = constants->CenterModulePositionX(52)-deltaXB;
660 Float_t barPosYOutInF = supportPosYOutE-boxSingleBar[1]-boxUnionUp[1]-boxUnionDown[1]-7.5;
661 Float_t barPosXOutPF = x0000+(barPosXOutInF-x0000)*TMath::Cos(theta1)-(barPosYOutInF-0.4-y0000)*TMath::Sin(theta1);
662 Float_t barPosYOutPF = y0000+(barPosYOutInF-0.4-y0000)*TMath::Cos(theta1)+(barPosXOutInF-x0000)*TMath::Sin(theta1);
b7b24482 663
74696677 664 acordeFullSupportOutFace->AddNode(acordeMainBar,indexBar0,new TGeoCombiTrans("ACOFSBOUT08",barPosXOutPC,barPosYOutPC,barPosZOutInC,idrotm231));
665 acordeFullSupportOutFace->AddNode(acordeMainBar,indexBar0+1,new TGeoCombiTrans("ACOFSBOUT08",barPosXOutPD,barPosYOutPD,barPosZOutInC,idrotm231));
666 acordeFullSupportOutFace->AddNode(acordeMainBar,indexBar0+2,new TGeoCombiTrans("ACOFSBOUT08",barPosXOutPE,barPosYOutPE,barPosZOutInC,idrotm231));
667 acordeFullSupportOutFace->AddNode(acordeMainBar,indexBar0+3,new TGeoCombiTrans("ACOFSBOUT08",barPosXOutPF,barPosYOutPF,barPosZOutInC,idrotm231));
668
b7b24482 669
b7b24482 670
b7b24482 671
b7b24482 672
74696677 673 supportBars->AddNode(acordeFullSupportUpFace,1);
674 supportBars->AddNode(acordeFullSupportInFace,2);
675 supportBars->AddNode(acordeFullSupportOutFace,3);
676 acorde->AddNode(acordeModules,1);
677 acorde->AddNode(supportBars,2);
678 alice->AddNode(acorde,1);//---> put volume of ACORDE over ALICE's volume
b7b24482 679
680
681
682}
ee0da434 683//__________________________________________________________________________
b7b24482 684
685void AliACORDEv1::Init()
686{
687 // Initialise L3 magnet after it has been built
688 Int_t i;
689 if(AliLog::GetGlobalDebugLevel()>0) {
690 printf("\n%s: ",ClassName());
691 for(i=0;i<35;i++) printf("*");
692 printf(" ACORDEv1_INIT ");
693 for(i=0;i<35;i++) printf("*");
694 printf("\n%s: ",ClassName());
695 // Here the ACORDEv initialisation code (if any!)
696 for(i=0;i<80;i++) printf("*");
697 printf("\n");
698 }
699 // AliACORDE::Init();
700}
701//____________________________________________________________________________
702void AliACORDEv1::StepManager()
703{
704
705 //
706 // Called for every step in the Cosmic Ray Trigger
707 //
708
709
710 // volume:
711 // [0] = module number 1-60 (1==>(0-0), 60 (5-9)
712 // [1] = Plastic number: 0 (down) to 1 (up)
713 static Int_t vol[2];
714 //
715 // hit
716 // [0] = PID
717 // [1-3] = x, y, z
718 // [4] = time
719 // [5-7] = px, py, pz
720 // [8] = energy
721 // [9] = energy loss
722 // [10] = length of track through plastic
723 static Float_t hits[11];
724
725 // local static variables
726 static Float_t eloss;
727 static Float_t step;
728 // scintillator volume
74696677 729 static Int_t idScint = gMC->VolId("ACORDESCINTILLATORMODULE");
b7b24482 730 // local variables
731 Int_t copy;
732 TLorentzVector pos;
733 TLorentzVector mom;
734
735 // only charged tracks
736 if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
737
738 // only in sensitive material
739 if (gMC->CurrentVolID(copy) == idScint) {
740
b7b24482 741 step += gMC->TrackStep();
742 eloss += gMC->Edep();
743 // set all hit variables except eloss which is resetted
744 // set volume variables
745 if (gMC->IsTrackEntering()) {
746 eloss = 0.0;
747 step = 0.0;
748 gMC->TrackPosition(pos);
749 gMC->TrackMomentum(mom);
750 // hit
751 // [0] = PID
752 // [1-3] = x, y, z
753 // [4] = time
754 // [5-7] = px, py, pz
755 // [8] = energy
756 // [9] = energy loss
757 hits[0] = (Float_t ) gMC->TrackPid();
329ce604 758
759
20868cc6 760 hits[1] = pos[0];
761 hits[2] = pos[1];
762 hits[3] = pos[2];
763 hits[4] = gMC->TrackTime();
764 hits[5] = mom[0];
765 hits[6] = mom[1];
766 hits[7] = mom[2];
767 hits[8] = gMC->Etot();
b7b24482 768 // volume:
769 // [0] = module number 1-60 (1==>(0-0), 60 (5-9)
770 // [1] = Plastic number: 0 (down) to 1 (up)
771 Int_t copyPlastic; // plastic: down=1, up=2
772 Int_t copyModule; // module: 1-60
773 gMC->CurrentVolID(copyPlastic);
774 gMC->CurrentVolOffID(1, copyModule);
775 // module
776 vol[0] = copyModule;
777 // plastic: 0 = down, 1 = up
70ae285c 778 vol[1] = copyPlastic - 4 ; // !!!!!!!
0b854350 779 // vol[1] = copyPlastic;
b7b24482 780 } // end if gMC->IsTrackEntering()
781
782 // set hit[9] = total energy loss and book hit
783 if( gMC->IsTrackExiting() ||
784 gMC->IsTrackStop() ||
785 gMC->IsTrackDisappeared()){
20868cc6 786 hits[9] = eloss;
b7b24482 787 hits[10] = step;
788 eloss = 0.0;
789 step = 0.0;
790 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
f957acf5 791 }
b7b24482 792 }
793
794
329ce604 795
b7b24482 796}
797
b7b24482 798//_____________________________________________________________________________
799void AliACORDEv1::AddHit(Int_t track, Int_t *vol, Float_t *hits)
800{
801 //
f957acf5 802 // Add an ACORDE hit
b7b24482 803 //
804 TClonesArray &lhits = *fHits;
805 new(lhits[fNhits++]) AliACORDEhit(fIshunt,track,vol,hits);
806}
807
f957acf5 808//_____________________________________________________________________________
809void AliACORDEv1::AddDigits(Int_t* track, Int_t module, Float_t time)
f957acf5 810{
811
812 // Adds Digit
813
814 TClonesArray &ldigits = *fDigits;
815 new(ldigits[fNdigits++]) AliACORDEdigit(track,module,time);
816}
817//_____________________________________________________________________________
818
f957acf5 819void AliACORDEv1::MakeBranch(Option_t *option)
820{
821// Creates new branches in the current Root Tree
822
823 char branchname[10];
4c0f7539 824 //sprintf(branchname,"%s",GetName());
f957acf5 825 AliDebug(2,Form("fBufferSize = %d",fBufferSize));
826 const char *cH = strstr(option,"H");
cb5b8b21 827 if (fHits && fLoader->TreeH() && cH) {
828 fLoader->TreeH()->Branch(branchname,&fHits, fBufferSize);
f957acf5 829 AliDebug(2,Form("Making Branch %s for hits",branchname));
830 }
831 const char *cD = strstr(option,"D");
832 if (fDigits && fLoader->TreeD() && cD) {
833 fLoader->TreeD()->Branch(branchname,&fDigits, fBufferSize);
834 AliDebug(2,Form("Making Branch %s for digits",branchname));
835 }
836}
837
838//_____________________________________________________________________________
839void AliACORDEv1::AddAlignableVolumes() const
840{
841 //
842 // Create entries for alignable volumes associating the symbolic volume
843 // name with the corresponding volume path. Needs to be syncronized with
844 // eventual changes in the geometry.
845 //
846
847 // The alignable volumes are only the "ACORDE_MODULE_%d"
848 //
849 // Structure of ACORDE's Geometry
850 //
851 // ALIC_1
852 // |---> ACORDE_1
74696677 853 // |----> ALL_ACORDE_MODULES_1/ACORDE_MODULE_%d (d:0->to->59)
854 // |----> ACORDE_SUPPORT_BARS_2 |--> BARS&SUPPORTS
f957acf5 855 //
856 // Send comments to: Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch>
857
74696677 858 TString vpstr1 = "ALIC_1/ACORDE_1/ALL_ACORDE_MODULES_1/ACORDE_MODULE_";
f957acf5 859 TString snstr1 = "ACORDE/Array";
860 TString volpath, symname;
2e242e04 861 for(Int_t dy=0; dy<60 ; dy++)
f957acf5 862 {
863 volpath = vpstr1;
864 volpath += dy;
865 symname = snstr1;
866 symname += dy;
867 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
868 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
869 }
870}