30{
32
36
37 try {
38
39 JParser<> zap(
"Example program to histogram shower energy.");
40
44
45 zap(argc, argv);
46 }
47 catch(const exception &error) {
48 FATAL(error.what() << endl);
49 }
50
51
53
54
56
57 TH2* h0 = new TH2D("total", NULL, 24, 2.0, 10.0, 50, 0.0, 10.0);
58
59 NOTICE(
"Setting up radiation tables... " << flush);
60
63
64 ntuple radiation;
65
66 const JRadiation hydrogen ( 1.0, 1.0, 40, 0.01, 0.1, 0.1);
67 const JRadiation oxygen ( 8.0, 16.0, 40, 0.01, 0.1, 0.1);
68 const JRadiation chlorine (17.0, 35.0, 40, 0.01, 0.1, 0.1);
69 const JRadiation sodium (11.0, 23.0, 40, 0.01, 0.1, 0.1);
70
75
76 radiation.push_back(tuple(
new JRadiationSource(11, Oxygen, DENSITY_SEA_WATER * JSeaWater::O(), EErad_t), (TH2D*) h0->Clone(
"[eerad O]" )));
77 radiation.push_back(tuple(
new JRadiationSource(12, Chlorine, DENSITY_SEA_WATER * JSeaWater::Cl(), EErad_t), (TH2D*) h0->Clone(
"[eerad Cl]")));
78 radiation.push_back(tuple(
new JRadiationSource(13, Hydrogen, DENSITY_SEA_WATER * JSeaWater::H(), EErad_t), (TH2D*) h0->Clone(
"[eerad H]" )));
79 radiation.push_back(tuple(
new JRadiationSource(14, Sodium, DENSITY_SEA_WATER * JSeaWater::Na(), EErad_t), (TH2D*) h0->Clone(
"[eerad Na]" )));
80
81 radiation.push_back(tuple(
new JRadiationSource(21, Oxygen, DENSITY_SEA_WATER * JSeaWater::O(), Brems_t), (TH2D*) h0->Clone(
"[Brems O]" )));
82 radiation.push_back(tuple(
new JRadiationSource(22, Chlorine, DENSITY_SEA_WATER * JSeaWater::Cl(), Brems_t), (TH2D*) h0->Clone(
"[Brems Cl]")));
83 radiation.push_back(tuple(
new JRadiationSource(23, Hydrogen, DENSITY_SEA_WATER * JSeaWater::H(), Brems_t), (TH2D*) h0->Clone(
"[Brems H]" )));
84 radiation.push_back(tuple(
new JRadiationSource(24, Sodium, DENSITY_SEA_WATER * JSeaWater::Na(), Brems_t), (TH2D*) h0->Clone(
"[Brems Na]" )));
85
86 radiation.push_back(tuple(
new JRadiationSource(31, Oxygen, DENSITY_SEA_WATER * JSeaWater::O(), GNrad_t), (TH2D*) h0->Clone(
"[gnrad O]" )));
87 radiation.push_back(tuple(
new JRadiationSource(32, Chlorine, DENSITY_SEA_WATER * JSeaWater::Cl(), GNrad_t), (TH2D*) h0->Clone(
"[gnrad Cl]")));
88 radiation.push_back(tuple(
new JRadiationSource(33, Hydrogen, DENSITY_SEA_WATER * JSeaWater::H(), GNrad_t), (TH2D*) h0->Clone(
"[gnrad H]" )));
89 radiation.push_back(tuple(
new JRadiationSource(34, Sodium, DENSITY_SEA_WATER * JSeaWater::Na(), GNrad_t), (TH2D*) h0->Clone(
"[gnrad Na]" )));
90
92
93 for (int i = 1; i <= h0->GetXaxis()->GetNbins(); ++i) {
94
95 const double x = h0->GetXaxis()->GetBinCenter(i);
96 const double E =
pow(10.0, x);
97
99
100 for (ntuple::iterator p = radiation.begin(); p != radiation.end(); ++p) {
101
103
104 const double Es = p->first->getEnergyOfShower(E);
105
107 }
108 }
110 }
111
112 delete h0;
113
114 out.Write();
115 out.Close();
116}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
The template JSharedPointer class can be used to share a pointer to an object.
Utility class to parse command line options.
Fast implementation of class JRadiation.
Implementation for calculation of inverse interaction length and shower energy.
Auxiliary class for the calculation of the muon radiative cross sections.
T pow(const T &x, const double y)
Power .
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.