17 #include "TClonesArray.h"
18 #include "TDirectory.h"
30 TObject **GetCont(TClonesArray *klon);
31 TObject **GetKeep(TClonesArray *klon);
34 TObject **myClonesArray::GetCont(TClonesArray *klon)
36 int offsetC = (
char*)&fCont - (
char*)
this;
37 return *((TObject***)((
char*)klon+offsetC));
41 TObject **myClonesArray::GetKeep(TClonesArray *klon)
43 int offsetK = (
char*)&fKeep - (
char*)
this;
44 TObjArray *k = *((TObjArray**)((
char*)klon+offsetK));
45 int offsetC = (
char*)&fCont - (
char*)
this;
46 return *(TObject***)((
char*)k+offsetC);
51 void THack::DeleteClonesArray(TClonesArray *clone)
55 TObject **keep = mycl.GetKeep(clone);
56 TObject **cont = mycl.GetCont(clone);
57 int sz = clone->Capacity();
69 void THack::ClearClonesArray(TClonesArray *clone)
73 TObject **keep = mycl.GetKeep(clone);
75 int sz = clone->Capacity();
83 if (to->TestBit(TObject::kNotDeleted))
continue;
91 void THack::PadRefresh(TPad *pad,
int flag)
98 TList *tl = pad->GetListOfPrimitives();
102 while ((to=next())) {
103 if (to->InheritsFrom(TPad::Class())) PadRefresh((TPad*)to,1);}
105 gSystem->ProcessEvents();
109 void THack::HistRelease(TDirectory *dir)
113 TListIter nextHist(dir->GetList());
116 while ((h1=(TH1*)nextHist())) {
117 if (!h1->InheritsFrom(TH1::Class()))
continue;
123 int THack::LineToD(
const char *line,
const char **lend,
124 int nItems,
double *Items,TString *Names)
127 const char *l=line;
char *ll,*le=0;
128 while ((l = strstr(l,
"="))) {
130 if(nIt>nItems)
break;
131 if(Names)Names[nIt]=
"";
132 double d = strtod(l,&ll);
137 if (!Names)
continue;
139 for (
int jj=-2;ll+jj>=line;jj--) {
140 int space = isspace(l[jj]);
141 if (space && !n)
continue;
142 if (!strchr(
"_()[]",l[jj]) && !isalnum(l[jj]))
break;
143 Names[nIt-1].Insert(0,l+jj,1);n++;
150 bool THack::IsTreeWritable(
const TTree *tree,
bool fatal)
155 if (tree && (d = tree->GetDirectory()) && d->IsWritable() ) {
157 }
else if (tree && fatal) {
158 Fatal(
"IsTreeWritable",
"TTree %p %s can not be written", tree,tree->GetName());