Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JSIRENE Namespace Reference

Detector simulations. More...

Classes

struct  JFoxWolframMoments
 Class for computing Fox-Wolfram moments. More...
 
struct  JHit_t
 Auxiliary class to set-up Hit. More...
 
struct  JHitInertiaTensor
 Class for hit inertia tensor calculations. More...
 
struct  JHits_t
 Auxiliary data structure for list of hits with hit merging capability. More...
 
struct  JParameters
 Detector simulation parameters. More...
 
struct  JPoint
 Point along muon trajectory. More...
 
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  JSphericityTensor
 Class for sphericity tensor calculations. More...
 
struct  JTrack
 Muon trajectory. More...
 
struct  JTrk_t
 Auxiliary class to set-up Trk. More...
 
struct  JVertex
 Vertex of energy loss of muon. More...
 
struct  number_of_photo_electrons_type
 Auxiliary data structure for determination of number of photo-electrons. More...
 

Functions

const JCylinder3D getMaximumContainmentVolume ()
 Forward function declarations.
 
double getVisibleEnergy (const Trk &track, const JCylinder3D &can=getMaximumContainmentVolume())
 Get the visible energy of a track.
 
double getVisibleEnergy (const Evt &evt, const JCylinder3D &can=getMaximumContainmentVolume())
 Get the visible energy vector of an event.
 
double getThrust (const std::vector< Trk >::const_iterator __begin, const std::vector< Trk >::const_iterator __end)
 Compute thrust for a given range of tracks.
 
double getThrust (const Evt &event)
 Compute thrust for a given event.
 
bool operator< (const JPulse &first, const JPulse &second)
 Compare Monte Carlo hit times.
 
bool operator< (const JPulse &hit, const double t0)
 Compare Monte Carlo hit times.
 
JHitType_t getHitType (const JPDFType_t pdf, const bool shower=false)
 Get hit type corresponding to given PDF type.
 
Vec getVisibleEnergyVector (const Trk &track, const JCylinder3D &can=getMaximumContainmentVolume())
 Get the visible energy vector of a track.
 
double getVisibleEnergy (std::vector< Trk >::const_iterator __begin, std::vector< Trk >::const_iterator __end, const JCylinder3D &can=getMaximumContainmentVolume())
 Get the visible energy of a given range of tracks.
 
Vec getVisibleEnergyVector (std::vector< Trk >::const_iterator __begin, std::vector< Trk >::const_iterator __end, const JCylinder3D &can=getMaximumContainmentVolume())
 Get the visible energy vector of a given range of tracks.
 
Vec getVisibleEnergyVector (const Evt &evt, const JCylinder3D &can=getMaximumContainmentVolume())
 Get the visible energy vector of an event.
 
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)
 
double pythia (const int type, const double E)
 Get equivalent EM-energy for given pion energy.
 

Variables

static const JPythia pythia
 Function object for relative light yield as a function of GEANT particle code.
 
const struct JSIRENE::number_of_photo_electrons_type getNumberOfPhotoElectrons
 

Detailed Description

Detector simulations.

Author
bjung
mdejong

Function Documentation

◆ getMaximumContainmentVolume()

const JCylinder3D JSIRENE::getMaximumContainmentVolume ( )
inline

Forward function declarations.

Auxiliary function to retrieve the maximum cylindrical containment volume.

Returns
maximum cylindrical containment volume

Definition at line 48 of file JVisibleEnergyToolkit.hh.

49 {
50 using namespace JPP;
51
52 const double R_Earth = R_EARTH_KM * 1e3; // m
53
54 const JVector2D center(0.0, 0.0);
55 const JCircle2D circle(center, R_Earth);
56
57 return JCylinder3D(circle, -R_Earth, R_Earth);
58 }
Data structure for circle in two dimensions.
Definition JCircle2D.hh:35
Data structure for vector in two dimensions.
Definition JVector2D.hh:34
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).

◆ getVisibleEnergy() [1/3]

double JSIRENE::getVisibleEnergy ( const Trk & track,
const JCylinder3D & can = getMaximumContainmentVolume() )

Get the visible energy of a track.


This method accounts for muon radiative energy losses.
Note: The optional parameter can is used only when the given track
corresponds to a muon and if this track does not contain the
mc_usr_keys::energy_lost_in_can information, generated by JSirene.

Parameters
tracktrack
candetector can
Returns
visible energy [GeV]

Definition at line 73 of file JVisibleEnergyToolkit.hh.

75 {
76 using namespace std;
77 using namespace JPP;
78
79 double Evis = 0.0;
80
81 if (is_finalstate(track)) {
82
83 const bool isMuon = is_muon(track);
84
85 if (isMuon && track.haveusr(mc_usr_keys::energy_lost_in_can)) {
86
88
89 } else if (isMuon) {
90
91 // Determine muon pathlength inside detector [m]
92
93 const JCylinder3D::intersection_type& intersection = can.getIntersection(getAxis(track));
94
95 const double Lmuon = gWater.getX(track.E, MASS_MUON / getSinThetaC());
96 const double Leff = (min(Lmuon, max(intersection.second, 0.0)) -
97 min(Lmuon, max(intersection.first, 0.0)));
98
99
100 // Determine visible energy deposition [GeV]
101
102 const double Emidpoint = gWater.getE(track.E, Lmuon/2.0);
103
104 const double dEb = gWater.getEb(track.E, Leff);
105 const double dEc = Leff / geanc();
106 const double dEd = Leff * getDeltaRaysFromMuon(Emidpoint);
107
108 Evis = dEb + dEc + dEd;
109
110 } else if (!is_neutrino(track) && JPDB::getInstance().hasPDG(track.type)) {
111
112 Evis = pythia(track.type, getKineticEnergy(track));
113 }
114 }
115
116 return Evis;
117 }
bool is_neutrino(const Trk &track)
Test whether given track is a neutrino.
double pythia(const int type, const double E)
Get equivalent EM-energy for given pion energy.
Definition pythia.hh:245
const char *const energy_lost_in_can
Definition io_ascii.hh:46
bool haveusr(const std::string &key) const
Check availability of user data of the item with given key.
Definition AAObject.hh:42
double getusr(const std::string &key) const
Get user data item with given key.
Definition AAObject.hh:72
The cylinder used for photon tracking.
Definition JHead.hh:575
int type
MC: particle type in PDG encoding.
Definition Trk.hh:24
double E
Energy [GeV] (either MC truth or reconstructed)
Definition Trk.hh:20

◆ getVisibleEnergy() [2/3]

double JSIRENE::getVisibleEnergy ( const Evt & evt,
const JCylinder3D & can = getMaximumContainmentVolume() )
inline

Get the visible energy vector of an event.


This method accounts for muon radiative energy losses.

Parameters
evtevent
candetector can
Returns
visible energy [GeV]

Definition at line 192 of file JVisibleEnergyToolkit.hh.

194 {
195 return getVisibleEnergy(evt.mc_trks.begin(), evt.mc_trks.end(), can);
196 }
double getVisibleEnergy(const Trk &, const JCylinder3D &)
Get the visible energy of a track.
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition Evt.hh:49

◆ getThrust() [1/2]

double JSIRENE::getThrust ( const std::vector< Trk >::const_iterator __begin,
const std::vector< Trk >::const_iterator __end )
inline

Compute thrust for a given range of tracks.


The definition was taken from the description in section 15.2.2 of arXiv:hep-ph/0603175v2.

Parameters
__beginbeginning of track data
__endend of track data
Returns
thrust

< Thrust axis

< residual angle

Definition at line 43 of file JEventShapeVariables.hh.

45 {
46 using namespace std;
47 using namespace JPP;
48
49 static const int MAX_STEPS = 20;
50 static const double epsilon = 1e-9;
51
52
53 Vec axis0(0.0, 0.0, 0.0); //!< Thrust axis
54
55 // Set thrust axis start value (= summed final state particle momenta)
56
57 for (vector<Trk>::const_iterator i = __begin; i != __end; ++i) {
58 if (is_finalstate(*i)) {
59 axis0 += getKineticEnergy(*i) * i->dir;
60 }
61 }
62
63 if (axis0.len() < epsilon) { // If total final state momentum is zero, set start value equal to first final state track momentum
64
65 vector<Trk>::const_iterator i = find_if(__begin, __end, is_finalstate);
66
67 if (i != __end) {
68 axis0 = getKineticEnergy(*i) * i->dir;
69 } else {
70 THROW(JValueOutOfRange, "getThrust(): No final state tracks given.");
71 }
72 }
73
74 axis0.normalize();
75
76 // Find axis which maximizes the thrust
77
78 double res = numeric_limits<double>::max(); //!< residual angle
79
80 for (int k = 0; k < MAX_STEPS && res > epsilon; ++k) {
81
82 Vec axis1(0.0, 0.0, 0.0);
83
84 for (vector<Trk>::const_iterator i = __begin; i != __end; ++i) {
85
86 if (is_finalstate(*i)) {
87
88 const Vec p = getKineticEnergy(*i) * i->dir;
89
90 axis1 += (p.dot(axis0) > 0.0 ? p : -p);
91 }
92 }
93
94 axis1.normalize();
95
96 res = acos( axis0.dot(axis1) );
97
98 axis0 = axis1;
99 }
100
101 // Compute thrust
102
103 double pSum = 0.0;
104 double norm = 0.0;
105
106 for (vector<Trk>::const_iterator i = __begin; i != __end; ++i) {
107
108 if (is_finalstate(*i)) {
109
110 const Vec p = getKineticEnergy(*i) * i->dir;
111
112 pSum += fabs(p.dot(axis0));
113 norm += p.len();
114 }
115 }
116
117 return pSum / norm;
118 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Exception for accessing a value in a collection that is outside of its range.
const double epsilon
bool is_finalstate(const Trk &track)
Test whether given track corresponds to a final state particle.
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition Vec.hh:13
double len() const
Get length.
Definition Vec.hh:145
double dot(const Vec &v) const
Get dot product.
Definition Vec.hh:36

◆ getThrust() [2/2]

double JSIRENE::getThrust ( const Evt & event)
inline

Compute thrust for a given event.


The definition was taken from the description in section 15.2.2 of arXiv:hep-ph/0603175v2.

Parameters
eventevent
Returns
thrust

Definition at line 128 of file JEventShapeVariables.hh.

129 {
130 return getThrust(event.mc_trks.begin(), event.mc_trks.end());
131 }
double getThrust(const std::vector< Trk >::const_iterator __begin, const std::vector< Trk >::const_iterator __end)
Compute thrust for a given range of tracks.

◆ operator<() [1/2]

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 }
T getLowerLimit() const
Get lower limit.
Definition JRange.hh:202

◆ operator<() [2/2]

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 }

◆ getHitType()

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 151 of file JSireneToolkit.hh.

152 {
153 using namespace JAANET;
154 using namespace JPHYSICS;
155
156 switch (pdf) {
157
158 case DIRECT_LIGHT_FROM_MUON:
159 return HIT_TYPE_MUON_DIRECT;
160
161 case SCATTERED_LIGHT_FROM_MUON:
162 return HIT_TYPE_MUON_SCATTERED;
163
164 case DIRECT_LIGHT_FROM_DELTARAYS:
165 return HIT_TYPE_DELTARAYS_DIRECT;
166
167 case SCATTERED_LIGHT_FROM_DELTARAYS:
168 return HIT_TYPE_DELTARAYS_SCATTERED;
169
170 case DIRECT_LIGHT_FROM_EMSHOWER:
171 return (shower ? HIT_TYPE_SHOWER_DIRECT : HIT_TYPE_BREMSSTRAHLUNG_DIRECT );
172
173 case SCATTERED_LIGHT_FROM_EMSHOWER:
174 return (shower ? HIT_TYPE_SHOWER_SCATTERED : HIT_TYPE_BREMSSTRAHLUNG_SCATTERED);
175
176 default:
177 return HIT_TYPE_UNKNOWN;
178 }
179 }
Extensions to Evt data format.
Auxiliary methods for light properties of deep-sea water.

◆ getVisibleEnergyVector() [1/3]

Vec JSIRENE::getVisibleEnergyVector ( const Trk & track,
const JCylinder3D & can = getMaximumContainmentVolume() )
inline

Get the visible energy vector of a track.


This method accounts for muon radiative energy losses.

Parameters
tracktrack
candetector can
Returns
visible energy vector [GeV]

Definition at line 128 of file JVisibleEnergyToolkit.hh.

129 {
130 return getVisibleEnergy(track, can) * track.dir;
131 }
Vec dir
track direction
Definition Trk.hh:18

◆ getVisibleEnergy() [3/3]

double JSIRENE::getVisibleEnergy ( std::vector< Trk >::const_iterator __begin,
std::vector< Trk >::const_iterator __end,
const JCylinder3D & can = getMaximumContainmentVolume() )
inline

Get the visible energy of a given range of tracks.


This method accounts for muon radiative energy losses.

Parameters
__beginstart of track data
__endend of track data
candetector can
Returns
visible energy [GeV]

Definition at line 143 of file JVisibleEnergyToolkit.hh.

146 {
147 using namespace std;
148
149 double Evis = 0.0;
150
151 for (vector<Trk>::const_iterator track = __begin; track != __end; ++track) {
152 Evis += getVisibleEnergy(*track, can);
153 }
154
155 return Evis;
156 }

◆ getVisibleEnergyVector() [2/3]

Vec JSIRENE::getVisibleEnergyVector ( std::vector< Trk >::const_iterator __begin,
std::vector< Trk >::const_iterator __end,
const JCylinder3D & can = getMaximumContainmentVolume() )
inline

Get the visible energy vector of a given range of tracks.


This method accounts for muon radiative energy losses.

Parameters
__beginstart of track data
__endend of track data
candetector can
Returns
visible energy vector [GeV]

Definition at line 168 of file JVisibleEnergyToolkit.hh.

171 {
172 using namespace std;
173
174 Vec Evis(0.0, 0.0, 0.0);
175
176 for (vector<Trk>::const_iterator track = __begin; track != __end; ++track) {
177 Evis += getVisibleEnergyVector(*track, can);
178 }
179
180 return Evis;
181 }
Vec getVisibleEnergyVector(const Trk &track, const JCylinder3D &can=getMaximumContainmentVolume())
Get the visible energy vector of a track.

◆ getVisibleEnergyVector() [3/3]

Vec JSIRENE::getVisibleEnergyVector ( const Evt & evt,
const JCylinder3D & can = getMaximumContainmentVolume() )
inline

Get the visible energy vector of an event.


This method accounts for muon radiative energy losses.

Parameters
evtevent
candetector can
Returns
visible energy vector [GeV]

Definition at line 207 of file JVisibleEnergyToolkit.hh.

209 {
210 return getVisibleEnergyVector(evt.mc_trks.begin(), evt.mc_trks.end(), can);
211 }

◆ opa_weight_high_e()

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 }

◆ ngamma_elec()

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 }

◆ weight_pion()

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

◆ weight_kaon()

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 }

◆ weight_kshort()

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 }

◆ weight_klong()

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 }

◆ weight_proton()

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 }

◆ weight_neutron()

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 }

◆ opa_efrac()

double JSIRENE::opa_efrac ( const int ipart,
const double ekin )
inline

Definition at line 173 of file pythia.hh.

174 {
175 using namespace JPP;
176
177 double etemp, weight_part;
178
179 // neutrino or muon
180 if (ipart == GEANT4_TYPE_NEUTRINO ||
181 ipart == GEANT4_TYPE_ANTIMUON ||
182 ipart == GEANT4_TYPE_MUON ||
183 ipart == GEANT4_TYPE_ANTITAU ||
184 ipart == GEANT4_TYPE_TAU) {
185 return 0.0;
186 }
187
188 // 100% energy to EM showers if electron, positron, pi0, or gamma
189 if (ipart == GEANT4_TYPE_PHOTON ||
190 ipart == GEANT4_TYPE_ANTIELECTRON ||
191 ipart == GEANT4_TYPE_ELECTRON ||
192 ipart == GEANT4_TYPE_NEUTRAL_PION ||
193 ipart == GEANT4_TYPE_ETA) {
194 return 1.0;
195 }
196
197 // low-energy fits went up to 40 GeV
198 if (ekin <= 40)
199 etemp=ekin;
200 else
201 etemp=40.;
202
203 // otherwise, calculate fractions the long way. First we get the
204 // expected number of photons from the particle:
205 if (ipart == GEANT4_TYPE_PION_PLUS ||
206 ipart == GEANT4_TYPE_PION_MINUS)
207 weight_part=weight_pion(etemp);
208 else if (ipart == GEANT4_TYPE_KAON_LONG)
209 weight_part=weight_klong(etemp);
210 else if (ipart == GEANT4_TYPE_KAON_SHORT)
211 weight_part=weight_kshort(etemp);
212 else if (ipart == GEANT4_TYPE_KAON_PLUS ||
213 ipart == GEANT4_TYPE_KAON_MINUS)
214 weight_part=weight_kaon(etemp);
215 else if (ipart == GEANT4_TYPE_NEUTRON)
216 weight_part=weight_neutron(etemp);
217 else if (ipart == GEANT4_TYPE_PROTON ||
218 ipart == GEANT4_TYPE_ANTIPROTON)
219 weight_part=weight_proton(etemp);
220 else
221 // when in doubt, treat it as a proton
222 weight_part=weight_proton(etemp);
223
224 if (ekin <= 40)
225 return weight_part;
226 else if (ekin >= 1e7)
227 return opa_weight_high_e(ekin);
228 else {
229 // smooth transition between low-energy weights and high-energy pion weight
230 const double wp40 = weight_part;
231 const double whe40 = opa_weight_high_e(40.);
232 const double whex = opa_weight_high_e(ekin);
233 return whex - (whe40-wp40)*(7.-log10(ekin))/5.398;
234 }
235 }
double weight_neutron(const double ekin)
Definition pythia.hh:149
double weight_klong(const double ekin)
Definition pythia.hh:119
double weight_kshort(const double ekin)
Definition pythia.hh:108
double opa_weight_high_e(const double ekin)
Definition pythia.hh:20
double weight_proton(const double ekin)
Definition pythia.hh:135
double weight_kaon(const double ekin)
Definition pythia.hh:92
double weight_pion(const double ekin)
Definition pythia.hh:69

◆ pythia()

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 245 of file pythia.hh.

246 {
247 int ipart = JPDB::getInstance().getPDG(type).geant;
248 float ekin = (float) E;
249
250 return opa_efrac(ipart, ekin) * E;
251 }
double opa_efrac(const int ipart, const double ekin)
Definition pythia.hh:173

Variable Documentation

◆ pythia

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.

◆ getNumberOfPhotoElectrons

const struct JSIRENE::number_of_photo_electrons_type JSIRENE::getNumberOfPhotoElectrons