]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDsim.cxx
Adding makefile for Darwin and XLC compiler
[u/mrichter/AliRoot.git] / TRD / AliTRDsim.cxx
index 82b68e25fd7e450f97de2aac7ee66d9a5d721dec..0bdd970ed501c777dd08949bffa7e5bc73de1f03 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-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
-
-Revision 1.2  1999/09/29 09:24:35  fca
-Introduction of the Copyright and cvs Log
-
-*/
+/* $Id$ */
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
@@ -110,7 +90,7 @@ AliTRDsim::AliTRDsim(AliModule *mod, Int_t foil, Int_t gap)
 }
 
 //_____________________________________________________________________________
-AliTRDsim::AliTRDsim(const AliTRDsim &s)
+AliTRDsim::AliTRDsim(const AliTRDsim &s):TObject(s)
 {
   //
   // AliTRDsim copy constructor
@@ -127,8 +107,8 @@ AliTRDsim::~AliTRDsim()
   // AliTRDsim destructor
   //
 
-  if (fSpectrum) delete fSpectrum;
-  if (fSigma)    delete fSigma;
+  //  if (fSpectrum) delete fSpectrum;
+  if (fSigma)    delete [] fSigma;
 
 }
 
@@ -169,7 +149,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];
@@ -184,20 +164,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;
@@ -213,6 +192,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();
@@ -337,7 +317,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;
@@ -354,14 +334,11 @@ Double_t AliTRDsim::Sigma(Double_t energykeV)
   // Calculates the absorbtion crosssection for a one-foil-one-gap-radiator
   //
 
-  // Gas at 0 C
-  const Double_t kTemp0 = 273.16;
-
   // keV -> MeV
   Double_t energyMeV = energykeV * 0.001;
   if (energyMeV >= 0.001) {
-    return(GetMuPo(energyMeV) * fFoilDens * fFoilThick + 
-           GetMuCO(energyMeV) * fGapDens  * fGapThick  * fTemp/kTemp0);
+    return(GetMuPo(energyMeV) * fFoilDens * fFoilThick +
+           GetMuAi(energyMeV) * fGapDens  * fGapThick  * GetTemp());
   }
   else {
     return 1e6;
@@ -689,6 +666,50 @@ Double_t AliTRDsim::GetMuHe(Double_t energyMeV)
 
 }
 
+//_____________________________________________________________________________
+Double_t AliTRDsim::GetMuAi(Double_t energyMeV)
+{
+  //
+  // Returns the photon absorbtion cross section for air
+  // Implemented by Oliver Busch
+  //
+
+  const Int_t kN = 38;
+
+  Double_t mu[kN] = { 0.35854E+04, 0.11841E+04, 0.52458E+03,
+                      0.16143E+03, 0.14250E+03, 0.15722E+03,
+                      0.77538E+02, 0.40099E+02, 0.23313E+02,
+                      0.98816E+01, 0.51000E+01, 0.16079E+01,
+                      0.77536E+00, 0.35282E+00, 0.24790E+00,
+                      0.20750E+00, 0.18703E+00, 0.16589E+00,
+                      0.15375E+00, 0.13530E+00, 0.12311E+00,
+                      0.10654E+00, 0.95297E-01, 0.86939E-01,
+                      0.80390E-01, 0.70596E-01, 0.63452E-01,
+                      0.56754E-01, 0.51644E-01, 0.44382E-01,
+                      0.35733E-01, 0.30721E-01, 0.27450E-01,
+                      0.25171E-01, 0.22205E-01, 0.20399E-01,
+                      0.18053E-01, 0.18057E-01 };
+
+
+
+  Double_t en[kN] = { 0.10000E-02, 0.15000E-02, 0.20000E-02,
+                      0.30000E-02, 0.32029E-02, 0.32029E-02,
+                      0.40000E-02, 0.50000E-02, 0.60000E-02,
+                      0.80000E-02, 0.10000E-01, 0.15000E-01,
+                      0.20000E-01, 0.30000E-01, 0.40000E-01,
+                      0.50000E-01, 0.60000E-01, 0.80000E-01,
+                      0.10000E+00, 0.15000E+00, 0.20000E+00,
+                      0.30000E+00, 0.40000E+00, 0.50000E+00,
+                      0.60000E+00, 0.80000E+00, 0.10000E+01,
+                      0.12500E+01, 0.15000E+01, 0.20000E+01,
+                      0.30000E+01, 0.40000E+01, 0.50000E+01,
+                      0.60000E+01, 0.80000E+01, 0.10000E+02,
+                      0.15000E+02, 0.20000E+02 };
+
+  return Interpolate(energyMeV,en,mu,kN);
+
+}
+
 //_____________________________________________________________________________
 Double_t AliTRDsim::Interpolate(Double_t energyMeV
                               , Double_t *en, Double_t *mu, Int_t n)