CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
Utilities/NTupleHelper/NTupleHelper-00-00-01/NTupleHelper/NTupleHelper.h
Go to the documentation of this file.
1#ifndef NTUPLEHELPER_H
2#define NTUPLEHELPER_H
3
4using namespace std;
5
6#include <string>
7#include <map>
8#include "GaudiKernel/NTuple.h"
9
10
11// ***************************************************************
12//
13// CLASS NTupleHelper
14//
15// a utility to keep track of and fill trees
16//
17// ***************************************************************
18
19class NTupleHelper{
20
21 public:
22
23 // constructor takes a Tuple object created by BOSS
24
25 NTupleHelper(NTuple::Tuple* Tree);
26
27
28 // generic routine to fill a tree variable;
29 // if the variable doesn't yet exist, it is created
30
31 void fillDouble(string name, double value);
32 void fillLong (string name, long value);
33 void fillArray (string name, string index_name, double* value, int size);
34 void fillArrayLong(string name, string index_name, long* value, int size);
35 void fillArrayInt(string name, string index_name, int* value, int size);
36
37 // write the tree
38
39 void write();
40
41
42 private:
43
44 bool containsEntry(string name);
45
46 NTuple::Tuple* m_Tree;
47
48
49 map<string, NTuple::Item<double> > m_ntupleDoubleMap;
50 map<string, double> m_doubleMap;
51
52 map<string, NTuple::Item<long> > m_ntupleLongMap;
53 map<string, long> m_longMap;
54
55 map<string, NTuple::Array<double> > m_ntupleArrayMap;
56 map<string, double*> m_arrayMap;
57
58 map<string, NTuple::Array<long> > m_ntupleArrayLongMap;
59 map<string, long*> m_arrayLongMap;
60
61 map<string, NTuple::Array<int> > m_ntupleArrayIntMap;
62 map<string, int*> m_arrayIntMap;
63
64 bool m_bookingStage;
65
66 string concatName(string prefix, string base, int index);
67 string concatName(string prefix, string base);
68
69};
70
71#endif
void fillArrayLong(string name, string index_name, long *value, int size)
void fillLong(string name, long value)
void fillDouble(string name, double value)
void fillArrayInt(string name, string index_name, int *value, int size)
NTupleHelper(NTuple::Tuple *Tree)
void fillArray(string name, string index_name, double *value, int size)