Jpp
18.2.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
software
JGizmo
JPrintChain.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
6
#include "TError.h"
7
#include "TROOT.h"
8
#include "TFile.h"
9
10
#include "
km3net-dataformat/offline/Head.hh
"
11
#include "
km3net-dataformat/offline/Evt.hh
"
12
13
#include "
JDAQ/JDAQEventIO.hh
"
14
#include "
JDAQ/JDAQTimesliceIO.hh
"
15
#include "
JDAQ/JDAQSummarysliceIO.hh
"
16
17
#include "
JTrigger/JTriggerParameters.hh
"
18
19
#include "
antares-dataformat/TimeSlice.hh
"
20
#include "
antares-dataformat/PhysicsEvent.hh
"
21
22
#include "
JROOT/JTreeParameters.hh
"
23
#include "
JROOT/JChainReader.hh
"
24
#include "
JSupport/JSupport.hh
"
25
26
#include "
JLang/JBool.hh
"
27
#include "
JLang/JType.hh
"
28
29
#include "
Jeep/JParser.hh
"
30
#include "
Jeep/JMessage.hh
"
31
32
33
namespace
{
34
35
using namespace
JPP;
36
37
38
/**
39
* Auxiliary class to build list of valid TreeReader pointers.
40
*/
41
class
JChainList :
42
public
std::vector
<TChain*>
43
{
44
public
:
45
/**
46
* Constructor.
47
*
48
* \param typelist type list
49
*/
50
template
<
class
T>
51
JChainList(
JType<T>
typelist)
52
{
53
for_each
(*
this
, typelist);
54
}
55
56
57
/**
58
* Addition of class.
59
*
60
* \param type type
61
*/
62
template
<
class
T>
63
void
operator()(
JType<T>
type)
64
{
65
add(type,
JBool
<
JTreeParametersAvailable<T>::result
>());
66
}
67
68
private
:
69
/**
70
* Addition of TChain compatible class.
71
*/
72
template
<
class
T>
73
void
add(
JType<T>
,
JBool<true>
)
74
{
75
this->push_back(
new
JChainReader<T>
(
getTreeParameters
(
JType<T>
())));
76
}
77
78
79
/**
80
* No addition of TChain incompatible class.
81
*/
82
template
<
class
T>
83
void
add(
JType<T>
,
JBool<false>
)
84
{}
85
};
86
}
87
88
89
/**
90
* \file
91
*
92
* Auxiliary program to print ROOT TChain information.
93
* \author mdejong
94
*/
95
int
main
(
int
argc,
char
**argv)
96
{
97
using namespace
std;
98
using namespace
JPP;
99
100
typedef
JAppend<JAllTypes_t, JAntaresTypes_t>::typelist
typelist;
101
102
vector<string>
inputFile;
103
int
debug
;
104
105
try
{
106
107
JParser<>
zap(
"Auxiliary program to print ROOT TChain information."
);
108
109
zap[
'f'
] =
make_field
(inputFile);
110
zap[
'd'
] =
make_field
(
debug
) = 1;
111
112
zap(argc, argv);
113
}
114
catch
(
const
exception &error) {
115
FATAL
(error.what() << endl);
116
}
117
118
119
JType<typelist>
type;
120
121
JChainList inspector(type);
122
123
for
(JChainList::iterator
i
= inspector.begin();
i
!= inspector.end(); ++
i
) {
124
for
(
vector<string>::const_iterator
file
= inputFile.begin();
file
!= inputFile.end(); ++
file
) {
125
(*i)->Add(
file
->c_str());
126
}
127
}
128
129
DEBUG
(
"Number of files "
<< inputFile.size() << endl);
130
131
gErrorIgnoreLevel = kFatal;
132
133
for
(JChainList::iterator
i
= inspector.begin();
i
!= inspector.end(); ++
i
) {
134
cout << setw(24) << left << (*i)->GetName() <<
' '
135
<< setw(10) << right << (*i)->GetEntries() << endl;
136
}
137
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1514
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JSupport.hh
ROOT TTree parameter settings of various packages.
file
then usage $script[< detector identifier >< run range >]< QA/QCfile > nExample script to produce data quality plots nWhen a detector identifier and run range are data are downloaded from the database nand subsequently stored in the given QA QC file
Definition:
JDataQuality.sh:19
JROOT::JTreeParametersAvailable
Test availability of TTree parameters for given class.
Definition:
JTreeParameters.hh:196
JLANG::JType
Auxiliary class for a type holder.
Definition:
JType.hh:19
std::vector
Definition:
JSTDTypes.hh:12
JROOT::JChainReader
Auxiliary class for template TChain reading.
Definition:
JChainReader.hh:24
JLANG::JTypeList
Type list.
Definition:
JTypeList.hh:22
i
then rm i
Definition:
JEvtReweightMupageParameterScan.sh:309
JLANG::JBool
Auxiliary template class for type bool.
Definition:
JBool.hh:20
JChainReader.hh
TChain reading for template data type.
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1989
TimeSlice.hh
JDAQSummarysliceIO.hh
JBool.hh
PhysicsEvent.hh
JMessage.hh
General purpose messaging.
JLANG::for_each
JObject_t & for_each(JObject_t &object, JType< JTypeList< JHead_t, JTail_t > > typelist)
For each data type method.
Definition:
JTypeList.hh:415
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JTreeParameters.hh
getTreeParameters
JROOT::JTreeParameters getTreeParameters(JLANG::JType< JRECONSTRUCTION::JEvt >)
Get TTree parameters for given data type.
Definition:
JReconstruction/JEvt.hh:486
JType.hh
Evt.hh
JParser.hh
Utility class to parse command line options.
JDAQEventIO.hh
Head.hh
JDAQTimesliceIO.hh
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
JTriggerParameters.hh
DEBUG
#define DEBUG(A)
Message macros.
Definition:
JMessage.hh:62
Generated by
1.8.5