Project
Loading...
Searching...
No Matches
TRsim.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
13 * See cxx source for full Copyright notice */
14
15/* $Id$ */
16
18// //
19// TRD simulation - multimodule (regular rad.) //
20// //
22#ifndef ALICEO2_TRD_TRSIM_H_
23#define ALICEO2_TRD_TRSIM_H_
24
25#include <TMath.h>
26#include <array>
27#include <vector>
28
29class TH1D;
30
31namespace o2
32{
33namespace trd
34{
35class TRsim
36{
37 public:
38 TRsim();
40 void init();
41 int createPhotons(int pdg, float p, std::vector<float>& ePhoton);
42 int calculatePhotons(float p, float mass, std::vector<float>& ePhoton);
43 double getSigma(double energykeV);
44 double interpolate(double energyMeV, double* en, const double* const mu, int n);
45 int locate(double* xv, int n, double xval, int& kl, double& dx);
46 double getOmega(float rho, float z, float a) { return (28.8 * TMath::Sqrt(rho * z / a)); };
47 int selectNFoils(float p) const;
48
49 void setFoilThick(float t)
50 {
51 mFoilThick = t;
52 setSigma();
53 };
54 void setGapThick(float t)
55 {
56 mGapThick = t;
57 setSigma();
58 };
59 void setFoilDens(float d)
60 {
61 mFoilDens = d;
63 setSigma();
64 };
65 void setFoilZ(float z)
66 {
67 mFoilZ = z;
69 };
70 void setFoilA(float a)
71 {
72 mFoilA = a;
74 };
75 void setGapDens(float d)
76 {
77 mGapDens = d;
79 setSigma();
80 };
81 void setGapZ(float z)
82 {
83 mGapZ = z;
85 };
86 void setGapA(float a)
87 {
88 mGapA = a;
90 };
91 void setTemp(float t)
92 {
93 mTemp = t;
94 setSigma();
95 };
96 void setSigma();
97
98 double getMuPo(double energyMeV);
99 double getMuCO(double energyMeV);
100 double getMuXe(double energyMeV);
101 double getMuAr(double energyMeV);
102 double getMuMy(double energyMeV);
103 double getMuN2(double energyMeV);
104 double getMuO2(double energyMeV);
105 double getMuHe(double energyMeV);
106 double getMuAi(double energyMeV);
107
108 float getFoilThick() const { return mFoilThick; };
109 float getGapThick() const { return mGapThick; };
110 float getFoilDens() const { return mFoilDens; };
111 float getGapDens() const { return mGapDens; };
112 double getFoilgetOmega() const { return mFoilOmega; };
113 double getGapgetOmega() const { return mGapOmega; };
114 float getTemp() const { return mTemp / 273.16; };
115 TH1D* getSpectrum() const { return mSpectrum; };
116
117 protected:
118 static constexpr int mNFoilsDim = 7; // Dimension of the NFoils array
119 std::array<int, mNFoilsDim> mNFoils; // [mNFoilsDim] Number of foils in the radiator stack
120 std::array<double, mNFoilsDim> mNFoilsUp; // [mNFoilsDim] Upper momenta for a given number of foils
121 float mFoilThick; // Thickness of the foils (cm)
122 float mGapThick; // Thickness of the gaps between the foils (cm)
123 float mFoilDens; // Density of the radiator foils (g/cm^3)
124 float mGapDens; // Density of the gas in the radiator gaps (g/cm^3)
125 double mFoilOmega; // Plasma frequency of the radiator foils
126 double mGapOmega; // Plasma frequency of the gas in the radiator gaps
127 float mFoilZ; // Z of the foil material
128 float mGapZ; // Z of the gas in the gaps
129 float mFoilA; // A of the foil material
130 float mGapA; // A of the gas in the gaps
131 float mTemp; // Temperature of the radiator gas (Kelvin)
132 static constexpr int mSpNBins = 200; // Number of bins of the TR spectrum
133 static constexpr float mSpRange = 100; // Range of the TR spectrum
134 float mSpBinWidth; // Bin width of the TR spectrum
135 float mSpLower; // Lower border of the TR spectrum
136 float mSpUpper; // Upper border of the TR spectrum
137 std::array<double, mSpNBins> mSigma; // [mSpNBins] Array of sigma values
138 TH1D* mSpectrum = nullptr; // TR photon energy spectrum
139};
140} // namespace trd
141} // namespace o2
142#endif
double mGapOmega
Definition TRsim.h:126
void setSigma()
Definition TRsim.cxx:275
double mFoilOmega
Definition TRsim.h:125
int createPhotons(int pdg, float p, std::vector< float > &ePhoton)
Definition TRsim.cxx:122
double getMuAr(double energyMeV)
Definition TRsim.cxx:418
double interpolate(double energyMeV, double *en, const double *const mu, int n)
Definition TRsim.cxx:633
double getSigma(double energykeV)
Definition TRsim.cxx:288
std::array< double, mSpNBins > mSigma
Definition TRsim.h:137
void setGapA(float a)
Definition TRsim.h:86
static constexpr int mNFoilsDim
Definition TRsim.h:118
void setFoilZ(float z)
Definition TRsim.h:65
float mFoilZ
Definition TRsim.h:127
float mSpLower
Definition TRsim.h:135
float getFoilThick() const
Definition TRsim.h:108
float mGapThick
Definition TRsim.h:122
float mGapDens
Definition TRsim.h:124
double getMuXe(double energyMeV)
Definition TRsim.cxx:375
float mFoilDens
Definition TRsim.h:123
float mSpBinWidth
Definition TRsim.h:134
double getGapgetOmega() const
Definition TRsim.h:113
void setGapZ(float z)
Definition TRsim.h:81
float mGapA
Definition TRsim.h:130
void setGapThick(float t)
Definition TRsim.h:54
float getFoilDens() const
Definition TRsim.h:110
void setFoilThick(float t)
Definition TRsim.h:49
std::array< int, mNFoilsDim > mNFoils
Definition TRsim.h:119
void init()
Definition TRsim.cxx:69
int locate(double *xv, int n, double xval, int &kl, double &dx)
Definition TRsim.cxx:651
float getGapDens() const
Definition TRsim.h:111
double getMuPo(double energyMeV)
Definition TRsim.cxx:305
void setGapDens(float d)
Definition TRsim.h:75
double getFoilgetOmega() const
Definition TRsim.h:112
int calculatePhotons(float p, float mass, std::vector< float > &ePhoton)
Definition TRsim.cxx:160
double getMuO2(double energyMeV)
Definition TRsim.cxx:525
float getGapThick() const
Definition TRsim.h:109
TH1D * getSpectrum() const
Definition TRsim.h:115
std::array< double, mNFoilsDim > mNFoilsUp
Definition TRsim.h:120
double getMuAi(double energyMeV)
Definition TRsim.cxx:595
float getTemp() const
Definition TRsim.h:114
void setFoilA(float a)
Definition TRsim.h:70
void setFoilDens(float d)
Definition TRsim.h:59
float mFoilThick
Definition TRsim.h:121
float mTemp
Definition TRsim.h:131
double getMuN2(double energyMeV)
Definition TRsim.cxx:490
double getOmega(float rho, float z, float a)
Definition TRsim.h:46
double getMuCO(double energyMeV)
Definition TRsim.cxx:340
float mGapZ
Definition TRsim.h:128
int selectNFoils(float p) const
Definition TRsim.cxx:684
float mSpUpper
Definition TRsim.h:136
void setTemp(float t)
Definition TRsim.h:91
double getMuMy(double energyMeV)
Definition TRsim.cxx:455
static constexpr int mSpNBins
Definition TRsim.h:132
double getMuHe(double energyMeV)
Definition TRsim.cxx:560
float mFoilA
Definition TRsim.h:129
static constexpr float mSpRange
Definition TRsim.h:133
TH1D * mSpectrum
Definition TRsim.h:138
GLdouble n
Definition glcorearb.h:1982
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...