6 #include <TChainElement.h>
7 #include <TFriendElement.h>
16 fSoftwareRevision =
"";
34 for(
size_t f = 0; f <
fFriends.size(); f++) {
54 std::string sname(name);
56 bool firstCall =
false;
57 if(GetNtrees() == 0) firstCall =
true;
59 std::string fileExtension =
"";
60 std::string inFile = name;
61 size_t dotpos = inFile.find_last_of(
".");
62 if(dotpos != std::string::npos)
63 fileExtension = inFile.substr( dotpos+1 );
64 std::list<std::string> list;
65 if(fileExtension ==
"list") {
67 std::list<std::string>::const_iterator iter = list.begin();
68 while(iter != list.end()) {
69 res = TChain::Add(iter->c_str(),kBigNumber);
73 res = TChain::Add(name,kBigNumber);
76 if(firstCall && res) {
80 ((TChainElement *)GetListOfFiles()->First())->GetTitle();
82 TFile* file0 =
new TFile(filename.c_str());
83 if(!file0 || file0->IsZombie())
return res;
85 QTree *tree=(
QTree *)(file0->GetObjectChecked(GetName(),
"QTree"));
91 const char* pulserPath = tree->GetAlias(
"IsHeater");
94 this->SetAlias(
"IsPulser",pulserPath);
97 TList* friends = tree->GetListOfFriends();
100 while(TFriendElement* afriend = (TFriendElement*)nextf()) {
101 QTree* qfriend =
dynamic_cast<QTree*
>(afriend->GetTree());
107 this->AddFriend(qfriend->GetName());
114 for(
size_t f = 0; f <
fFriends.size(); f++) {
126 if(!this->GetListOfLeaves())
return 0;
131 TIter nexta(this->GetListOfLeaves());
132 while(TObject* leaf = nexta()) {
136 for(
size_t f = 0; f <
fFriends.size(); f++) {
137 TObjArray* fleaves =
fFriends[f]->GetListOfLeaves();
138 if(!fleaves)
continue;
139 TIter nextb(fleaves);
140 while(TLeaf* fleaf = (TLeaf*)nextb()) {
152 if(!this->GetTree()) this->LoadTree(0);
153 if(!this->GetTree())
return 0;
155 TList* aliases = this->GetTree()->GetListOfAliases();
156 if(!aliases)
return 0;
160 TIter nexta(aliases);
161 while(TObject* alias = nexta()) {
165 for(
size_t f = 0; f <
fFriends.size(); f++) {
167 if(!
fFriends[f]->GetTree())
continue;
168 TList* faliases =
fFriends[f]->GetTree()->GetListOfAliases();
169 if(!faliases)
continue;
170 TIter nextb(faliases);
171 while(TObject* falias = nextb()) {
182 if(!this->GetListOfBranches())
return 0;
187 TIter nexta(this->GetListOfBranches());
188 while(TObject* branch = nexta()) {
191 for(
size_t f = 0; f <
fFriends.size(); f++) {
192 TObjArray* fbranches =
fFriends[f]->GetListOfBranches();
193 if(!fbranches)
continue;
194 TIter nextb(fbranches);
195 while(TBranch* fbranch = (TBranch*)nextb()) {
const std::string & GetVersionTag()
const std::string & GetSoftwareRevision()
std::string fSoftwareRevision
software version of first qtree
TObjArray * GetListOfAllBranches()
TObjArray * fAllBranches
list of all branches
TList * fAllAliases
list of all aliases
virtual ~QChain()
destructor
TList * GetListOfAllAliases()
std::vector< QChain * > fFriends
friend QChains
Int_t Add(const char *filename, Long64_t nentries=kBigNumber)
TObjArray * fAllLeaves
list of all leaves
TObjArray * GetListOfAllLeaves()
void Read(const std::string &fileListPath)