This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / STRUCT / AliPIPEv0.cxx
1 ////////////////////////////////////////////////
2 //  Beam pipe class                            /
3 ////////////////////////////////////////////////
4
5 #include <stdio.h> 
6 #include <TMath.h>
7 #include <TRandom.h>
8 #include <TVector.h>
9 #include "AliPIPEv0.h"
10 #include "AliRun.h"
11 #include "stdlib.h"
12 #include "AliMC.h"
13 #include "TSystem.h"
14  
15 ClassImp(AliPIPEv0)
16  
17 //_____________________________________________________________________________
18 AliPIPEv0::AliPIPEv0() : AliPIPE()
19 {
20 }
21
22 //_____________________________________________________________________________
23 AliPIPEv0::AliPIPEv0(const char *name, const char *title)
24   : AliPIPE(name,title)
25 {
26 }
27
28  
29 //___________________________________________
30 void AliPIPEv0::CreateGeometry()
31 {
32   printf("Create PIPEv0 geometry\n ");
33 //Begin_Html
34 /*
35 <img src="gif/pipe.gif">
36 */
37 //End_Html
38
39
40 //Begin_Html
41 /*
42 <img src="gif/tree_pipe.gif">
43 */
44 //End_Html
45
46   const char *pipename = "$(ALICE_ROOT)/Euclid/bpipeb.euc";
47   const char *pumpname = "$(ALICE_ROOT)/Euclid/bpumpa.euc";
48   char *filtmp;
49   char topvol[5];
50   printf("Create PIPEv0 geometry ");
51   
52   Int_t idrotm[2099];
53
54   AliMC* pMC = AliMC::GetMC();
55   
56 //
57 // The peam pipe up to the Front Absorber
58   filtmp=gSystem->ExpandPathName(pipename);
59   FILE *file = fopen(filtmp,"r");
60   delete [] filtmp;
61   if(file) {
62     fclose(file);
63     printf(" Reading PIPE \n");
64     gAlice->ReadEuclid(pipename,20,topvol);
65   } else {
66     printf(" THE GEOM FILE %s DOES NOT EXIST !\n",pipename);
67     exit(1);
68   }
69 //
70 // The Ion Pump
71   filtmp=gSystem->ExpandPathName(pumpname);
72   file = fopen(filtmp,"r");
73   delete [] filtmp;
74   if(file) {
75     fclose(file);
76     printf(" Reading PUMP \n");
77     gAlice->ReadEuclid(pumpname,20,topvol);
78   } else {
79     printf(" THE GEOM FILE %s DOES NOT EXIST !\n",pumpname);
80     exit(1);
81   }
82 //
83 // --- Place the PIPE ghost volume (QBPM) in its mother volume (ALIC)
84 //    and make it invisible
85 // 
86   AliMatrix(idrotm[2001],90.,0.,90.,90.,180.,0.);
87   
88   pMC->Gspos("QBPM",1,"ALIC",0,0,0,idrotm[2001],"ONLY");
89 //
90 //    PLACE ION PUMP (QIPM) AT Z=-385.
91 //
92   pMC->Gspos("QIPM",1,"ALIC",0,0,-385,idrotm[2001],"ONLY");
93
94   pMC->Gsatt("QIPM", "SEEN", 0);
95   pMC->Gsatt("QBPM", "SEEN", 0);
96   pMC->Gsatt("QB20", "SEEN", 0);
97 }
98
99  
100 //___________________________________________
101 void AliPIPEv0::DrawDetector()
102 {
103 }
104
105 //___________________________________________
106 void AliPIPEv0::CreateMaterials()
107 {
108   printf("Create PIPEv0 materials\n");
109   const char *name = "$(ALICE_ROOT)/Euclid/pipe.tme";
110   char *filtmp;
111   filtmp=gSystem->ExpandPathName(name);
112   FILE *file = fopen(filtmp,"r");
113   delete [] filtmp;
114   if(file) {
115     fclose(file);
116     gAlice->ReadEuclidMedia(name,20);
117   } else {
118     printf(" THE MEDIA FILE %s DOES NOT EXIST !\n",name);
119     exit(1);
120   }
121 }
122
123
124
125
126
127
128
129
130
131
132
133
134
135