]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDv2.cxx
Transition to NewIO
[u/mrichter/AliRoot.git] / TRD / AliTRDv2.cxx
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$ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 //                                                                           //
20 //  Transition Radiation Detector version 2 -- slow simulator with           //
21 //  detailed geometry                                                        //
22 //                                                                           //
23 ///////////////////////////////////////////////////////////////////////////////
24
25 #include <stdlib.h> 
26
27 #include <TMath.h>
28 #include <TVirtualMC.h>
29
30 #include "AliConst.h"
31 #include "AliRun.h"
32 #include "AliTRDgeometryDetail.h"
33 #include "AliTRDv2.h"
34
35 ClassImp(AliTRDv2)
36  
37 //_____________________________________________________________________________
38 AliTRDv2::AliTRDv2():AliTRDv1()
39 {
40   //
41   // Default constructor
42   //
43
44 }
45
46 //_____________________________________________________________________________
47 AliTRDv2::AliTRDv2(const char *name, const char *title) 
48          :AliTRDv1(name, title) 
49 {
50   //
51   // Standard constructor for Transition Radiation Detector version 2
52   //
53
54   // Check that FRAME is there otherwise we have no place where to
55   // put TRD
56   AliModule* frame = gAlice->GetModule("FRAME");
57   if (!frame) {
58     Error("Ctor","TRD needs FRAME to be present\n");
59     exit(1);
60   } 
61
62   if (frame->IsVersion() == 1) {
63     // Detailed geometry without hole
64     if (fGeometry) delete fGeometry;
65     fGeometry = new AliTRDgeometryDetail();
66   }
67   else {
68     Error("Ctor","Could not find valid FRAME version 1\n");
69     exit(1);
70   }
71
72 }
73
74 //_____________________________________________________________________________
75 AliTRDv2::AliTRDv2(const AliTRDv2 &trd)
76 {
77   //
78   // Copy constructor
79   //
80
81   ((AliTRDv2 &) trd).Copy(*this);
82
83 }
84
85 //_____________________________________________________________________________
86 AliTRDv2::~AliTRDv2()
87 {
88   //
89   // AliTRDv2 destructor
90   //
91
92 }
93  
94 //_____________________________________________________________________________
95 AliTRDv2 &AliTRDv2::operator=(const AliTRDv2 &trd)
96 {
97   //
98   // Assignment operator
99   //
100
101   if (this != &trd) ((AliTRDv2 &) trd).Copy(*this);
102   return *this;
103
104 }
105  
106 //_____________________________________________________________________________
107 void AliTRDv2::Copy(TObject &trd)
108 {
109   //
110   // Copy function
111   //
112
113 }
114
115 //_____________________________________________________________________________
116 void AliTRDv2::CreateGeometry()
117 {
118   //
119   // Create the geometry for the Transition Radiation Detector version 2
120   //
121
122   // Check that FRAME is there otherwise we have no place where to put the TRD
123   AliModule* frame = gAlice->GetModule("FRAME");
124   if (!frame) return;
125
126   // Define the chambers
127   AliTRD::CreateGeometry();
128
129 }
130
131 //_____________________________________________________________________________
132 void AliTRDv2::CreateMaterials()
133 {
134   //
135   // Create materials for the Transition Radiation Detector version 2
136   //
137
138   AliTRD::CreateMaterials();
139
140 }
141