|
ATLAS Offline Software
|
Go to the documentation of this file.
16 #include "GaudiKernel/System.h"
19 #include "TDataType.h"
20 #include "TVirtualCollectionProxy.h"
44 for (
Var&
v : *
this) {
57 const std::string&
name,
69 "List of contained block filler tools.");
71 "Variable name prefix for the contained blocks.");
73 "Name of the variable for the count of rows. "
76 "Name of the variable for the count of objects. "
79 "Name of the variable for the object index. "
92 return StatusCode::SUCCESS;
103 return StatusCode::SUCCESS;
117 "Number of ntuple rows.") );
119 "Number of ntuple rows.") );
123 "Number of objects.") );
125 "Number of objects.") );
129 "Index of this object.") );
135 return StatusCode::SUCCESS;
152 const std::type_info& ti =
it.elementTypeinfo();
158 return StatusCode::SUCCESS;
200 const std::vector<unsigned long>& codes_in,
201 std::vector<unsigned long>& codes_out)
209 bool all_empty =
true;
214 codes_out[j] = scode.getCode();
232 return StatusCode::SUCCESS;
250 size_t sz = sizeHint;
252 std::vector<unsigned long> codes_in;
253 std::vector<unsigned long> codes_out;
258 while (
const void*
obj =
it.nextUntyped() ) {
263 codes_in = codes_out;
264 while (
std::find (codes_out.begin(), codes_out.end(),
273 it.releaseElementUntyped (
obj);
287 return StatusCode::SUCCESS;
307 const std::type_info& ti,
309 const std::string& docstring ,
315 return StatusCode::SUCCESS;
322 EDataType
dt = TDataType::GetType (ti);
345 <<
"Requested a default value for variable " <<
name
346 <<
" of type " << System::typeinfoName (ti)
347 <<
"; but default values are only supported for basic types.";
348 return StatusCode::FAILURE;
351 TDataType*
tdt = gROOT->GetType (TDataType::GetTypeName (
dt));
353 defsize =
tdt->Size();
354 defcopied =
new char[defsize];
355 std::memcpy (defcopied, defval, defsize);
362 return StatusCode::SUCCESS;
384 const std::type_info& ,
390 REPORT_MESSAGE(MSG::ERROR) <<
"addDimensionedVariable not yet implemented.";
391 return StatusCode::FAILURE;
409 const std::type_info& ti,
411 const std::string& docstring,
416 m_addr (reinterpret_cast<
char**> (&
ptr)),
417 m_docstring (docstring),
433 const std::string&
prefix)
439 if (eltname ==
"bool")
443 std::string vname =
"std::vector<" + eltname;
444 if (vname[vname.size()-1] ==
'>')
449 TClass*
cls = TClass::GetClass (vname.c_str());
455 return StatusCode::FAILURE;
457 m_proxy =
cls->GetCollectionProxy();
460 REPORT_MESSAGE(MSG::ERROR) <<
"Can't find root collection proxy for type "
464 return StatusCode::FAILURE;
467 if (!m_proxy->GetCollectionClass() ||
468 !m_proxy->GetCollectionClass()->GetTypeInfo())
470 REPORT_MESSAGE(MSG::ERROR) <<
"Dictionary error for collection class "
474 return StatusCode::FAILURE;
483 *m_proxy->GetCollectionClass()->GetTypeInfo(),
498 TVirtualCollectionProxy::TPushPop pushcont (m_proxy, m_contptr);
499 size_t oldsz = m_proxy->Size();
500 m_proxy->Allocate (
sz,
false);
506 char*
begin =
static_cast<char*
> (m_proxy->At(0));
513 if (m_valdiff == 0 &&
sz >= 2)
514 m_valdiff =
static_cast<char*
> (m_proxy->At(1)) -
begin;
520 if (m_default &&
sz > oldsz) {
522 std::memcpy (
begin, m_default, m_defsize);
525 assert (m_defsize <= m_valdiff);
526 for (
char*
p =
begin + oldsz * m_valdiff;
530 std::memcpy (
p, m_default, m_defsize);
553 for (
Var&
v : *
this) {
566 for (
Var&
v : *
this) {
Common interface for adding a variable to a tuple.
std::string find(const std::string &s)
return a remapped string
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Abstract interface for iterating over a set of things.
Block filler tool for noisy FEB information.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string typeinfoToName(const std::type_info &ti)
Convert from a type_info to a name.
#define CHECK(...)
Evaluate an expression and check for errors.
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE(LVL)
Report a message.
StatusCode addVariable(const std::string &name, T *&ptr, const std::string &docstring="")
Add a variable to the tuple.
Utility functions for converting between type names, type_info, and CLIDs.
Abstract interface for iterating over a set of things.