/*
$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
#include <stdlib.h>
-#include "TH1.h"
-#include "TRandom.h"
-#include "TMath.h"
-#include "TParticle.h"
+#include <TH1.h>
+#include <TRandom.h>
+#include <TMath.h>
+#include <TParticle.h>
-#include "AliTRDsim.h"
-#include "AliTRDconst.h"
#include "AliModule.h"
+#include "AliTRDsim.h"
+
ClassImp(AliTRDsim)
//_____________________________________________________________________________
// AliTRDsim default constructor
//
+ fSpectrum = 0;
+ fSigma = 0;
+
Init();
}
Float_t rad, abs;
Char_t name[21];
+ fSpectrum = 0;
+ fSigma = 0;
+
Init();
mod->AliGetMaterial(foil,name,aFoil,zFoil,rhoFoil,rad,abs);
// AliTRDsim destructor
//
- if (fSpectrum) delete fSpectrum;
- if (fSigma) delete fSigma;
+ // if (fSpectrum) delete fSpectrum;
+ if (fSigma) delete [] fSigma;
}
((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];
{
//
// 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;
if (fSpectrum) delete fSpectrum;
fSpectrum = new TH1D("TRspectrum","TR spectrum",fSpNBins,fSpLower,fSpUpper);
+ fSpectrum->SetDirectory(0);
// Set the sigma values
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;
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;
- }
-
-}