Jpp  15.0.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions | Variables
JSIRENE Namespace Reference

Detector simulations. More...

Classes

class  JPulse
 Auxiliary class for a time-over-threshold pulse from a PMT. More...
 
struct  JPythia
 Auxiliary class to determine EM-equivalent energy as a function of PDG particle code and energy. More...
 
class  JSeaWater
 Sea water composition. More...
 
struct  JVertex
 Vertex of energy loss of muon. More...
 
struct  JTrack
 Muon trajectory. More...
 

Functions

bool operator< (const JPulse &first, const JPulse &second)
 Compare Monte Carlo hit times. More...
 
bool operator< (const JPulse &hit, const double t0)
 Compare Monte Carlo hit times. More...
 
int getNumberOfPhotoElectrons (const double NPE, const int N, const double npe)
 Get number of photo-electrons of a hit given the expectation values of the number of photo-electrons on a module and PMT. More...
 
int getNumberOfPhotoElectrons (const int npe)
 Get number of photo-electrons of a hit given number of photo-electrons on PMT. More...
 
JHitType_t getHitType (const JPDFType_t pdf, const bool shower=false)
 Get hit type corresponding to given PDF type. More...
 
double getKineticEnergy (const double E, const double m)
 Get kinetic energy of particle with given mass. More...
 
double pythia (const int type, const double E)
 Get equivalent EM-energy for given pion energy. More...
 
double opa_weight_high_e (const double ekin)
 
double ngamma_elec (const double ekin)
 
double weight_pion (const double ekin)
 
double weight_kaon (const double ekin)
 
double weight_kshort (const double ekin)
 
double weight_klong (const double ekin)
 
double weight_proton (const double ekin)
 
double weight_neutron (const double ekin)
 
double opa_efrac (const int ipart, const double ekin)
 

Variables

static const JPythia pythia
 Function object for relative light yield as a function of GEANT particle code. More...
 

Detailed Description

Detector simulations.

Author
mdejong

Function Documentation

bool JSIRENE::operator< ( const JPulse first,
const JPulse second 
)
inline

Compare Monte Carlo hit times.

Parameters
firstfirst hit
secondsecond hit
Returns
true if first hit earlier than second; else false

Definition at line 81 of file JPulse.hh.

82  {
83  return first.getLowerLimit() < second.getLowerLimit();
84  }
bool JSIRENE::operator< ( const JPulse hit,
const double  t0 
)
inline

Compare Monte Carlo hit times.

Parameters
hithit
t0time [ns]
Returns
true if hit earlier than given time; else false

Definition at line 94 of file JPulse.hh.

95  {
96  return hit.getLowerLimit() < t0;
97  }
int JSIRENE::getNumberOfPhotoElectrons ( const double  NPE,
const int  N,
const double  npe 
)
inline

Get number of photo-electrons of a hit given the expectation values of the number of photo-electrons on a module and PMT.

The return value is evaluated by pick-and-drop statistics from the generated number of photo-electrons when the expectation value of the number of photo-electrons on a module deviates less than 5 sigmas from 0 (i.e. when it is less than 25). Otherwise, the return value is evaluated by Poisson statistics from the expectation value of the number of photo-electrons on PMT.

Parameters
NPEexpectation value of npe on module
Ngenerated value of npe on module
npeexpectation value of npe on PMT
Returns
number of photo-electrons on PMT

Definition at line 54 of file JSireneToolkit.hh.

57  {
58  if (NPE < 25.0) {
59 
60  int n = 0;
61 
62  for (int i = N; i != 0; --i) {
63  if (gRandom->Rndm() * NPE < npe) {
64  ++n;
65  }
66  }
67 
68  return n;
69 
70  } else {
71 
72  return gRandom->Poisson(npe);
73  }
74  }
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
const int n
Definition: JPolint.hh:660
int JSIRENE::getNumberOfPhotoElectrons ( const int  npe)
inline

Get number of photo-electrons of a hit given number of photo-electrons on PMT.

The number of photo-electrons of a hit may be larger than unity to limit the overall number of hits and consequently the memory coonsumption as well as the number of times the arrival time needs to be evaluated which is CPU intensive.

Parameters
npenumber of photo-electrons on PMT
Returns
number of photo-electrons of hit

Definition at line 87 of file JSireneToolkit.hh.

88  {
89  static const int NPE = 20;
90 
91  if (npe > NPE) {
92 
93  const int n = (int) (NPE * log10((double) npe / (double) NPE));
94 
95  if (n == 0)
96  return 1;
97  else
98  return n;
99  }
100 
101  return 1;
102  }
const int n
Definition: JPolint.hh:660
JHitType_t JSIRENE::getHitType ( const JPDFType_t  pdf,
const bool  shower = false 
)
inline

Get hit type corresponding to given PDF type.

Parameters
pdfPDF type
showerforce origin from neutrino interaction shower
Returns
hit type

Definition at line 112 of file JSireneToolkit.hh.

113  {
114  using namespace JAANET;
115  using namespace JPHYSICS;
116 
117  switch (pdf) {
118 
120  return HIT_TYPE_MUON_DIRECT;
121 
124 
127 
130 
133 
136 
137  default:
138  return HIT_TYPE_UNKNOWN;
139  }
140  }
Scattered light from primary shower.
Direct light from delta-rays.
Scattered light from muon.
scattered light from EM shower
Definition: JPDFTypes.hh:41
Scattered light from Bremsstrahlung.
Direct light from Bremsstrahlung.
Direct light from primary shower.
direct light from muon
Definition: JPDFTypes.hh:29
scattered light from muon
Definition: JPDFTypes.hh:30
scattered light from delta-rays
Definition: JPDFTypes.hh:36
direct light from EM shower
Definition: JPDFTypes.hh:40
direct light from delta-rays
Definition: JPDFTypes.hh:35
Direct light from muon.
Scattered light from delta-rays.
double JSIRENE::getKineticEnergy ( const double  E,
const double  m 
)
inline

Get kinetic energy of particle with given mass.

Parameters
Eenergy [GeV]
mmass [GeV]
Returns
energy [GeV]

Definition at line 375 of file JSireneToolkit.hh.

376  {
377  if (E > m)
378  return sqrt((E - m) * (E + m));
379  else
380  return 0.0;
381  }
then usage E
Definition: JMuonPostfit.sh:35
double JSIRENE::pythia ( const int  type,
const double  E 
)
inline

Get equivalent EM-energy for given pion energy.

Parameters
typeparticle type [PDG]
Eparticle energy [GeV]
Returns
EM-equivalent energy [GeV]

Definition at line 31 of file km3-opa_efrac.hh.

32  {
33  int ipart = JPDB::getInstance().getPDG(type).geant;
34  float ekin = (float) E;
35 
36  return opa_efrac_(ipart, ekin) * E;
37  }
then usage E
Definition: JMuonPostfit.sh:35
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:75
float opa_efrac_(int &ipart, float &ekin)
double JSIRENE::opa_weight_high_e ( const double  ekin)
inline

Definition at line 20 of file pythia.hh.

21  {
22  static const double Ma = 72.425;
23  static const double Mb = -49.417;
24  static const double Mc = 5.858;
25  static const double Md = 207.252;
26  static const double Me = 132.784;
27  static const double Mf = -10.277;
28  static const double Mg = -19.441;
29  static const double Mh = 58.598;
30  static const double Mi = 53.161;
31  static const double Mkref = 2.698;
32  // leading_coef Mlc=(Ma-Mf)/Mkref
33  static const double Mlc = (Ma-Mf)/Mkref;
34 
35  double num, denom, lognp, Ee, logE;
36 
37  // implement the energy-fractions according to M. Dentler: ANTARES-SOFT-2012-009. E must be the kinetic energy in GeV. Here, 'everything else' is treated as a pion. Other than charged pions, mostly kaons of all varieties and protons fall into this category. These fits were made mostly at high energies - at low energies, other fits are used.
38 
39  if (ekin > 0.2)
40  logE=log10(ekin);
41  else
42  // nphotons constant below 0.2 GeV (lowest fit point)
43  return 0.292;
44 
45  num = Me + Md*logE + Mc*pow(logE,2) + Mb*pow(logE,3) + Ma *pow(logE,4) + Mlc*pow(logE,5);
46  denom = Mi + Mh*logE + Mg*pow(logE,2) + Mf*pow(logE,3) + Mlc*pow(logE,4);
47 
48  if (denom <= 0) {
49  return 0.;
50  }
51 
52  lognp = num/denom;
53  Ee = pow(10.0, lognp-Mkref);
54 
55  return Ee/ekin;
56  }
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
double JSIRENE::ngamma_elec ( const double  ekin)
inline

Definition at line 58 of file pythia.hh.

59  {
60  static const double eleca = 1.33356e5;
61  static const double elecb = 1.66113e2;
62  static const double elecc = 16.4949;
63  static const double elecd = 1.5385e5;
64  static const double elece = 6.04871e5;
65 
66  return (eleca*ekin+elecb) * exp(-ekin/elecc) + (elecd*ekin+elece)* (1.-exp(-ekin/elecc));
67  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` typeset -Z 4 STRING JOpera1D -f hydrophone.root
double JSIRENE::weight_pion ( const double  ekin)
inline

Definition at line 69 of file pythia.hh.

70  {
71  static const double pia = 0.538346;
72  static const double pib = 1.32041;
73  static const double pic = 0.737415;
74  static const double pid = -0.813861;
75  static const double pie = -2.22444;
76  static const double pif = -2.15795;
77  static const double pig = -6.47242;
78  static const double pih = -2.7567;
79  static const double pix = 8.83498;
80 
81  if (ekin < 0.06)
82  return 1e4*pia/ngamma_elec(ekin);
83  else if (ekin < 0.15)
84  return pix*1e4*ekin/ngamma_elec(ekin);
85  else {
86  const double lek=log(ekin);
87  return (pib*1e5*ekin + (pow(ekin,(1.-1./pic))) * (pid*1e4 + 1e4*pie*lek + 1e4*pif*pow(lek,2) + 1e3*pig*pow(lek,3) + 1e2*pih*pow(lek,4)))/ngamma_elec(ekin);
88  }
89  }
double ngamma_elec(const double ekin)
Definition: pythia.hh:58
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
double JSIRENE::weight_kaon ( const double  ekin)
inline

Definition at line 92 of file pythia.hh.

93  {
94  static const double ka = 12.7537;
95  static const double kb = -1.052;
96  static const double kc = 3.49559;
97  static const double kd = 16.7914;
98  static const double ke = -0.355066;
99  static const double kf = 2.77116;
100 
101  if (ekin > 0.26)
102  return (1e4*ka*(ekin+kb)*(1.-exp(-ekin/kc)) + 1e4*(kd*ekin+ke)*exp(-ekin/kc))/ngamma_elec(ekin);
103  else
104  return kf*1e4/ngamma_elec(ekin);
105  }
double ngamma_elec(const double ekin)
Definition: pythia.hh:58
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` typeset -Z 4 STRING JOpera1D -f hydrophone.root
double JSIRENE::weight_kshort ( const double  ekin)
inline

Definition at line 108 of file pythia.hh.

109  {
110  static const double k0sa = 0.351242;
111  static const double k0sb = 0.613076;
112  static const double k0sc = 6.24682;
113  static const double k0sd = 2.8858;
114 
115  return (k0sa*1e5 + k0sb*1e5*ekin + ekin*k0sc*1e4*log(k0sd + 1./ekin))/ngamma_elec(ekin);
116  }
double ngamma_elec(const double ekin)
Definition: pythia.hh:58
double JSIRENE::weight_klong ( const double  ekin)
inline

Definition at line 119 of file pythia.hh.

120  {
121  static const double k0la = 2.18152;
122  static const double k0lb = -0.632798;
123  static const double k0lc = 0.999514;
124  static const double k0ld = 1.36052;
125  static const double k0le = 4.22484;
126  static const double k0lf = -0.307859;
127 
128  if (ekin < 1.5)
129  return (1e4*k0la + ekin*1e5*k0lb*log(ekin) + 1e5*k0lc*pow(ekin,1.5))/ngamma_elec(ekin);
130  else
131  return (ekin*k0ld*1e5 + pow(ekin,1.-1./k0le)*k0lf*1e5)/ngamma_elec(ekin);
132  }
double ngamma_elec(const double ekin)
Definition: pythia.hh:58
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
double JSIRENE::weight_proton ( const double  ekin)
inline

Definition at line 135 of file pythia.hh.

136  {
137  static const double pa = 12.1281;
138  static const double pb = -17.1528;
139  static const double pc = 0.573158;
140  static const double pd = 34.1436;
141  static const double pe = -0.28944;
142  static const double pf = -13.2619;
143  static const double pg = 24.1357;
144 
145  return (1e4*(pa*ekin+pb)*(1.-exp(-ekin/pc)) + 1e4*(pd*ekin +pe+ pf*pow(ekin,2) + pg*pow(ekin,3))*exp(-ekin/pc)) / ngamma_elec(ekin);
146  }
double ngamma_elec(const double ekin)
Definition: pythia.hh:58
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` typeset -Z 4 STRING JOpera1D -f hydrophone.root
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
double JSIRENE::weight_neutron ( const double  ekin)
inline

Definition at line 149 of file pythia.hh.

150  {
151  static const double na = 1.24605;
152  static const double nb = 0.63819;
153  static const double nc = -0.802822;
154  static const double nd = -0.935327;
155  static const double ne = -6.1126;
156  static const double nf = -1.96894;
157  static const double ng = 0.716954;
158  static const double nh = 2.68246;
159  static const double ni = -9.39464;
160  static const double nj = 15.0737;
161 
162  if (ekin > 0.5) {
163  const double lek=log(ekin);
164  return (na*1e5*ekin + 1e3*pow(ekin,1.-1./nb) * (100.*nc+100.*nd*lek + 10.*ne*pow(lek,2) + 11.*nf*pow(lek,3)))/ngamma_elec(ekin);
165  } else
166  return (1e3*ng + 1e4*nh*ekin + 1e4*ni*pow(ekin,2) + 1e4*nj*pow(ekin,3))/ngamma_elec(ekin);
167  }
double ngamma_elec(const double ekin)
Definition: pythia.hh:58
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
double JSIRENE::opa_efrac ( const int  ipart,
const double  ekin 
)
inline

Definition at line 173 of file pythia.hh.

174  {
175  double etemp, weight_part;
176 
177  // 100% energy to EM showers if electron, positron, pi0, or gamma
178  if (ipart == 1 || ipart == 2 || ipart == 3 || ipart == 7) {
179  return 1.0;
180  }
181 
182  // low-energy fits went up to 40 GeV
183  if (ekin <= 40)
184  etemp=ekin;
185  else
186  etemp=40.;
187 
188  // otherwise, calculate fractions the long way. First we get the
189  // expected number of photons from the particle:
190  if (ipart == 8 || ipart == 9)
191  weight_part=weight_pion(etemp);
192  else if (ipart == 10)
193  weight_part=weight_klong(etemp);
194  else if (ipart == 16)
195  weight_part=weight_kshort(etemp);
196  else if (ipart == 11 || ipart == 12)
197  weight_part=weight_kaon(etemp);
198  else if (ipart == 13)
199  weight_part=weight_neutron(etemp);
200  else if (ipart == 14)
201  weight_part=weight_proton(etemp);
202  else
203  // when in doubt, treat it as a pion
204  weight_part=weight_pion(etemp);
205 
206  if (ekin <= 40)
207  return weight_part;
208  else if (ekin >= 1e7)
209  return opa_weight_high_e(ekin);
210  else {
211  // smooth transition between low-energy weights and high-energy pion weight
212  const double wp40 = weight_part;
213  const double whe40 = opa_weight_high_e(40.);
214  const double whex = opa_weight_high_e(ekin);
215  return whex - (whe40-wp40)*(7.-log10(ekin))/5.398;
216  }
217  }
double weight_klong(const double ekin)
Definition: pythia.hh:119
double opa_weight_high_e(const double ekin)
Definition: pythia.hh:20
double weight_proton(const double ekin)
Definition: pythia.hh:135
double weight_pion(const double ekin)
Definition: pythia.hh:69
double weight_kaon(const double ekin)
Definition: pythia.hh:92
double weight_kshort(const double ekin)
Definition: pythia.hh:108
double weight_neutron(const double ekin)
Definition: pythia.hh:149

Variable Documentation

const JPythia JSIRENE::pythia
static

Function object for relative light yield as a function of GEANT particle code.

Definition at line 96 of file JPythia.hh.