45 <<
"Written by Martijn Jongen" <<
endl
47 cout <<
"Type '" <<
argv[0] <<
" -h!' to display the command-line options." <<
endl ;
70 zap[
"-lH"] =
make_field(
lHG,
"scattering length in m for Henyey-Greenstein scattering") ;
71 zap[
"g"] =
make_field(g,
"parameter g for Henyey-Greenstein function") ;
72 zap[
"R"] =
make_field(
lR,
"scattering length in m for Rayleigh scattering") ;
73 zap[
"a"] =
make_field(a,
"parameter a for Rayleigh scattering") ;
75 zap[
"d"] =
make_field(d,
"distance between source and target in m") ;
78 zap[
"i"] =
make_field(interval,
"number of MCMC steps to take between saving paths") ;
81 zap[
"sourceNB"] =
make_field(
sourceNB,
"Use a nanobeacon profile as source (currently a uniform distribution in a 45 degree cone around the positive z-direction") ;
88 catch(
const exception &error) {
94 cout <<
"absorption length = " <<
lA <<
" m" <<
endl ;
95 cout <<
"distance to target = " << d <<
" m" <<
endl ;
98 cout <<
"interval = " << interval <<
" steps" <<
endl ;
105 cout <<
"Henyey-Greenstein scattering length = " <<
lHG <<
" m" <<
endl ;
107 smHG.setScatteringLength(
lHG) ;
108 smHG.setScatteringProfileHG(g) ;
113 cout <<
"Rayleigh scattering length = " <<
lR <<
" m" <<
endl ;
115 smR.setScatteringLength(
lR) ;
116 smR.setScatteringProfileRayleigh(a) ;
120 cout <<
"Combining HG and Rayleigh scattering into a single effective model." <<
endl ;
123 cout <<
"Effective scattering length = " <<
sm.getScatteringLength() <<
" m" <<
endl ;
124 sm.setAbsorptionLength(
lA) ;
126 cout <<
"Integral over scattering profile = " <<
sm.hscat->Integral(
"width")*2*
M_PI <<
" (should be 1)" <<
endl ;
131 cout <<
"Setting source distribution to a preliminary approximation of a nanobeacon profile. Light is emitted uniformly within a cone around the positive z-axis." <<
endl ;
136 double xmin =
sm.hsource->GetXaxis()->GetBinLowEdge(
bin) ;
137 double xmax =
sm.hsource->GetXaxis()->GetBinUpEdge(
bin) ;
138 for(
int i=0 ; i<
n ; ++i ) {
139 double ct = xmin + (xmax-xmin)*(i+0.5)/
n ;
140 if( ct >= sqrt(0.5) )
val += 1 ;
145 sm.hsource->SetBinContent(
bin,
val) ;
148 sm.hsource->Scale( sqrt(2)/(2*
M_PI*(sqrt(2)-1)) ) ;
152 cout <<
"Integral over source profile = " <<
sm.hsource->Integral(
"width") <<
" (should be 1)" <<
endl ;
157 cout <<
"Setting target to a KM3NeT PMT." <<
endl
158 <<
"Its orientation is rotated " <<
target_zenith <<
" degrees w.r.t. the negative z-axis" <<
endl
159 <<
"(the rotation is in the yz-plane)" <<
endl ;
163 double ct =
sm.htarget->GetXaxis()->GetBinCenter(
xbin) ;
164 double theta =
acos(ct) ;
167 double phi =
sm.htarget->GetYaxis()->GetBinCenter(
ybin) ;
173 double val = KM3NET::getAngularAcceptance(
effct) ;
176 if(
val == 0 )
val = 1e-10 ;
177 sm.htarget->SetBinContent(
bin,
val) ;
180 double maxval =
sm.htarget->GetBinContent(
sm.htarget->GetMaximumBin() ) ;
192 fout->mkdir(
"ScatteringModel_ingredients")->cd() ;
193 sm.hsource->Write() ;
195 sm.htarget->Write() ;
202 cout <<
"Generating ensemble" <<
endl ;
205 cout <<
"Done generating ensemble." <<
endl ;
208 <<
"(as a rule of thumb, ~23% is optimal for high-dimensional spaces)" <<
endl
int main(int argc, char **argv)
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Properties of KM3NeT PMT and deep-sea water.
Data structure for normalised vector in three dimensions.
virtual void open(const char *file_name) override
Open file.
virtual void close()=0
Close device.
virtual bool put(const T &object)=0
Object output.
The JMarkovPathGenerator generates ensembles of photon paths using a Markov Chain Monte Carlo (MCMC).
Virtual base class for a scattering model.
Template definition of a multi-dimensional oscillation probability interpolation table.
JReader & read(JReader &in) override final
Read from input.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).