Jpp
18.1.0
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
JDetector
JSlewing.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/JPMTAnalogueSignalProcessor.hh
"
12
#include "
JTrigger/JGetRiseTime.hh
"
13
14
#include "
Jeep/JParser.hh
"
15
#include "
Jeep/JMessage.hh
"
16
17
18
/**
19
* \file
20
*
21
* Example program to histogram time over threshold as a function of number of photo-electrons.
22
* \author mdejong
23
*/
24
int
main
(
int
argc,
char
**argv)
25
{
26
using namespace
std;
27
using namespace
JPP;
28
29
string
outputFile
;
30
JPMTParameters
parameters
;
31
int
debug
;
32
33
try
{
34
35
JProperties
properties =
parameters
.getProperties();
36
37
JParser<>
zap(
"Example program to histogram time over threshold as a function of number of photo-electrons."
);
38
39
zap[
'o'
] =
make_field
(
outputFile
) =
"histogram.root"
;
40
zap[
'P'
] =
make_field
(properties) =
JPARSER::initialised
();
41
zap[
'd'
] =
make_field
(
debug
) = 0;
42
43
zap(argc, argv);
44
}
45
catch
(
const
exception &error) {
46
FATAL
(error.what() << endl);
47
}
48
49
50
if
(
debug
>=
JEEP::debug_t
) {
51
cout <<
"PMT parameters:"
<< endl;
52
cout <<
parameters
.getProperties(
JEquationParameters
(
"="
,
"\n"
,
""
,
""
)) << endl;
53
}
54
55
JPMTAnalogueSignalProcessor cpu(
parameters
);
56
57
TFile out(
outputFile
.c_str(),
"recreate"
);
58
59
TH1D h0(
"[model]"
, NULL, 510, 0.0, 255.0);
60
TH1D h1(
"[parametrisation]"
, NULL, 510, 0.0, 255.0);
61
62
for
(
int
i
= 1;
i
<= h0.GetNbinsX(); ++
i
) {
63
64
try
{
65
66
const
double
x
= h0.GetBinCenter(
i
);
67
const
double
npe = cpu.getNPE(x);
68
const
double
y
= cpu.getRiseTime(npe);
69
70
h0.SetBinContent(
i
, y);
71
h1.SetBinContent(
i
,
getRiseTime
(x));
72
}
73
catch
(
const
JValueOutOfRange& error) {}
74
}
75
76
out.Write();
77
out.Close();
78
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1514
i
then rm i
Definition:
JEvtReweightGSeaGenParameterScan.sh:337
JEEP::debug_t
debug
Definition:
JMessage.hh:29
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JEEP::JProperties
Utility class to parse parameter values.
Definition:
JProperties.hh:496
parameters
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition:
diff-Tuna.sh:38
JLANG::JEquationParameters
Simple data structure to support I/O of equations (see class JLANG::JEquation).
Definition:
JEquationParameters.hh:20
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
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
JTRIGGER::getRiseTime
static const JGetRiseTime getRiseTime
Function object for rise time evaluation.
Definition:
JGetRiseTime.hh:313
makedeclinationtable.y
tuple y
Definition:
makedeclinationtable.py:51
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JGetRiseTime.hh
Rise time evaluation.
JParser.hh
Utility class to parse command line options.
JPMTAnalogueSignalProcessor.hh
PMT analogue signal processor.
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
Generated by
1.8.5