Jpp
17.3.0-rc.1
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
JDB
JDB/JToAshortMonitor.cc
Go to the documentation of this file.
1
#include <iostream>
2
#include <iomanip>
3
4
#include "TROOT.h"
5
#include "TFile.h"
6
#include "TGraph.h"
7
#include "TH1D.h"
8
9
#include "
JDB/JToAshort.hh
"
10
#include "
JDB/JSupport.hh
"
11
12
#include "
JROOT/JGraph.hh
"
13
#include "
JROOT/JManager.hh
"
14
15
#include "
JSupport/JMultipleFileScanner.hh
"
16
17
#include "
Jeep/JParser.hh
"
18
#include "
Jeep/JMessage.hh
"
19
20
21
/**
22
* \file
23
*
24
* Example program to monitor "toashort" data.
25
*/
26
int
main
(
int
argc,
char
**argv)
27
{
28
using namespace
std;
29
using namespace
JPP;
30
31
JMultipleFileScanner<JToAshort>
inputFile;
32
JLimit_t
& numberOfEvents = inputFile.
getLimit
();
33
string
outputFile
;
34
int
debug
;
35
36
try
{
37
38
JParser<>
zap(
"Example program to monitor \"toashort\" data."
);
39
40
zap[
'f'
] =
make_field
(inputFile,
"output of JConvertDB -q toashort"
);
41
zap[
'n'
] =
make_field
(numberOfEvents) = JLimit::max();
42
zap[
'o'
] =
make_field
(
outputFile
) =
"toashort.root"
;
43
zap[
'd'
] =
make_field
(
debug
) = 1;
44
45
zap(argc, argv);
46
}
47
catch
(
const
exception &error) {
48
FATAL
(error.what() << endl);
49
}
50
51
52
map <int, JGraph_t>
G1
;
53
JManager<int, TH1D>
H1(
new
TH1D(
"H[%].quality"
, NULL, 100, 0.0, 8.0));
54
55
while
(inputFile.hasNext()) {
56
57
if
(inputFile.getCounter()%1000 == 0) {
58
STATUS
(
"counter: "
<< setw(8) << inputFile.getCounter() <<
'\r'
<< flush);
DEBUG
(endl);
59
}
60
61
const
JToAshort
* toashort = inputFile.next();
62
63
G1
[toashort->
EMITTERID
].put(toashort->
UNIXTIMEBASE
+ toashort->
TOA_S
,
log10
(toashort->
QUALITYFACTOR
));
64
H1[toashort->
EMITTERID
]->Fill(
log10
(toashort->
QUALITYFACTOR
));
65
}
66
STATUS
(endl);
67
68
TFile out(
outputFile
.c_str(),
"recreate"
);
69
70
for
(
map<int, JGraph_t>::const_iterator
i =
G1
.begin(); i !=
G1
.end(); ++i) {
71
out <<
JGraph
(i->second,
MAKE_CSTRING
(
"G["
<< i->first <<
"].toa"
));
72
}
73
74
out << H1;
75
76
out.
Write
();
77
out.Close();
78
}
JDATABASE::JToAshort::UNIXTIMEBASE
double UNIXTIMEBASE
[s]
Definition:
JToAshort.hh:25
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1517
JDATABASE::JToAshort::QUALITYFACTOR
int QUALITYFACTOR
Definition:
JToAshort.hh:29
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JToAshort.hh
std::map
Definition:
JSTDTypes.hh:16
STATUS
#define STATUS(A)
Definition:
JMessage.hh:63
MAKE_CSTRING
#define MAKE_CSTRING(A)
Make C-string.
Definition:
JPrint.hh:136
JManager.hh
Dynamic ROOT object management.
JROOT::JGraph
Auxiliary data structure to build TGraph.
Definition:
JGraph.hh:42
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
JSUPPORT::JLimit
Auxiliary class for defining the range of iterations of objects.
Definition:
JLimit.hh:41
JROOT::JManager
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
Definition:
JManager.hh:43
G1
Double_t G1(const Double_t x)
Integral of method g1.
Definition:
JQuantiles.cc:37
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1993
log10
set_variable E_E log10(E_{fit}/E_{#mu})"
JROOT::JManager::Write
void Write(TDirectory &out, const bool wm=false)
Write objects to file.
Definition:
JManager.hh:295
JSupport.hh
ROOT TTree parameter settings.
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JMultipleFileScanner.hh
Scanning of objects from multiple files according a format that follows from the extension of each fi...
JSUPPORT::JMultipleFileScanner
General purpose class for object reading from a list of file names.
Definition:
JMultipleFileScanner.hh:199
JParser.hh
Utility class to parse command line options.
JDATABASE::JToAshort::TOA_S
double TOA_S
[s]
Definition:
JToAshort.hh:28
JDATABASE::JToAshort
Definition:
JToAshort.hh:17
JSUPPORT::JLimit::getLimit
const JLimit & getLimit() const
Get limit.
Definition:
JLimit.hh:73
JGraph.hh
JDATABASE::JToAshort::EMITTERID
int EMITTERID
waveform identifier
Definition:
JToAshort.hh:27
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
DEBUG
#define DEBUG(A)
Message macros.
Definition:
JMessage.hh:62
Generated by
1.8.5