Line data Source code
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 : // Class AliMUONGeometryConstituent
20 : // -----------------------------
21 : // Helper class for definititon of an assembly of volumes.
22 : // Author: Ivana Hrivnacova, IPN Orsay
23 : // 23/01/2004
24 : //-----------------------------------------------------------------------------
25 :
26 : #include <TGeoMatrix.h>
27 :
28 : #include "AliMUONGeometryConstituent.h"
29 : #include "AliLog.h"
30 :
31 : /// \cond CLASSIMP
32 18 : ClassImp(AliMUONGeometryConstituent)
33 : /// \endcond
34 :
35 : //______________________________________________________________________________
36 : AliMUONGeometryConstituent::AliMUONGeometryConstituent(const TString& name,
37 : Int_t copyNo, Int_t npar, Double_t* param)
38 1168 : : TNamed(name, name),
39 1168 : fCopyNo(copyNo),
40 1168 : fNpar(npar),
41 1168 : fParam(0),
42 1168 : fTransformation(0)
43 5840 : {
44 : /// Standard constructor for a constituent without translation & rotation
45 :
46 : // fTransformation = new TGeoCombiTrans(name);
47 : // would be nice to be so simple
48 :
49 : // Create the constituent transformation
50 3504 : fTransformation = new TGeoCombiTrans("");
51 :
52 : // Volume parameters
53 1168 : if (npar > 0) {
54 2336 : fParam = new Double_t[npar];
55 9344 : for (Int_t i=0; i<npar; i++) fParam[i] = param[i];
56 1168 : }
57 2336 : }
58 :
59 : //______________________________________________________________________________
60 : AliMUONGeometryConstituent::AliMUONGeometryConstituent(const TString& name,
61 : Int_t copyNo, const TGeoTranslation& translation,
62 : Int_t npar, Double_t* param)
63 1676 : : TNamed(name, name),
64 1676 : fCopyNo(copyNo),
65 1676 : fNpar(npar),
66 1676 : fParam(0),
67 1676 : fTransformation(0)
68 8380 : {
69 : /// Standard constructor for a constituent with translation
70 :
71 : // Create the constituent transformation
72 6704 : fTransformation = new TGeoCombiTrans(translation, TGeoRotation());
73 :
74 : // Volume parameters
75 1676 : if (npar > 0) {
76 64 : fParam = new Double_t[npar];
77 256 : for (Int_t i=0; i<npar; i++) fParam[i] = param[i];
78 32 : }
79 3352 : }
80 :
81 :
82 : //______________________________________________________________________________
83 : AliMUONGeometryConstituent::AliMUONGeometryConstituent(const TString& name,
84 : Int_t copyNo, const TGeoTranslation& translation,
85 : const TGeoRotation& rotation,
86 : Int_t npar, Double_t* param)
87 :
88 468 : : TNamed(name, name),
89 468 : fCopyNo(copyNo),
90 468 : fNpar(npar),
91 468 : fParam(0),
92 468 : fTransformation(0)
93 2340 : {
94 : /// Standard constructor for a constituent with translation and rotation
95 :
96 : // Create the constituent transformation
97 1404 : fTransformation = new TGeoCombiTrans(translation, rotation);
98 :
99 : // Volume parameters
100 468 : if (npar > 0) {
101 0 : fParam = new Double_t[npar];
102 0 : for (Int_t i=0; i<npar; i++) fParam[i] = param[i];
103 0 : }
104 936 : }
105 :
106 : //______________________________________________________________________________
107 : AliMUONGeometryConstituent::AliMUONGeometryConstituent(const TString& name,
108 : Int_t copyNo,
109 : const TGeoCombiTrans& transform,
110 : Int_t npar, Double_t* param)
111 :
112 0 : : TNamed(name, name),
113 0 : fCopyNo(copyNo),
114 0 : fNpar(npar),
115 0 : fParam(0),
116 0 : fTransformation(0)
117 0 : {
118 : /// Standard constructor for a constituent with translation and rotation
119 : /// defined via TGeoCombiTrans
120 :
121 : // Create the constituent transformation
122 0 : fTransformation = new TGeoCombiTrans(transform);
123 :
124 : // Volume parameters
125 0 : if (npar > 0) {
126 0 : fParam = new Double_t[npar];
127 0 : for (Int_t i=0; i<npar; i++) fParam[i] = param[i];
128 0 : }
129 0 : }
130 :
131 : //______________________________________________________________________________
132 : AliMUONGeometryConstituent::AliMUONGeometryConstituent()
133 39744 : : TNamed(),
134 39744 : fCopyNo(0),
135 39744 : fNpar(0),
136 39744 : fParam(0),
137 39744 : fTransformation(0)
138 198720 : {
139 : /// Default constructor
140 79488 : }
141 :
142 : //______________________________________________________________________________
143 : AliMUONGeometryConstituent::~AliMUONGeometryConstituent()
144 258336 : {
145 : /// Destructor
146 :
147 86112 : delete fTransformation;
148 58656 : delete [] fParam;
149 129168 : }
|