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
5#ifndef MULTI_DRAW_FORMULA_H
6#define MULTI_DRAW_FORMULA_H
7
8// - 2012.
9// Distributed under the Boost Software License, Version 1.0.
10// (See accompanying file LICENSE_1_0.txt or copy at
11// http://www.boost.org/LICENSE_1_0.txt)
12
13// Please feel free to contact me (krumnack@iastate.edu) for bug
14// reports, feature suggestions, praise and complaints.
15
16
20
21
22
23//protect
24#include <MultiDraw/Global.h>
25
26#include <string>
27#include <Rtypes.h>
28
29class TTree;
30class TTreeFormula;
31class TTreeFormulaManager;
32
33namespace MD
34{
35 class Formula
36 {
37 //
38 // public interface
39 //
40
43 public:
44 void testInvariant () const;
45
46
49 public:
50 Formula ();
51
52
56 public:
57 Formula (const std::string& name, const std::string& formula, TTree *tree);
58
59
62 public:
63 ~Formula ();
64
65
71 public:
72 void reset (TTree *tree);
73
74
77 public:
78 const std::string& formula () const;
79
80
83 public:
84 bool valid () const;
85
86
91 public:
92 int ndim () const;
93
94
100 public:
101 std::size_t ndata () const;
102
103
110 public:
111 Double_t value (std::size_t data) const;
112
113
114
115 //
116 // private interface
117 //
118
120 private:
121 std::string m_formula;
122
124 private:
125 std::string m_name;
126
128 private:
129 TTree *m_tree;
130
132 private:
133 TTreeFormula *m_form;
134
136 private:
137 TTreeFormulaManager *m_manager;
138
141 private:
143
145 private:
146 mutable Long64_t m_entry;
147
149 private:
150 mutable Int_t m_ndata;
151
153 private:
154 mutable std::vector<Double_t> m_cache;
155
157 private:
158 mutable std::vector<bool> m_read;
159
160
162 private:
163 Formula (const Formula& that);
165 };
166}
167
168#endif
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
const std::string & formula() const
description: the formula used guarantee: no-fail
Definition Formula.cxx:140
int ndim() const
returns: the number of unspecified array dimensions for the given formula guarantee: no-fail requires...
Definition Formula.cxx:158
Long64_t m_entry
description: the last entry we read
Definition Formula.h:146
void testInvariant() const
effects: test the invariant of this object guarantee: no-fail
Definition Formula.cxx:37
TTreeFormulaManager * m_manager
description: the manager used
Definition Formula.h:137
TTreeFormula * m_form
description the formula used
Definition Formula.h:133
std::string m_name
description: the name we use for the formula
Definition Formula.h:125
TTree * m_tree
description: the tree we are connected to
Definition Formula.h:129
~Formula()
effects: standard destructor guarantee: no-fail
Definition Formula.cxx:92
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:142
std::vector< Double_t > m_cache
description: the cache of data entries
Definition Formula.h:154
bool valid() const
returns: whether the formula is valid guarantee: no-fail
Definition Formula.cxx:149
std::size_t ndata() const
returns: the number of data entries for the formula with the given index guarantee: strong failures: ...
Definition Formula.cxx:168
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:201
std::string m_formula
description: members directly corresponding to accessors
Definition Formula.h:121
Formula()
effects: standard default constructor guarantee: no-fail
Definition Formula.cxx:69
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:103
Int_t m_ndata
description: the number of data entries
Definition Formula.h:150
std::vector< bool > m_read
description: whether we read the given data entry
Definition Formula.h:158
This module provides a lot of global definitions, forward declarations and includes that are used by ...
Definition AlgCFlow.h:31
TChain * tree