ATLAS Offline Software
Loading...
Searching...
No Matches
LArSamples::ShapeErrorData Class Reference

#include <ShapeErrorData.h>

Inheritance diagram for LArSamples::ShapeErrorData:
Collaboration diagram for LArSamples::ShapeErrorData:

Public Member Functions

 ShapeErrorData (const TVectorD &xi=TVectorD(), const TVectorD &xip=TVectorD(), const CovMatrix &xiErr=CovMatrix(), const CovMatrix &xipErr=CovMatrix(), double tbar=Definitions::none, int n=-1)
 Constructor.
 ShapeErrorData (const ShapeErrorData &other)
virtual ~ShapeErrorData ()
unsigned int nSamples () const
const TVectorD & xi () const
const TVectorD & xip () const
const CovMatrixxiErr () const
const CovMatrixxipErr () const
int lwb () const
int upb () const
const TVectorD xi (int first, int last) const
const TVectorD xip (int first, int last) const
const CovMatrix xiErr (int first, int last) const
const CovMatrix xipErr (int first, int last) const
double tbar () const
int n () const
ShapeErrorDataadd (const ShapeErrorData &other) const
ShapeErrorType shapeErrorType () const
void setShapeErrorType (ShapeErrorType type)
bool isInRange (int i) const
bool hasSameRange (int lw, int up) const
bool hasSameRange (const IndexRange &other) const
bool hasSameRange (const TVectorD &v) const
bool providesRange (int lw, int up) const
bool providesRange (const IndexRange &other) const
bool providesRange (const TVectorD &v) const
TString rangeStr () const
int commonLwb (const IndexRange &other) const
int commonUpb (const IndexRange &other) const
bool checkRange (int &l, int &h) const

Private Attributes

TVectorD m_xi
TVectorD m_xip
CovMatrix m_xiErr
CovMatrix m_xipErr
double m_tbar {}
int m_n {}
ShapeErrorType m_shapeErrorType {CellShapeError}

Detailed Description

Definition at line 19 of file ShapeErrorData.h.

Constructor & Destructor Documentation

◆ ShapeErrorData() [1/2]

LArSamples::ShapeErrorData::ShapeErrorData ( const TVectorD & xi = TVectorD(),
const TVectorD & xip = TVectorD(),
const CovMatrix & xiErr = CovMatrix(),
const CovMatrix & xipErr = CovMatrix(),
double tbar = Definitions::none,
int n = -1 )
inline

◆ ShapeErrorData() [2/2]

LArSamples::ShapeErrorData::ShapeErrorData ( const ShapeErrorData & other)
inline

Definition at line 30 of file ShapeErrorData.h.

30 :
31 IndexRange(),
32 m_xi(other.m_xi), m_xip(other.m_xip), m_xiErr(other.m_xiErr), m_xipErr(other.m_xipErr),
33 m_tbar(other.m_tbar), m_n(other.m_n) { }

◆ ~ShapeErrorData()

virtual LArSamples::ShapeErrorData::~ShapeErrorData ( )
inlinevirtual

Definition at line 35 of file ShapeErrorData.h.

35{ }

Member Function Documentation

◆ add()

ShapeErrorData * ShapeErrorData::add ( const ShapeErrorData & other) const

Definition at line 58 of file ShapeErrorData.cxx.

59{
60 int newLwb = commonLwb(other);
61 int newUpb = commonUpb(other);
62 if (newUpb < newLwb) return nullptr;
63 TVectorD newXi = xi(newLwb, newUpb) + other.xi(newLwb, newUpb);
64 TVectorD newXip = xip(newLwb, newUpb) + other.xip(newLwb, newUpb);
65 CovMatrix newXiErr = xiErr(newLwb, newUpb) + other.xiErr(newLwb, newUpb);
66 CovMatrix newXipErr = xipErr(newLwb, newUpb) + other.xipErr(newLwb, newUpb);
67 int newN = n() + other.n();
68 return new ShapeErrorData(newXi, newXip, newXiErr, newXipErr, newN);
69}
int commonLwb(const IndexRange &other) const
Definition IndexRange.h:39
int commonUpb(const IndexRange &other) const
Definition IndexRange.h:40
ShapeErrorData(const TVectorD &xi=TVectorD(), const TVectorD &xip=TVectorD(), const CovMatrix &xiErr=CovMatrix(), const CovMatrix &xipErr=CovMatrix(), double tbar=Definitions::none, int n=-1)
Constructor.

◆ checkRange()

bool IndexRange::checkRange ( int & l,
int & h ) const
inherited

Definition at line 14 of file IndexRange.cxx.

15{
16 if (l < 0)
17 l = lwb();
18 else if (!isInRange(l)) {
19 cout << "IndexRange::checkRange : lower bound " << l << " is out of bounds" << endl;
20 return false;
21 }
22
23 if (h < 0)
24 h = upb();
25 else if (!isInRange(h)) {
26 cout << "IndexRange::checkRange : upper bound " << h << " is out of bounds" << endl;
27 return false;
28 }
29
30 return true;
31}
virtual int lwb() const =0
bool isInRange(int i) const
Definition IndexRange.h:27
virtual int upb() const =0
l
Printing final latex table to .tex output file.

◆ commonLwb()

int LArSamples::IndexRange::commonLwb ( const IndexRange & other) const
inlineinherited

Definition at line 39 of file IndexRange.h.

39{ return (other.lwb() > lwb() ? other.lwb() : lwb()); }

◆ commonUpb()

int LArSamples::IndexRange::commonUpb ( const IndexRange & other) const
inlineinherited

Definition at line 40 of file IndexRange.h.

40{ return (other.upb() < upb() ? other.upb() : upb()); }

◆ hasSameRange() [1/3]

bool LArSamples::IndexRange::hasSameRange ( const IndexRange & other) const
inlineinherited

Definition at line 30 of file IndexRange.h.

30{ return hasSameRange(other.lwb(), other.upb()); }
bool hasSameRange(int lw, int up) const
Definition IndexRange.h:29

◆ hasSameRange() [2/3]

bool LArSamples::IndexRange::hasSameRange ( const TVectorD & v) const
inlineinherited

Definition at line 31 of file IndexRange.h.

31{ return hasSameRange(v.GetLwb(), v.GetUpb()); }

◆ hasSameRange() [3/3]

bool LArSamples::IndexRange::hasSameRange ( int lw,
int up ) const
inlineinherited

Definition at line 29 of file IndexRange.h.

29{ return (lwb() == lw && upb() == up); }

◆ isInRange()

bool LArSamples::IndexRange::isInRange ( int i) const
inlineinherited

Definition at line 27 of file IndexRange.h.

27{ return (i >= lwb() && i <= upb()); }

◆ lwb()

int LArSamples::ShapeErrorData::lwb ( ) const
inlinevirtual

Implements LArSamples::IndexRange.

Definition at line 45 of file ShapeErrorData.h.

45{ return m_xi.GetLwb(); }

◆ n()

int LArSamples::ShapeErrorData::n ( ) const
inline

Definition at line 54 of file ShapeErrorData.h.

54{ return m_n; }

◆ nSamples()

unsigned int LArSamples::ShapeErrorData::nSamples ( ) const
inline
Returns
size

Definition at line 38 of file ShapeErrorData.h.

38{ return m_xi.GetNrows(); }

◆ providesRange() [1/3]

bool LArSamples::IndexRange::providesRange ( const IndexRange & other) const
inlineinherited

Definition at line 34 of file IndexRange.h.

34{ return providesRange(other.lwb(), other.upb()); }
bool providesRange(int lw, int up) const
Definition IndexRange.h:33

◆ providesRange() [2/3]

bool LArSamples::IndexRange::providesRange ( const TVectorD & v) const
inlineinherited

Definition at line 35 of file IndexRange.h.

35{ return providesRange(v.GetLwb(), v.GetUpb()); }

◆ providesRange() [3/3]

bool LArSamples::IndexRange::providesRange ( int lw,
int up ) const
inlineinherited

Definition at line 33 of file IndexRange.h.

33{ return (lwb() <= lw && upb() >= up); }

◆ rangeStr()

TString LArSamples::IndexRange::rangeStr ( ) const
inlineinherited

Definition at line 37 of file IndexRange.h.

37{ return Form("[%d, %d]", lwb(), upb()); }

◆ setShapeErrorType()

void LArSamples::ShapeErrorData::setShapeErrorType ( ShapeErrorType type)
inline

◆ shapeErrorType()

ShapeErrorType LArSamples::ShapeErrorData::shapeErrorType ( ) const
inline

Definition at line 58 of file ShapeErrorData.h.

58{ return m_shapeErrorType; }

◆ tbar()

double LArSamples::ShapeErrorData::tbar ( ) const
inline

Definition at line 53 of file ShapeErrorData.h.

53{ return m_tbar; }

◆ upb()

int LArSamples::ShapeErrorData::upb ( ) const
inlinevirtual

Implements LArSamples::IndexRange.

Definition at line 46 of file ShapeErrorData.h.

46{ return m_xi.GetUpb(); }

◆ xi() [1/2]

const TVectorD & LArSamples::ShapeErrorData::xi ( ) const
inline

Definition at line 40 of file ShapeErrorData.h.

40{ return m_xi; }

◆ xi() [2/2]

const TVectorD ShapeErrorData::xi ( int first,
int last ) const

Definition at line 14 of file ShapeErrorData.cxx.

15{
16 if (!checkRange(first, last)) {
17 cout << "ShapeErrorData::xi : range error" << endl;
18 return TVectorD();
19 }
20
21 return m_xi.GetSub(first, last, "I"); // "I" => indexed as [first, last]
22}
bool checkRange(int &l, int &h) const

◆ xiErr() [1/2]

const CovMatrix & LArSamples::ShapeErrorData::xiErr ( ) const
inline

Definition at line 42 of file ShapeErrorData.h.

42{ return m_xiErr; }

◆ xiErr() [2/2]

const CovMatrix ShapeErrorData::xiErr ( int first,
int last ) const

Definition at line 36 of file ShapeErrorData.cxx.

37{
38 if (!checkRange(first, last)) {
39 cout << "ShapeErrorData::xiErr : range error" << endl;
40 return CovMatrix();
41 }
42
43 return m_xiErr.GetSub(first, last, first, last, "I"); // "I" => indexed as [first, last]
44}

◆ xip() [1/2]

const TVectorD & LArSamples::ShapeErrorData::xip ( ) const
inline

Definition at line 41 of file ShapeErrorData.h.

41{ return m_xip; }

◆ xip() [2/2]

const TVectorD ShapeErrorData::xip ( int first,
int last ) const

Definition at line 25 of file ShapeErrorData.cxx.

26{
27 if (!checkRange(first, last)) {
28 cout << "ShapeErrorData::xip : range error" << endl;
29 return TVectorD();
30 }
31
32 return m_xip.GetSub(first, last, "I"); // "I" => indexed as [first, last]
33}

◆ xipErr() [1/2]

const CovMatrix & LArSamples::ShapeErrorData::xipErr ( ) const
inline

Definition at line 43 of file ShapeErrorData.h.

43{ return m_xipErr; }

◆ xipErr() [2/2]

const CovMatrix ShapeErrorData::xipErr ( int first,
int last ) const

Definition at line 47 of file ShapeErrorData.cxx.

48{
49 if (!checkRange(first, last)) {
50 cout << "ShapeErrorData::xipErr : range error" << endl;
51 return CovMatrix();
52 }
53
54 return m_xipErr.GetSub(first, last, first, last, "I"); // "I" => indexed as [first, last]
55}

Member Data Documentation

◆ m_n

int LArSamples::ShapeErrorData::m_n {}
private

Definition at line 66 of file ShapeErrorData.h.

66{};

◆ m_shapeErrorType

ShapeErrorType LArSamples::ShapeErrorData::m_shapeErrorType {CellShapeError}
private

◆ m_tbar

double LArSamples::ShapeErrorData::m_tbar {}
private

Definition at line 65 of file ShapeErrorData.h.

65{};

◆ m_xi

TVectorD LArSamples::ShapeErrorData::m_xi
private

Definition at line 63 of file ShapeErrorData.h.

◆ m_xiErr

CovMatrix LArSamples::ShapeErrorData::m_xiErr
private

Definition at line 64 of file ShapeErrorData.h.

◆ m_xip

TVectorD LArSamples::ShapeErrorData::m_xip
private

Definition at line 63 of file ShapeErrorData.h.

◆ m_xipErr

CovMatrix LArSamples::ShapeErrorData::m_xipErr
private

Definition at line 64 of file ShapeErrorData.h.


The documentation for this class was generated from the following files: