#include "TEntryList.h"
#include "TEntryListBlock.h"
#include "TTree.h"
#include "TFile.h"
#include "TSystem.h"
ClassImp(TEntryList)
TEntryList::TEntryList() : fEntriesToProcess(0)
{
fLists = 0;
fCurrent = 0;
fBlocks = 0;
fN = 0;
fNBlocks = 0;
fTreeName = "";
fFileName = "";
fStringHash = 0;
fTreeNumber = -1;
fDirectory = 0;
fReapply = kFALSE;
fLastIndexQueried = -1;
fLastIndexReturned = 0;
fShift = kFALSE;
}
TEntryList::TEntryList(const char *name, const char *title) :
TNamed(name, title),
fEntriesToProcess(0)
{
fLists = 0;
fCurrent = 0;
fBlocks = 0;
fN = 0;
fNBlocks = 0;
fTreeName = "";
fFileName = "";
fStringHash = 0;
fTreeNumber = -1;
fReapply = kFALSE;
fDirectory = gDirectory;
if (fDirectory) fDirectory->Append(this);
fLastIndexQueried = -1;
fLastIndexReturned = 0;
fShift = kFALSE;
}
TEntryList::TEntryList(const char *name, const char *title, const TTree *tree):TNamed(name, title)
{
fLists = 0;
fCurrent = 0;
fBlocks = 0;
fN = 0;
fNBlocks = 0;
fTreeNumber = -1;
SetTree(tree);
fReapply = kFALSE;
fDirectory = gDirectory;
if (fDirectory) fDirectory->Append(this);
fLastIndexQueried = -1;
fLastIndexReturned = 0;
fShift = kFALSE;
}
TEntryList::TEntryList(const char *name, const char *title, const char *treename, const char *filename) : TNamed(name, title),fEntriesToProcess(0)
{
fLists = 0;
fCurrent = 0;
fBlocks = 0;
fNBlocks = 0;
fN = 0;
SetTree(treename, filename);
fTreeNumber = -1;
fReapply = kFALSE;
fDirectory = gDirectory;
if (fDirectory) fDirectory->Append(this);
fLastIndexQueried = -1;
fLastIndexReturned = 0;
fShift = kFALSE;
}
TEntryList::TEntryList(const TTree *tree) : fEntriesToProcess(0)
{
fLists = 0;
fCurrent = 0;
fBlocks = 0;
fNBlocks = 0;
fN = 0;
SetTree(tree);
fTreeNumber = -1;
fReapply = kFALSE;
fDirectory = gDirectory;
if (fDirectory) fDirectory->Append(this);
fLastIndexQueried = -1;
fLastIndexReturned = 0;
fShift = kFALSE;
}
TEntryList::TEntryList(const TEntryList &elist) : TNamed(elist)
{
fNBlocks = elist.fNBlocks;
fTreeName = elist.fTreeName;
fFileName = elist.fFileName;
fStringHash = elist.fStringHash;
fTreeNumber = elist.fTreeNumber;
fLastIndexQueried = -1;
fLastIndexReturned = 0;
fN = elist.fN;
fShift = elist.fShift;
fLists = 0;
fBlocks = 0;
fReapply = elist.fReapply;
fCurrent = 0;
fEntriesToProcess = elist.fEntriesToProcess;
if (elist.fLists){
fLists = new TList();
TEntryList *el1 = 0;
TEntryList *el2 = 0;
TIter next(elist.fLists);
while((el1 = (TEntryList*)next())){
el2 = new TEntryList(*el1);
if (el1==elist.fCurrent)
fCurrent = el2;
fLists->Add(el2);
}
} else {
if (elist.fBlocks){
TEntryListBlock *block1 = 0;
TEntryListBlock *block2 = 0;
fBlocks = new TObjArray();
for (Int_t i=0; i<fNBlocks; i++){
block1 = (TEntryListBlock*)elist.fBlocks->UncheckedAt(i);
block2 = new TEntryListBlock(*block1);
fBlocks->Add(block2);
}
}
fCurrent = this;
}
fDirectory = 0;
}
TEntryList::~TEntryList()
{
if (fBlocks){
fBlocks->Delete();
delete fBlocks;
}
fBlocks = 0;
if (fLists){
fLists->Delete();
delete fLists;
}
fLists = 0;
if (fDirectory) fDirectory->Remove(this);
fDirectory = 0;
}
void TEntryList::Add(const TEntryList *elist)
{
if (fN==0){
if (!fLists && fTreeName=="" && fFileName==""){
fNBlocks = elist->fNBlocks;
fTreeName = elist->fTreeName;
fFileName = elist->fFileName;
fStringHash = elist->fStringHash;
fTreeNumber = elist->fTreeNumber;
fLastIndexQueried = -1;
fLastIndexReturned = 0;
fN = elist->fN;
if (elist->fLists){
fLists = new TList();
TEntryList *el1 = 0;
TEntryList *el2 = 0;
TIter next(elist->fLists);
while((el1 = (TEntryList*)next())){
el2 = new TEntryList(*el1);
if (el1==elist->fCurrent)
fCurrent = el2;
fLists->Add(el2);
}
} else {
if (elist->fBlocks){
TEntryListBlock *block1 = 0;
TEntryListBlock *block2 = 0;
fBlocks = new TObjArray();
for (Int_t i=0; i<fNBlocks; i++){
block1 = (TEntryListBlock*)elist->fBlocks->UncheckedAt(i);
block2 = new TEntryListBlock(*block1);
fBlocks->Add(block2);
}
}
fCurrent = 0;
}
return;
}
}
if (!fLists){
if (!elist->fLists){
if (!strcmp(elist->fTreeName.Data(),fTreeName.Data()) && !strcmp(elist->fFileName.Data(),fFileName.Data())){
if (!elist->fBlocks)
return;
if (!fBlocks){
TEntryListBlock *block1 = 0;
TEntryListBlock *block2 = 0;
fNBlocks = elist->fNBlocks;
fN = elist->fN;
fBlocks = new TObjArray();
for (Int_t i=0; i<fNBlocks; i++){
block1 = (TEntryListBlock*)elist->fBlocks->UncheckedAt(i);
block2 = new TEntryListBlock(*block1);
fBlocks->Add(block2);
}
return;
}
TEntryListBlock *block1=0;
TEntryListBlock *block2=0;
Int_t i;
Int_t nmin = TMath::Min(fNBlocks, elist->fNBlocks);
Long64_t nnew, nold;
for (i=0; i<nmin; i++){
block1 = (TEntryListBlock*)fBlocks->UncheckedAt(i);
block2 = (TEntryListBlock*)elist->fBlocks->UncheckedAt(i);
nold = block1->GetNPassed();
nnew = block1->Merge(block2);
fN = fN - nold + nnew;
}
if (fNBlocks<elist->fNBlocks){
Int_t nmax = elist->fNBlocks;
for (i=nmin; i<nmax; i++){
block2 = (TEntryListBlock*)elist->fBlocks->UncheckedAt(i);
block1 = new TEntryListBlock(*block2);
fBlocks->Add(block1);
fN+=block1->GetNPassed();
fNBlocks++;
}
}
fLastIndexQueried = -1;
fLastIndexReturned = 0;
} else {
fLastIndexQueried = -1;
fLastIndexReturned = 0;
fLists = new TList();
TEntryList *el = new TEntryList();
el->fTreeName = fTreeName;
el->fFileName = fFileName;
el->fBlocks = fBlocks;
fBlocks = 0;
el->fNBlocks = fNBlocks;
el->fN = fN;
el->fLastIndexQueried = -1;
el->fLastIndexReturned = 0;
fLists->Add(el);
el = new TEntryList(*elist);
el->fLastIndexQueried = -1;
el->fLastIndexReturned = 0;
fLists->Add(el);
fN+=el->GetN();
fCurrent = 0;
}
} else {
TEntryList *el = 0;
TIter next(elist->fLists);
while ((el = (TEntryList*)next())){
Add(el);
}
fCurrent = 0;
}
} else {
if (!elist->fLists){
TIter next(fLists);
TEntryList *el = 0;
Bool_t found = kFALSE;
while ((el = (TEntryList*)next())){
if (!strcmp(el->fTreeName.Data(), elist->fTreeName.Data()) &&
!strcmp(el->fFileName.Data(), elist->fFileName.Data())){
Long64_t oldn = el->GetN();
el->Add(elist);
found = kTRUE;
fN = fN - oldn + el->GetN();
break;
}
}
if (!found){
el = new TEntryList(*elist);
el->fLastIndexQueried = -1;
el->fLastIndexReturned = 0;
fLists->Add(el);
fN+=el->GetN();
}
} else {
TEntryList *el = 0;
TIter next(elist->fLists);
while ((el = (TEntryList*)next())){
Add(el);
}
fCurrent = 0;
}
if (fCurrent){
if (fCurrent->fBlocks){
Int_t currentblock = (fCurrent->fLastIndexReturned)/kBlockSize;
TEntryListBlock *block = (TEntryListBlock*)fCurrent->fBlocks->UncheckedAt(currentblock);
block->ResetIndices();
fCurrent->fLastIndexReturned = 0;
fCurrent->fLastIndexQueried = -1;
}
}
fCurrent = 0;
}
}
Int_t TEntryList::Contains(Long64_t entry, TTree *tree)
{
if (!tree){
if (fBlocks) {
TEntryListBlock *block = 0;
Int_t nblock = entry/kBlockSize;
if (nblock >= fNBlocks) return 0;
block = (TEntryListBlock*)fBlocks->UncheckedAt(nblock);
return block->Contains(entry-nblock*kBlockSize);
}
if (fLists) {
if (!fCurrent) fCurrent = (TEntryList*)fLists->First();
return fCurrent->Contains(entry);
}
return 0;
} else {
Long64_t localEntry = tree->LoadTree(entry);
SetTree(tree->GetTree());
if (fCurrent)
return fCurrent->Contains(localEntry);
}
return 0;
}
void TEntryList::DirectoryAutoAdd(TDirectory* dir)
{
SetDirectory(dir);
}
Bool_t TEntryList::Enter(Long64_t entry, TTree *tree)
{
if (!tree){
if (!fLists) {
if (!fBlocks) fBlocks = new TObjArray();
TEntryListBlock *block = 0;
Long64_t nblock = entry/kBlockSize;
if (nblock >= fNBlocks) {
if (fNBlocks>0){
block = (TEntryListBlock*)fBlocks->UncheckedAt(fNBlocks-1);
if (!block) return 0;
block->OptimizeStorage();
}
for (Int_t i=fNBlocks; i<=nblock; i++){
block = new TEntryListBlock();
fBlocks->Add(block);
}
fNBlocks = nblock+1;
}
block = (TEntryListBlock*)fBlocks->UncheckedAt(nblock);
if (block->Enter(entry-nblock*kBlockSize)) {
fN++;
return 1;
}
} else {
if (!fCurrent) fCurrent = (TEntryList*)fLists->First();
if (fCurrent->Enter(entry)) {
if (fLists)
fN++;
return 1;
}
}
} else {
Long64_t localentry = tree->LoadTree(entry);
SetTree(tree->GetTree());
if (fCurrent){
if (fCurrent->Enter(localentry)) {
if (fLists)
fN++;
return 1;
}
}
}
return 0;
}
Bool_t TEntryList::Remove(Long64_t entry, TTree *tree)
{
if (!tree){
if (!fLists) {
if (!fBlocks) return 0;
TEntryListBlock *block = 0;
Long64_t nblock = entry/kBlockSize;
block = (TEntryListBlock*)fBlocks->UncheckedAt(nblock);
if (!block) return 0;
Long64_t blockindex = entry - nblock*kBlockSize;
if (block->Remove(blockindex)){
fN--;
return 1;
}
} else {
if (!fCurrent) fCurrent = (TEntryList*)fLists->First();
if (fCurrent->Remove(entry)){
if (fLists)
fN--;
return 1;
}
}
} else {
Int_t localentry = tree->LoadTree(entry);
SetTree(tree->GetTree());
if (fCurrent){
if (fCurrent->Remove(localentry)) {
if (fLists)
fN--;
return 1;
}
}
}
return 0;
}
Long64_t TEntryList::GetEntry(Int_t index)
{
if (index>=fN){
return -1;
}
if (index==fLastIndexQueried+1){
return Next();
} else {
if (fBlocks) {
TEntryListBlock *block = 0;
Long64_t total_passed = 0;
Int_t i=0;
while (total_passed<=index && i<fNBlocks){
block=(TEntryListBlock*)fBlocks->UncheckedAt(i);
total_passed+=block->GetNPassed();
i++;
}
i--;
total_passed-=block->GetNPassed();
if (i!=fLastIndexReturned/kBlockSize){
block = (TEntryListBlock*)fBlocks->UncheckedAt(fLastIndexReturned/kBlockSize);
block->ResetIndices();
block = (TEntryListBlock*)fBlocks->UncheckedAt(i);
}
Long64_t localindex = index - total_passed;
Long64_t blockindex = block->GetEntry(localindex);
if (blockindex < 0) return -1;
Long64_t res = i*kBlockSize + blockindex;
fLastIndexQueried = index;
fLastIndexReturned = res;
return res;
} else {
if (!fCurrent) fCurrent = (TEntryList*)fLists->First();
TIter next(fLists);
TEntryList *templist;
Long64_t ntotal = 0;
if (fCurrent){
if (fCurrent->fBlocks){
Int_t currentblock = (fCurrent->fLastIndexReturned)/kBlockSize;
TEntryListBlock *block = (TEntryListBlock*)fCurrent->fBlocks->UncheckedAt(currentblock);
block->ResetIndices();
fCurrent->fLastIndexReturned = 0;
fCurrent->fLastIndexQueried = -1;
}
}
while ((templist = (TEntryList*)next())){
if (!fShift){
ntotal += templist->GetN();
} else {
if (templist->GetTreeNumber() >= 0)
ntotal += templist->GetN();
}
if (ntotal > index)
break;
}
fCurrent = templist;
Long64_t localentry = index - (ntotal - fCurrent->GetN());
fLastIndexQueried = index;
fLastIndexReturned = fCurrent->GetEntry(localentry);
return fLastIndexReturned;
}
}
return -1;
}
Long64_t TEntryList::GetEntryAndTree(Int_t index, Int_t &treenum)
{
Long64_t result = GetEntry(index);
if (fLists)
treenum = fCurrent->fTreeNumber;
else
treenum = fTreeNumber;
if (treenum<0) return -1;
return result;
}
TEntryList *TEntryList::GetEntryList(const char *treename, const char *filename, Option_t *opt)
{
if (gDebug > 1)
Info("GetEntryList","tree: %s, file: %s",
(treename ? treename : "-"), (filename ? filename : "-"));
TString option = opt;
option.ToUpper();
Bool_t nexp = option.Contains("NE");
TString fn;
TUrl u(filename, kTRUE);
Bool_t local=kFALSE;
if (!nexp){
local = !strcmp(u.GetProtocol(), "file");
if (local) fn = u.GetFile();
else fn = u.GetUrl();
} else {
fn = filename;
}
if (!fLists){
if (!strcmp(treename, fTreeName.Data()) && !(strcmp(fn.Data(), fFileName.Data()))){
return this;
} else {
if (!nexp && local){
gSystem->ExpandPathName(fn);
if (!gSystem->IsAbsoluteFileName(fn))
gSystem->PrependPathName(gSystem->pwd(), fn);
fn = gSystem->UnixPathName(fn);
if (!strcmp(treename, fTreeName.Data()) && !(strcmp(fn.Data(), fFileName.Data())))
return this;
}
return 0;
}
}
TString stotal = treename;
stotal.Append(fn);
ULong_t newhash = stotal.Hash();
TIter next(fLists);
TEntryList *templist;
while ((templist = (TEntryList*)next())){
if (templist->fStringHash==0){
stotal = templist->fTreeName + templist->fFileName;
templist->fStringHash = stotal.Hash();
}
if (newhash == templist->fStringHash){
if (!strcmp(templist->GetTreeName(), treename) && !strcmp(templist->GetFileName(), fn.Data())){
return templist;
}
}
}
if (!nexp && local){
TString longname = fn;
gSystem->ExpandPathName(longname);
if (!gSystem->IsAbsoluteFileName(longname))
gSystem->PrependPathName(gSystem->pwd(), longname);
longname = gSystem->UnixPathName(longname);
stotal = treename;
stotal.Append(longname);
newhash = stotal.Hash();
next.Reset();
while ((templist = (TEntryList*)next())){
if (templist->fStringHash==0){
stotal = templist->fTreeName + templist->fFileName;
templist->fStringHash = stotal.Hash();
}
if (newhash == templist->fStringHash){
if (!strcmp(templist->GetTreeName(), treename) && !strcmp(templist->GetFileName(), longname)){
return templist;
}
}
}
}
return 0;
}
Int_t TEntryList::Merge(TCollection *list)
{
if (!list) return -1;
TIter next(list);
TEntryList *elist = 0;
while ((elist = (TEntryList*)next())) {
if (!elist->InheritsFrom(TEntryList::Class())) {
Error("Add","Attempt to add object of class: %s to a %s",elist->ClassName(),this->ClassName());
return -1;
}
Add(elist);
}
return 0;
}
Long64_t TEntryList::Next()
{
Long64_t result;
if (fN == fLastIndexQueried+1 || fN==0){
return -1;
}
if (fBlocks){
Int_t iblock = fLastIndexReturned/kBlockSize;
TEntryListBlock *current_block = (TEntryListBlock*)fBlocks->UncheckedAt(iblock);
result = current_block->Next();
if (result>=0) {
fLastIndexQueried++;
fLastIndexReturned = result+kBlockSize*iblock;
return fLastIndexReturned;
}
else {
while (result<0 && iblock<fNBlocks-1) {
current_block->ResetIndices();
iblock++;
current_block = (TEntryListBlock*)fBlocks->UncheckedAt(iblock);
current_block->ResetIndices();
result = current_block->Next();
}
if (result<0) {
fLastIndexQueried = -1;
fLastIndexReturned = 0;
return -1;
}
fLastIndexQueried++;
fLastIndexReturned = result+kBlockSize*iblock;
return fLastIndexReturned;
}
} else {
if (!fCurrent) {
fCurrent = (TEntryList*)fLists->First();
if (!fCurrent) return 0;
if (fShift) {
while (fCurrent->GetTreeNumber()<0)
fCurrent = (TEntryList*)fLists->After(fCurrent);
}
}
result = fCurrent->Next();
if (result>=0) {
fLastIndexQueried++;
fLastIndexReturned = result;
return result;
} else {
if (fCurrent){
if (fCurrent->fBlocks){
Int_t currentblock = (fCurrent->fLastIndexReturned)/kBlockSize;
TEntryListBlock *block = (TEntryListBlock*)fCurrent->fBlocks->UncheckedAt(currentblock);
block->ResetIndices();
fCurrent->fLastIndexReturned = 0;
fCurrent->fLastIndexQueried = -1;
}
}
while (result<0 && fCurrent!=((TEntryList*)fLists->Last())){
fCurrent->fLastIndexQueried = -1;
fCurrent->fLastIndexReturned = 0;
fCurrent = (TEntryList*)fLists->After(fCurrent);
if (!fShift)
result = fCurrent->Next();
else {
if (fCurrent->GetTreeNumber() >= 0)
result = fCurrent->Next();
}
}
fLastIndexQueried++;
fLastIndexReturned = result;
return result;
}
}
}
void TEntryList::OptimizeStorage()
{
if (fBlocks){
TEntryListBlock *block = 0;
for (Int_t i=0; i<fNBlocks; i++){
block = (TEntryListBlock*)fBlocks->UncheckedAt(i);
block->OptimizeStorage();
}
}
}
void TEntryList::Print(const Option_t* option) const
{
TString opt = option;
opt.ToUpper();
if (fBlocks) {
printf("%s %s\n", fTreeName.Data(), fFileName.Data());
if (opt.Contains("A")){
TEntryListBlock* block = 0;
for (Int_t i=0; i<fNBlocks; i++){
block = (TEntryListBlock*)fBlocks->UncheckedAt(i);
Int_t shift = i*kBlockSize;
block->PrintWithShift(shift);
}
}
}
else {
TEntryList *elist = 0;
if (fN>0){
TIter next(fLists);
while((elist = (TEntryList*)next())){
elist->Print(option);
}
} else {
if (!fLists) printf("%s %s\n", fTreeName.Data(), fFileName.Data());
else {
TIter next(fLists);
while ((elist = (TEntryList*)next())){
printf("%s %s\n", elist->GetTreeName(), elist->GetFileName());
}
}
}
}
}
void TEntryList::Reset()
{
if (fBlocks){
fBlocks->Delete();
delete fBlocks;
fBlocks = 0;
}
if (fLists){
if (!((TEntryList*)fLists->First())->GetDirectory()){
fLists->Delete();
}
delete fLists;
fLists = 0;
}
fCurrent = 0;
fBlocks = 0;
fNBlocks = 0;
fN = 0;
fTreeName = "";
fFileName = "";
fStringHash = 0;
fTreeNumber = -1;
fLastIndexQueried = -1;
fLastIndexReturned = 0;
fReapply = kFALSE;
}
void TEntryList::SetDirectory(TDirectory *dir)
{
if (fDirectory == dir) return;
if (fDirectory) fDirectory->Remove(this);
fDirectory = dir;
if (fDirectory) fDirectory->Append(this);
}
void TEntryList::SetTree(const char *treename, const char *filename)
{
TEntryList *elist = 0;
TString stotal = treename;
stotal.Append(filename);
ULong_t newhash = stotal.Hash();
if (fLists) {
if (!fCurrent) fCurrent = (TEntryList*)fLists->First();
if (fCurrent->fStringHash == 0){
stotal = fCurrent->fTreeName + fCurrent->fFileName;
fCurrent->fStringHash = stotal.Hash();
}
if (newhash == fCurrent->fStringHash){
if (!strcmp(fCurrent->fTreeName, treename) && !strcmp(fCurrent->fFileName, filename)){
return;
}
}
TIter next(fLists);
while ((elist = (TEntryList*)next())){
if (newhash == elist->fStringHash){
if (!strcmp(elist->GetTreeName(), treename) && !strcmp(elist->GetFileName(), filename)){
if (fCurrent->fBlocks){
Int_t currentblock = (fCurrent->fLastIndexReturned)/kBlockSize;
TEntryListBlock *block = (TEntryListBlock*)fCurrent->fBlocks->UncheckedAt(currentblock);
block->ResetIndices();
fCurrent->fLastIndexReturned = 0;
fCurrent->fLastIndexQueried = -1;
}
fCurrent = elist;
fLastIndexQueried = -3;
return;
}
}
}
elist = new TEntryList("", "", treename, filename);
if (elist->GetDirectory()) {
elist->GetDirectory()->Remove(elist);
elist->SetDirectory(0);
}
fLists->Add(elist);
fCurrent = elist;
return;
} else {
if (fN==0 && fTreeName=="" && fFileName==""){
fTreeName = treename;
fFileName = filename;
stotal = fTreeName + fFileName;
fStringHash = newhash;
fCurrent = this;
} else {
if (fStringHash == 0){
stotal = fTreeName + fFileName;
fStringHash = stotal.Hash();
}
if (newhash != fStringHash){
fLists = new TList();
elist = new TEntryList();
elist->fTreeName = fTreeName;
elist->fFileName = fFileName;
elist->fStringHash = fStringHash;
elist->fN = fN;
elist->fTreeNumber = fTreeNumber;
elist->fBlocks = fBlocks;
fBlocks = 0;
elist->fNBlocks = fNBlocks;
fLists->Add(elist);
elist = new TEntryList("", "", treename, filename);
if (elist->GetDirectory()) {
elist->GetDirectory()->Remove(elist);
elist->SetDirectory(0);
}
fLists->Add(elist);
fCurrent = elist;
fLastIndexQueried = -3;
}
else {
return;
}
}
}
}
void TEntryList::SetTree(const TTree *tree)
{
if (!tree) return;
TString treename = tree->GetTree()->GetName();
TString filename;
if (tree->GetTree()->GetCurrentFile()){
filename = tree->GetTree()->GetCurrentFile()->GetName();
TUrl url(filename.Data(), kTRUE);
if (!strcmp(url.GetProtocol(), "file")){
gSystem->ExpandPathName(filename);
if (!gSystem->IsAbsoluteFileName(filename))
gSystem->PrependPathName(gSystem->pwd(), filename);
filename = gSystem->UnixPathName(filename);
} else {
filename = url.GetUrl();
}
} else {
filename = "";
}
SetTree(treename, filename);
}
void TEntryList::Subtract(const TEntryList *elist)
{
TEntryList *templist = 0;
if (!fLists){
if (!fBlocks) return;
if (!elist->fLists){
if (!strcmp(elist->fTreeName.Data(),fTreeName.Data()) &&
!strcmp(elist->fFileName.Data(),fFileName.Data())){
Long64_t n2 = elist->GetN();
Long64_t entry;
for (Int_t i=0; i<n2; i++){
entry = (const_cast<TEntryList*>(elist))->GetEntry(i);
Remove(entry);
}
} else {
return;
}
} else {
TIter next1(elist->GetLists());
templist = 0;
Bool_t found = kFALSE;
while ((templist = (TEntryList*)next1())){
if (!strcmp(templist->fTreeName.Data(),fTreeName.Data()) &&
!strcmp(templist->fFileName.Data(),fFileName.Data())){
found = kTRUE;
break;
}
}
if (found) {
Subtract(templist);
}
}
} else {
TIter next2(fLists);
templist = 0;
Long64_t oldn=0;
while ((templist = (TEntryList*)next2())){
oldn = templist->GetN();
templist->Subtract(elist);
fN = fN - oldn + templist->GetN();
}
}
return;
}
TEntryList operator||(TEntryList &elist1, TEntryList &elist2)
{
TEntryList eresult = elist1;
eresult.Print("all");
eresult.Add(&elist2);
eresult.Print("all");
return eresult;
}