AMSDST
|
This class provides access to the Ntuplize Events
Only one instance of this class exists (singleton) you can access it with the static method: myChain::gethead()
More...
#include <myChain.h>
Classes | |
class | Section |
Public Member Functions | |
~myChain () | |
Default destructor. | |
virtual Int_t | Add (const char *name, Long64_t nentries=kBigNumber) |
Add ROOT file(s) to the chain. | |
Int_t | AddFromFile (const char *name) |
Add the ROOT_files listed on a text file. | |
myEvent * | GetEvent (Long64_t entry=0, Int_t getall=0) |
Read the event in memory for analysis. | |
myEvent * | GetEventPointer () |
Returns the pointer to the event object. | |
Int_t | GetThisEntry (Int_t getall=0) |
(re)Read the current event | |
Int_t | GetNextEntry (Int_t getall=0) |
Get the nextEvent. | |
virtual Long64_t | LoadTree (Long64_t entry) |
It calls the TChain::LoadEntry after some checks. | |
virtual Long64_t | Draw (const char *varexp, const TCut &selection, Option_t *option="", Long64_t nentries=kBigNumber, Long64_t firstentry=0) |
It calls the TChain::Draw after some hacks. | |
virtual Long64_t | Draw (const char *varexp, const char *selection, Option_t *option="", Long64_t nentries=kBigNumber, Long64_t firstentry=0) |
virtual void | Draw (Option_t *opt) |
void | CloneTrees (const char *outpath="./", int single=0) |
Creates a new file(s) in the specified directory to store the selected events If Single different from 0, just one file containing all the trees is produced. | |
void | FillOutput () |
Fills the tree(s) containing the filtered data. | |
void | CloseOutput () |
Close the files containing the Filtered data. | |
void | PrintEverything () |
does really need an explanation? | |
void | PrintEntries () |
void | PrintMyInfo () |
void | AddSection (const char *Name, const char *DirName=0, bool enable=true) |
void | ListSections () |
myChain::Section * | GetSection (const char *Name) |
bool | HasSection (const char *Name) |
bool | HasSectionActivated (const char *Name) |
void | EnableSection (const char *Name) |
void | DisableSection (const char *Name) |
void | SectionSetDirName (const char *SectionName, const char *DirName) |
virtual void | Clear (Option_t *option="") |
Static Public Member Functions | |
static myChain * | gethead () |
returns the pointer to the myChain singleton and it creates the object if needed | |
static char * | ExtractFileNameWithoutExtension (TTree *_InputTree) |
static void | CloneSingleTree (TChain *_InputTree, TFile *ff, TChain *&_OutputTree) |
static void | CloneSingleTree (TTree *_InputTree, TFile *ff, TTree *&_OutputTree) |
static bool | checkCastorFile (TString fn) |
Check stage state of castor file. | |
static int | checkWildcardList (TString fn, std::vector< TString > &list, TString treeName="AMSRootNtuplized") |
A universal function to retrive file list from a wildcard pattern,. | |
Private Member Functions | |
myChain (const char *name="AMSRootNtuplized", const char *title="") | |
Constructor private beacuse it is a singleton. | |
void | init () |
void | AddActiveFriends () |
ClassDef (myChain, 0) | |
Private Attributes | |
std::vector< Section * > | sections |
std::vector< TFile * > | filesoutput |
useful for filtering | |
myEvent * | me |
bool | kIndexValid |
bool | kInitializationDone |
bool | kGetAll |
Static Private Attributes | |
static myChain * | ptr =0 |
This class provides access to the Ntuplize Events
Only one instance of this class exists (singleton) you can access it with the static method: myChain::gethead()
|
private |
Constructor private beacuse it is a singleton.
Definition at line 54 of file myChain.cxx.
Referenced by gethead().
myChain::~myChain | ( | ) |
Default destructor.
Definition at line 62 of file myChain.cxx.
References Clear(), CloseOutput(), filesoutput, and ptr.
|
virtual |
Add ROOT file(s) to the chain.
It assumes that your ROOT file name contains the string "MainTree" Will also add the friend trees to friend chain, either in a seperated file in the same directory of the main file, or in the same file with the main tree. Wildcard file name is also accepted. If a friend file is not found or can't load, the corresponding section will be disabled.
name | file name |
nentries | number of entries to be add to chain, kBigNumber means all entries. If file name is wildcard, the number will be applyed to every file. |
Definition at line 226 of file myChain.cxx.
References AddActiveFriends(), checkWildcardList(), DisableSection(), kIndexValid, kInitializationDone, me, myEvent::ms, myEvent::RTI, sections, myEvent::us1, myEvent::vmbhp, myEvent::vmbp, myEvent::vmep, myEvent::vmrp, myEvent::vmtp, myEvent::vmuktp, myEvent::vmukup, myEvent::vmup, and myEvent::vmuqtp.
Referenced by AddFromFile().
|
private |
Int_t myChain::AddFromFile | ( | const char * | name | ) |
Add the ROOT_files listed on a text file.
Definition at line 772 of file myChain.cxx.
References Add().
void myChain::AddSection | ( | const char * | Name, |
const char * | DirName = 0 , |
||
bool | enable = true |
||
) |
Definition at line 125 of file myChain.cxx.
References myChain::Section::Active, myChain::Section::bname, myChain::Section::dirname, myChain::Section::name, myChain::Section::ntrees, sections, and myChain::Section::t3friend.
Referenced by init().
|
static |
Check stage state of castor file.
Currently use external command stager_qry and grep to check the status. Could change to castor functions if possible.
fn | file name, could be in full URL like castor://castor/... or root://stage.server//castor/... |
Definition at line 156 of file myChain.cxx.
Referenced by checkWildcardList().
|
static |
A universal function to retrive file list from a wildcard pattern,.
Making use the feature of TChain::Add(). With current AMS ROOT, or any ROOT with Netx plugin, rootd protocal ("root://") is also supported. The expantion of wildcard file name will be stored in a vector<TString>, but no check with the file will be made. If the input is a simple file, then connect and check existance of the tree inside the file. Besides that, also convert to root protocol for eos and castor files, and add svcClass=amsuser for castor file if needed. Also check the stage status of a single castor file, and fail if file not staged. This feature may be better moved to a seperated function.
fn | file name pattern to be parsed |
list | a TString vector to store the resulting file list |
treeName | the default tree name if not specified in fn |
Definition at line 171 of file myChain.cxx.
References checkCastorFile(), and ShowError().
Referenced by Add().
|
private |
|
virtual |
Definition at line 76 of file myChain.cxx.
References filesoutput, me, and sections.
Referenced by ~myChain().
|
static |
Definition at line 700 of file myChain.cxx.
Referenced by CloneTrees().
|
static |
Definition at line 708 of file myChain.cxx.
void myChain::CloneTrees | ( | const char * | outpath = "./" , |
int | single = 0 |
||
) |
Creates a new file(s) in the specified directory to store the selected events If Single different from 0, just one file containing all the trees is produced.
Definition at line 661 of file myChain.cxx.
References CloneSingleTree(), ExtractFileNameWithoutExtension(), filesoutput, and sections.
void myChain::CloseOutput | ( | ) |
Close the files containing the Filtered data.
Definition at line 608 of file myChain.cxx.
References filesoutput, and sections.
Referenced by ~myChain().
void myChain::DisableSection | ( | const char * | Name | ) |
|
virtual |
It calls the TChain::Draw after some hacks.
Definition at line 974 of file myChain.cxx.
References kGetAll.
|
virtual |
Definition at line 987 of file myChain.cxx.
References kGetAll.
|
inlinevirtual |
void myChain::EnableSection | ( | const char * | Name | ) |
Definition at line 791 of file myChain.cxx.
References sections.
|
static |
Definition at line 730 of file myChain.cxx.
Referenced by CloneTrees().
void myChain::FillOutput | ( | ) |
Fills the tree(s) containing the filtered data.
Definition at line 644 of file myChain.cxx.
References me, myEvent::RTI, sections, and myRTI::utime.
myEvent * myChain::GetEvent | ( | Long64_t | entry = 0 , |
Int_t | getall = 0 |
||
) |
|
inline |
|
static |
returns the pointer to the myChain singleton and it creates the object if needed
Definition at line 68 of file myChain.cxx.
References myChain(), and ptr.
Referenced by myEvent::LoadRTI().
|
inline |
myChain::Section * myChain::GetSection | ( | const char * | Name | ) |
|
inline |
bool myChain::HasSection | ( | const char * | Name | ) |
Definition at line 851 of file myChain.cxx.
References sections.
bool myChain::HasSectionActivated | ( | const char * | Name | ) |
Definition at line 861 of file myChain.cxx.
References sections.
|
private |
Definition at line 91 of file myChain.cxx.
References _FRIENDSNUM, myChain::Section::Active, AddSection(), myChain::Section::bname, DisableSection(), kGetAll, kIndexValid, kInitializationDone, me, myChain::Section::name, myChain::Section::ntrees, sections, and myChain::Section::t3friend.
Referenced by myChain().
void myChain::ListSections | ( | ) |
Definition at line 834 of file myChain.cxx.
References sections.
|
virtual |
It calls the TChain::LoadEntry after some checks.
Definition at line 879 of file myChain.cxx.
References kGetAll, kIndexValid, kInitializationDone, and sections.
void myChain::PrintEntries | ( | ) |
Definition at line 502 of file myChain.cxx.
References sections.
void myChain::PrintEverything | ( | ) |
void myChain::PrintMyInfo | ( | ) |
Definition at line 596 of file myChain.cxx.
void myChain::SectionSetDirName | ( | const char * | SectionName, |
const char * | DirName | ||
) |
Definition at line 820 of file myChain.cxx.
References sections.
|
private |
useful for filtering
Definition at line 32 of file myChain.h.
Referenced by Clear(), CloneTrees(), CloseOutput(), and ~myChain().
|
private |
Definition at line 165 of file myChain.h.
Referenced by Draw(), init(), and LoadTree().
|
private |
Definition at line 162 of file myChain.h.
Referenced by Add(), init(), and LoadTree().
|
private |
Definition at line 163 of file myChain.h.
Referenced by Add(), init(), and LoadTree().
|
private |
Definition at line 35 of file myChain.h.
Referenced by Add(), Clear(), FillOutput(), GetEvent(), GetEventPointer(), and init().
|
staticprivate |
Definition at line 34 of file myChain.h.
Referenced by gethead(), myChain(), and ~myChain().
|
private |
Definition at line 29 of file myChain.h.
Referenced by Add(), AddActiveFriends(), AddSection(), Clear(), CloneTrees(), CloseOutput(), DisableSection(), EnableSection(), FillOutput(), GetSection(), HasSection(), HasSectionActivated(), init(), ListSections(), LoadTree(), PrintEntries(), PrintEverything(), and SectionSetDirName().