|
Gaudi Framework, version v22r2 |
| Home | Generated: Tue May 10 2011 |
Row wise NTuple converter class definition. More...
#include <RRWNTupleCnv.h>


Public Member Functions | |
| RRWNTupleCnv (ISvcLocator *svc) | |
| Standard constructor. | |
| virtual | ~RRWNTupleCnv () |
| Standard destructor. | |
Static Public Member Functions | |
| static const CLID & | classID () |
| Inquire class type. | |
Protected Member Functions | |
| virtual StatusCode | load (TTree *tree, INTuple *&refpObject) |
| Create the transient representation of an object. | |
| virtual StatusCode | book (const std::string &desc, INTuple *pObject, TTree *&tree) |
| Book the N tuple. | |
| virtual StatusCode | writeData (TTree *rtree, INTuple *pObject) |
| Write N tuple data. | |
| virtual StatusCode | readData (TTree *rtree, INTuple *pObject, long ievt) |
| Read N tuple data. | |
Friends | |
| class | CnvFactory< RRWNTupleCnv > |
| Creator needs access to constructor/destructor. | |
Row wise NTuple converter class definition.
Definition at line 19 of file RRWNTupleCnv.h.
| RootHistCnv::RRWNTupleCnv::RRWNTupleCnv | ( | ISvcLocator * | svc ) | [inline] |
Standard constructor.
Definition at line 31 of file RRWNTupleCnv.h.
: RNTupleCnv(svc, classID()) { }
| virtual RootHistCnv::RRWNTupleCnv::~RRWNTupleCnv | ( | ) | [inline, virtual] |
| StatusCode RootHistCnv::RRWNTupleCnv::book | ( | const std::string & | desc, |
| INTuple * | pObject, | ||
| TTree *& | tree | ||
| ) | [protected, virtual] |
Book the N tuple.
Implements RootHistCnv::RNTupleCnv.
Definition at line 20 of file RRWNTupleCnv.cpp.
{
MsgStream log(msgSvc(), "RRWNTupleCnv");
const INTuple::ItemContainer& itms = nt->items();
// Book the tree
rtree = new TTree(desc.c_str(),nt->title().c_str());
// Add the branches
for (size_t length = itms.size(), i = 0; i < length; i++ ) {
const char* itm = itms[i]->name().c_str();
std::string tag = itm;
tag += rootVarType( itms[i]->type() );
// add the branch
log << MSG::INFO << "ID " << desc << ": added branch: "
<< itm << " / " << tag << endmsg;
rtree->Branch(itm,const_cast<void*>(itms[i]->buffer()),tag.c_str());
}
log << MSG::INFO << "Booked TTree with ID:" << desc
<< " \"" << nt->title() << "\"" << endmsg;
return StatusCode::SUCCESS;
}
| static const CLID& RootHistCnv::RRWNTupleCnv::classID | ( | ) | [inline, static] |
| StatusCode RootHistCnv::RRWNTupleCnv::load | ( | TTree * | tree, |
| INTuple *& | refpObject | ||
| ) | [protected, virtual] |
Create the transient representation of an object.
Implements RootHistCnv::RNTupleCnv.
Definition at line 72 of file RRWNTupleCnv.cpp.
{
return StatusCode::FAILURE;
}
| StatusCode RootHistCnv::RRWNTupleCnv::readData | ( | TTree * | rtree, |
| INTuple * | pObject, | ||
| long | ievt | ||
| ) | [protected, virtual] |
Read N tuple data.
Implements RootHistCnv::RNTupleCnv.
Definition at line 63 of file RRWNTupleCnv.cpp.
{
return StatusCode::FAILURE;
}
| StatusCode RootHistCnv::RRWNTupleCnv::writeData | ( | TTree * | rtree, |
| INTuple * | pObject | ||
| ) | [protected, virtual] |
Write N tuple data.
Implements RootHistCnv::RNTupleCnv.
Definition at line 45 of file RRWNTupleCnv.cpp.
{
if ( 0 != rtree ) {
// Fill the tree;
rtree->Fill();
// Reset the NTuple
nt->reset();
return StatusCode::SUCCESS;
}
MsgStream log(msgSvc(), "RRWNTupleCnv");
log << MSG::ERROR << "Attempt to write invalid N-tuple.";
if ( nt != 0 ) log << nt->title();
log << endmsg;
return StatusCode::FAILURE;
}
friend class CnvFactory< RRWNTupleCnv > [friend] |
Creator needs access to constructor/destructor.
Definition at line 22 of file RRWNTupleCnv.h.