Class to hold information about the processed elements of a file.
{
const ProcFileElements::ProcFileElement *
e =
dynamic_cast<const ProcFileElements::ProcFileElement *>(o);
return 0;
}
else if (fFirst < e->
fFirst) {
return -1;
} else {
return 1;
}
}
Int_t ProcFileElements::ProcFileElement::Overlapping(ProcFileElement *
e)
{
if (
fFirst == 0 && fLast == -1) {
return 1;
}
if (fLast >= 0) {
return -1;
} else {
if (fLast ==
e->fFirst - 1) {
return 0;
} else {
return 1;
}
}
} else {
return 1;
}
if (
fFirst == fLast ||
e->fFirst ==
e->fLast)
return 0;
return 1;
} else {
return -1;
} else {
return 0;
} else {
return 1;
}
}
} else {
return 1;
}
}
Warning(
"Overlapping",
"should never be here!");
return -1;
}
Int_t ProcFileElements::ProcFileElement::MergeElement(ProcFileElement *
e)
{
if (Overlapping(
e) < 0)
return -1;
if (fLast == -1 ||
e->fLast == -1) {
fLast = -1;
} else {
if (fLast < e->fLast) fLast =
e->fLast;
}
return 0;
}
{
}
{
if (!fElements) {
Error(
"Add",
"could not create internal list!");
return -1;
}
ProcFileElements::ProcFileElement *ne =
new ProcFileElements::ProcFileElement(fst, lst);
ProcFileElements::ProcFileElement *
e = 0;
while ((
e = (ProcFileElements::ProcFileElement *)nxe())) {
if (
e->MergeElement(ne) == 0)
break;
}
} else {
fElements->Add(ne);
rc = 1;
}
ProcFileElements::ProcFileElement *ep = 0, *en = 0;
TObjLink *olp = fElements->FirstLink(), *oln = 0;
while (olp && (ep = (ProcFileElements::ProcFileElement *) olp->
GetObject())) {
while (oln) {
if ((en = (ProcFileElements::ProcFileElement *) oln->GetObject())) {
if (ep->MergeElement(en) == 0) {
fElements->Remove(en);
delete en;
}
}
}
}
if ((
e = (ProcFileElements::ProcFileElement *) fElements->First()))
fFirst =
e->fFirst;
if ((
e = (ProcFileElements::ProcFileElement *) fElements->Last())) fLast =
e->fLast;
return rc;
}
{
Printf(
"--- ProcFileElements ----------------------------------------");
Printf(
" File: %s", fName.Data());
Printf(
" # proc elements: %d", fElements ? fElements->GetSize() : 0);
ProcFileElements::ProcFileElement *
e = 0;
while ((
e = (ProcFileElements::ProcFileElement *)nxe())) {
e->Print(); }
Printf(
"-------------------------------------------------------------");
}
{
if (!li) return -1;
ProcFileElements *pfe = 0;
while ((pfe = (ProcFileElements *) nxo())) {
if (strcmp(
GetName(), pfe->GetName()))
Warning(
"Merge",
"merging objects of different name! ('%s' != '%s')",
TIter nxe(pfe->GetListOfElements());
ProcFileElements::ProcFileElement *
e = 0;
while ((
e = (ProcFileElements::ProcFileElement *)nxe())) {
if (rc == 1) nadd++;
}
}
return nadd;
}
Class to hold information about the processed elements of a file.
void Error(const char *location, const char *msgfmt,...)
void Warning(const char *location, const char *msgfmt,...)
Int_t Compare(const void *item1, const void *item2)
void Printf(const char *fmt,...)
Collection abstract base class.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Wrapper around a TObject so it can be stored in a TList.
TObject * GetObject() const
Mother of all ROOT objects.
A sorted doubly linked list.
std::string GetName(const std::string &scope_name)
void Add(RHist< DIMENSIONS, PRECISION_TO, STAT_TO... > &to, const RHist< DIMENSIONS, PRECISION_FROM, STAT_FROM... > &from)
Add two histograms.
void Print(std::ostream &os, const OptionType &opt)