22 const ProcFileElements::ProcFileElement *
e =
23 dynamic_cast<const ProcFileElements::ProcFileElement *
>(o);
29 }
else if (fFirst < e->
fFirst) {
39Int_t ProcFileElements::ProcFileElement::Overlapping(ProcFileElement *
e)
49 if (
fFirst == 0 && fLast == -1) {
56 if (fLast < e->
fFirst - 1) {
61 if (fLast ==
e->fFirst - 1) {
73 }
else if (
fFirst ==
e->fFirst) {
75 if (
fFirst == fLast ||
e->fFirst ==
e->fLast)
return 0;
100 Warning(
"Overlapping",
"should never be here!");
105Int_t ProcFileElements::ProcFileElement::MergeElement(ProcFileElement *
e)
111 if (Overlapping(
e) < 0)
return -1;
117 if (fLast == -1 ||
e->fLast == -1) {
120 if (fLast < e->fLast) fLast =
e->fLast;
143 Error(
"Add",
"could not create internal list!");
148 ProcFileElements::ProcFileElement *ne =
149 new ProcFileElements::ProcFileElement(fst, lst);
152 TIter nxe(fElements);
153 ProcFileElements::ProcFileElement *
e = 0;
154 while ((
e = (ProcFileElements::ProcFileElement *)nxe())) {
155 if (
e->MergeElement(ne) == 0)
break;
161 fElements->Remove(
e);
174 ProcFileElements::ProcFileElement *ep = 0, *en = 0;
175 TObjLink *olp = fElements->FirstLink(), *oln = 0;
176 while (olp && (ep = (ProcFileElements::ProcFileElement *) olp->
GetObject())) {
179 if ((en = (ProcFileElements::ProcFileElement *) oln->GetObject())) {
180 if (ep->MergeElement(en) == 0) {
181 fElements->Remove(en);
191 if ((
e = (ProcFileElements::ProcFileElement *) fElements->First()))
fFirst =
e->fFirst;
192 if ((
e = (ProcFileElements::ProcFileElement *) fElements->Last())) fLast =
e->fLast;
203 Printf(
"--- ProcFileElements ----------------------------------------");
204 Printf(
" File: %s", fName.Data());
205 Printf(
" # proc elements: %d", fElements ? fElements->GetSize() : 0);
206 TIter nxe(fElements);
207 ProcFileElements::ProcFileElement *
e = 0;
208 while ((
e = (ProcFileElements::ProcFileElement *)nxe())) {
e->Print(); }
209 Printf(
" Raw overall range: [%lld, %lld]",
fFirst, fLast);
210 Printf(
"-------------------------------------------------------------");
221 if (li->
GetSize() <= 0)
return 0;
225 ProcFileElements *pfe = 0;
226 while ((pfe = (ProcFileElements *) nxo())) {
227 if (strcmp(
GetName(), pfe->GetName()))
228 Warning(
"Merge",
"merging objects of different name! ('%s' != '%s')",
230 TIter nxe(pfe->GetListOfElements());
231 ProcFileElements::ProcFileElement *
e = 0;
232 while ((
e = (ProcFileElements::ProcFileElement *)nxe())) {
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)