Jpp
17.3.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
JDetector
JTransitTime2D.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
6
#include "TROOT.h"
7
#include "TFile.h"
8
#include "TH1D.h"
9
10
#include "
JDetector/JPMTTransitTimeProbability.hh
"
11
12
#include "
Jeep/JParser.hh
"
13
#include "
Jeep/JMessage.hh
"
14
15
16
/**
17
* \file
18
*
19
* Example program to histogram PMT 2D transit-time distribution.
20
* \author mdejong
21
*/
22
int
main
(
int
argc,
char
**argv)
23
{
24
using namespace
std;
25
using namespace
JPP;
26
27
string
outputFile
;
28
int
debug
;
29
30
try
{
31
32
JParser<>
zap(
"Example program to histogram PMT 2D transit-time distribution."
);
33
34
zap[
'o'
] =
make_field
(
outputFile
) =
"histogram.root"
;
35
zap[
'd'
] =
make_field
(
debug
) = 0;
36
37
zap(argc, argv);
38
}
39
catch
(
const
exception &error) {
40
FATAL
(error.what() << endl);
41
}
42
43
44
TFile out(
outputFile
.c_str(),
"recreate"
);
45
46
TH1D h2(
"tt2"
, NULL, 100, -20.0, +20.0);
47
48
for
(
int
i = 1; i <= h2.GetNbinsX(); ++i) {
49
50
const
double
t1 = h2.GetBinCenter(i);
51
52
h2.SetBinContent(i,
getTransitionTimeProbability2D
(t1));
53
}
54
55
out.Write();
56
out.Close();
57
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1517
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
JPMTTransitTimeProbability.hh
JDETECTOR::getTransitionTimeProbability2D
static const JTransitionTimeProbability2D getTransitionTimeProbability2D
Function object of twofold transition time prabability.
Definition:
JPMTTransitTimeProbability.hh:2659
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1993
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
Generated by
1.8.5