ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
TProfile_LW Class Reference

#include <TProfile_LW.h>

Inheritance diagram for TProfile_LW:
Collaboration diagram for TProfile_LW:

Public Member Functions

void Fill (const double &x, const double &y)
 
void Fill (const double &x, const double &y, const double &w)
 
unsigned GetNbinsX () const
 
double GetBinEntries (unsigned bin) const
 
double GetBinContent (unsigned bin) const
 
double GetBinError (unsigned bin) const
 
void SetBinEntries (unsigned bin, const double &)
 
void SetBinContent (unsigned bin, const double &)
 
void SetBinError (unsigned bin, const double &)
 
virtual unsigned GetEntries () const override
 
virtual void SetEntries (unsigned) override
 
virtual void Reset () override
 
double getXMin () const
 
double getXMax () const
 
void GetBinInfo (unsigned bin, double &entries, double &content, double &error) const
 
void SetBinInfo (unsigned bin, const double &entries, const double &content, const double &error)
 
void SetErrorOption (const char *option)
 
const char * GetErrorOption () const
 
void getSums (double &sumW, double &sumW2, double &sumWX, double &sumWX2, double &sumWY, double &sumWY2) const
 
void setSums (const double &sumW, const double &sumW2, const double &sumWX, const double &sumWX2, const double &sumWY, const double &sumWY2)
 
TProfilegetROOTHist ()
 
virtual TH1getROOTHistBase () override
 
virtual double Integral () const override
 
void SetName (const char *)
 
void SetTitle (const char *)
 
void SetNameTitle (const char *name, const char *title)
 
const char * GetName () const
 
const char * GetTitle () const
 
LWHistAxisGetXaxis ()
 
LWHistAxisGetYaxis ()
 
LWHistAxisGetZaxis ()
 
short GetMarkerColor () const
 
short GetMarkerStyle () const
 
float GetMarkerSize () const
 
void SetMarkerColor (short c=1)
 
void SetMarkerStyle (short s=1)
 
void SetMarkerSize (float sz=1)
 
void SetXTitle (const char *)
 
void SetYTitle (const char *)
 
void SetZTitle (const char *)
 
void SetMinimum (const double &minimum=-1111)
 
void SetMaximum (const double &maximum=-1111)
 
void SetOption (const char *option=" ")
 
void setCustomData (void *data)
 
const void * getCustomData () const
 
void * getCustomData ()
 
bool usingROOTBackend () const
 
bool ownsROOTHisto () const
 
void setOwnsROOTHisto (bool b)
 

Static Public Member Functions

static TProfile_LWcreate (const char *name, const char *title, unsigned nbinsx, const double &xlow, const double &xup, const char *option=" ")
 
static TProfile_LWcreate (const char *name, const char *title, unsigned nbinsx, const double &xlow, const double &xup, const double &ylow, const double &yup, const char *option=" ")
 
static TProfile_LWcreate (const char *name, const char *title, unsigned nbinsx, const float *xbins, const char *option=" ")
 
static TProfile_LWcreate (const char *name, const char *title, unsigned nbinsx, const double *xbins, const char *option=" ")
 
static TProfile_LWcreate (const char *name, const char *title, unsigned nbinsx, const double *xbins, const double &ylow, const double &yup, const char *option=" ")
 
static void safeDelete (LWHist *)
 

Protected Member Functions

virtual bool apply (TH1 *) const
 

Protected Attributes

unsigned short m_nBytesFromPool
 

Private Member Functions

virtual void clear () override
 
virtual const TH1getROOTHistBaseNoAlloc () const override
 
virtual TH1getROOTHistBaseNoAlloc () override
 
virtual void clearKeptROOTHist () override
 
const float * getVarBins () const
 
float * getVarBins ()
 
 TProfile_LW (const char *name, const char *title, unsigned nbinsx, const double &xlow, const double &xup, const double &ylow, const double &yup, const float *xbins_flt, const double *xbins_dbl, const char *option, bool rootbackend)
 
virtual ~TProfile_LW ()
 
 TProfile_LW (const TProfile_LW &)
 
TProfile_LWoperator= (const TProfile_LW &)
 
virtual double actualGetBinCenterX (int bin) const override
 
virtual double actualGetBinCenterY (int) const override
 
virtual unsigned actualFindBinX (const double &) const override
 
virtual unsigned actualFindBinY (const double &) const override
 
virtual unsigned actualGetNBinsX () const override
 
virtual unsigned actualGetNBinsY () const override
 
void ensureInitDecorations ()
 

Static Private Member Functions

static TProfile_LWactualcreate (const char *name, const char *title, unsigned nbinsx, const double &xlow, const double &xup, const double &ylow, const double &yup, const float *xbins_flt, const double *xbins_dbl, const char *option)
 

Private Attributes

Flex1DProfileHistom_flexHisto
 
TProfilem_rootHisto
 
const bool m_usingROOTBackend
 
bool m_ownsRootHisto
 
char * m_name
 
char * m_title
 
LWHistDecorationsm_decorations
 
void * m_customData
 

Friends

class LWHistInt
 
class LWHistVal
 

Detailed Description

Definition at line 24 of file TProfile_LW.h.

Constructor & Destructor Documentation

◆ TProfile_LW() [1/2]

TProfile_LW::TProfile_LW ( const char *  name,
const char *  title,
unsigned  nbinsx,
const double &  xlow,
const double &  xup,
const double &  ylow,
const double &  yup,
const float *  xbins_flt,
const double *  xbins_dbl,
const char *  option,
bool  rootbackend 
)
private

Definition at line 84 of file TProfile_LW.cxx.

89  : LWHist(name,title,rootbackend),
90  m_flexHisto(0),
91  m_rootHisto(0)
92 {
93  //Fixme: these asserts could be in common for all binnings... [+nan
94  //checking) (check input and revert to dummy range in case of
95  //problems +emit warning).
96  assert(!(xbins_flt&&xbins_dbl));//max one var binning defined
97  assert(!xbins_flt||(xbins_flt[0]==xlow&&xbins_flt[nbinsx]==xup));
98  assert(!xbins_dbl||(xbins_dbl[0]==xlow&&xbins_dbl[nbinsx]==xup));
99  assert(!xbins_flt||(ylow==0.0&&yup==0.0));//because otherwise we would have to use
100  //a non-existing constructor from root.
101  assert(xup>xlow);
102  assert(nbinsx>0);
103  if (rootbackend) {
104  if (xbins_dbl)
105  m_rootHisto = new TProfile(name,title,nbinsx,xbins_dbl,ylow,yup,option);
106  else if (xbins_flt)
107  m_rootHisto = new TProfile(name,title,nbinsx,xbins_flt,option);
108  else
109  m_rootHisto = new TProfile(name,title,nbinsx,xlow,xup,ylow,yup,option);
110  } else {
111  if (xbins_dbl)
112  m_flexHisto = Flex1DProfileHisto::create(nbinsx,xbins_dbl,ylow,yup);
113  else if (xbins_flt)
114  m_flexHisto = Flex1DProfileHisto::create(nbinsx,xbins_flt,ylow,yup);
115  else
116  m_flexHisto = Flex1DProfileHisto::create(nbinsx,xlow,xup,ylow,yup);
118  }
119 }

◆ ~TProfile_LW()

TProfile_LW::~TProfile_LW ( )
privatevirtual

Definition at line 122 of file TProfile_LW.cxx.

123 {
125  clear();
126  if (ownsROOTHisto())
127  delete m_rootHisto;//for root backend
128 }

◆ TProfile_LW() [2/2]

TProfile_LW::TProfile_LW ( const TProfile_LW )
private

Member Function Documentation

◆ actualcreate()

TProfile_LW * TProfile_LW::actualcreate ( const char *  name,
const char *  title,
unsigned  nbinsx,
const double &  xlow,
const double &  xup,
const double &  ylow,
const double &  yup,
const float *  xbins_flt,
const double *  xbins_dbl,
const char *  option 
)
staticprivate

Definition at line 67 of file TProfile_LW.cxx.

71 {
72  bool rootbackend(LWHistControls::hasROOTBackend());
73  TProfile_LW * h;
74  if (rootbackend) {
75  h = new TProfile_LW(name,title,nbinsx,xlow,xup,ylow,yup,xbins_flt,xbins_dbl,option,rootbackend);
76  } else {
77  h = MP_NEW(TProfile_LW)(name,title,nbinsx,xlow,xup,ylow,yup,xbins_flt,xbins_dbl,option,rootbackend);
78  h->m_nBytesFromPool = sizeof(TProfile_LW);
79  }
80  return h;
81 }

◆ actualFindBinX()

unsigned TProfile_LW::actualFindBinX ( const double &  x) const
overrideprivatevirtual

Implements LWHist.

Definition at line 324 of file TProfile_LW.cxx.

325 {
326  assert(!m_rootHisto);//Should have called the TAxis method
327  return m_flexHisto->valueToBin(x);
328 }

◆ actualFindBinY()

virtual unsigned TProfile_LW::actualFindBinY ( const double &  ) const
inlineoverrideprivatevirtual

Implements LWHist.

Definition at line 105 of file TProfile_LW.h.

105 { return 0; }

◆ actualGetBinCenterX()

double TProfile_LW::actualGetBinCenterX ( int  bin) const
overrideprivatevirtual

Implements LWHist.

Definition at line 315 of file TProfile_LW.cxx.

316 {
317  if (m_rootHisto) {
318  assert(false);
319  return 0;
320  }
321  return m_flexHisto->getBinCenter(bin);
322 }

◆ actualGetBinCenterY()

virtual double TProfile_LW::actualGetBinCenterY ( int  ) const
inlineoverrideprivatevirtual

Implements LWHist.

Definition at line 103 of file TProfile_LW.h.

103 { return 0; }

◆ actualGetNBinsX()

virtual unsigned TProfile_LW::actualGetNBinsX ( ) const
inlineoverrideprivatevirtual

Implements LWHist.

Definition at line 106 of file TProfile_LW.h.

106 { return GetNbinsX(); }

◆ actualGetNBinsY()

virtual unsigned TProfile_LW::actualGetNBinsY ( ) const
inlineoverrideprivatevirtual

Implements LWHist.

Definition at line 107 of file TProfile_LW.h.

107 { return 0; }

◆ apply()

bool LWHist::apply ( TH1 h) const
protectedvirtualinherited

Reimplemented in LWHist2D, and LWHist1D.

Definition at line 256 of file LWHist.cxx.

257 {
258  if (!h)
259  return false;
260  assert(!m_usingROOTBackend);
261 
262  if (!LWStrUtils::stringsEqual(h->GetTitle(),GetTitle()))
263  h->SetTitle(GetTitle());
264 
266  TAxis * a = h->GetXaxis();
267  assert(a);
269  a->SetTitle(m_decorations->m_xAxis->m_title);
270  if (m_decorations->m_xAxis->m_labelSize!=a->GetLabelSize())
271  a->SetLabelSize(m_decorations->m_xAxis->m_labelSize);
274  }
276  TAxis * a = h->GetYaxis();
277  assert(a);
279  a->SetTitle(m_decorations->m_yAxis->m_title);
280  if (m_decorations->m_yAxis->m_labelSize!=a->GetLabelSize())
281  a->SetLabelSize(m_decorations->m_yAxis->m_labelSize);
284  }
286  TAxis * a = h->GetZaxis();
287  assert(a);
289  a->SetTitle(m_decorations->m_zAxis->m_title);
290  if (m_decorations->m_zAxis->m_labelSize!=a->GetLabelSize())
291  a->SetLabelSize(m_decorations->m_zAxis->m_labelSize);
294  }
295  h->SetMarkerColor( GetMarkerColor() );
296  h->SetMarkerStyle( GetMarkerStyle() );
297  h->SetMarkerSize( GetMarkerSize() );
299  h->SetMinimum(m_decorations->m_minimum);
301  h->SetMaximum(m_decorations->m_maximum);
303  h->SetOption(m_decorations->m_option);
304 
305  return true;
306 }

◆ clear()

void TProfile_LW::clear ( )
overrideprivatevirtual

Reimplemented from LWHist.

Definition at line 157 of file TProfile_LW.cxx.

158 {
159  LWREPORT
160  LWHist::clear();
162  m_flexHisto = 0;
163 }

◆ clearKeptROOTHist()

void TProfile_LW::clearKeptROOTHist ( )
overrideprivatevirtual

Implements LWHist.

Definition at line 166 of file TProfile_LW.cxx.

167 {
169  return;
170 
171  if (m_rootHisto) {
172  if (usingROOTBackend())
173  delete m_rootHisto;
174  else
176 
177  m_rootHisto = 0;
178  }
179 }

◆ create() [1/5]

TProfile_LW * TProfile_LW::create ( const char *  name,
const char *  title,
unsigned  nbinsx,
const double &  xlow,
const double &  xup,
const char *  option = " " 
)
static

Definition at line 32 of file TProfile_LW.cxx.

34 {
35  return actualcreate(name,title,nbinsx,xlow,xup,0.0,0.0,0,0,option);
36 }

◆ create() [2/5]

TProfile_LW * TProfile_LW::create ( const char *  name,
const char *  title,
unsigned  nbinsx,
const double &  xlow,
const double &  xup,
const double &  ylow,
const double &  yup,
const char *  option = " " 
)
static

Definition at line 39 of file TProfile_LW.cxx.

42 {
43  return actualcreate(name,title,nbinsx,xlow,xup,ylow,yup,0,0,option);
44 }

◆ create() [3/5]

TProfile_LW * TProfile_LW::create ( const char *  name,
const char *  title,
unsigned  nbinsx,
const double *  xbins,
const char *  option = " " 
)
static

Definition at line 53 of file TProfile_LW.cxx.

54 {
55  return actualcreate(name,title,nbinsx,xbins[0],xbins[nbinsx],0.0,0.0,0,xbins,option);
56 }

◆ create() [4/5]

TProfile_LW * TProfile_LW::create ( const char *  name,
const char *  title,
unsigned  nbinsx,
const double *  xbins,
const double &  ylow,
const double &  yup,
const char *  option = " " 
)
static

Definition at line 59 of file TProfile_LW.cxx.

61 {
62  return actualcreate(name,title,nbinsx,xbins[0],xbins[nbinsx],ylow,yup,0,xbins,option);
63 }

◆ create() [5/5]

TProfile_LW * TProfile_LW::create ( const char *  name,
const char *  title,
unsigned  nbinsx,
const float *  xbins,
const char *  option = " " 
)
static

Definition at line 47 of file TProfile_LW.cxx.

48 {
49  return actualcreate(name,title,nbinsx,xbins[0],xbins[nbinsx],0.0,0.0,xbins,0,option);
50 }

◆ ensureInitDecorations()

void LWHist::ensureInitDecorations ( )
privateinherited

Definition at line 90 of file LWHist.cxx.

91 {
92  if (!m_decorations)
93  m_decorations = usingROOTBackend() ? new LWHistDecorations : MP_NEW(LWHistDecorations);
94 }

◆ Fill() [1/2]

void TProfile_LW::Fill ( const double &  x,
const double &  y 
)

Definition at line 223 of file TProfile_LW.cxx.

224 {
226  if (m_rootHisto)
227  m_rootHisto->Fill(x,y);
228  else
229  m_flexHisto->fill(x,y);
230 }

◆ Fill() [2/2]

void TProfile_LW::Fill ( const double &  x,
const double &  y,
const double &  w 
)

Definition at line 232 of file TProfile_LW.cxx.

233 {
235  if (m_rootHisto)
236  m_rootHisto->Fill(x,y,w);
237  else
238  m_flexHisto->fill(x,y,w);
239 }

◆ GetBinContent()

double TProfile_LW::GetBinContent ( unsigned  bin) const

Definition at line 243 of file TProfile_LW.cxx.

243 { LWCOUNTCALL;return CALL(GetBinContent(bin),getBinContent(bin)); }

◆ GetBinEntries()

double TProfile_LW::GetBinEntries ( unsigned  bin) const

Definition at line 242 of file TProfile_LW.cxx.

242 { LWCOUNTCALL;return CALL(GetBinEntries(bin),getBinEntries(bin)); }

◆ GetBinError()

double TProfile_LW::GetBinError ( unsigned  bin) const

Definition at line 244 of file TProfile_LW.cxx.

244 { LWCOUNTCALL;return CALL(GetBinError(bin),getBinError(bin)); }

◆ GetBinInfo()

void TProfile_LW::GetBinInfo ( unsigned  bin,
double &  entries,
double &  content,
double &  error 
) const

Definition at line 291 of file TProfile_LW.cxx.

292 {
293  LWCOUNTCALL;
294  if (m_rootHisto) {
295  entries = m_rootHisto->GetBinEntries(bin);
297  error = m_rootHisto->GetBinError(bin);
298  } else {
300  }
301 }

◆ getCustomData() [1/2]

void* LWHist::getCustomData ( )
inlineinherited

Definition at line 71 of file LWHist.h.

71 { return m_customData; }

◆ getCustomData() [2/2]

const void* LWHist::getCustomData ( ) const
inlineinherited

Definition at line 70 of file LWHist.h.

70 { return m_customData; }

◆ GetEntries()

unsigned TProfile_LW::GetEntries ( ) const
overridevirtual

Implements LWHist.

Definition at line 248 of file TProfile_LW.cxx.

249 {
250  if (m_rootHisto)
251  return static_cast<unsigned>(m_rootHisto->GetEntries());
252  else
253  return m_flexHisto->getEntries();
254 }

◆ GetErrorOption()

const char * TProfile_LW::GetErrorOption ( ) const

Definition at line 195 of file TProfile_LW.cxx.

195 { return CALL(GetErrorOption(),getErrorOptionAsString()); }

◆ GetMarkerColor()

short LWHist::GetMarkerColor ( ) const
inherited

Definition at line 96 of file LWHist.cxx.

97 {
98  const TH1 * hroot= getROOTHistBaseNoAlloc();
99  if (hroot)
100  return hroot->GetMarkerColor();
101 
103 }

◆ GetMarkerSize()

float LWHist::GetMarkerSize ( ) const
inherited

Definition at line 113 of file LWHist.cxx.

114 {
115  const TH1 * hroot= getROOTHistBaseNoAlloc();
116  if (hroot)
117  return hroot->GetMarkerSize();
119 }

◆ GetMarkerStyle()

short LWHist::GetMarkerStyle ( ) const
inherited

Definition at line 105 of file LWHist.cxx.

106 {
107  const TH1 * hroot= getROOTHistBaseNoAlloc();
108  if (hroot)
109  return hroot->GetMarkerStyle();
111 }

◆ GetName()

const char * LWHist::GetName ( ) const
inherited

Definition at line 366 of file LWHist.cxx.

367 {
368  const TH1 * hroot = getROOTHistBaseNoAlloc();
369  return hroot ? hroot->GetName() : m_name;
370 }

◆ GetNbinsX()

unsigned TProfile_LW::GetNbinsX ( ) const

Definition at line 241 of file TProfile_LW.cxx.

241 { return CALL(GetNbinsX(),getNBins()); }

◆ getROOTHist()

TProfile * TProfile_LW::getROOTHist ( )

Definition at line 140 of file TProfile_LW.cxx.

141 {
142  if (!m_rootHisto) {
144  if (!apply(h))
145  assert(false);
146  double stats[6];
147  getSums(stats[0],stats[1],stats[2],stats[3],stats[4],stats[5]);
148  h->PutStats(stats);
150  clear();
151  m_rootHisto = h;
152  }
153  return m_rootHisto;
154 }

◆ getROOTHistBase()

TH1 * TProfile_LW::getROOTHistBase ( )
overridevirtual

Implements LWHist.

Definition at line 139 of file TProfile_LW.cxx.

139 { return getROOTHist(); }

◆ getROOTHistBaseNoAlloc() [1/2]

const TH1 * TProfile_LW::getROOTHistBaseNoAlloc ( ) const
overrideprivatevirtual

Implements LWHist.

Definition at line 131 of file TProfile_LW.cxx.

132 {
133  return m_rootHisto;
134 }

◆ getROOTHistBaseNoAlloc() [2/2]

TH1 * TProfile_LW::getROOTHistBaseNoAlloc ( )
overrideprivatevirtual

Implements LWHist.

Definition at line 135 of file TProfile_LW.cxx.

136 {
137  return m_rootHisto;
138 }

◆ getSums()

void TProfile_LW::getSums ( double &  sumW,
double &  sumW2,
double &  sumWX,
double &  sumWX2,
double &  sumWY,
double &  sumWY2 
) const

Definition at line 257 of file TProfile_LW.cxx.

260 {
261  if (m_rootHisto) {
262  sumW = LWHistRootUtils::getSumW(m_rootHisto);
263  sumW2 = LWHistRootUtils::getSumW2(m_rootHisto);
264  sumWX = LWHistRootUtils::getSumWX(m_rootHisto);
265  sumWX2 = LWHistRootUtils::getSumWX2(m_rootHisto);
266  sumWY = LWHistRootUtils::getSumWY(m_rootHisto);
267  sumWY2 = LWHistRootUtils::getSumWY2(m_rootHisto);
268  } else {
269  sumW = m_flexHisto->getSumW(); sumW2 = m_flexHisto->getSumW2();
270  sumWX = m_flexHisto->getSumWX(); sumWX2 = m_flexHisto->getSumWX2();
271  sumWY = m_flexHisto->getSumWProfPar(); sumWY2 = m_flexHisto->getSumWProfPar2();
272  }
273 }

◆ GetTitle()

const char * LWHist::GetTitle ( ) const
inherited

Definition at line 372 of file LWHist.cxx.

373 {
374  const TH1 * hroot = getROOTHistBaseNoAlloc();
375  return hroot ? hroot->GetTitle() : m_title;
376 }

◆ getVarBins() [1/2]

float * TProfile_LW::getVarBins ( )
private

Definition at line 203 of file TProfile_LW.cxx.

204 {
205  assert(!m_rootHisto);
206  return m_flexHisto->getVarBins();
207 }

◆ getVarBins() [2/2]

const float * TProfile_LW::getVarBins ( ) const
private

Definition at line 197 of file TProfile_LW.cxx.

198 {
199  assert(!m_rootHisto);
200  return std::as_const(m_flexHisto)->getVarBins();
201 }

◆ GetXaxis()

LWHist::LWHistAxis * LWHist::GetXaxis ( )
inherited

Definition at line 309 of file LWHist.cxx.

310 {
311  this->ensureInitDecorations();
312  if (!m_decorations->m_xAxis)
313  this->m_decorations->m_xAxis = usingROOTBackend() ? new LWHistAxis(this) : MP_NEW(LWHistAxis)(this);
314 
315  return m_decorations->m_xAxis;
316 }

◆ getXMax()

double TProfile_LW::getXMax ( ) const

Definition at line 216 of file TProfile_LW.cxx.

217 {
218  if (m_rootHisto)
219  return std::as_const(*m_rootHisto).GetXaxis()->GetXmax();
220  return m_flexHisto->getXMax();
221 }

◆ getXMin()

double TProfile_LW::getXMin ( ) const

Definition at line 209 of file TProfile_LW.cxx.

210 {
211  if (m_rootHisto)
212  return std::as_const(*m_rootHisto).GetXaxis()->GetXmin();
213  return m_flexHisto->getXMin();
214 }

◆ GetYaxis()

LWHist::LWHistAxis * LWHist::GetYaxis ( )
inherited

Definition at line 319 of file LWHist.cxx.

320 {
321  this->ensureInitDecorations();
322  if (!m_decorations->m_yAxis)
323  this->m_decorations->m_yAxis = usingROOTBackend() ? new LWHistAxis(this) : MP_NEW(LWHistAxis)(this);
324  return m_decorations->m_yAxis;
325 }

◆ GetZaxis()

LWHist::LWHistAxis * LWHist::GetZaxis ( )
inherited

Definition at line 328 of file LWHist.cxx.

329 {
330  this->ensureInitDecorations();
331  if (!m_decorations->m_zAxis)
332  this->m_decorations->m_zAxis = usingROOTBackend() ? new LWHistAxis(this) : MP_NEW(LWHistAxis)(this);
333  return m_decorations->m_zAxis;
334 }

◆ Integral()

double TProfile_LW::Integral ( ) const
overridevirtual

Implements LWHist.

Definition at line 290 of file TProfile_LW.cxx.

290 { return CALL(Integral(),integral()); }

◆ operator=()

TProfile_LW& TProfile_LW::operator= ( const TProfile_LW )
private

◆ ownsROOTHisto()

bool LWHist::ownsROOTHisto ( ) const
inlineinherited

Definition at line 74 of file LWHist.h.

74 { return m_ownsRootHisto; }

◆ Reset()

void TProfile_LW::Reset ( )
overridevirtual

Implements LWHist.

Definition at line 182 of file TProfile_LW.cxx.

183 {
184  if (m_rootHisto) {
185  m_rootHisto->Reset();
186  return;
187  }
188  if (m_flexHisto) {
189  LWREPORT
190  m_flexHisto->reset();
191  }
192 }

◆ safeDelete()

void LWHist::safeDelete ( LWHist h)
staticinherited

Definition at line 30 of file LWHist.cxx.

31 {
32  if (!h) {
33  //std::cout<<"LWHist::safeDelete ERROR: Called with null pointer!"<<std::endl;
34  return;
35  }
36  if (h->m_nBytesFromPool) {
37  h->~LWHist();
38  LWPools::release(reinterpret_cast<char*>(h),h->m_nBytesFromPool);
40  std::cout<<"LWHists INFO: Last active histogram deleted. Triggering complete pool cleanup."<<std::endl;
42  }
43  } else {
44  delete h;
45  }
46 }

◆ SetBinContent()

void TProfile_LW::SetBinContent ( unsigned  bin,
const double &  c 
)

Definition at line 246 of file TProfile_LW.cxx.

246 { LWCOUNTCALL;CALL(SetBinContent(bin,c),setBinContent(bin,c)); }

◆ SetBinEntries()

void TProfile_LW::SetBinEntries ( unsigned  bin,
const double &  c 
)

Definition at line 245 of file TProfile_LW.cxx.

245 { LWCOUNTCALL;CALL(SetBinEntries(bin,c),setBinEntries(bin,c)); }

◆ SetBinError()

void TProfile_LW::SetBinError ( unsigned  bin,
const double &  e 
)

Definition at line 247 of file TProfile_LW.cxx.

247 { LWCOUNTCALL;CALL(SetBinError(bin,e),setBinError(bin,e)); }

◆ SetBinInfo()

void TProfile_LW::SetBinInfo ( unsigned  bin,
const double &  entries,
const double &  content,
const double &  error 
)

Definition at line 303 of file TProfile_LW.cxx.

304 {
305  LWCOUNTCALL;
306  if (m_rootHisto) {
307  m_rootHisto->SetBinEntries(bin,entries);
308  m_rootHisto->SetBinContent(bin,content);
309  m_rootHisto->SetBinError(bin,error);
310  } else {
312  }
313 }

◆ setCustomData()

void LWHist::setCustomData ( void *  data)
inlineinherited

Definition at line 69 of file LWHist.h.

69 { m_customData = data; }

◆ SetEntries()

void TProfile_LW::SetEntries ( unsigned  n)
overridevirtual

Implements LWHist.

Definition at line 255 of file TProfile_LW.cxx.

255 { CALL(SetEntries(n),setEntries(n)); }

◆ SetErrorOption()

void TProfile_LW::SetErrorOption ( const char *  option)

Definition at line 194 of file TProfile_LW.cxx.

194 { CALL(SetErrorOption(option),setErrorOptionFromString(option)); }

◆ SetMarkerColor()

void LWHist::SetMarkerColor ( short  c = 1)
inherited

Definition at line 121 of file LWHist.cxx.

122 {
123  TH1 * hroot= getROOTHistBaseNoAlloc();
124  if (hroot) {
125  hroot->SetMarkerColor(c);
126  return;
127  }
129  return;
132 }

◆ SetMarkerSize()

void LWHist::SetMarkerSize ( float  sz = 1)
inherited

Definition at line 150 of file LWHist.cxx.

150  {
151  TH1 * hroot= getROOTHistBaseNoAlloc();
152  if (hroot) {
153  hroot->SetMarkerSize(sz);
154  return;
155  }
157  return;
160 }

◆ SetMarkerStyle()

void LWHist::SetMarkerStyle ( short  s = 1)
inherited

Definition at line 133 of file LWHist.cxx.

134 {
135  TH1 * hroot= getROOTHistBaseNoAlloc();
136  if (hroot) {
137  hroot->SetMarkerStyle(s);
138  assert(GetMarkerStyle()==s);
139  return;
140  }
142  assert(GetMarkerStyle()==s);
143  return;
144  }
147  assert(GetMarkerStyle()==s);
148 }

◆ SetMaximum()

void LWHist::SetMaximum ( const double &  maximum = -1111)
inherited

Definition at line 175 of file LWHist.cxx.

176 {
177  TH1 * hroot= getROOTHistBaseNoAlloc();
178  if (hroot) {
179  hroot->SetMaximum(m);
180  return;
181  }
182  if (!m_decorations&&fabs(m-DEFAULT_MAXIMUM)<1.0e-5)
183  return;
186 }

◆ SetMinimum()

void LWHist::SetMinimum ( const double &  minimum = -1111)
inherited

Definition at line 162 of file LWHist.cxx.

163 {
164  TH1 * hroot= getROOTHistBaseNoAlloc();
165  if (hroot) {
166  hroot->SetMinimum(m);
167  return;
168  }
169  if (!m_decorations&&fabs(m-DEFAULT_MINIMUM)<1.0e-5)
170  return;
173 }

◆ SetName()

void LWHist::SetName ( const char *  n)
inherited

Definition at line 222 of file LWHist.cxx.

223 {
224  TH1 * hroot= getROOTHistBaseNoAlloc();
225  if (hroot) {
226  hroot->SetName(n);
227  return;
228  }
230 }

◆ SetNameTitle()

void LWHist::SetNameTitle ( const char *  name,
const char *  title 
)
inherited

Definition at line 244 of file LWHist.cxx.

245 {
246  TH1 * hroot= getROOTHistBaseNoAlloc();
247  if (hroot) {
248  hroot->SetNameTitle(n,t);
249  return;
250  }
253 }

◆ SetOption()

void LWHist::SetOption ( const char *  option = " ")
inherited

Definition at line 460 of file LWHist.cxx.

461 {
462  TH1 * hroot= getROOTHistBaseNoAlloc();
463  if (hroot) {
464  hroot->SetOption(option);
465  return;
466  }
469 }

◆ setOwnsROOTHisto()

void LWHist::setOwnsROOTHisto ( bool  b)
inlineinherited

Definition at line 75 of file LWHist.h.

75 { m_ownsRootHisto = b; }

◆ setSums()

void TProfile_LW::setSums ( const double &  sumW,
const double &  sumW2,
const double &  sumWX,
const double &  sumWX2,
const double &  sumWY,
const double &  sumWY2 
)

Definition at line 275 of file TProfile_LW.cxx.

278 {
279  if (m_rootHisto) {
280  LWHistRootUtils::setSumW(m_rootHisto,sumW);
281  LWHistRootUtils::setSumW2(m_rootHisto,sumW2);
282  LWHistRootUtils::setSumWX(m_rootHisto,sumWX);
283  LWHistRootUtils::setSumWX2(m_rootHisto,sumWX2);
284  LWHistRootUtils::setSumWY(m_rootHisto,sumWY);
285  LWHistRootUtils::setSumWY2(m_rootHisto,sumWY2);
286  } else {
287  m_flexHisto->setSums(sumW,sumW2,sumWX,sumWX2,sumWY,sumWY2);
288  }
289 }

◆ SetTitle()

void LWHist::SetTitle ( const char *  t)
inherited

Definition at line 233 of file LWHist.cxx.

234 {
235  TH1 * hroot= getROOTHistBaseNoAlloc();
236  if (hroot) {
237  hroot->SetTitle(t);
238  return;
239  }
241 }

◆ SetXTitle()

void LWHist::SetXTitle ( const char *  t)
inherited

Definition at line 431 of file LWHist.cxx.

432 {
433  TH1 * hroot= getROOTHistBaseNoAlloc();
434  if (hroot) {
435  hroot->SetXTitle(t);
436  return;
437  }
438  GetXaxis()->SetTitle(t);
439 }

◆ SetYTitle()

void LWHist::SetYTitle ( const char *  t)
inherited

Definition at line 440 of file LWHist.cxx.

441 {
442  TH1 * hroot= getROOTHistBaseNoAlloc();
443  if (hroot) {
444  hroot->SetYTitle(t);
445  return;
446  }
447  GetYaxis()->SetTitle(t);
448 }

◆ SetZTitle()

void LWHist::SetZTitle ( const char *  t)
inherited

Definition at line 449 of file LWHist.cxx.

450 {
451  TH1 * hroot= getROOTHistBaseNoAlloc();
452  if (hroot) {
453  hroot->SetZTitle(t);
454  return;
455  }
456  GetZaxis()->SetTitle(t);
457 }

◆ usingROOTBackend()

bool LWHist::usingROOTBackend ( ) const
inlineinherited

Definition at line 73 of file LWHist.h.

73 { return m_usingROOTBackend; }

Friends And Related Function Documentation

◆ LWHistInt

friend class LWHistInt
friend

Definition at line 76 of file TProfile_LW.h.

◆ LWHistVal

friend class LWHistVal
friend

Definition at line 77 of file TProfile_LW.h.

Member Data Documentation

◆ m_customData

void* LWHist::m_customData
privateinherited

Definition at line 103 of file LWHist.h.

◆ m_decorations

LWHistDecorations* LWHist::m_decorations
privateinherited

Definition at line 102 of file LWHist.h.

◆ m_flexHisto

Flex1DProfileHisto* TProfile_LW::m_flexHisto
private

Definition at line 100 of file TProfile_LW.h.

◆ m_name

char* LWHist::m_name
privateinherited

Definition at line 99 of file LWHist.h.

◆ m_nBytesFromPool

unsigned short LWHist::m_nBytesFromPool
protectedinherited

Definition at line 91 of file LWHist.h.

◆ m_ownsRootHisto

bool LWHist::m_ownsRootHisto
privateinherited

Definition at line 95 of file LWHist.h.

◆ m_rootHisto

TProfile* TProfile_LW::m_rootHisto
private

Definition at line 101 of file TProfile_LW.h.

◆ m_title

char* LWHist::m_title
privateinherited

Definition at line 100 of file LWHist.h.

◆ m_usingROOTBackend

const bool LWHist::m_usingROOTBackend
privateinherited

Definition at line 94 of file LWHist.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
LWHist::GetZaxis
LWHistAxis * GetZaxis()
Definition: LWHist.cxx:328
TProfile_LW::m_rootHisto
TProfile * m_rootHisto
Definition: TProfile_LW.h:101
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
Flex1DProfileHisto::getSumWProfPar2
double getSumWProfPar2() const
Definition: Flex1DProfileHisto.h:72
fitman.sz
sz
Definition: fitman.py:527
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
TProfile_LW::GetBinContent
double GetBinContent(unsigned bin) const
Definition: TProfile_LW.cxx:243
LWHist::m_ownsRootHisto
bool m_ownsRootHisto
Definition: LWHist.h:95
TProfile_LW::actualcreate
static TProfile_LW * actualcreate(const char *name, const char *title, unsigned nbinsx, const double &xlow, const double &xup, const double &ylow, const double &yup, const float *xbins_flt, const double *xbins_dbl, const char *option)
Definition: TProfile_LW.cxx:67
TProfile_LW::clearKeptROOTHist
virtual void clearKeptROOTHist() override
Definition: TProfile_LW.cxx:166
integral
double integral(TH1 *h)
Definition: computils.cxx:57
LWHist::ensureInitDecorations
void ensureInitDecorations()
Definition: LWHist.cxx:90
Flex1DProfileHisto::getSumW2
double getSumW2() const
Definition: Flex1DProfileHisto.h:68
DEFAULT_MAXIMUM
#define DEFAULT_MAXIMUM
Definition: LWHist.cxx:52
Flex1DProfileHisto::reset
void reset()
Flex1DProfileHisto::valueToBin
unsigned valueToBin(const double &x) const
TProfile_LW::GetNbinsX
unsigned GetNbinsX() const
Definition: TProfile_LW.cxx:241
TProfile_LW::GetBinError
double GetBinError(unsigned bin) const
Definition: TProfile_LW.cxx:244
TProfile_LW::SetBinContent
void SetBinContent(unsigned bin, const double &)
Definition: TProfile_LW.cxx:246
Flex1DProfileHisto::create
static Flex1DProfileHisto * create(unsigned nbins, const double &xmin, const double &xmax, const double &profparmin, const double &profparmax)
LWCOUNTCALL
#define LWCOUNTCALL
Definition: TProfile_LW.cxx:27
LWHist::GetMarkerSize
float GetMarkerSize() const
Definition: LWHist.cxx:113
Flex1DProfileHisto::getSumWX
double getSumWX() const
Definition: Flex1DProfileHisto.h:69
CALL
#define CALL(x, y)
Definition: TProfile_LW.cxx:22
bin
Definition: BinsDiffFromStripMedian.h:43
LWStrUtils::stringsEqual
static bool stringsEqual(const char *c1, const char *c2)
Definition: LWStrUtils.h:79
LWPools::release
static void release(char *, unsigned length)
LWHist::ownsROOTHisto
bool ownsROOTHisto() const
Definition: LWHist.h:74
TProfile_LW::getROOTHist
TProfile * getROOTHist()
Definition: TProfile_LW.cxx:140
DEFAULT_MINIMUM
#define DEFAULT_MINIMUM
Definition: LWHist.cxx:51
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DEFAULT_MARKERSIZE
#define DEFAULT_MARKERSIZE
Definition: LWHist.cxx:48
TProfile_LW::SetBinEntries
void SetBinEntries(unsigned bin, const double &)
Definition: TProfile_LW.cxx:245
LWHist::LWHistDecorations::m_markerStyle
short m_markerStyle
Definition: LWHist.cxx:81
TProfile_LW::SetEntries
virtual void SetEntries(unsigned) override
Definition: TProfile_LW.cxx:255
trigbs_dumpHLTContentInBS.stats
stats
Definition: trigbs_dumpHLTContentInBS.py:91
TProfile_LW
Definition: TProfile_LW.h:24
LWHist::LWHistDecorations::m_xAxis
LWHist::LWHistAxis * m_xAxis
Definition: LWHist.cxx:74
LWHistRootUtils::createRootProfileHisto
TProfile * createRootProfileHisto(TProfile_LW *lwhist, Flex1DProfileHisto *flexHist)
x
#define x
LWHist::LWHistDecorations::m_yAxis
LWHist::LWHistAxis * m_yAxis
Definition: LWHist.cxx:75
LWHist::GetMarkerColor
short GetMarkerColor() const
Definition: LWHist.cxx:96
TProfile_LW::getSums
void getSums(double &sumW, double &sumW2, double &sumWX, double &sumWX2, double &sumWY, double &sumWY2) const
Definition: TProfile_LW.cxx:257
LWHist::GetXaxis
LWHistAxis * GetXaxis()
Definition: LWHist.cxx:309
grepfile.content
string content
Definition: grepfile.py:56
LWHist::usingROOTBackend
bool usingROOTBackend() const
Definition: LWHist.h:73
Flex1DProfileHisto::getXMax
double getXMax() const
Definition: Flex1DProfileHisto.h:41
LWHist::GetTitle
const char * GetTitle() const
Definition: LWHist.cxx:372
Flex1DProfileHisto::getXMin
double getXMin() const
Definition: Flex1DProfileHisto.h:40
Flex1DProfileHisto::fill
void fill(const double &x, const double &profiledpar)
Flex1DProfileHisto::getSumW
double getSumW() const
Definition: Flex1DProfileHisto.h:67
LWHist::LWHistDecorations::m_markerColor
short m_markerColor
Definition: LWHist.cxx:80
LWHist::m_customData
void * m_customData
Definition: LWHist.h:103
MP_NEW
#define MP_NEW(Class)
Definition: LWPools.h:26
LWHist::LWHistAxis::m_title
char * m_title
Definition: LWHist.h:133
LWHist::LWHistAxis::SetTitle
void SetTitle(const char *)
Definition: LWHist.cxx:359
TProfile_LW::GetErrorOption
const char * GetErrorOption() const
Definition: TProfile_LW.cxx:195
TProfile_LW::SetBinError
void SetBinError(unsigned bin, const double &)
Definition: TProfile_LW.cxx:247
python.TrigEgammaMonitorHelper.TProfile
def TProfile(*args, **kwargs)
Definition: TrigEgammaMonitorHelper.py:81
beamspotman.n
n
Definition: beamspotman.py:731
Flex1DProfileHisto::setSums
void setSums(const double &sumW, const double &sumW2, const double &sumWX, const double &sumWX2, const double &sumWProfPar, const double &sumWProfPar2)
extractSporadic.h
list h
Definition: extractSporadic.py:97
covarianceTool.title
title
Definition: covarianceTool.py:542
LWHist::LWHist
LWHist(const char *name, const char *title, bool rootbackend)
Definition: LWHist.cxx:189
LWHistControls::hasROOTBackend
static bool hasROOTBackend()
Definition: LWHistControls.cxx:47
LWHist::m_name
char * m_name
Definition: LWHist.h:99
Flex1DProfileHisto::getVarBins
const float * getVarBins() const
Definition: Flex1DProfileHisto.h:42
LWREPORT
#define LWREPORT
Definition: TProfile_LW.cxx:28
LWHist::LWHistDecorations::m_minimum
float m_minimum
Definition: LWHist.cxx:77
DEFAULT_MARKERSTYLE
#define DEFAULT_MARKERSTYLE
Definition: LWHist.cxx:50
LWStrUtils::setStringFromInput
static void setStringFromInput(const char *input, char *&target)
Definition: LWStrUtils.h:58
LWHist::m_usingROOTBackend
const bool m_usingROOTBackend
Definition: LWHist.h:94
Flex1DProfileHisto::getBinCenter
double getBinCenter(int bin) const
LWHistControls::cleanupOnGetROOT
static bool cleanupOnGetROOT()
Definition: LWHistControls.cxx:35
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
LWHistControls::releaseAllHeldMemory
static void releaseAllHeldMemory()
Definition: LWHistControls.cxx:41
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
Flex1DProfileHisto::destroy
static void destroy(Flex1DProfileHisto *)
LWHist::clear
virtual void clear()
Definition: LWHist.cxx:474
TProfile
Definition: rootspy.cxx:515
LWHist::m_title
char * m_title
Definition: LWHist.h:100
Flex1DProfileHisto::setErrorOptionFromString
void setErrorOptionFromString(const char *option)
Definition: Flex1DProfileHisto.h:62
LArCellBinning.xbins
int xbins
Definition: LArCellBinning.py:163
Flex1DProfileHisto::getEntries
unsigned getEntries() const
Flex1DProfileHisto::getSumWProfPar
double getSumWProfPar() const
Definition: Flex1DProfileHisto.h:71
TProfile_LW::SetErrorOption
void SetErrorOption(const char *option)
Definition: TProfile_LW.cxx:194
LWHist::LWHistAxis::m_labelSize
float m_labelSize
Definition: LWHist.h:132
TProfile_LW::GetBinEntries
double GetBinEntries(unsigned bin) const
Definition: TProfile_LW.cxx:242
a
TList * a
Definition: liststreamerinfos.cxx:10
y
#define y
h
TProfile::Fill
int Fill(double, double)
Definition: rootspy.cxx:523
DEFAULT_MARKERCOLOR
#define DEFAULT_MARKERCOLOR
Definition: LWHist.cxx:49
LWHist::LWHistDecorations::m_markerSize
float m_markerSize
Definition: LWHist.cxx:79
LWHist::apply
virtual bool apply(TH1 *) const
Definition: LWHist.cxx:256
Flex1DProfileHisto::getSumWX2
double getSumWX2() const
Definition: Flex1DProfileHisto.h:70
TH1
Definition: rootspy.cxx:268
LWHist::getROOTHistBaseNoAlloc
virtual const TH1 * getROOTHistBaseNoAlloc() const =0
LWHist::LWHistDecorations::m_zAxis
LWHist::LWHistAxis * m_zAxis
Definition: LWHist.cxx:76
LWHist::LWHistDecorations::m_maximum
float m_maximum
Definition: LWHist.cxx:78
Flex1DProfileHisto::getBinInfo
void getBinInfo(unsigned bin, double &entries, double &content, double &error) const
LWHist::m_decorations
LWHistDecorations * m_decorations
Definition: LWHist.h:101
entries
double entries
Definition: listroot.cxx:49
Flex1DProfileHisto::setBinInfo
void setBinInfo(unsigned bin, const double &entries, const double &content, const double &error)
TProfile_LW::TProfile_LW
TProfile_LW(const char *name, const char *title, unsigned nbinsx, const double &xlow, const double &xup, const double &ylow, const double &yup, const float *xbins_flt, const double *xbins_dbl, const char *option, bool rootbackend)
Definition: TProfile_LW.cxx:84
TProfile_LW::m_flexHisto
Flex1DProfileHisto * m_flexHisto
Definition: TProfile_LW.h:100
LWHist::LWHistAxis::m_binLabels
LWBinLabels * m_binLabels
Definition: LWHist.h:134
TProfile_LW::clear
virtual void clear() override
Definition: TProfile_LW.cxx:157
LWHist::GetMarkerStyle
short GetMarkerStyle() const
Definition: LWHist.cxx:105
LWHistRootUtils::deleteProfileHisto
void deleteProfileHisto(TProfileX *rootHist)
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
LWBinLabels::apply
void apply(TAxis *) const
Definition: LWBinLabels.cxx:38
error
Definition: IImpactPoint3dEstimator.h:70
python.compressB64.c
def c
Definition: compressB64.py:93
LWHist::GetYaxis
LWHistAxis * GetYaxis()
Definition: LWHist.cxx:319
LWHistStats::s_nActiveHists
static std::atomic< long > s_nActiveHists
Definition: LWHistStats.h:36
TProfile::GetBinContent
double GetBinContent(int) const
Definition: rootspy.cxx:527
TProfile_LW::Integral
virtual double Integral() const override
Definition: TProfile_LW.cxx:290
LWHist::LWHistDecorations::m_option
char * m_option
Definition: LWHist.cxx:73