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

#include <TH1I_LW.h>

Inheritance diagram for TH1I_LW:
Collaboration diagram for TH1I_LW:

Public Types

typedef int bin_type_t
 

Public Member Functions

virtual void Fill (const double &x) override
 
virtual void Fill (const double &x, const double &w) override
 
virtual unsigned GetNbinsX () const override
 
virtual double GetBinContent (unsigned bin) const override
 
virtual double GetBinError (unsigned bin) const override
 
virtual void SetBinContent (unsigned bin, const double &) override
 
virtual void SetBinError (unsigned bin, const double &) override
 
virtual unsigned GetEntries () const override
 
virtual void SetEntries (unsigned) override
 
virtual void SetBins (unsigned nbins, double xmin, double xmax) override
 
virtual void Reset () override
 
virtual double getXMin () const override
 
virtual double getXMax () const override
 
virtual void GetBinContentAndError (unsigned bin, double &content, double &error) const override
 
virtual void SetBinContentAndError (unsigned bin, const double &content, const double &error) override
 
virtual void getSums (double &sumW, double &sumW2, double &sumWX, double &sumWX2) const override
 
virtual void setSums (const double &sumW, const double &sumW2, const double &sumWX, const double &sumWX2) override
 
TH1IgetROOTHist ()
 
virtual TH1getROOTHistBase () override
 
virtual double Integral () const override
 
virtual void resetActiveBinLoop () override
 
virtual bool getNextActiveBin (unsigned &bin, double &content, double &error) override
 
virtual void scaleContentsAndErrors (const double &fact) 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 TH1I_LWcreate (const char *name, const char *title, unsigned nbinsx, const double &xlow, const double &xup)
 
static TH1I_LWcreate (const char *name, const char *title, unsigned nbinsx, const double *xbins)
 
static TH1I_LWcreate (const char *name, const char *title, unsigned nbinsx, const float *xbins)
 
static void safeDelete (LWHist *)
 

Protected Member Functions

virtual bool apply (TH1 *) const
 
virtual double actualGetBinCenterY (int) const
 
virtual unsigned actualFindBinY (const double &) const
 
virtual unsigned actualGetNBinsX () const
 
virtual unsigned actualGetNBinsY () const
 

Protected Attributes

unsigned short m_nBytesFromPool
 

Private Member Functions

virtual void clear () override
 
virtual unsigned actualFindBinX (const double &) const override
 
virtual double actualGetBinCenterX (int bin) const override
 
virtual const TH1getROOTHistBaseNoAlloc () const override
 
virtual TH1getROOTHistBaseNoAlloc () override
 
virtual void clearKeptROOTHist () override
 
const float * getVarBins () const
 
float * getVarBins ()
 
 TH1I_LW (const char *name, const char *title, unsigned nbinsx, const double &xlow, const double &xup, bool rootbackend)
 
 TH1I_LW (const char *name, const char *title, unsigned nbinsx, const double *xbins, bool rootbackend)
 
 TH1I_LW (const char *name, const char *title, unsigned nbinsx, const float *xbins, bool rootbackend)
 
virtual ~TH1I_LW ()
 
 TH1I_LW (const TH1I_LW &)
 
TH1I_LWoperator= (const TH1I_LW &)
 
void ensureInitDecorations ()
 

Private Attributes

void * m_flexHisto
 
TH1Im_rootHisto
 
unsigned m_rootbackend_fastloopbin
 
bool m_ownsRootSumw2
 
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 23 of file TH1I_LW.h.

Member Typedef Documentation

◆ bin_type_t

typedef int TH1I_LW::bin_type_t

Definition at line 25 of file TH1I_LW.h.

Constructor & Destructor Documentation

◆ TH1I_LW() [1/4]

TH1I_LW::TH1I_LW ( const char *  name,
const char *  title,
unsigned  nbinsx,
const double &  xlow,
const double &  xup,
bool  rootbackend 
)
private

Definition at line 76 of file TH1I_LW.cxx.

81  : LWHist1D(name,title,rootbackend),
82  m_flexHisto(0),
83  m_rootHisto(0),
85  m_ownsRootSumw2(false)
86 {
87  if (rootbackend) {
89  } else {
91  }
92 }

◆ TH1I_LW() [2/4]

TH1I_LW::TH1I_LW ( const char *  name,
const char *  title,
unsigned  nbinsx,
const double *  xbins,
bool  rootbackend 
)
private

Definition at line 95 of file TH1I_LW.cxx.

97  : LWHist1D(name,title,rootbackend),
98  m_flexHisto(0),
99  m_rootHisto(0),
101  m_ownsRootSumw2(false)
102 {
103  if (rootbackend) {
105  } else {
107  }
108 }

◆ TH1I_LW() [3/4]

TH1I_LW::TH1I_LW ( const char *  name,
const char *  title,
unsigned  nbinsx,
const float *  xbins,
bool  rootbackend 
)
private

Definition at line 111 of file TH1I_LW.cxx.

113  : LWHist1D(name,title,rootbackend),
114  m_flexHisto(0),
115  m_rootHisto(0),
117  m_ownsRootSumw2(false)
118 {
119  if (rootbackend) {
121  } else {
123  }
124 }

◆ ~TH1I_LW()

TH1I_LW::~TH1I_LW ( )
privatevirtual

Definition at line 127 of file TH1I_LW.cxx.

128 {
130  clear();
131  if (ownsROOTHisto())
132  delete m_rootHisto;//for root backend
133 }

◆ TH1I_LW() [4/4]

TH1I_LW::TH1I_LW ( const TH1I_LW )
private

Member Function Documentation

◆ actualFindBinX()

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

Implements LWHist.

Definition at line 315 of file TH1I_LW.cxx.

316 {
317  assert(!m_rootHisto);//Should have called the TAxis method
318  return FLEXHIST()->valueToBin(x);
319 }

◆ actualFindBinY()

virtual unsigned LWHist1D::actualFindBinY ( const double &  ) const
inlineprotectedvirtualinherited

Implements LWHist.

Definition at line 66 of file LWHist1D.h.

66 { return 0; }

◆ actualGetBinCenterX()

double TH1I_LW::actualGetBinCenterX ( int  bin) const
overrideprivatevirtual

Implements LWHist.

Definition at line 305 of file TH1I_LW.cxx.

306 {
307  assert(!m_rootHisto);//Should have called the TAxis method
308  if (m_rootHisto) {
309  assert(false);
310  return 0;
311  }
312  return FLEXHIST()->getBinCenter(bin);
313 }

◆ actualGetBinCenterY()

virtual double LWHist1D::actualGetBinCenterY ( int  ) const
inlineprotectedvirtualinherited

Implements LWHist.

Definition at line 65 of file LWHist1D.h.

65 { return 0; }

◆ actualGetNBinsX()

virtual unsigned LWHist1D::actualGetNBinsX ( ) const
inlineprotectedvirtualinherited

Implements LWHist.

Definition at line 67 of file LWHist1D.h.

67 { return GetNbinsX(); }

◆ actualGetNBinsY()

virtual unsigned LWHist1D::actualGetNBinsY ( ) const
inlineprotectedvirtualinherited

Implements LWHist.

Definition at line 68 of file LWHist1D.h.

68 { return 0; }

◆ apply()

bool LWHist1D::apply ( TH1 h) const
protectedvirtualinherited

Reimplemented from LWHist.

Definition at line 20 of file LWHist1D.cxx.

21 {
22  if (!LWHist::apply(h))
23  return false;
24  double stats[4];
25  getSums(stats[0],stats[1],stats[2],stats[3]);
26  h->PutStats(stats);
27  return true;
28 }

◆ clear()

void TH1I_LW::clear ( )
overrideprivatevirtual

Reimplemented from LWHist.

Definition at line 159 of file TH1I_LW.cxx.

160 {
161  LWREPORT
162  LWHist::clear();
164  m_flexHisto = 0;
165 }

◆ clearKeptROOTHist()

void TH1I_LW::clearKeptROOTHist ( )
overrideprivatevirtual

Implements LWHist.

Definition at line 168 of file TH1I_LW.cxx.

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

◆ create() [1/3]

TH1I_LW * TH1I_LW::create ( const char *  name,
const char *  title,
unsigned  nbinsx,
const double &  xlow,
const double &  xup 
)
static

Definition at line 33 of file TH1I_LW.cxx.

35 {
36  bool rootbackend(LWHistControls::hasROOTBackend());
37  TH1I_LW * h;
38  if (rootbackend) {
39  h = new TH1I_LW (name,title,nbinsx,xlow,xup,rootbackend);
40  } else {
41  h = MP_NEW(TH1I_LW)(name,title,nbinsx,xlow,xup,rootbackend);
42  h->m_nBytesFromPool = sizeof(TH1I_LW);
43  }
44  return h;
45 }

◆ create() [2/3]

TH1I_LW * TH1I_LW::create ( const char *  name,
const char *  title,
unsigned  nbinsx,
const double *  xbins 
)
static

Definition at line 48 of file TH1I_LW.cxx.

49 {
50  bool rootbackend(LWHistControls::hasROOTBackend());
51  TH1I_LW * h;
52  if (rootbackend) {
53  h = new TH1I_LW(name,title,nbinsx,xbins,rootbackend);
54  } else {
55  h = MP_NEW(TH1I_LW)(name,title,nbinsx,xbins,rootbackend);
56  h->m_nBytesFromPool = sizeof(TH1I_LW);
57  }
58  return h;
59 }

◆ create() [3/3]

TH1I_LW * TH1I_LW::create ( const char *  name,
const char *  title,
unsigned  nbinsx,
const float *  xbins 
)
static

Definition at line 62 of file TH1I_LW.cxx.

63 {
64  bool rootbackend(LWHistControls::hasROOTBackend());
65  TH1I_LW * h;
66  if (rootbackend) {
67  h = new TH1I_LW(name,title,nbinsx,xbins,rootbackend);
68  } else {
69  h = MP_NEW(TH1I_LW)(name,title,nbinsx,xbins,rootbackend);
70  h->m_nBytesFromPool = sizeof(TH1I_LW);
71  }
72  return h;
73 }

◆ 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 TH1I_LW::Fill ( const double &  x)
overridevirtual

Implements LWHist1D.

Definition at line 246 of file TH1I_LW.cxx.

247 {
249  if (m_rootHisto)
250  m_rootHisto->Fill(x);
251  else
252  FLEXHIST()->fill(x);
253 }

◆ Fill() [2/2]

void TH1I_LW::Fill ( const double &  x,
const double &  w 
)
overridevirtual

Implements LWHist1D.

Definition at line 255 of file TH1I_LW.cxx.

256 {
258  if (m_rootHisto)
259  m_rootHisto->Fill(x,w);
260  else
261  FLEXHIST()->fill(x,w);
262 }

◆ GetBinContent()

double TH1I_LW::GetBinContent ( unsigned  bin) const
overridevirtual

Implements LWHist1D.

Definition at line 265 of file TH1I_LW.cxx.

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

◆ GetBinContentAndError()

void TH1I_LW::GetBinContentAndError ( unsigned  bin,
double &  content,
double &  error 
) const
overridevirtual

Implements LWHist1D.

Definition at line 348 of file TH1I_LW.cxx.

349 {
351  if (m_rootHisto) {
353  error = m_rootHisto->GetBinError(bin);
354  } else {
355  FLEXHIST()->getBinContentAndError(bin,content,error);
356  }
357 }

◆ GetBinError()

double TH1I_LW::GetBinError ( unsigned  bin) const
overridevirtual

Implements LWHist1D.

Definition at line 266 of file TH1I_LW.cxx.

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

◆ 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 TH1I_LW::GetEntries ( ) const
overridevirtual

Implements LWHist.

Definition at line 269 of file TH1I_LW.cxx.

270 {
271  if (m_rootHisto)
272  return static_cast<unsigned>(m_rootHisto->GetEntries());
273  else
274  return FLEXHIST()->getEntries();
275 }

◆ 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 TH1I_LW::GetNbinsX ( ) const
overridevirtual

Implements LWHist1D.

Definition at line 264 of file TH1I_LW.cxx.

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

◆ getNextActiveBin()

bool TH1I_LW::getNextActiveBin ( unsigned &  bin,
double &  content,
double &  error 
)
overridevirtual

Implements LWHist1D.

Definition at line 330 of file TH1I_LW.cxx.

330  {
331  if (m_rootHisto) {
332  unsigned n(GetNbinsX()+2);
333  assert(m_rootbackend_fastloopbin<n+1);
338  if (content!=0.0||error!=0.0) {
340  return true;
341  }
342  }
343  return false;
344  }
345  assert(m_rootbackend_fastloopbin==UINT_MAX);
346  return FLEXHIST()->getNextActiveBin(bin, content, error);
347 }

◆ getROOTHist()

TH1I * TH1I_LW::getROOTHist ( )

Definition at line 145 of file TH1I_LW.cxx.

146 {
147  if (!m_rootHisto) {
148  TH1I* h = LWHistRootUtils::createRootHisto<int,TH1I_LW,TH1I,Flex1DHisto<int> >(this,FLEXHIST(),m_ownsRootSumw2);
149  if (!apply(h))
150  assert(false);
152  clear();
153  m_rootHisto = h;
154  }
155  return m_rootHisto;
156 }

◆ getROOTHistBase()

TH1 * TH1I_LW::getROOTHistBase ( )
overridevirtual

Implements LWHist.

Definition at line 144 of file TH1I_LW.cxx.

144 { return getROOTHist(); }

◆ getROOTHistBaseNoAlloc() [1/2]

const TH1 * TH1I_LW::getROOTHistBaseNoAlloc ( ) const
overrideprivatevirtual

Implements LWHist.

Definition at line 136 of file TH1I_LW.cxx.

137 {
138  return m_rootHisto;
139 }

◆ getROOTHistBaseNoAlloc() [2/2]

TH1 * TH1I_LW::getROOTHistBaseNoAlloc ( )
overrideprivatevirtual

Implements LWHist.

Definition at line 140 of file TH1I_LW.cxx.

141 {
142  return m_rootHisto;
143 }

◆ getSums()

void TH1I_LW::getSums ( double &  sumW,
double &  sumW2,
double &  sumWX,
double &  sumWX2 
) const
overridevirtual

Implements LWHist1D.

Definition at line 279 of file TH1I_LW.cxx.

281 {
282  if (m_rootHisto) {
283  sumW = LWHistRootUtils::getSumW(m_rootHisto);
284  sumW2 = LWHistRootUtils::getSumW2(m_rootHisto);
285  sumWX = LWHistRootUtils::getSumWX(m_rootHisto);
286  sumWX2 = LWHistRootUtils::getSumWX2(m_rootHisto);
287  } else {
288  sumW = FLEXHIST()->getSumW(); sumW2 = FLEXHIST()->getSumW2();
289  sumWX = FLEXHIST()->getSumWX(); sumWX2 = FLEXHIST()->getSumWX2();
290  }
291 }

◆ 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 * TH1I_LW::getVarBins ( )
private

Definition at line 223 of file TH1I_LW.cxx.

224 {
225  if (m_rootHisto) {
226  assert(false);
227  return 0;
228  }
229  return FLEXHIST()->getVarBins();
230 }

◆ getVarBins() [2/2]

const float * TH1I_LW::getVarBins ( ) const
private

Definition at line 214 of file TH1I_LW.cxx.

215 {
216  if (m_rootHisto) {
217  assert(false);
218  return 0;
219  }
220  return std::as_const(*FLEXHIST()).getVarBins();
221 }

◆ 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 TH1I_LW::getXMax ( ) const
overridevirtual

Implements LWHist1D.

Definition at line 239 of file TH1I_LW.cxx.

240 {
241  if (m_rootHisto)
242  return std::as_const(*m_rootHisto).GetXaxis()->GetXmax();
243  return FLEXHIST()->getXMax();
244 }

◆ getXMin()

double TH1I_LW::getXMin ( ) const
overridevirtual

Implements LWHist1D.

Definition at line 232 of file TH1I_LW.cxx.

233 {
234  if (m_rootHisto)
235  return std::as_const(*m_rootHisto).GetXaxis()->GetXmin();
236  return FLEXHIST()->getXMin();
237 }

◆ 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 TH1I_LW::Integral ( ) const
overridevirtual

Implements LWHist.

Definition at line 321 of file TH1I_LW.cxx.

321 { return CALL(Integral(),Integral()); }

◆ operator=()

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

◆ ownsROOTHisto()

bool LWHist::ownsROOTHisto ( ) const
inlineinherited

Definition at line 74 of file LWHist.h.

74 { return m_ownsRootHisto; }

◆ Reset()

void TH1I_LW::Reset ( )
overridevirtual

Implements LWHist.

Definition at line 183 of file TH1I_LW.cxx.

184 {
185  if (m_rootHisto) {
186  m_rootHisto->Reset();
187  return;
188  }
189  if (m_flexHisto) {
190  LWREPORT
191  const float * xbins = FLEXHIST()->getVarBins();
192  double xmin(FLEXHIST()->getXMin()),xmax(FLEXHIST()->getXMax());
193  unsigned nbins(FLEXHIST()->getNBins());
196 
197  }
198 }

◆ resetActiveBinLoop()

void TH1I_LW::resetActiveBinLoop ( )
overridevirtual

Implements LWHist1D.

Definition at line 322 of file TH1I_LW.cxx.

322  {
323  if (m_rootHisto) {
325  return;
326  }
327  m_rootbackend_fastloopbin=UINT_MAX;
328  FLEXHIST()->resetActiveBinLoop();
329 }

◆ 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 }

◆ scaleContentsAndErrors()

void TH1I_LW::scaleContentsAndErrors ( const double &  fact)
overridevirtual

Implements LWHist1D.

Definition at line 370 of file TH1I_LW.cxx.

371 {
372  //Treated like changing unit on the weights.
373  if (m_rootHisto) {
375  double sumW, sumW2, sumWX, sumWX2;
376  getSums(sumW, sumW2, sumWX, sumWX2);
377  setSums(fact*sumW, sumW2*fact*fact, sumWX*fact, sumWX2*fact);
378  return;
379  }
380  FLEXHIST()->scaleContentsAndErrors(fact);
381 }

◆ SetBinContent()

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

Implements LWHist1D.

Definition at line 267 of file TH1I_LW.cxx.

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

◆ SetBinContentAndError()

void TH1I_LW::SetBinContentAndError ( unsigned  bin,
const double &  content,
const double &  error 
)
overridevirtual

Implements LWHist1D.

Definition at line 359 of file TH1I_LW.cxx.

360 {
362  if (m_rootHisto) {
364  m_rootHisto->SetBinError(bin,error);
365  } else {
366  FLEXHIST()->setBinContentAndError(bin,content,error);
367  }
368 }

◆ SetBinError()

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

Implements LWHist1D.

Definition at line 268 of file TH1I_LW.cxx.

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

◆ SetBins()

void TH1I_LW::SetBins ( unsigned  nbins,
double  xmin,
double  xmax 
)
overridevirtual

Implements LWHist1D.

Definition at line 201 of file TH1I_LW.cxx.

202 {
203  if (GetEntries())
204  std::cout<<"TH1I_LW Warning: SetBins(..) called on non-empty histogram."
205  <<" Bin contents lost/reshuffled! (histogram name: \""<<GetName()<<"\")"<<std::endl;
206  if (m_rootHisto) {
207  m_rootHisto->SetBins(nbins,xmin,xmax);
208  } else {
211  }
212 }

◆ setCustomData()

void LWHist::setCustomData ( void *  data)
inlineinherited

Definition at line 69 of file LWHist.h.

69 { m_customData = data; }

◆ SetEntries()

void TH1I_LW::SetEntries ( unsigned  n)
overridevirtual

Implements LWHist.

Definition at line 276 of file TH1I_LW.cxx.

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

◆ 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 TH1I_LW::setSums ( const double &  sumW,
const double &  sumW2,
const double &  sumWX,
const double &  sumWX2 
)
overridevirtual

Implements LWHist1D.

Definition at line 293 of file TH1I_LW.cxx.

294 {
295  if (m_rootHisto) {
296  LWHistRootUtils::setSumW(m_rootHisto,sumW);
297  LWHistRootUtils::setSumW2(m_rootHisto,sumW2);
298  LWHistRootUtils::setSumWX(m_rootHisto,sumWX);
299  LWHistRootUtils::setSumWX2(m_rootHisto,sumWX2);
300  } else {
301  FLEXHIST()->setSums(sumW,sumW2,sumWX,sumWX2);
302  }
303 }

◆ 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 67 of file TH1I_LW.h.

◆ LWHistVal

friend class LWHistVal
friend

Definition at line 68 of file TH1I_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

void* TH1I_LW::m_flexHisto
private

Definition at line 87 of file TH1I_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_ownsRootSumw2

bool TH1I_LW::m_ownsRootSumw2
private

Definition at line 90 of file TH1I_LW.h.

◆ m_rootbackend_fastloopbin

unsigned TH1I_LW::m_rootbackend_fastloopbin
private

Definition at line 89 of file TH1I_LW.h.

◆ m_rootHisto

TH1I* TH1I_LW::m_rootHisto
private

Definition at line 88 of file TH1I_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:
LWHistRootUtils::scaleContentsAndErrors
void scaleContentsAndErrors(THX *, const double &fact)
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
LWHist::GetZaxis
LWHistAxis * GetZaxis()
Definition: LWHist.cxx:328
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
fitman.sz
sz
Definition: fitman.py:527
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
LWHist::m_ownsRootHisto
bool m_ownsRootHisto
Definition: LWHist.h:95
TH1I_LW::GetBinError
virtual double GetBinError(unsigned bin) const override
Definition: TH1I_LW.cxx:266
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
LWHist::ensureInitDecorations
void ensureInitDecorations()
Definition: LWHist.cxx:90
DEFAULT_MAXIMUM
#define DEFAULT_MAXIMUM
Definition: LWHist.cxx:52
TH1I
Definition: rootspy.cxx:332
TH1I_LW
Definition: TH1I_LW.h:23
TH1I_LW::m_rootHisto
TH1I * m_rootHisto
Definition: TH1I_LW.h:88
TH1I_LW::create
static TH1I_LW * create(const char *name, const char *title, unsigned nbinsx, const double &xlow, const double &xup)
Definition: TH1I_LW.cxx:33
bin
Definition: BinsDiffFromStripMedian.h:43
TH1I_LW::GetBinContent
virtual double GetBinContent(unsigned bin) const override
Definition: TH1I_LW.cxx:265
LWPools::release
static void release(char *, unsigned length)
LWHist::ownsROOTHisto
bool ownsROOTHisto() const
Definition: LWHist.h:74
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
TH1I_LW::getROOTHist
TH1I * getROOTHist()
Definition: TH1I_LW.cxx:145
LWHist::LWHistDecorations::m_markerStyle
short m_markerStyle
Definition: LWHist.cxx:81
TH1I_LW::GetEntries
virtual unsigned GetEntries() const override
Definition: TH1I_LW.cxx:269
TH1I_LW::m_ownsRootSumw2
bool m_ownsRootSumw2
Definition: TH1I_LW.h:90
trigbs_dumpHLTContentInBS.stats
stats
Definition: trigbs_dumpHLTContentInBS.py:91
LWHist::LWHistDecorations::m_xAxis
LWHist::LWHistAxis * m_xAxis
Definition: LWHist.cxx:74
x
#define x
LWCOUNTCALL
#define LWCOUNTCALL
Definition: TH1I_LW.cxx:28
LWHist::LWHistDecorations::m_yAxis
LWHist::LWHistAxis * m_yAxis
Definition: LWHist.cxx:75
LWHist::GetXaxis
LWHistAxis * GetXaxis()
Definition: LWHist.cxx:309
SCT_CalibAlgs::nbins
@ nbins
Definition: SCT_CalibNumbers.h:10
grepfile.content
string content
Definition: grepfile.py:56
LWHist::usingROOTBackend
bool usingROOTBackend() const
Definition: LWHist.h:73
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::SetTitle
void SetTitle(const char *)
Definition: LWHist.cxx:359
TH1I_LW::TH1I_LW
TH1I_LW(const char *name, const char *title, unsigned nbinsx, const double &xlow, const double &xup, bool rootbackend)
Definition: TH1I_LW.cxx:76
xmin
double xmin
Definition: listroot.cxx:60
beamspotman.n
n
Definition: beamspotman.py:731
TH1I_LW::clear
virtual void clear() override
Definition: TH1I_LW.cxx:159
Flex1DHisto
Definition: Flex1DHisto.h:37
extractSporadic.h
list h
Definition: extractSporadic.py:97
TH1I_LW::clearKeptROOTHist
virtual void clearKeptROOTHist() override
Definition: TH1I_LW.cxx:168
covarianceTool.title
title
Definition: covarianceTool.py:542
FLEXHIST
#define FLEXHIST()
Definition: TH1I_LW.cxx:22
TH1I_LW::m_rootbackend_fastloopbin
unsigned m_rootbackend_fastloopbin
Definition: TH1I_LW.h:89
LWHist::GetName
const char * GetName() const
Definition: LWHist.cxx:366
TH1I_LW::setSums
virtual void setSums(const double &sumW, const double &sumW2, const double &sumWX, const double &sumWX2) override
Definition: TH1I_LW.cxx:293
LWHistControls::hasROOTBackend
static bool hasROOTBackend()
Definition: LWHistControls.cxx:47
LWREPORT
#define LWREPORT
Definition: TH1I_LW.cxx:29
LWHist::m_name
char * m_name
Definition: LWHist.h:99
Flex1DHisto::destroy
static void destroy(Flex1DHisto *)
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
TH1I_LW::getXMax
virtual double getXMax() const override
Definition: TH1I_LW.cxx:239
LWHistControls::cleanupOnGetROOT
static bool cleanupOnGetROOT()
Definition: LWHistControls.cxx:35
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
LWHistControls::releaseAllHeldMemory
static void releaseAllHeldMemory()
Definition: LWHistControls.cxx:41
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
CALL
#define CALL(x, y)
Definition: TH1I_LW.cxx:23
LWHist::clear
virtual void clear()
Definition: LWHist.cxx:474
TH1I_LW::getXMin
virtual double getXMin() const override
Definition: TH1I_LW.cxx:232
LWHist1D::GetNbinsX
virtual unsigned GetNbinsX() const =0
LWHistRootUtils::deleteRootHisto
void deleteRootHisto(THX *rootHist, bool &sumW2IsFromPools)
LWHist::m_title
char * m_title
Definition: LWHist.h:100
LArCellBinning.xbins
int xbins
Definition: LArCellBinning.py:163
TH1I_LW::GetNbinsX
virtual unsigned GetNbinsX() const override
Definition: TH1I_LW.cxx:264
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
h
DEFAULT_MARKERCOLOR
#define DEFAULT_MARKERCOLOR
Definition: LWHist.cxx:49
TH1I::SetBinContent
void SetBinContent(int, double)
Definition: rootspy.cxx:338
TH1I_LW::getSums
virtual void getSums(double &sumW, double &sumW2, double &sumWX, double &sumWX2) const override
Definition: TH1I_LW.cxx:279
LWHist::LWHistDecorations::m_markerSize
float m_markerSize
Definition: LWHist.cxx:79
LWHist::apply
virtual bool apply(TH1 *) const
Definition: LWHist.cxx:256
TH1
Definition: rootspy.cxx:268
Flex1DHisto::create
static Flex1DHisto * create(unsigned nbins, const double &xmin, const double &xmax)
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
LWHist::m_decorations
LWHistDecorations * m_decorations
Definition: LWHist.h:101
xmax
double xmax
Definition: listroot.cxx:61
LWHist1D::getSums
virtual void getSums(double &sumW, double &sumW2, double &sumWX, double &sumWX2) const =0
TH1I::GetBinContent
double GetBinContent(int) const
Definition: rootspy.cxx:337
TH1I_LW::Integral
virtual double Integral() const override
Definition: TH1I_LW.cxx:321
LWHist1D::LWHist1D
LWHist1D(const char *n, const char *t, bool rb)
Definition: LWHist1D.h:61
TH1I_LW::SetEntries
virtual void SetEntries(unsigned) override
Definition: TH1I_LW.cxx:276
TH1I_LW::SetBinContent
virtual void SetBinContent(unsigned bin, const double &) override
Definition: TH1I_LW.cxx:267
LWHist::GetMarkerStyle
short GetMarkerStyle() const
Definition: LWHist.cxx:105
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
TH1I_LW::SetBinError
virtual void SetBinError(unsigned bin, const double &) override
Definition: TH1I_LW.cxx:268
error
Definition: IImpactPoint3dEstimator.h:70
python.compressB64.c
def c
Definition: compressB64.py:93
LWHist::GetYaxis
LWHistAxis * GetYaxis()
Definition: LWHist.cxx:319
TH1I_LW::m_flexHisto
void * m_flexHisto
Definition: TH1I_LW.h:87
LWHist1D::apply
virtual bool apply(TH1 *) const
Definition: LWHist1D.cxx:20
LWHistStats::s_nActiveHists
static std::atomic< long > s_nActiveHists
Definition: LWHistStats.h:36
LWHist::LWHistDecorations::m_option
char * m_option
Definition: LWHist.cxx:73