1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
23 // ---------------------------------------------------------------------------
27 // This file is part of the ALICE Geometry Database .
29 // Author: Joana E. Santo
31 // ---------------------------------------------------------------------------
33 #include "AliGMaterial.h"
35 ClassImp(AliGMaterial)
38 //-------------------------------------------------------------------------
40 AliGMaterial::AliGMaterial( Int_t imat, Text_t* name, Text_t* title, Int_t isvol, Int_t ifield, Float_t fieldm, Float_t tmaxfd, Float_t stemax, Float_t deemax, Float_t epsil, Float_t stmin, Float_t* ubuf, Int_t nbuf, Float_t a, Float_t z, Float_t dens, Float_t radl, Float_t absl, Float_t* buf, Int_t nwbuf ) : TNamed(name, title)
42 /* VIC: Very Important Constructor */
54 fUbuf = new Float_t[nbuf];
56 for( int i=0; i<nbuf; i++ )
66 fBuf = new Float_t[nwbuf];
68 for( int j=0; j<nwbuf; j++ )
74 //-------------------------------------------------------------------------
76 AliGMaterial::AliGMaterial(Text_t* name, Text_t* title, Float_t A, Float_t Z, Float_t rho) : TNamed(name, title)
84 //-------------------------------------------------------------------------
86 AliGMaterial::AliGMaterial( AliGMaterial* Mat )
88 /* Copy Constructor */
92 fIfield = Mat->fIfield;
93 fFieldm = Mat->fFieldm;
94 fTmaxfd = Mat->fTmaxfd;
95 fStemax = Mat->fStemax;
96 fDeemax = Mat->fDeemax;
100 fUbuf = new Float_t[Mat->fNbuf];
102 for( int i=0; i<Mat->fNbuf; i++ )
103 fUbuf[i] = Mat->fUbuf[i];
112 fBuf = new Float_t[Mat->fNwbuf];
114 for( int j=0; j<Mat->fNwbuf; j++ )
115 fBuf[j] = Mat->fBuf[j];
117 fNwbuf = Mat->fNwbuf;
119 fName = Mat->GetName();
120 fTitle = Mat->GetTitle();
123 /* Default Constructor */
152 //-------------------------------------------------------------------------
154 AliGMaterial::~AliGMaterial()
157 if( fUbuf ) delete [] fUbuf;
158 if( fBuf ) delete [] fBuf;
161 //-------------------------------------------------------------------------
163 AliGMaterial* AliGMaterial::operator=( const AliGMaterial* Mat )
166 if( this == Mat ) return this; // special case.
169 fName = Mat->GetName();
171 fTitle = Mat->GetTitle();
177 //-------------------------------------------------------------------------
179 void AliGMaterial::Streamer(TBuffer &R__b)
181 // Stream an object of class AliGMaterial.
183 if (R__b.IsReading()) {
184 Version_t R__v = R__b.ReadVersion(); if (R__v) { }
185 TNamed::Streamer(R__b);
195 R__b.ReadArray(fUbuf); //
202 R__b.ReadArray(fBuf); //
206 R__b.WriteVersion(AliGMaterial::IsA());
207 TNamed::Streamer(R__b);
217 R__b.WriteArray(fUbuf, fNbuf); //
224 R__b.WriteArray(fBuf, fNbuf); //
230 //-------------------------------------------------------------------------