Jpp - 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
JDAQ
JPrintLargestOverlay.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
#include <limits>
6
#include <set>
7
8
#include "TROOT.h"
9
#include "TFile.h"
10
#include "TH1D.h"
11
12
#include "
JDAQ/JDAQEventIO.hh
"
13
14
#include "
JSupport/JMultipleFileScanner.hh
"
15
#include "
JSupport/JSupport.hh
"
16
17
#include "
Jeep/JParser.hh
"
18
#include "
Jeep/JMessage.hh
"
19
20
21
/**
22
* \file
23
*
24
* Example program to find the largest event in a file.
25
* \author lnauta
26
*/
27
int
main
(
int
argc,
char
**argv)
28
{
29
using namespace
std;
30
using namespace
JPP;
31
using namespace
KM3NETDAQ;
32
33
JMultipleFileScanner<JDAQEvent>
inputFile;
34
int
debug
;
35
36
try
{
37
38
JParser<>
zap(
"Example program to find largest event in data."
);
39
40
zap[
'f'
] =
make_field
(inputFile);
41
zap[
'd'
] =
make_field
(
debug
) = 1;
42
43
zap(argc, argv);
44
}
45
catch
(
const
exception& error) {
46
FATAL
(error.what() << endl);
47
}
48
49
50
cout.tie(&cerr);
51
52
int
overlay = 0;
53
int
treeIndex = 0;
54
55
while
(inputFile.hasNext()) {
56
57
STATUS
(
"event: "
<< setw(10) << inputFile.getCounter() <<
'\r'
);
DEBUG
(endl);
58
59
JDAQEvent
*
event
= inputFile.
next
();
60
61
int
currentOverlay =
event
->getOverlays();
62
63
if
(currentOverlay > overlay) {
64
overlay = currentOverlay;
65
treeIndex = inputFile.getCounter();
66
}
67
68
}
69
STATUS
(endl);
70
71
NOTICE
(
"Largest overlay is at tree index "
<< treeIndex <<
" with overlay of "
<< overlay);
72
NOTICE
(
"In JConvert use the tree index "
<< treeIndex-1 <<
" to fetch the proper event."
);
73
74
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1500
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JSupport.hh
ROOT TTree parameter settings of various packages.
STATUS
#define STATUS(A)
Definition:
JMessage.hh:63
KM3NETDAQ::JDAQEvent
DAQ Event.
Definition:
JDAQEvent.hh:30
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1961
NOTICE
#define NOTICE(A)
Definition:
JMessage.hh:64
debug
int debug
debug level
Definition:
JSirene.cc:63
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:167
JParser.hh
Utility class to parse command line options.
JDAQEventIO.hh
KM3NETDAQ::JDAQTriggerCounter::next
JTriggerCounter_t next()
Increment trigger counter.
Definition:
JDAQTriggerCounter.hh:121
DEBUG
#define DEBUG(A)
Message macros.
Definition:
JMessage.hh:62
Generated by
1.8.5