|
ATLAS Offline Software
|
Go to the documentation of this file.
47 static std::map<const void*,std::pair<std::string,std::string> > s_getsymbol_cache;
51 static std::pair<std::string,std::string>
np(
"/libnothing.so",
"nullptr");
54 std::map<const void*,std::pair<std::string,std::string> >::const_iterator
it=s_getsymbol_cache.find(
address);
55 if (
it!=s_getsymbol_cache.end())
60 char **strings = backtrace_symbols (
array,1);
61 std::string
s(strings[0]);
62 size_t n =
s.find(
'+');
63 if (
n!=std::string::npos)
s.resize(
n);
65 std::string cleansymb = &(
s.c_str()[(
n==std::string::npos?0:
n+1)]);
66 std::string libname(
s);
67 if (
n!=std::string::npos)
69 s_getsymbol_cache[
address]=std::pair<std::string,std::string>(libname,cleansymb);
70 return s_getsymbol_cache[
address];
74 return s.size()>=npat && strncmp(&(
s[
s.size()-npat]),
pat,npat)==0;
78 return endsWith(libname,
"libHist.so",10)||
endsWith(libname,
"libAthenaMonitoringLib.so",25);
84 static const char* (*real)(
void*) = 0;
86 real = (
const char* (*)(
void*))dlsym(RTLD_NEXT,
"_ZNK6TNamed7GetNameEv");
88 std::cout<<
"ROOTSPY ERROR: Could not find symbol for TNamed::GetName() through hardcoded mangling."<<std::endl;
97 static const char* (*real)(
void*) = 0;
99 real = (
const char* (*)(
void*))dlsym(RTLD_NEXT,
"_ZNK7TObject9ClassNameEv");
101 std::cout<<
"ROOTSPY ERROR: Could not find symbol for TObject::GetName() through hardcoded mangling."<<std::endl;
105 return real(tobject);
122 size_t l(
name.length());
123 if (
l>=
sizeof(
unsigned)) {
124 const size_t l2(
l-
l%
sizeof(
unsigned));
126 hash+=*((
unsigned*)(&(
name.at(0))));
127 hash+=*((
unsigned*)(&(
name.at(
l-
sizeof(
unsigned)))));
140 static std::map<logitem,unsigned> s_logcalls;
141 static std::map<void*,std::pair<logitem,unsigned> > s_loghists;
143 void logcall(
const void* cthisptr,
void *& realaddr,
bool indirect=
false)
145 if (realaddr&&loglvl>1)
150 realaddr=dlsym(RTLD_NEXT,
getSymbol(
item.trace[1+
item.traceoffset]).second.c_str());
154 void* thisptr=
const_cast<void*
>(cthisptr);
159 size_t nrc(strlen(rc));
160 size_t nrn(strlen(
rn));
161 item.name.reserve(nrc+nrn+1);
162 item.name.append(rc,nrc);
163 item.name.push_back(
':');
168 if (
it==s_logcalls.end()) {
175 std::map<void*,std::pair<logitem,unsigned> >
::iterator it2=s_loghists.find(thisptr);
176 if (it2==s_loghists.end()) {
177 s_loghists.insert(std::pair<
void*,std::pair<logitem,unsigned> >(thisptr,std::pair<logitem,unsigned>(
item,thesize)));
179 it2->second.second=std::max<unsigned>(it2->second.second,thesize);
183 void logcall(
const void* cthisptr,
const void *& realaddr)
185 void* ra =
const_cast<void*
>(realaddr);
198 std::cout<<
"ROOTSPY WARNING: Could not find user symbol in trace"<<std::endl;
204 std::cout<<ncalls<<
" calls to "<<
getSymbol(
item.trace[1+
item.traceoffset]).second
205 <<
" by "<<
s.second <<
" : "<<
s.first <<
" : "<<
item.name<<std::endl;
211 std::cout<<
"============= rootspy: Producing report [begin]"<<std::endl;
212 std::cout<<
"============= Calls"<<std::endl;
216 std::cout<<
"============= Sizes"<<std::endl;
217 std::map<void*,std::pair<logitem,unsigned> >
::iterator it2(s_loghists.begin()),it2E(s_loghists.end());
218 for (;it2!=it2E;++it2)
219 reporthist(it2->second.first,it2->second.second);
220 std::cout<<
"============= rootspy: Producing report [end]"<<std::endl;
232 static bool needsinit =
true;
241 std::cout<<
"ROOTSPY WARNING: Could not find roothiststatGetSize(..) symbol. Reduced functionality"<<std::endl;
243 return real ? real(
h) : 0;
246 #define LOGCALL static void * realaddr=0;++RootSpy::loglvl;RootSpy::logcall(this,realaddr);
247 #define LOGCALLC static const void * realaddr=0;++RootSpy::loglvl;RootSpy::logcall(this,realaddr);
259 template <
typename T>
271 int Fill(
double,
double);
272 int Fill(
const char *,
double);
291 if (
d==0.123456&&std::string(
c)==
"rootspy_producereport") {
295 LOGCALL;
return ret(((
int (*)(
void*,
const char*,
double))realaddr)(
this,
c,
d));
303 void TH1::SetBinContent(
int i1,
int i2,
int i3,
double d) {
LOGCALL; ((void(*)(
void*,
int,
int,
int,
double))realaddr)(
this,i1,i2,i3,
d);
ret(); }
306 void TH1::SetBinError(
int i1,
int i2,
int i3,
double d) {
LOGCALL; ((void(*)(
void*,
int,
int,
int,
double))realaddr)(
this,i1,i2,i3,
d);
ret(); }
375 int Fill(
double,
double);
376 int Fill(
double,
double,
double);
377 int Fill(
const char*,
const char*,
double);
378 int Fill(
const char*,
double,
double);
379 int Fill(
double,
const char*,
double);
442 int Fill(
double,
double,
double);
443 int Fill(
double,
double,
double,
double);
444 int Fill(
const char *,
const char *,
const char *,
double);
445 int Fill(
const char *,
double,
const char *,
double);
446 int Fill(
const char *,
const char *,
double,
double);
447 int Fill(
double,
const char *,
const char *,
double);
448 int Fill(
double,
const char *,
double,
double);
449 int Fill(
double,
double,
const char *,
double);
454 int TH3::Fill(
double d1,
double d2,
double d3,
double d4) {
LOGCALL;
return ret(((
int(*)(
void*,
double,
double,
double,
double))realaddr)(
this,
d1,
d2,d3,d4)); }
455 int TH3::Fill(
const char *
c1,
const char *
c2,
const char *
c3,
double d) {
LOGCALL;
return ret(((
int(*)(
void*,
const char*,
const char*,
const char*,
double))realaddr)(
this,
c1,
c2,
c3,
d)); }
456 int TH3::Fill(
const char *
c1,
double d1,
const char *
c2,
double d2) {
LOGCALL;
return ret(((
int(*)(
void*,
const char*,
double,
const char*,
double))realaddr)(
this,
c1,
d1,
c2,
d2)); }
457 int TH3::Fill(
const char *
c1,
const char *
c2,
double d1,
double d2) {
LOGCALL;
return ret(((
int(*)(
void*,
const char*,
const char*,
double,
double))realaddr)(
this,
c1,
c2,
d1,
d2)); }
458 int TH3::Fill(
double d1,
const char *
c1,
const char *
c2,
double d2) {
LOGCALL;
return ret(((
int(*)(
void*,
double,
const char*,
const char*,
double))realaddr)(
this,
d1,
c1,
c2,
d2)); }
459 int TH3::Fill(
double d1,
const char *
c,
double d2,
double d3) {
LOGCALL;
return ret(((
int(*)(
void*,
double,
const char*,
double,
double))realaddr)(
this,
d1,
c,
d2,d3)); }
460 int TH3::Fill(
double d1,
double d2,
const char *
c,
double d3) {
LOGCALL;
return ret(((
int(*)(
void*,
double,
double,
const char*,
double))realaddr)(
this,
d1,
d2,
c,d3)); }
517 int Fill(
double,
double);
518 int Fill(
const char *,
double);
519 int Fill(
double,
double,
double);
520 int Fill(
const char *,
double,
double);
533 int Fill(
double,
double,
double);
534 int Fill(
double,
const char *,
double);
535 int Fill(
const char *,
const char *,
double);
536 int Fill(
const char *,
double,
double);
537 int Fill(
double,
double,
double,
double);
545 int TProfile2D::Fill(
double d1,
double d2,
double d3,
double d4) {
LOGCALL;
return ret(((
int(*)(
void*,
double,
double,
double,
double))realaddr)(
this,
d1,
d2,d3,d4)); }
552 int Fill(
double,
double,
double,
double);
553 int Fill(
double,
double,
double,
double,
double);
556 int TProfile3D::Fill(
double d1,
double d2,
double d3,
double d4) {
LOGCALL;
return ret(((
int(*)(
void*,
double,
double,
double,
double))realaddr)(
this,
d1,
d2,d3,d4)); }
557 int TProfile3D::Fill(
double d1,
double d2,
double d3,
double d4,
double d5) {
LOGCALL;
return ret(((
int(*)(
void*,
double,
double,
double,
double,
double))realaddr)(
this,
d1,
d2,d3,d4,d5)); }
JetConstituentVector::iterator iterator
void SetBinContent(int, double)
double GetBinContent(int) const
@ depth
pointing depth of the shower as calculated in egammaqgcld
const char * getROOTName(void *tobject)
double GetBinContent(int) const
void SetBinContent(int, double)
void logcall(const void *cthisptr, void *&realaddr, bool indirect=false)
void SetBinContent(int, double)
void SetBinContent(int, double)
void SetBinContent(int, double)
void SetBinContent(int, double)
double GetBinContent(int) const
double GetBinContent(int) const
const std::pair< std::string, std::string > & getUserSymbol(const logitem &item)
bool endsWith(const std::string &s, const char *pat, size_t npat)
void SetBinContent(int, double)
double GetBinContent(int) const
double GetBinContent(int) const
int Fill(double, double, double)
void SetBinContent(int, double)
const char * getROOTClass(void *tobject)
unsigned roothiststatGetSize(TH1 *h)
double GetBinContent(int) const
double GetBinContent(int) const
void SetBinContent(int, double)
int Fill(double, double, double)
void SetBinContent(int, double)
void SetBinContent(int, double)
double GetBinContent(int) const
double GetBinContent(int) const
void SetBinError(int, double)
void SetBinContent(int, double)
double GetBinContent(int) const
bool operator<(const logitem &o) const
int Fill(double, double, double, double)
double GetBinContent(int) const
double GetBinContent(int) const
void reporthist(const logitem &item, unsigned thesize)
double GetBinContent(int) const
double GetBinContent(int) const
void SetBinContent(int, double)
void SetBinContent(int, double)
double GetBinContent(int) const
double GetBinContent(int) const
double GetBinContent(int) const
const std::pair< std::string, std::string > & getSymbol(const void *address)
void SetBinContent(int, double)
void SetBinContent(int, double)
static const unsigned ntracemax
void reportcall(const logitem &item, unsigned ncalls)
double GetBinContent(int) const
bool ignoreLib(const std::string &libname)
double GetBinContent(int) const