//*CMZ :  2.23/04 10/10/99  16.59.47  by  Rene Brun
//*CMZ :  2.00/11 17/04/99  07.50.09  by  Rene Brun
//*CMZ :  1.03/09 07/12/97  16.34.57  by  Fons Rademakers
//*-- Author :    Rene Brun   03/10/95

//*KEEP,CopyRight,T=C.
/*************************************************************************
 * Copyright(c) 1995-1999, The ROOT System, All rights reserved.         *
 * Authors: Rene Brun and Fons Rademakers.                               *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/AA_LICENSE.                      *
 * For the list of contributors see $ROOTSYS/AA_CREDITS.                 *
 *************************************************************************/
//*KEND.

//*KEEP,TROOT.
#include "TROOT.h"
//*KEEP,TGeometry.
#include "TGeometry.h"
//*KEEP,TMaterial.
#include "TMaterial.h"
//*KEND.

ClassImp(TMaterial)

//______________________________________________________________________________
//
// Manages a detector material. See class TGeometry
//

//______________________________________________________________________________
 TMaterial::TMaterial()
{
//*-*-*-*-*-*-*-*-*-*-*Material default constructor*-*-*-*-*-*-*-*-*-*-*-*
//*-*                  ============================

   //do nothing
}



//______________________________________________________________________________
 TMaterial::TMaterial(Text_t *name, Text_t *title, Float_t a, Float_t z, Float_t density)
           :TNamed(name,title), TAttFill(0,1)
{
//*-*-*-*-*-*-*-*-*-*-*Material normal constructor*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                  ============================

   if (!gGeometry) gGeometry = new TGeometry("Geometry","Default Geometry");
   fA       = a;
   fZ       = z;
   fDensity = density;
   fNumber  = gGeometry->GetListOfMaterials()->GetSize();
   fRadLength   = 0;
   fInterLength = 0;
   gGeometry->GetListOfMaterials()->Add(this);
}



//______________________________________________________________________________
 TMaterial::TMaterial(Text_t *name, Text_t *title, Float_t a, Float_t z, Float_t density, Float_t radl, Float_t inter)
           :TNamed(name,title), TAttFill(0,1)
{
//*-*-*-*-*-*-*-*-*-*-*Material normal constructor*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                  ============================

   if (!gGeometry) gGeometry = new TGeometry("Geometry","Default Geometry");
   fA       = a;
   fZ       = z;
   fDensity = density;
   fNumber  = gGeometry->GetListOfMaterials()->GetSize();
   fRadLength   = radl;
   fInterLength = inter;
   gGeometry->GetListOfMaterials()->Add(this);
}


//______________________________________________________________________________
 TMaterial::~TMaterial()
{
//*-*-*-*-*-*-*-*-*-*-*Material default destructor*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                  ============================

   gGeometry->GetListOfMaterials()->Remove(this);

}

//______________________________________________________________________________
 void TMaterial::Streamer(TBuffer &R__b)
{
   // Stream an object of class TMaterial.

   if (R__b.IsReading()) {
      Version_t v = R__b.ReadVersion();
      TNamed::Streamer(R__b);
      R__b >> fNumber;
      R__b >> fA;
      R__b >> fZ;
      R__b >> fDensity;
      if (v > 2) {
         TAttFill::Streamer(R__b);
         R__b >> fRadLength;
         R__b >> fInterLength;
      } else {
         fRadLength   = 0;
         fInterLength = 0;
      }
   } else {
      R__b.WriteVersion(TMaterial::IsA());
      TNamed::Streamer(R__b);
      R__b << fNumber;
      R__b << fA;
      R__b << fZ;
      R__b << fDensity;
      TAttFill::Streamer(R__b);
      R__b << fRadLength;
      R__b << fInterLength;
   }
}


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.