Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JLight.cc File Reference

Auxiliary program histogram plot absorption and scattering lengths as well as dispersion. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "TROOT.h"
#include "TFile.h"
#include "TH1D.h"
#include "JPhysics/Antares.hh"
#include "JPhysics/KM3NeT.hh"
#include "JPhysics/JDispersion.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program histogram plot absorption and scattering lengths as well as dispersion.

Author
mdejong

Definition in file JLight.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 22 of file JLight.cc.

23 {
24  using namespace std;
25 
26  string outputFile;
27  bool debug;
28 
29  try {
30 
31  JParser<> zap("Auxiliary program histogram plot absorption and scattering lengths as well as dispersion.");
32 
33  zap['o'] = make_field(outputFile) = "light.root";
34  zap['d'] = make_field(debug);
35 
36  zap(argc, argv);
37  }
38  catch(const exception &error) {
39  FATAL(error.what() << endl);
40  }
41 
42 
43  using namespace JPP;
44 
45  TFile out(outputFile.c_str(), "recreate");
46 
47  TH1D h0("abs[Antares]", NULL, 400, 280.0, 680.0);
48  TH1D h1("abs[KM3NeT]", NULL, 400, 280.0, 680.0);
49  TH1D h2("scat[Antares]", NULL, 400, 280.0, 680.0);
50  TH1D h3("scat[KM3NeT]", NULL, 400, 280.0, 680.0);
51 
52  TH1D h4("vp[Antares]", NULL, 400, 280.0, 680.0);
53  TH1D h5("vp[KM3NeT]", NULL, 400, 280.0, 680.0);
54  TH1D h6("vg[Antares]", NULL, 400, 280.0, 680.0);
55  TH1D h7("vg[KM3NeT]", NULL, 400, 280.0, 680.0);
56 
57  TH1D h8("Ps[Antares]", NULL, 800, -1.0, +1.0);
58  TH1D h9("Ps[KM3NeT]", NULL, 800, -1.0, +1.0);
59  TH1D ha("f4", NULL, 800, -1.0, +1.0);
60  TH1D hb("p00075", NULL, 800, -1.0, +1.0);
61 
62  JDispersion antares(250.0); // P [bar]
63  JDispersion km3net (350.0); // P [bar]
64 
65  for (int i = 1; i <= h0.GetNbinsX(); ++i) {
66 
67  const double x = h0.GetBinCenter (i);
68 
69  h0.SetBinContent(i, ANTARES::getAbsorptionLength(x));
70  h1.SetBinContent(i, KM3NET ::getAbsorptionLength(x));
71  h2.SetBinContent(i, ANTARES::getScatteringLength(x));
72  h3.SetBinContent(i, KM3NET ::getScatteringLength(x));
73 
74  h4.SetBinContent(i, antares.getIndexOfRefractionPhase(x));
75  h5.SetBinContent(i, km3net .getIndexOfRefractionPhase(x));
76  h6.SetBinContent(i, antares.getIndexOfRefractionGroup(x));
77  h7.SetBinContent(i, km3net .getIndexOfRefractionGroup(x));
78  }
79 
80  for (int i = 1; i <= h8.GetNbinsX(); ++i) {
81 
82  const double x = h8.GetBinCenter (i);
83 
84  h8.SetBinContent(i, ANTARES::getScatteringProbability(x));
85  h9.SetBinContent(i, KM3NET ::getScatteringProbability(x));
86  ha.SetBinContent(i, KM3NET ::f4 (x));
87  hb.SetBinContent(i, KM3NET ::p00075(x));
88  }
89 
90  out.Write();
91  out.Close();
92 }
Utility class to parse command line options.
Definition: JParser.hh:1410
double getScatteringLength(const double lambda)
Scattering length.
Definition: KM3NeT.hh:97
double getScatteringProbability(const double x)
Function to describe light scattering in water.
Definition: KM3NeT.hh:212
double getAbsorptionLength(const double lambda)
Absorption length.
Definition: KM3NeT.hh:59
double getScatteringProbability(const double x)
Function to describe light scattering in water.
Definition: Antares.hh:292
string outputFile
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1836
double p00075(const double x)
Model specific function to describe light scattering in water (p00075)
Definition: KM3NeT.hh:197
int debug
debug level
Definition: JSirene.cc:59
#define FATAL(A)
Definition: JMessage.hh:65
double getAbsorptionLength(const double lambda)
Absoption length.
Definition: Antares.hh:53
double getScatteringLength(const double lambda)
Scattering length.
Definition: Antares.hh:138
double f4(const double x)
Model specific function to describe light scattering in water (f4)
Definition: KM3NeT.hh:181