Transition to NewIO
[u/mrichter/AliRoot.git] / STRUCT / AliFRAMEv1.cxx
CommitLineData
4c039060 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
eeacf08b 16/* $Id$ */
43ea1292 17
eeacf08b 18//-------------------------------------------------------------------------
19// AliFRAMEv1.cxx
20// symmetric space frame without holes
21// Author:
22//-------------------------------------------------------------------------
fe4da5cc 23
88cb7938 24#include <TSystem.h>
25
fe4da5cc 26#include "AliFRAMEv1.h"
27#include "AliRun.h"
fe4da5cc 28
29ClassImp(AliFRAMEv1)
30
31//_____________________________________________________________________________
b8032157 32AliFRAMEv1::AliFRAMEv1()
fe4da5cc 33{
b43eb0dc 34// Constructor
fe4da5cc 35}
ba25f477 36
fe4da5cc 37//_____________________________________________________________________________
38AliFRAMEv1::AliFRAMEv1(const char *name, const char *title)
ba25f477 39 : AliFRAME(name,title)
fe4da5cc 40{
b43eb0dc 41// Constructor
9e1a0ddb 42 if(fDebug>1) printf("%s: Create FRAMEv1 object\n",ClassName());
ba25f477 43 fEuclidGeometry="$(ALICE_ROOT)/Euclid/frame1099i.euc";
44 fEuclidMaterial="$(ALICE_ROOT)/Euclid/frame.tme";
fe4da5cc 45}
ba25f477 46
fe4da5cc 47
ba25f477 48//___________________________________________
fe4da5cc 49void AliFRAMEv1::CreateGeometry()
50{
ba25f477 51//Begin_Html
52/*
53<img src="picts/frame.gif">
54*/
55//End_Html
cfce8870 56
fe4da5cc 57
ba25f477 58//Begin_Html
59/*
60<img src="picts/tree_frame.gif">
61*/
62//End_Html
fe4da5cc 63
ba25f477 64 char *filetmp;
65 char topvol[5];
66
67//
68// The Space frame
69 filetmp = gSystem->ExpandPathName(fEuclidGeometry.Data());
70 FILE *file = fopen(filetmp,"r");
71 delete [] filetmp;
72 if(file) {
73 fclose(file);
9e1a0ddb 74 if(fDebug) printf("%s: Reading FRAME geometry\n",ClassName());
b13db077 75 ReadEuclid(fEuclidGeometry.Data(),topvol);
9e1a0ddb 76 } else
77 Fatal("CreateGeometry","The Euclid file %s does not exist!\n",
78 fEuclidGeometry.Data());
ba25f477 79//
80// --- Place the FRAME ghost volume (B010) in its mother volume (ALIC)
81// and make it invisible
82//
83// AliMatrix(idrotm[2001],90.,0.,90.,90.,180.,0.);
84
85 gMC->Gspos(topvol,1,"ALIC",0,0,0,0,"ONLY");
86
87 gMC->Gsatt(topvol, "SEEN", 0);
fe4da5cc 88}
89
ba25f477 90
91//___________________________________________
92void AliFRAMEv1::CreateMaterials()
fe4da5cc 93{
b43eb0dc 94// Create materials and media (from Euclid file)
ba25f477 95 char *filetmp;
9e1a0ddb 96 if(fDebug) printf("%s: Create FRAMEv1 materials\n",ClassName());
ba25f477 97 filetmp = gSystem->ExpandPathName(fEuclidMaterial.Data());
98 FILE *file = fopen(filetmp,"r");
99 delete [] filetmp;
100 if(file) {
101 fclose(file);
b13db077 102 ReadEuclidMedia(fEuclidMaterial.Data());
ba25f477 103 } else {
104 Warning("CreateMaterials","The material file %s does not exist!\n",
105 fEuclidMaterial.Data());
106 exit(1);
107 }
fe4da5cc 108}
109
110//_____________________________________________________________________________
ba25f477 111void AliFRAMEv1::Init()
fe4da5cc 112{
fe4da5cc 113 //
ba25f477 114 // Initialise the module after the geometry has been defined
fe4da5cc 115 //
fe4da5cc 116
9e1a0ddb 117 if(fDebug) {
118 printf("%s: **************************************"
119 " FRAME "
120 "**************************************\n",ClassName());
121 printf("\n%s: Version 1 of FRAME initialised, symmetric FRAME\n\n",ClassName());
122 printf("%s: **************************************"
123 " FRAME "
124 "**************************************\n",ClassName());
125 }
fe4da5cc 126}