X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TRD%2FAliTRDsim.cxx;h=68097ab5c1063c38a830ed01b6e4c27f3b5f991c;hb=84737f5ebdced6f89d316fe11d01638384191d8e;hp=169663794fb86089b6bd0d0e6688e05f6ef11c00;hpb=46d29e70f4a95bcdfb79ded060b04aee708ac03b;p=u%2Fmrichter%2FAliRoot.git diff --git a/TRD/AliTRDsim.cxx b/TRD/AliTRDsim.cxx index 169663794fb..68097ab5c10 100644 --- a/TRD/AliTRDsim.cxx +++ b/TRD/AliTRDsim.cxx @@ -15,6 +15,27 @@ /* $Log$ +Revision 1.10 2001/05/31 16:53:26 alibrary +Correction to the destructor + +Revision 1.9 2001/05/21 16:45:47 hristov +Last minute changes (C.Blume) + +Revision 1.8 2001/01/26 19:56:57 hristov +Major upgrade of AliRoot code + +Revision 1.7 2000/12/20 13:00:45 cblume +Modifications for the HP-compiler + +Revision 1.6 2000/12/12 10:20:10 cblume +Initialize fSepctrum = 0 in ctors + +Revision 1.5 2000/10/15 23:40:01 cblume +Remove AliTRDconst + +Revision 1.4 2000/10/06 16:49:46 cblume +Made Getters const + Revision 1.3.2.1 2000/09/18 13:45:30 cblume New class AliTRDsim that simulates TR photons @@ -37,15 +58,15 @@ Introduction of the Copyright and cvs Log #include -#include "TH1.h" -#include "TRandom.h" -#include "TMath.h" -#include "TParticle.h" +#include +#include +#include +#include -#include "AliTRDsim.h" -#include "AliTRDconst.h" #include "AliModule.h" +#include "AliTRDsim.h" + ClassImp(AliTRDsim) //_____________________________________________________________________________ @@ -55,6 +76,9 @@ AliTRDsim::AliTRDsim():TObject() // AliTRDsim default constructor // + fSpectrum = 0; + fSigma = 0; + Init(); } @@ -74,6 +98,9 @@ AliTRDsim::AliTRDsim(AliModule *mod, Int_t foil, Int_t gap) Float_t rad, abs; Char_t name[21]; + fSpectrum = 0; + fSigma = 0; + Init(); mod->AliGetMaterial(foil,name,aFoil,zFoil,rhoFoil,rad,abs); @@ -109,8 +136,8 @@ AliTRDsim::~AliTRDsim() // AliTRDsim destructor // - if (fSpectrum) delete fSpectrum; - if (fSigma) delete fSigma; + // if (fSpectrum) delete fSpectrum; + if (fSigma) delete [] fSigma; } @@ -151,7 +178,7 @@ void AliTRDsim::Copy(TObject &s) ((AliTRDsim &) s).fSpLower = fSpLower; ((AliTRDsim &) s).fSpUpper = fSpUpper; - if (((AliTRDsim &) s).fSigma) delete ((AliTRDsim &) s).fSigma; + if (((AliTRDsim &) s).fSigma) delete [] ((AliTRDsim &) s).fSigma; ((AliTRDsim &) s).fSigma = new Double_t[fSpNBins]; for (Int_t iBin = 0; iBin < fSpNBins; iBin++) { ((AliTRDsim &) s).fSigma[iBin] = fSigma[iBin]; @@ -166,20 +193,19 @@ void AliTRDsim::Init() { // // Initialization - // The default radiator are 100 prolypropilene foils of 20 mu thickness - // with gaps of 500 mu filled with CO2. - // + // The default radiator are 100 prolypropilene foils of 13 mu thickness + // with gaps of 60 mu filled with CO2. // fNFoils = 100; - fFoilThick = 0.0020; + fFoilThick = 0.0013; fFoilDens = 0.92; fFoilZ = 5.28571; fFoilA = 10.4286; fFoilOmega = Omega(fFoilDens,fFoilZ,fFoilA); - fGapThick = 0.0500; + fGapThick = 0.0060; fGapDens = 0.001977; fGapZ = 7.45455; fGapA = 14.9091; @@ -195,6 +221,7 @@ void AliTRDsim::Init() if (fSpectrum) delete fSpectrum; fSpectrum = new TH1D("TRspectrum","TR spectrum",fSpNBins,fSpLower,fSpUpper); + fSpectrum->SetDirectory(0); // Set the sigma values SetSigma(); @@ -319,7 +346,7 @@ void AliTRDsim::SetSigma() // Sets the absorbtion crosssection for the energies of the TR spectrum // - if (fSigma) delete fSigma; + if (fSigma) delete [] fSigma; fSigma = new Double_t[fSpNBins]; for (Int_t iBin = 0; iBin < fSpNBins; iBin++) { Double_t energykeV = iBin * fSpBinWidth + 1.0; @@ -723,59 +750,3 @@ Int_t AliTRDsim::Locate(Double_t *xv, Int_t n, Double_t xval return 0; } - -//_____________________________________________________________________________ -void AliTRDsim::Streamer(TBuffer &R__b) -{ - // - // Stream an object of class AliTRDsim. - // - - if (R__b.IsReading()) { - Version_t R__v = R__b.ReadVersion(); if (R__v) { } - TObject::Streamer(R__b); - R__b >> fNFoils; - R__b >> fFoilThick; - R__b >> fGapThick; - R__b >> fFoilDens; - R__b >> fGapDens; - R__b >> fFoilOmega; - R__b >> fGapOmega; - R__b >> fFoilZ; - R__b >> fGapZ; - R__b >> fFoilA; - R__b >> fGapA; - R__b >> fTemp; - R__b >> fSpNBins; - R__b >> fSpRange; - R__b >> fSpBinWidth; - R__b >> fSpLower; - R__b >> fSpUpper; - R__b.ReadArray(fSigma); - R__b >> fSpectrum; - } - else { - R__b.WriteVersion(AliTRDsim::IsA()); - TObject::Streamer(R__b); - R__b << fNFoils; - R__b << fFoilThick; - R__b << fGapThick; - R__b << fFoilDens; - R__b << fGapDens; - R__b << fFoilOmega; - R__b << fGapOmega; - R__b << fFoilZ; - R__b << fGapZ; - R__b << fFoilA; - R__b << fGapA; - R__b << fTemp; - R__b << fSpNBins; - R__b << fSpRange; - R__b << fSpBinWidth; - R__b << fSpLower; - R__b << fSpUpper; - R__b.WriteArray(fSigma, fSpNBins); - R__b << (TObject*) fSpectrum; - } - -}