#include <StdNtup.h>
Public Member Functions | |
| ~SAnaNtup () | |
| bool | Add (void *pntr, string ClassName="StdNtup", string TreeName="", string TreeTitle="Standard Analysis Ntuple") |
| bool | Fill (string TreeName) |
| void | Print (string TreeName) |
| void | Save (string TreeName) |
Static Public Member Functions | |
| SAnaNtup & | Instance () |
Private Member Functions | |
| SAnaNtup () | |
Private Attributes | |
| TFile * | fFile |
| vector< TTree * > | fTree |
| vector< void * > | fPntr |
| vector< string > | fTreeName |
| map< string, TTree * > | fTreeNameMap |
Static Private Attributes | |
| SAnaNtup * | fInstance = 0 |
|
|
Definition at line 24 of file StdNtup.cxx. References fFile, fTreeName, and fTreeNameMap.
00025 {
00026
00027 for (unsigned int i=0; i<fTreeName.size(); ++i)
00028 fTreeNameMap[fTreeName[i]]->AutoSave();
00029
00030 fFile->Close();
00031
00032 delete fFile;
00033
00034 for (unsigned int i=0; i<fTreeName.size(); ++i)
00035 delete fTreeNameMap[fTreeName[i]];
00036
00037 }
|
|
|
Definition at line 14 of file StdNtup.cxx. References fPntr, fTree, fTreeName, and fTreeNameMap.
00014 : fFile(0) 00015 { 00016 fTree.clear(); 00017 fPntr.clear(); 00018 fTreeName.clear(); 00019 fTreeNameMap.clear(); 00020 } |
|
||||||||||||||||||||
|
Definition at line 52 of file StdNtup.cxx. References assert_jobc, fFile, fPntr, fTree, fTreeName, and fTreeNameMap. Referenced by main().
00054 {
00055 char* msg[4] = {"SAnaNtup::Add -- pointer already exists!",
00056 "SAnaNtup::Add -- tree name already exists!",
00057 "SAnaNtup::Add -- tree name is empty!",
00058 "SAnaNtup::Add -- tree title is empty!"};
00059
00060 // demand that neither pointer nor tree name has already been used
00061 assert_jobc(find(fPntr.begin(),fPntr.end(),pntr) == fPntr.end(),msg[0]);
00062 assert_jobc(find(fTreeName.begin(),fTreeName.end(),TreeName) == fTreeName.end(),msg[1]);
00063
00064 // demand that the strings are not empty
00065 assert_jobc(TreeName. length() > 0,msg[2]);
00066 assert_jobc(TreeTitle.length() > 0,msg[3]);
00067
00068 if (!fFile)
00069 fFile = new TFile("stdntup.root","recreate");
00070
00071 fFile->cd();
00072
00073 // now create the tree
00074 TTree* tree = new TTree(TreeName.c_str(),TreeTitle.c_str());
00075 string brName = "f" + TreeName;
00076 tree->Branch(brName.c_str(),ClassName.c_str(),pntr);
00077 fTree.push_back(tree);
00078
00079 fPntr.push_back(pntr);
00080 fTreeName.push_back(TreeName);
00081
00082 // create link between tree name and pointer to tree
00083 fTreeNameMap[TreeName] = tree;
00084
00085 return true;
00086 }
|
|
|
Definition at line 108 of file StdNtup.cxx. References fFile, and fTreeNameMap. Referenced by main().
00109 {
00110 fFile->cd();
00111
00112 if (fTreeNameMap[TreeName]) {
00113 fTreeNameMap[TreeName]->Fill();
00114 // fTreeNameMap[TreeName]->AutoSave();
00115 return true;
00116 }
00117
00118 return false;
00119 }
|
|
|
Definition at line 41 of file StdNtup.cxx. References fInstance.
|
|
|
Definition at line 90 of file StdNtup.cxx. References fTreeNameMap.
00091 {
00092 if (fTreeNameMap[TreeName])
00093 fTreeNameMap[TreeName]->Print();
00094
00095 }
|
|
|
Definition at line 99 of file StdNtup.cxx. References fTreeNameMap. Referenced by main().
00100 {
00101 if (fTreeNameMap[TreeName])
00102 fTreeNameMap[TreeName]->AutoSave();
00103
00104 }
|
|
|
Definition at line 273 of file StdNtup.h. Referenced by Add(), Fill(), and ~SAnaNtup(). |
|
|
Definition at line 10 of file StdNtup.cxx. Referenced by Instance(). |
|
|
Definition at line 275 of file StdNtup.h. Referenced by Add(), and SAnaNtup(). |
|
|
Definition at line 274 of file StdNtup.h. Referenced by Add(), and SAnaNtup(). |
|
|
Definition at line 277 of file StdNtup.h. Referenced by Add(), SAnaNtup(), and ~SAnaNtup(). |
|
|
Definition at line 279 of file StdNtup.h. Referenced by Add(), Fill(), Print(), SAnaNtup(), Save(), and ~SAnaNtup(). |
1.3.5