re-activate contrib code
[u/mrichter/AliRoot.git] / TRD / AliTRDsimTR.h
1 #ifndef ALITRDSIMTR_H
2 #define ALITRDSIMTR_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 ////////////////////////////////////////////////////////////////////////////
9 //                                                                        //
10 //  TRD simulation - multimodule (regular rad.)                           //
11 //                                                                        //
12 ////////////////////////////////////////////////////////////////////////////
13
14 #include <TObject.h>
15 #include <TMath.h>
16
17 class TH1D;
18
19 class AliModule;
20
21 class AliTRDsimTR : public TObject {
22
23  public:
24
25   AliTRDsimTR();
26   AliTRDsimTR(const AliTRDsimTR &s);
27   AliTRDsimTR(AliModule *mod, Int_t foil, Int_t gap);
28   virtual ~AliTRDsimTR();
29   AliTRDsimTR &operator=(const AliTRDsimTR &s);
30
31   virtual void     Copy(TObject &s) const;
32   virtual void     Init();
33   virtual Int_t    CreatePhotons(Int_t pdg, Float_t p
34                                , Int_t &nPhoton, Float_t *ePhoton);
35   virtual Int_t    TrPhotons(Float_t p, Float_t mass
36                            , Int_t &nPhoton, Float_t *ePhoton);
37   virtual Double_t Sigma(Double_t energykeV);
38   virtual Double_t Interpolate(Double_t energyMeV
39                              , Double_t *en, const Double_t * const mu, Int_t n);
40   virtual Int_t    Locate(Double_t *xv, Int_t n, Double_t xval
41                         , Int_t &kl, Double_t &dx);
42   virtual Double_t Omega(Float_t rho, Float_t z, Float_t a)  { return (28.8 * TMath::Sqrt(rho * z / a)); };
43   virtual Int_t    SelectNFoils(Float_t p) const;
44
45           void     SetFoilThick(Float_t t)                   { fFoilThick = t;
46                                                                SetSigma();                                  };
47           void     SetGapThick(Float_t t)                    { fGapThick  = t;
48                                                                SetSigma();                                  };
49           void     SetFoilDens(Float_t d)                    { fFoilDens  = d; 
50                                                                fFoilOmega = Omega(fFoilDens,fFoilZ,fFoilA);
51                                                                SetSigma();                                  };
52           void     SetFoilZ(Float_t z)                       { fFoilZ     = z; 
53                                                                fFoilOmega = Omega(fFoilDens,fFoilZ,fFoilA); };
54           void     SetFoilA(Float_t a)                       { fFoilA     = a; 
55                                                                fFoilOmega = Omega(fFoilDens,fFoilZ,fFoilA); };
56           void     SetGapDens(Float_t d)                     { fGapDens   = d;
57                                                                fGapOmega  = Omega(fGapDens ,fGapZ ,fGapA );
58                                                                SetSigma();                                  };
59           void     SetGapZ(Float_t z)                        { fGapZ      = z;
60                                                                fGapOmega  = Omega(fGapDens ,fGapZ ,fGapA ); };
61           void     SetGapA(Float_t a)                        { fGapA      = a;
62                                                                fGapOmega  = Omega(fGapDens ,fGapZ ,fGapA ); };
63           void     SetTemp(Float_t t)                        { fTemp      = t; 
64                                                                SetSigma();                                  };
65           void     SetSigma();
66
67   virtual Double_t GetMuPo(Double_t energyMeV);
68   virtual Double_t GetMuCO(Double_t energyMeV);
69   virtual Double_t GetMuXe(Double_t energyMeV);
70   virtual Double_t GetMuAr(Double_t energyMeV);
71   virtual Double_t GetMuMy(Double_t energyMeV);
72   virtual Double_t GetMuN2(Double_t energyMeV);
73   virtual Double_t GetMuO2(Double_t energyMeV);
74   virtual Double_t GetMuHe(Double_t energyMeV);
75   virtual Double_t GetMuAi(Double_t energyMeV);
76
77           Float_t  GetFoilThick() const                      { return fFoilThick;     };
78           Float_t  GetGapThick() const                       { return fGapThick;      };
79           Float_t  GetFoilDens() const                       { return fFoilDens;      };
80           Float_t  GetGapDens() const                        { return fGapDens;       };
81           Double_t GetFoilOmega() const                      { return fFoilOmega;     };
82           Double_t GetGapOmega() const                       { return fGapOmega;      };
83           Float_t  GetTemp() const                           { return fTemp / 273.16; };
84           TH1D    *GetSpectrum() const                       { return fSpectrum;      };
85
86  protected:
87
88           Int_t     fNFoilsDim;            //  Dimension of the NFoils array
89           Int_t    *fNFoils;               //[fNFoilsDim] Number of foils in the radiator stack
90           Double_t *fNFoilsUp;             //[fNFoilsDim] Upper momenta for a given number of foils
91           Float_t   fFoilThick;            //  Thickness of the foils (cm)
92           Float_t   fGapThick;             //  Thickness of the gaps between the foils (cm)
93
94           Float_t   fFoilDens;             //  Density of the radiator foils (g/cm^3) 
95           Float_t   fGapDens;              //  Density of the gas in the radiator gaps (g/cm^3)
96
97           Double_t  fFoilOmega;            //  Plasma frequency of the radiator foils
98           Double_t  fGapOmega;             //  Plasma frequency of the gas in the radiator gaps
99
100           Float_t   fFoilZ;                //  Z of the foil material
101           Float_t   fGapZ;                 //  Z of the gas in the gaps
102
103           Float_t   fFoilA;                //  A of the foil material
104           Float_t   fGapA;                 //  A of the gas in the gaps
105
106           Float_t   fTemp;                 //  Temperature of the radiator gas (Kelvin)
107
108           Int_t     fSpNBins;              //  Number of bins of the TR spectrum
109           Float_t   fSpRange;              //  Range of the TR spectrum
110           Float_t   fSpBinWidth;           //  Bin width of the TR spectrum
111           Float_t   fSpLower;              //  Lower border of the TR spectrum
112           Float_t   fSpUpper;              //  Upper border of the TR spectrum
113
114           Double_t *fSigma;                //[fSpNBins] Array of sigma values
115
116           TH1D     *fSpectrum;             //! TR photon energy spectrum
117
118   ClassDef(AliTRDsimTR,1)                  //  Simulates TR photons
119
120 };
121 #endif