ATLAS Offline Software
Loading...
Searching...
No Matches
Formula.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#ifndef MULTI_DRAW_FORMULA_H
8#define MULTI_DRAW_FORMULA_H
9
11
12
13
14//protect
15#include <MultiDraw/Global.h>
16
17#include <string>
18#include <Rtypes.h>
19
20class TTree;
21class TTreeFormula;
22class TTreeFormulaManager;
23
24namespace MD
25{
26 class Formula
27 {
28 //
29 // public interface
30 //
31
34 public:
35 void testInvariant () const;
36
37
40 public:
41 Formula ();
42
43
47 public:
48 Formula (const std::string& name, const std::string& formula, TTree *tree);
49
50
53 public:
54 ~Formula ();
55
56
62 public:
63 void reset (TTree *tree);
64
65
68 public:
69 const std::string& formula () const;
70
71
74 public:
75 bool valid () const;
76
77
82 public:
83 int ndim () const;
84
85
91 public:
92 std::size_t ndata () const;
93
94
101 public:
102 Double_t value (std::size_t data) const;
103
104
105
106 //
107 // private interface
108 //
109
111 private:
112 std::string m_formula;
113
115 private:
116 std::string m_name;
117
119 private:
120 TTree *m_tree;
121
123 private:
124 TTreeFormula *m_form;
125
127 private:
128 TTreeFormulaManager *m_manager;
129
132 private:
134
136 private:
137 mutable Long64_t m_entry;
138
140 private:
141 mutable Int_t m_ndata;
142
144 private:
145 mutable std::vector<Double_t> m_cache;
146
148 private:
149 mutable std::vector<bool> m_read;
150
151
153 private:
154 Formula (const Formula& that);
156 };
157}
158
159#endif
const std::string & formula() const
description: the formula used guarantee: no-fail
Definition Formula.cxx:134
int ndim() const
returns: the number of unspecified array dimensions for the given formula guarantee: no-fail requires...
Definition Formula.cxx:152
Long64_t m_entry
description: the last entry we read
Definition Formula.h:137
void testInvariant() const
effects: test the invariant of this object guarantee: no-fail
Definition Formula.cxx:31
TTreeFormulaManager * m_manager
description: the manager used
Definition Formula.h:128
TTreeFormula * m_form
description the formula used
Definition Formula.h:124
std::string m_name
description: the name we use for the formula
Definition Formula.h:116
TTree * m_tree
description: the tree we are connected to
Definition Formula.h:120
~Formula()
effects: standard destructor guarantee: no-fail
Definition Formula.cxx:86
Formula(const Formula &that)
rationale: to avoid broken objects
int m_ndim
description: the number of array dimensions we need to loop over, or -1 if we are in error
Definition Formula.h:133
std::vector< Double_t > m_cache
description: the cache of data entries
Definition Formula.h:145
bool valid() const
returns: whether the formula is valid guarantee: no-fail
Definition Formula.cxx:143
std::size_t ndata() const
returns: the number of data entries for the formula with the given index guarantee: strong failures: ...
Definition Formula.cxx:162
Double_t value(std::size_t data) const
returns: the result of evaluating the formula with the given index for the given data entry guarantee...
Definition Formula.cxx:195
std::string m_formula
description: members directly corresponding to accessors
Definition Formula.h:112
Formula()
effects: standard default constructor guarantee: no-fail
Definition Formula.cxx:63
Formula & operator=(const Formula &that)
void reset(TTree *tree)
effects: reset this formula to a new tree guarantee: strong failures: out of memory II failures: TTre...
Definition Formula.cxx:97
Int_t m_ndata
description: the number of data entries
Definition Formula.h:141
std::vector< bool > m_read
description: whether we read the given data entry
Definition Formula.h:149
This module provides a lot of global definitions, forward declarations and includes that are used by ...
Definition AlgCFlow.h:22
TChain * tree