32{
33
34
35
36
37 const std::string FormulaSvc::name = "MultiDraw";
38
39
40
41 std::string
dbg (
const FormulaSvc& ,
unsigned )
42 {
43 return "FormulaSvc";
44 }
45
46
47
49 {
50 if (!
job.algsHas (FormulaSvc::name))
51 job.algsAdd (
new FormulaSvc);
52 }
53
54
55
57 {
59
61 =
dynamic_cast<FormulaSvc*
>(worker->
getAlg (FormulaSvc::name));
62 if (svc == 0)
65 }
66
67
68
69 void FormulaSvc ::
70 testInvariant () const
71 {
73
74 for (std::size_t form = 0, end =
m_vars.size(); form != end; ++ form)
75 {
77 }
78 }
79
80
81
82 FormulaSvc ::
83 FormulaSvc ()
85 {
87 }
88
89
90
91 FormulaSvc ::
92 ~FormulaSvc ()
93 {
95
96 for (std::size_t form = 0, end =
m_vars.size(); form != end; ++ form)
97 {
99 }
100 }
101
102
103
104 const Formula *FormulaSvc ::
105 addForm (const std::string& formula)
106 {
109
110 for (std::size_t form = 0, end =
m_vars.size(); form != end; ++ form)
111 {
112 if (m_vars[form]->formula() == formula)
114 }
116 std::ostringstream
name;
118 m_vars.push_back (
new Formula (
name.str(), formula, m_tree));
120 }
121
122
123
124 const char *FormulaSvc ::
125 GetName () const
126 {
129 }
130
131
132
134 changeInput (bool )
135 {
137
139
140 try
141 {
143 m_tree->ResetBit (TTree::kForceRead);
144
145 for (std::size_t form = 0, end =
m_vars.size(); form != end; ++ form)
146 m_vars[form]->reset (m_tree);
147 } catch (...)
148 {
150 throw;
151 }
152
153 return EL::StatusCode::SUCCESS;
154 }
155
156
157
159 execute ()
160 {
162 if (wk()->treeEntry() != wk()->
tree()->GetReadEvent())
163 wk()->tree()->LoadTree (wk()->treeEntry());
165 return EL::StatusCode::SUCCESS;
166 }
167}
#define RCU_DESTROY_INVARIANT(x)
#define RCU_CHANGE_INVARIANT(x)
#define RCU_NEW_INVARIANT(x)
#define RCU_REQUIRE_SOFT(x)
#define RCU_READ_INVARIANT(x)
#define RCU_THROW_MSG(message)
the interface for algorithms to access IWorker
virtual EL::Algorithm * getAlg(const std::string &name) const =0
effects: returns the algorithms with the given name or NULL if there is none guarantee: strong failur...
ID3PD * m_tree
Pointer to the ID3PD object used.
Vars m_vars
All booked variables.
::StatusCode StatusCode
StatusCode definition for legacy code.
AthROOTErrorHandlerSvc * svc
FormulaSvc * formulas(EL::IWorker *worker)
returns: the formula service for this worker guarantee: strong failures: formula service not configur...
void useFormulas(EL::Job &job)
effects: register the formula service for this job guarantee: strong failures: out of memory I