// //
////////////////////////////////////////////////////////////////////////////
-#include <stdlib.h>
-
#include <TH1.h>
#include <TRandom.h>
#include <TMath.h>
-#include <TParticle.h>
#include <TVirtualMC.h>
#include <TVirtualMCStack.h>
#include "AliModule.h"
-#include "AliLog.h"
-#include "AliMC.h"
#include "AliTRDsimTR.h"
// AliTRDsimTR copy constructor
//
- if (((AliTRDsimTR &) s).fNFoils) {
- delete [] ((AliTRDsimTR &) s).fNFoils;
- }
- ((AliTRDsimTR &) s).fNFoils = new Int_t[fNFoilsDim];
+ fNFoils = new Int_t[fNFoilsDim];
for (Int_t iFoil = 0; iFoil < fNFoilsDim; iFoil++) {
- ((AliTRDsimTR &) s).fNFoils[iFoil] = fNFoils[iFoil];
+ fNFoils[iFoil] = ((AliTRDsimTR &) s).fNFoils[iFoil];
}
- if (((AliTRDsimTR &) s).fNFoilsUp) {
- delete [] ((AliTRDsimTR &) s).fNFoilsUp;
- }
- ((AliTRDsimTR &) s).fNFoilsUp = new Double_t[fNFoilsDim];
+ fNFoilsUp = new Double_t[fNFoilsDim];
for (Int_t iFoil = 0; iFoil < fNFoilsDim; iFoil++) {
- ((AliTRDsimTR &) s).fNFoilsUp[iFoil] = fNFoilsUp[iFoil];
+ fNFoilsUp[iFoil] = ((AliTRDsimTR &) s).fNFoilsUp[iFoil];
}
- if (((AliTRDsimTR &) s).fSigma) {
- delete [] ((AliTRDsimTR &) s).fSigma;
- }
- ((AliTRDsimTR &) s).fSigma = new Double_t[fSpNBins];
+ fSigma = new Double_t[fSpNBins];
for (Int_t iBin = 0; iBin < fSpNBins; iBin++) {
- ((AliTRDsimTR &) s).fSigma[iBin] = fSigma[iBin];
+ fSigma[iBin] = ((AliTRDsimTR &) s).fSigma[iBin];
}
- fSpectrum->Copy(*((AliTRDsimTR &) s).fSpectrum);
-
}
//_____________________________________________________________________________
//
if (this != &s) ((AliTRDsimTR &) s).Copy(*this);
+ this->Init();
return *this;
((AliTRDsimTR &) s).fSigma[iBin] = fSigma[iBin];
}
- fSpectrum->Copy(*((AliTRDsimTR &) s).fSpectrum);
-
}
//_____________________________________________________________________________
energykeV = fSpectrum->GetBinCenter(iBin);
energyeV = energykeV * 1.0e3;
- sigma = Sigma(energykeV);
+ sigma = Sigma(energykeV);
csi1 = fFoilOmega / energyeV;
csi2 = fGapOmega / energyeV;
Int_t nPhCand = gRandom->Poisson(nTr);
// Link the MC stack and get info about parent electron
- TVirtualMCStack *stack = gMC->GetStack();
+ TVirtualMCStack *stack = TVirtualMC::GetMC()->GetStack();
Int_t track = stack->GetCurrentTrackNumber();
- Double_t px,py,pz,ptot;
- gMC->TrackMomentum(px,py,pz,ptot);
+ Double_t px, py, pz, ptot;
+ TVirtualMC::GetMC()->TrackMomentum(px,py,pz,ptot);
ptot = TMath::Sqrt(px*px+py*py+pz*pz);
px /= ptot;
py /= ptot;
Double_t x;
Double_t y;
Double_t z;
- gMC->TrackPosition(x,y,z);
-
+ TVirtualMC::GetMC()->TrackPosition(x,y,z);
+ Double_t t = TVirtualMC::GetMC()->TrackTime();
+
// Counter for TR analysed in custom code (e < 15keV)
nPhoton = 0;
Double_t e = fSpectrum->GetRandom();
// Put TR photon on particle stack
- if (e > 15.0 ) {
+ if (e > 15.0) {
e *= 1.0e-6; // Convert it to GeV
Int_t phtrack;
- stack-> PushTrack(1 // Must be 1
- ,track // Identifier of the parent track, -1 for a primary
- ,22 // Particle code.
- ,px*e // 4 momentum (The photon is generated on the same
- ,py*e // direction as the parent. For irregular radiator one
- ,pz*e // can calculate also the angle but this is a secondary
- ,e // order effect)
- ,x,y,z,0.0 // 4 vertex
- ,0.0,0.0,0.0 // Polarisation
- ,kPFeedBackPhoton // Production mechanism (there is no TR in G3 so one
- // has to make some convention)
- ,phtrack // On output the number of the track stored
- ,1.0
- ,1);
+ stack->PushTrack(1 // Must be 1
+ ,track // Identifier of the parent track, -1 for a primary
+ ,22 // Particle code.
+ ,px*e // 4 momentum (The photon is generated on the same
+ ,py*e // direction as the parent. For irregular radiator one
+ ,pz*e // can calculate also the angle but this is a secondary
+ ,e // order effect)
+ ,x,y,z,t // 4 vertex
+ ,0.0,0.0,0.0 // Polarisation
+ ,kPFeedBackPhoton // Production mechanism (there is no TR in G3 so one
+ // has to make some convention)
+ ,phtrack // On output the number of the track stored
+ ,1.0
+ ,1);
}
// Custom treatment of TR photons
, 5.00000E+00, 6.00000E+00, 8.00000E+00
, 1.00000E+01, 1.50000E+01, 2.00000E+01 };
- return Interpolate(energyMeV,en,mu,kN);
+ return Interpolate(energyMeV,en,mu,kN);
}
//_____________________________________________________________________________
-Double_t AliTRDsimTR::GetMuBu(Double_t energyMeV)
+Double_t AliTRDsimTR::GetMuAr(Double_t energyMeV)
{
//
- // Returns the photon absorbtion cross section for isobutane
+ // Returns the photon absorbtion cross section for argon
//
- const Int_t kN = 36;
-
- Double_t mu[kN] = { 0.38846E+03, 0.12291E+03, 0.53225E+02
- , 0.16091E+02, 0.69114E+01, 0.36541E+01
- , 0.22282E+01, 0.11149E+01, 0.72887E+00
- , 0.45053E+00, 0.38167E+00, 0.33920E+00
- , 0.32155E+00, 0.30949E+00, 0.29960E+00
- , 0.28317E+00, 0.26937E+00, 0.24228E+00
- , 0.22190E+00, 0.19289E+00, 0.17288E+00
- , 0.15789E+00, 0.14602E+00, 0.12829E+00
- , 0.11533E+00, 0.10310E+00, 0.93790E-01
- , 0.80117E-01, 0.63330E-01, 0.53229E-01
- , 0.46390E-01, 0.41425E-01, 0.34668E-01
- , 0.30267E-01, 0.23910E-01, 0.20509E-01 };
+ const Int_t kN = 38;
- Double_t en[kN] = { 0.10000E-02, 0.15000E-02, 0.20000E-02
- , 0.30000E-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 };
+ Double_t mu[kN] = { 3.184E+03, 1.105E+03, 5.120E+02
+ , 1.703E+02, 1.424E+02, 1.275E+03
+ , 7.572E+02, 4.225E+02, 2.593E+02
+ , 1.180E+02, 6.316E+01, 1.983E+01
+ , 8.629E+00, 2.697E+00, 1.228E+00
+ , 7.012E-01, 4.664E-01, 2.760E-01
+ , 2.043E-01, 1.427E-01, 1.205E-01
+ , 9.953E-02, 8.776E-02, 7.958E-02
+ , 7.335E-02, 6.419E-02, 5.762E-02
+ , 5.150E-02, 4.695E-02, 4.074E-02
+ , 3.384E-02, 3.019E-02, 2.802E-02
+ , 2.667E-02, 2.517E-02, 2.451E-02
+ , 2.418E-02, 2.453E-02 };
+
+ Double_t en[kN] = { 1.00000E-03, 1.50000E-03, 2.00000E-03
+ , 3.00000E-03, 3.20290E-03, 3.20290E-03
+ , 4.00000E-03, 5.00000E-03, 6.00000E-03
+ , 8.00000E-03, 1.00000E-02, 1.50000E-02
+ , 2.00000E-02, 3.00000E-02, 4.00000E-02
+ , 5.00000E-02, 6.00000E-02, 8.00000E-02
+ , 1.00000E-01, 1.50000E-01, 2.00000E-01
+ , 3.00000E-01, 4.00000E-01, 5.00000E-01
+ , 6.00000E-01, 8.00000E-01, 1.00000E+00
+ , 1.25000E+00, 1.50000E+00, 2.00000E+00
+ , 3.00000E+00, 4.00000E+00, 5.00000E+00
+ , 6.00000E+00, 8.00000E+00, 1.00000E+01
+ , 1.50000E+01, 2.00000E+01 };
return Interpolate(energyMeV,en,mu,kN);
//_____________________________________________________________________________
Double_t AliTRDsimTR::Interpolate(Double_t energyMeV
- , Double_t *en, Double_t *mu, Int_t n)
+ , Double_t *en
+ , const Double_t * const mu
+ , Int_t n)
{
//
// Interpolates the photon absorbtion cross section
//_____________________________________________________________________________
Int_t AliTRDsimTR::Locate(Double_t *xv, Int_t n, Double_t xval
- , Int_t &kl, Double_t &dx)
+ , Int_t &kl, Double_t &dx)
{
//
// Locates a point (xval) in a 1-dim grid (xv(n))