Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DataBlock.h File Reference

#include <iostream>
#include "TObject.h"

Go to the source code of this file.

Namespaces

namespace  Anp

Classes

class  DataBlock

Functions

std::ostream & operator<< (std::ostream &o, const DataBlock &self)
const DataBlock FindDataBlock (const std::string &path, const std::string &name="block")


Function Documentation

const DataBlock FindDataBlock const std::string &  path,
const std::string &  name = "block"
 

Definition at line 148 of file DataBlock.cxx.

Referenced by Anp::RunModule::RunChain().

00149 {
00150    TFile *file_ptr = new TFile(path.c_str(), "READ");
00151    if(!file_ptr || !file_ptr -> IsOpen())
00152    {
00153       cerr << "Failed to open root file " << path << endl;
00154       return DataBlock();
00155    }
00156    
00157    DataBlock *block_ptr = dynamic_cast<DataBlock *>(file_ptr -> Get(name.c_str()));
00158    if(!block_ptr)
00159    {
00160       cout << "Failed to find DataBlock" << endl;
00161       return DataBlock();
00162    }
00163 
00164    const DataBlock block = *block_ptr;
00165 
00166    file_ptr -> Close();
00167    
00168    return block;
00169 }

std::ostream& operator<< std::ostream &  o,
const DataBlock self
 


Generated on Mon Feb 15 11:07:55 2010 for loon by  doxygen 1.3.9.1