#include <MyRoot.hh>
Public Member Functions | |
MyRoot () | |
~MyRoot () | |
void | OpenFile (std::string filename) |
void | CreateTree (std::string branchname, int fCircular=0) |
void | Fill () |
template<typename Type > | |
void | SetBranch (const std::string &name, Type *var) |
void | SetBranch (const std::string &name, std::vector< double > *pVecD) |
void | SetBranch (const std::string &name, std::vector< int > *pVecI) |
void | SetBranch (const std::string &name, int *pI) |
void | SetBranch (const std::string &name, double *pD) |
void | SetBranch (const std::string &name, std::vector< std::string > *pVecCa) |
void | Save () |
int | FlushBaskets () |
void | Write () |
void | Close () |
void | SetVerbose (int val) |
void | SetPrintModulo (int val) |
Static Public Member Functions | |
static MyRoot * | GetMyRoot () |
Private Attributes | |
int | fVerbose |
int | fPrintModulo |
int | nbFilled |
TFile * | m_file |
TTree * | m_tree |
Static Private Attributes | |
static MyRoot * | fMyRoot = 0 |
Definition at line 18 of file MyRoot.hh.
MyRoot::MyRoot | ( | ) |
Definition at line 14 of file MyRoot.cc.
References fMyRoot, fPrintModulo, and fVerbose.
MyRoot::~MyRoot | ( | ) |
void MyRoot::Close | ( | ) |
void MyRoot::CreateTree | ( | std::string | branchname, | |
int | fCircular = 0 | |||
) |
Definition at line 38 of file MyRoot.cc.
References fVerbose, m_tree, and nbFilled.
Referenced by MyAnalysisSvc::BeginOfRunAction().
00038 { 00039 m_tree = new TTree(tree_name.c_str(),tree_name.c_str()); 00040 nbFilled = 0; 00041 // m_tree->SetName(tree_name); 00042 //set circular 00043 if (fCircular){ 00044 m_tree->SetCircular(fCircular); 00045 } 00046 if ( fVerbose >= 5 ){ 00047 std::cout<<"In MyRoot::CreateTree"<<std::endl; 00048 std::cout<<" New tree booked!!"<<std::endl; 00049 std::cout<<" Name: "<<tree_name<<std::endl; 00050 std::cout<<" Circular: "<<fCircular<<std::endl; 00051 } 00052 }
void MyRoot::Fill | ( | ) |
Definition at line 72 of file MyRoot.cc.
References fPrintModulo, fVerbose, m_tree, and nbFilled.
Referenced by MyAnalysisSvc::EndOfEventAction().
00072 { 00073 m_tree->Fill(); 00074 nbFilled++; 00075 if ( fVerbose >= 5 ){ 00076 if ( fPrintModulo ){ 00077 if ( nbFilled%fPrintModulo == 0 ){ 00078 std::cout<<"In MyRoot::Fill"<<std::endl; 00079 std::cout<<" m_tree->Fill()"<<std::endl; 00080 std::cout<<" "<<nbFilled<<" times for this tree"<<std::endl; 00081 } 00082 } 00083 } 00084 }
int MyRoot::FlushBaskets | ( | ) |
Definition at line 94 of file MyRoot.cc.
References fVerbose, and m_tree.
Referenced by MyAnalysisSvc::EndOfEventAction().
MyRoot * MyRoot::GetMyRoot | ( | ) | [static] |
Definition at line 65 of file MyRoot.cc.
References fMyRoot.
Referenced by MyAnalysisSvc::MyAnalysisSvc(), ProcessCountingSvc::SetBranch(), MonitorSD::SetBranch(), McTruthSvc::SetBranch(), and EventHeaderSvc::SetBranch().
void MyRoot::OpenFile | ( | std::string | filename | ) |
Definition at line 54 of file MyRoot.cc.
References fVerbose, and m_file.
Referenced by MyAnalysisSvc::BeginOfRunAction().
void MyRoot::Save | ( | ) |
void MyRoot::SetBranch | ( | const std::string & | name, | |
std::vector< std::string > * | pVecCa | |||
) |
void MyRoot::SetBranch | ( | const std::string & | name, | |
double * | pD | |||
) |
void MyRoot::SetBranch | ( | const std::string & | name, | |
int * | pI | |||
) |
void MyRoot::SetBranch | ( | const std::string & | name, | |
std::vector< int > * | pVecI | |||
) |
void MyRoot::SetBranch | ( | const std::string & | name, | |
std::vector< double > * | pVecD | |||
) |
void MyRoot::SetBranch | ( | const std::string & | name, | |
Type * | var | |||
) | [inline] |
Definition at line 32 of file MyRoot.hh.
References fVerbose, and m_tree.
Referenced by ProcessCountingSvc::SetBranch(), MonitorSD::SetBranch(), McTruthSvc::SetBranch(), and EventHeaderSvc::SetBranch().
void MyRoot::SetPrintModulo | ( | int | val | ) | [inline] |
Definition at line 56 of file MyRoot.hh.
References fPrintModulo.
Referenced by MyAnalysisSvc::set_out_card().
00056 {fPrintModulo = val;};
void MyRoot::SetVerbose | ( | int | val | ) | [inline] |
Definition at line 55 of file MyRoot.hh.
References fVerbose.
Referenced by MyAnalysisSvc::set_out_card().
00055 {fVerbose = val;};
void MyRoot::Write | ( | ) |
MyRoot * MyRoot::fMyRoot = 0 [static, private] |
Definition at line 56 of file MyRoot.hh.
Referenced by GetMyRoot(), and MyRoot().
int MyRoot::fPrintModulo [private] |
Definition at line 63 of file MyRoot.hh.
Referenced by Fill(), MyRoot(), and SetPrintModulo().
int MyRoot::fVerbose [private] |
Definition at line 62 of file MyRoot.hh.
Referenced by Close(), CreateTree(), Fill(), FlushBaskets(), MyRoot(), OpenFile(), Save(), SetBranch(), SetVerbose(), Write(), and ~MyRoot().
TFile* MyRoot::m_file [private] |
Definition at line 67 of file MyRoot.hh.
Referenced by Close(), OpenFile(), and ~MyRoot().
TTree* MyRoot::m_tree [private] |
Definition at line 68 of file MyRoot.hh.
Referenced by CreateTree(), Fill(), FlushBaskets(), Save(), SetBranch(), Write(), and ~MyRoot().
int MyRoot::nbFilled [private] |
Definition at line 64 of file MyRoot.hh.
Referenced by CreateTree(), and Fill().