Jpp
18.5.2
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JCalibrate
JPlotK40.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
#include <cmath>
6
7
#include "TROOT.h"
8
#include "TFile.h"
9
#include "TH1D.h"
10
11
#include "
JDetector/JModule.hh
"
12
#include "
JDetector/JDetectorToolkit.hh
"
13
#include "
JDetector/JDetectorSupportkit.hh
"
14
15
#include "
JCalibrate/JCalibrateK40.hh
"
16
#include "
JCalibrate/JFitK40.hh
"
17
18
#include "
Jeep/JProperties.hh
"
19
#include "
Jeep/JPrint.hh
"
20
#include "
Jeep/JParser.hh
"
21
#include "
Jeep/JMessage.hh
"
22
23
24
/**
25
* \file
26
*
27
* Auxiliary plot fit function of JFitK40.cc.
28
* \author mdejong
29
*/
30
int
main
(
int
argc,
char
**argv)
31
{
32
using namespace
std;
33
using namespace
JPP;
34
35
JK40Parameters K40 =
JK40Parameters::getInstance
();
36
37
string
outputFile
;
38
int
debug
;
39
40
try
{
41
42
JProperties
properties;
43
44
properties.insert(
gmake_property
(K40.R));
45
properties.insert(
gmake_property
(K40.p1));
46
properties.insert(
gmake_property
(K40.p2));
47
properties.insert(
gmake_property
(K40.p3));
48
properties.insert(
gmake_property
(K40.p4));
49
50
JParser<>
zap(
"Auxiliary plot fit function of JFitK40.cc."
);
51
52
zap[
'@'
] =
make_field
(properties) =
JPARSER::initialised
();
53
zap[
'o'
] =
make_field
(
outputFile
,
"output file."
) =
"k40.root"
;
54
zap[
'd'
] =
make_field
(
debug
,
"debug."
) = 1;
55
56
zap(argc, argv);
57
}
58
catch
(
const
exception &error) {
59
FATAL
(error.what() << endl);
60
}
61
62
63
const
JModule module = getModule<JKM3NeT_t>(1001);
64
65
const
JModel
model
(module, K40);
66
67
const
int
nx = model.getNumberOfPairs();
68
const
double
xmin
= -0.5;
69
const
double
xmax
= nx - 0.5;
70
71
72
TFile out(
outputFile
.c_str(),
"recreate"
);
73
74
TH1D h1(
"h1"
, NULL, nx,
xmin
,
xmax
);
75
76
for
(
int
ix = 1; ix <= h1.GetXaxis()->GetNbins(); ++ix) {
77
78
const
Double_t
x
= h1.GetXaxis()->GetBinCenter(ix);
79
80
const
pair_type
pair
= model.getPair((
int
) x);
81
const
double
rate
= model.getValue(pair);
82
83
h1.SetBinContent(ix, rate);
84
}
85
86
out.Write();
87
out.Close();
88
}
GAUSS_LEGENDRE::xmax
const double xmax
Definition:
JQuadrature.cc:24
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1514
JCALIBRATE::pair_type
JCombinatorics::pair_type pair_type
Definition:
JCalibrateK40.hh:41
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
std::pair
Definition:
JSTDTypes.hh:15
JFitK40.hh
gmake_property
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Definition:
JProperties.hh:1293
rate
then set_variable singlesRate set_variable doublesRate set_variable numberOfSlices echo Generating random background echo Singles rate
Definition:
software/JDataWriter/JDataWriter.sh:95
JEEP::JProperties
Utility class to parse parameter values.
Definition:
JProperties.hh:497
JPARSER::initialised
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition:
JParser.hh:83
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
JProperties.hh
Utility class to parse parameter values.
JPrint.hh
I/O formatting auxiliaries.
JDetectorSupportkit.hh
Detector support kit.
JLANG::getInstance
T & getInstance(const T &object)
Get static instance from temporary object.
Definition:
JObject.hh:75
makedeclinationtable.x
tuple x
Definition:
makedeclinationtable.py:44
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1989
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
GAUSS_LEGENDRE::xmin
const double xmin
Definition:
JQuadrature.cc:23
JParser.hh
Utility class to parse command line options.
makedeclinationtable.model
string model
Definition:
makedeclinationtable.py:39
JDetectorToolkit.hh
JCalibrateK40.hh
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
JModule.hh
Data structure for optical module.
Generated by
1.8.5