Jpp  17.1.1
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  JParameters
 Detector simulation parameters. More...
 
struct  JHit_t
 Auxiliary class to set-up Hit. More...
 
struct  JHits_t
 Auxiliary data structure for list of hits with hit merging capability. More...
 
struct  JTrk_t
 Auxiliary class to set-up Trk. More...
 
struct  JPoint
 Point along muon trajectory. More...
 
struct  JTrack
 Muon trajectory. More...
 
struct  JVertex
 Vertex of energy loss of muon. 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...
 
Vec getVisibleEnergy (const Trk &track, const JCylinder3D &can)
 Get the visible energy of a track. More...
 
Vec getVisibleEnergy (const Trk &track)
 Get the visible energy of a track, assuming an infinite detector volume. More...
 
Vec getVisibleEnergy (const Evt &evt, const JCylinder3D &can)
 Get the visible energy of an event. More...
 
Vec getVisibleEnergy (const Evt &evt)
 Get the visible energy of an event, assuming an infinite detector volume. 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)
 
double pythia (const int type, const double E)
 Get equivalent EM-energy for given pion energy. More...
 

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

67  {
68  if (NPE < 25.0) {
69 
70  int n = 0;
71 
72  for (int i = N; i != 0; --i) {
73  if (gRandom->Rndm() * NPE < npe) {
74  ++n;
75  }
76  }
77 
78  return n;
79 
80  } else {
81 
82  return gRandom->Poisson(npe);
83  }
84  }
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
const int n
Definition: JPolint.hh:697
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 97 of file JSireneToolkit.hh.

98  {
99  static const int NPE = 20;
100 
101  if (npe > NPE) {
102 
103  const int n = (int) (NPE * log10((double) npe / (double) NPE));
104 
105  if (n == 0)
106  return 1;
107  else
108  return n;
109  }
110 
111  return 1;
112  }
const int n
Definition: JPolint.hh:697
set_variable E_E log10(E_{fit}/E_{#mu})"
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 122 of file JSireneToolkit.hh.

123  {
124  using namespace JAANET;
125  using namespace JPHYSICS;
126 
127  switch (pdf) {
128 
130  return HIT_TYPE_MUON_DIRECT;
131 
134 
137 
140 
143 
146 
147  default:
148  return HIT_TYPE_UNKNOWN;
149  }
150  }
Scattered light from primary shower.
Direct light from delta-rays.
Scattered light from muon.
scattered light from EM shower
Definition: JPDFTypes.hh:38
Scattered light from Bremsstrahlung.
Direct light from Bremsstrahlung.
Direct light from primary shower.
direct light from muon
Definition: JPDFTypes.hh:26
scattered light from muon
Definition: JPDFTypes.hh:27
scattered light from delta-rays
Definition: JPDFTypes.hh:33
direct light from EM shower
Definition: JPDFTypes.hh:37
direct light from delta-rays
Definition: JPDFTypes.hh:32
Direct light from muon.
Scattered light from delta-rays.
Vec JSIRENE::getVisibleEnergy ( const Trk track,
const JCylinder3D &  can 
)
inline

Get the visible energy of a track.


This method accounts for muon radiative energy losses.

Parameters
tracktrack
candetector can
Returns
visible energy [GeV]

Definition at line 60 of file JVisibleEnergyToolkit.hh.

61  {
62  using namespace std;
63  using namespace JPP;
64 
65  double Evis = 0.0;
66 
67  if (track.is_finalstate()) {
68  if (is_muon(track)) {
69 
70  // Determine muon pathlength inside detector [m]
71 
72  const JCylinder3D::intersection_type& intersection = can.getIntersection(getAxis(track));
73 
74  const double Lmuon = gWater.getX(track.E, MASS_MUON / getSinThetaC());
75  const double Leff = (intersection.first < 0.0 ?
76  min(Lmuon, intersection.second) :
77  min(Lmuon, intersection.second) - intersection.first);
78 
79  // Determine visible energy deposition [GeV]
80 
81  const double dEb = gWater.getEb(track.E, Leff);
82  const double dEc = Leff / geanc();
83 
84  Evis = dEb + dEc;
85 
86  } else if (!is_neutrino(track) && JPDB::getInstance().hasPDG(track.type)) {
87 
88  Evis = pythia(track.type, getKineticEnergy(track));
89  }
90  }
91 
92  return Evis * track.dir / track.dir.len();
93  }
double geanc()
Equivalent muon track length per unit shower energy.
Definition: JGeane.hh:28
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
Vec dir
track direction
Definition: Trk.hh:18
static const double MASS_MUON
muon mass [GeV]
static const JGeaneWater gWater
Function object for energy loss of muon in sea water.
Definition: JGeane.hh:381
virtual double getX(const double E0, const double E1) const override
Get distance traveled by muon.
Definition: JGeane.hh:349
static const JPythia pythia
Function object for relative light yield as a function of GEANT particle code.
Definition: JPythia.hh:96
double E
Energy [GeV] (either MC truth or reconstructed)
Definition: Trk.hh:20
double getEb(const double E, const double dx) const
Get energy loss due to pair production and bremsstrahlung.
Definition: JGeane.hh:334
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
double len() const
Get length.
Definition: Vec.hh:145
bool is_neutrino(const Trk &track)
Test whether given track is a neutrino.
double getKineticEnergy(const double E, const double m)
Get kinetic energy of particle with given mass.
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:75
JAxis3D getAxis(const Trk &track)
Get axis.
int type
MC: particle type in PDG encoding.
Definition: Trk.hh:24
bool is_finalstate() const
Test whether given particle is a final state inside the detector.
Definition: Trk.hh:88
double getSinThetaC()
Get average sine of Cherenkov angle of water corresponding to group velocity.
Vec JSIRENE::getVisibleEnergy ( const Trk track)
inline

Get the visible energy of a track, assuming an infinite detector volume.


This method accounts for muon radiative energy losses.

Parameters
tracktrack

Definition at line 102 of file JVisibleEnergyToolkit.hh.

103  {
104  static const double Rearth = 6386 * 1e3; // Radius of the Earth [m]
105 
106  static const JCylinder3D can(JCircle2D(JVector2D(), Rearth), Rearth, Rearth);
107 
108  return getVisibleEnergy(track, can);
109  }
Vec getVisibleEnergy(const Trk &track, const JCylinder3D &can)
Get the visible energy of a track.
Vec JSIRENE::getVisibleEnergy ( const Evt evt,
const JCylinder3D &  can 
)
inline

Get the visible energy of an event.


This method accounts for muon radiative energy losses.

Parameters
evtevent
candetector can
Returns
visible energy [GeV]

Definition at line 120 of file JVisibleEnergyToolkit.hh.

122  {
123  Vec Evis(0.0, 0.0, 0.0);
124 
125  for (std::vector<Trk>::const_iterator track = evt.mc_trks.begin(); track != evt.mc_trks.end(); ++track) {
126  Evis += getVisibleEnergy(*track, can);
127  }
128 
129  return Evis;
130  }
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition: Vec.hh:12
Vec getVisibleEnergy(const Trk &track, const JCylinder3D &can)
Get the visible energy of a track.
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
Vec JSIRENE::getVisibleEnergy ( const Evt evt)
inline

Get the visible energy of an event, assuming an infinite detector volume.


This method accounts for muon radiative energy losses.

Parameters
evtevent
Returns
visible energy [GeV]

Definition at line 140 of file JVisibleEnergyToolkit.hh.

141  {
142  Vec Evis(0.0, 0.0, 0.0);
143 
144  for (std::vector<Trk>::const_iterator track = evt.mc_trks.cbegin(); track != evt.mc_trks.cend(); ++track) {
145  Evis += getVisibleEnergy(*track);
146  }
147 
148  return Evis;
149  }
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition: Vec.hh:12
Vec getVisibleEnergy(const Trk &track, const JCylinder3D &can)
Get the visible energy of a track.
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
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  }
set_variable E_E log10(E_{fit}/E_{#mu})"
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"` source JAcousticsToolkit.sh typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN
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  }
then cat $TRIPOD_INITIAL<< EOF1 256877.5 4743716.7-2438.42 256815.5 4743395.0-2435.53 257096.2 4743636.0-2439.5EOFfiJEditDetector-a $DETECTOR_INITIAL-s"-1 addz -6.9"-o $DETECTOReval`JPrintDetector-a $DETECTOR-O SUMMARY`for STRING in ${STRINGS[*]};do set_variable MODULE`getModule-a $DETECTOR-L"$STRING 0"`JEditDetector-a $DETECTOR-M"$MODULE setz -2.9"-o $DETECTORdonecp-p $TRIPOD_INITIAL $TRIPODJAcoustics.sh $DETECTOR_IDcat > acoustics_trigger_parameters txt<< EOFQ=0.0;TMax_s=0.020;numberOfHits=90;EOFJAcousticsEventBuilder.sh $DETECTOR $RUNS[*]INPUT_FILES=(`ls KM3NeT_ ${(l:8::0::0:) DETECTOR_ID}_0 *${^RUNS}_event.root`) cd $WORKDIRif[!$HOMEDIR-ef $WORKDIR];then cp-p $HOMEDIR/$DETECTOR $WORKDIR cp-p $HOMEDIR/$TRIPOD $WORKDIR cp-p $HOMEDIR/${^INPUT_FILES}$WORKDIR cp-p $HOMEDIR/{acoustics_fit_parameters, acoustics_trigger_parameters, disable, hydrophone, mechanics, sound_velocity, tripod, waveform}.txt $WORKDIRfisource $JPP_DIR/examples/JAcoustics/acoustics-fit-toolkit.shtimer_startinitialise stage_1B > &stage log
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"` source JAcousticsToolkit.sh typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN
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  }
then cat $TRIPOD_INITIAL<< EOF1 256877.5 4743716.7-2438.42 256815.5 4743395.0-2435.53 257096.2 4743636.0-2439.5EOFfiJEditDetector-a $DETECTOR_INITIAL-s"-1 addz -6.9"-o $DETECTOReval`JPrintDetector-a $DETECTOR-O SUMMARY`for STRING in ${STRINGS[*]};do set_variable MODULE`getModule-a $DETECTOR-L"$STRING 0"`JEditDetector-a $DETECTOR-M"$MODULE setz -2.9"-o $DETECTORdonecp-p $TRIPOD_INITIAL $TRIPODJAcoustics.sh $DETECTOR_IDcat > acoustics_trigger_parameters txt<< EOFQ=0.0;TMax_s=0.020;numberOfHits=90;EOFJAcousticsEventBuilder.sh $DETECTOR $RUNS[*]INPUT_FILES=(`ls KM3NeT_ ${(l:8::0::0:) DETECTOR_ID}_0 *${^RUNS}_event.root`) cd $WORKDIRif[!$HOMEDIR-ef $WORKDIR];then cp-p $HOMEDIR/$DETECTOR $WORKDIR cp-p $HOMEDIR/$TRIPOD $WORKDIR cp-p $HOMEDIR/${^INPUT_FILES}$WORKDIR cp-p $HOMEDIR/{acoustics_fit_parameters, acoustics_trigger_parameters, disable, hydrophone, mechanics, sound_velocity, tripod, waveform}.txt $WORKDIRfisource $JPP_DIR/examples/JAcoustics/acoustics-fit-toolkit.shtimer_startinitialise stage_1B > &stage log
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  }
then cat $TRIPOD_INITIAL<< EOF1 256877.5 4743716.7-2438.42 256815.5 4743395.0-2435.53 257096.2 4743636.0-2439.5EOFfiJEditDetector-a $DETECTOR_INITIAL-s"-1 addz -6.9"-o $DETECTOReval`JPrintDetector-a $DETECTOR-O SUMMARY`for STRING in ${STRINGS[*]};do set_variable MODULE`getModule-a $DETECTOR-L"$STRING 0"`JEditDetector-a $DETECTOR-M"$MODULE setz -2.9"-o $DETECTORdonecp-p $TRIPOD_INITIAL $TRIPODJAcoustics.sh $DETECTOR_IDcat > acoustics_trigger_parameters txt<< EOFQ=0.0;TMax_s=0.020;numberOfHits=90;EOFJAcousticsEventBuilder.sh $DETECTOR $RUNS[*]INPUT_FILES=(`ls KM3NeT_ ${(l:8::0::0:) DETECTOR_ID}_0 *${^RUNS}_event.root`) cd $WORKDIRif[!$HOMEDIR-ef $WORKDIR];then cp-p $HOMEDIR/$DETECTOR $WORKDIR cp-p $HOMEDIR/$TRIPOD $WORKDIR cp-p $HOMEDIR/${^INPUT_FILES}$WORKDIR cp-p $HOMEDIR/{acoustics_fit_parameters, acoustics_trigger_parameters, disable, hydrophone, mechanics, sound_velocity, tripod, waveform}.txt $WORKDIRfisource $JPP_DIR/examples/JAcoustics/acoustics-fit-toolkit.shtimer_startinitialise stage_1B > &stage log
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
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
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"` source JAcousticsToolkit.sh typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN
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  }
then cat $TRIPOD_INITIAL<< EOF1 256877.5 4743716.7-2438.42 256815.5 4743395.0-2435.53 257096.2 4743636.0-2439.5EOFfiJEditDetector-a $DETECTOR_INITIAL-s"-1 addz -6.9"-o $DETECTOReval`JPrintDetector-a $DETECTOR-O SUMMARY`for STRING in ${STRINGS[*]};do set_variable MODULE`getModule-a $DETECTOR-L"$STRING 0"`JEditDetector-a $DETECTOR-M"$MODULE setz -2.9"-o $DETECTORdonecp-p $TRIPOD_INITIAL $TRIPODJAcoustics.sh $DETECTOR_IDcat > acoustics_trigger_parameters txt<< EOFQ=0.0;TMax_s=0.020;numberOfHits=90;EOFJAcousticsEventBuilder.sh $DETECTOR $RUNS[*]INPUT_FILES=(`ls KM3NeT_ ${(l:8::0::0:) DETECTOR_ID}_0 *${^RUNS}_event.root`) cd $WORKDIRif[!$HOMEDIR-ef $WORKDIR];then cp-p $HOMEDIR/$DETECTOR $WORKDIR cp-p $HOMEDIR/$TRIPOD $WORKDIR cp-p $HOMEDIR/${^INPUT_FILES}$WORKDIR cp-p $HOMEDIR/{acoustics_fit_parameters, acoustics_trigger_parameters, disable, hydrophone, mechanics, sound_velocity, tripod, waveform}.txt $WORKDIRfisource $JPP_DIR/examples/JAcoustics/acoustics-fit-toolkit.shtimer_startinitialise stage_1B > &stage log
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  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_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
set_variable E_E log10(E_{fit}/E_{#mu})"
double weight_kshort(const double ekin)
Definition: pythia.hh:108
double weight_neutron(const double ekin)
Definition: pythia.hh:149
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  }
then usage E
Definition: JMuonPostfit.sh:35
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:75
double opa_efrac(const int ipart, const double ekin)
Definition: pythia.hh:173

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.