ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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
More...
 
 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

Constructor

Definition at line 24 of file ShapeErrorData.h.

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

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

◆ 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()); }

◆ 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()); }

◆ 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

Definition at line 59 of file ShapeErrorData.h.

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

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

◆ m_shapeErrorType

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

Definition at line 67 of file ShapeErrorData.h.

◆ m_tbar

double LArSamples::ShapeErrorData::m_tbar {}
private

Definition at line 65 of file ShapeErrorData.h.

◆ 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:
LArSamples::IndexRange::upb
virtual int upb() const =0
LArSamples::ShapeErrorData::tbar
double tbar() const
Definition: ShapeErrorData.h:53
LArSamples::CovMatrix
TMatrixTSym< double > CovMatrix
Definition: Definitions.h:11
LArSamples::IndexRange::checkRange
bool checkRange(int &l, int &h) const
Definition: IndexRange.cxx:14
python.LumiCalcWorking.lw
lw
Definition: LumiCalcWorking.py:112
LArSamples::IndexRange::hasSameRange
bool hasSameRange(int lw, int up) const
Definition: IndexRange.h:29
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
LArSamples::ShapeErrorData::m_n
int m_n
Definition: ShapeErrorData.h:66
LArSamples::IndexRange::commonUpb
int commonUpb(const IndexRange &other) const
Definition: IndexRange.h:40
LArSamples::ShapeErrorData::xip
const TVectorD & xip() const
Definition: ShapeErrorData.h:41
LArSamples::IndexRange::isInRange
bool isInRange(int i) const
Definition: IndexRange.h:27
LArSamples::ShapeErrorData::m_xipErr
CovMatrix m_xipErr
Definition: ShapeErrorData.h:64
lumiFormat.i
int i
Definition: lumiFormat.py:92
h
LArSamples::ShapeErrorData::xipErr
const CovMatrix & xipErr() const
Definition: ShapeErrorData.h:43
CalibCoolCompareRT.up
up
Definition: CalibCoolCompareRT.py:109
LArSamples::ShapeErrorData::m_xi
TVectorD m_xi
Definition: ShapeErrorData.h:63
LArSamples::ShapeErrorData::xiErr
const CovMatrix & xiErr() const
Definition: ShapeErrorData.h:42
LArSamples::IndexRange::commonLwb
int commonLwb(const IndexRange &other) const
Definition: IndexRange.h:39
LArSamples::ShapeErrorData::n
int n() const
Definition: ShapeErrorData.h:54
LArSamples::ShapeErrorData::m_xip
TVectorD m_xip
Definition: ShapeErrorData.h:63
LArSamples::ShapeErrorData::m_shapeErrorType
ShapeErrorType m_shapeErrorType
Definition: ShapeErrorData.h:67
LArSamples::IndexRange::lwb
virtual int lwb() const =0
python.PyAthena.v
v
Definition: PyAthena.py:157
LArSamples::ShapeErrorData::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)
Constructor
Definition: ShapeErrorData.h:24
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
LArSamples::ShapeErrorData::m_xiErr
CovMatrix m_xiErr
Definition: ShapeErrorData.h:64
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DeMoScan.first
bool first
Definition: DeMoScan.py:534
LArSamples::IndexRange::providesRange
bool providesRange(int lw, int up) const
Definition: IndexRange.h:33
LArSamples::ShapeErrorData::xi
const TVectorD & xi() const
Definition: ShapeErrorData.h:40
LArSamples::ShapeErrorData::m_tbar
double m_tbar
Definition: ShapeErrorData.h:65