ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
LArSamples::ScaledErrorData Class Reference

#include <ScaledErrorData.h>

Inheritance diagram for LArSamples::ScaledErrorData:
Collaboration diagram for LArSamples::ScaledErrorData:

Public Member Functions

 ScaledErrorData (const ShapeErrorData &sed, double scale=1, double time=0)
 Constructor
More...
 
 ScaledErrorData (const ScaledErrorData &other)
 
virtual ~ScaledErrorData ()
 
double scale () const
 
double time () const
 
const TVectorD offsets (int first=-1, int last=-1) const
 
const CovMatrix errors (int first=-1, int last=-1) const
 
unsigned int nSamples () const
 
const TVectorD & xi () const
 
const TVectorD xi (int first, int last) const
 
const TVectorD & xip () const
 
const TVectorD xip (int first, int last) const
 
const CovMatrixxiErr () const
 
const CovMatrix xiErr (int first, int last) const
 
const CovMatrixxipErr () const
 
const CovMatrix xipErr (int first, int last) const
 
int lwb () const
 
int upb () 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

double m_scale
 
double m_time
 
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 17 of file ScaledErrorData.h.

Constructor & Destructor Documentation

◆ ScaledErrorData() [1/2]

LArSamples::ScaledErrorData::ScaledErrorData ( const ShapeErrorData sed,
double  scale = 1,
double  time = 0 
)
inline

Constructor

Definition at line 22 of file ScaledErrorData.h.

◆ ScaledErrorData() [2/2]

LArSamples::ScaledErrorData::ScaledErrorData ( const ScaledErrorData other)
inline

Definition at line 25 of file ScaledErrorData.h.

25  :
26  ShapeErrorData(other), m_scale(other.m_scale), m_time(other.m_time) { }

◆ ~ScaledErrorData()

virtual LArSamples::ScaledErrorData::~ScaledErrorData ( )
inlinevirtual

Definition at line 28 of file ScaledErrorData.h.

28 { }

Member Function Documentation

◆ add()

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

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

◆ errors()

const CovMatrix ScaledErrorData::errors ( int  first = -1,
int  last = -1 
) const

Definition at line 31 of file ScaledErrorData.cxx.

32 {
33  if (!checkRange(first, last)) {
34  cout << "ScaledErrorData::errors : range error" << endl;
35  return CovMatrix();
36  }
37 
39  double t = time() - tbar() /*- Definitions::samplingTime(lwb())*/;
40  errors += t*t*xipErr();
41  errors *= scale()*scale();
42 
43  return errors.GetSub(first, last, first, last, "I"); // "I" => indexed as [first, last]
44 }

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

Implements LArSamples::IndexRange.

Definition at line 45 of file ShapeErrorData.h.

45 { return m_xi.GetLwb(); }

◆ n()

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

Definition at line 54 of file ShapeErrorData.h.

54 { return m_n; }

◆ nSamples()

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

Definition at line 38 of file ShapeErrorData.h.

38 { return m_xi.GetNrows(); }

◆ offsets()

const TVectorD ScaledErrorData::offsets ( int  first = -1,
int  last = -1 
) const

Definition at line 14 of file ScaledErrorData.cxx.

15 {
16  if (!checkRange(first, last)) {
17  cout << "ScaledErrorData::offsets : range error" << endl;
18  return TVectorD();
19  }
20 
21  TVectorD offsets = xi();
22 
23  double t = time() - tbar() /*- Definitions::samplingTime(lwb())*/;
24  offsets -= t*xip();
25  offsets *= scale();
26 
27  return offsets.GetSub(first, last, "I"); // "I" => indexed as [first, last]
28 }

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

◆ scale()

double LArSamples::ScaledErrorData::scale ( ) const
inline

Definition at line 30 of file ScaledErrorData.h.

30 { return m_scale; }

◆ setShapeErrorType()

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

Definition at line 59 of file ShapeErrorData.h.

◆ shapeErrorType()

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

Definition at line 58 of file ShapeErrorData.h.

58 { return m_shapeErrorType; }

◆ tbar()

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

Definition at line 53 of file ShapeErrorData.h.

53 { return m_tbar; }

◆ time()

double LArSamples::ScaledErrorData::time ( ) const
inline

Definition at line 31 of file ScaledErrorData.h.

31 { return m_time; }

◆ upb()

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

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
inlineinherited

Definition at line 40 of file ShapeErrorData.h.

40 { return m_xi; }

◆ xi() [2/2]

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

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
inlineinherited

Definition at line 42 of file ShapeErrorData.h.

42 { return m_xiErr; }

◆ xiErr() [2/2]

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

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
inlineinherited

Definition at line 41 of file ShapeErrorData.h.

41 { return m_xip; }

◆ xip() [2/2]

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

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
inlineinherited

Definition at line 43 of file ShapeErrorData.h.

43 { return m_xipErr; }

◆ xipErr() [2/2]

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

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 {}
privateinherited

Definition at line 66 of file ShapeErrorData.h.

◆ m_scale

double LArSamples::ScaledErrorData::m_scale
private

Definition at line 38 of file ScaledErrorData.h.

◆ m_shapeErrorType

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

Definition at line 67 of file ShapeErrorData.h.

◆ m_tbar

double LArSamples::ShapeErrorData::m_tbar {}
privateinherited

Definition at line 65 of file ShapeErrorData.h.

◆ m_time

double LArSamples::ScaledErrorData::m_time
private

Definition at line 38 of file ScaledErrorData.h.

◆ m_xi

TVectorD LArSamples::ShapeErrorData::m_xi
privateinherited

Definition at line 63 of file ShapeErrorData.h.

◆ m_xiErr

CovMatrix LArSamples::ShapeErrorData::m_xiErr
privateinherited

Definition at line 64 of file ShapeErrorData.h.

◆ m_xip

TVectorD LArSamples::ShapeErrorData::m_xip
privateinherited

Definition at line 63 of file ShapeErrorData.h.

◆ m_xipErr

CovMatrix LArSamples::ShapeErrorData::m_xipErr
privateinherited

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::ScaledErrorData::m_time
double m_time
Definition: ScaledErrorData.h:38
LArSamples::CovMatrix
TMatrixTSym< double > CovMatrix
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/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
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
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:85
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::ScaledErrorData::scale
double scale() const
Definition: ScaledErrorData.h:30
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::ScaledErrorData::m_scale
double m_scale
Definition: ScaledErrorData.h:38
LArSamples::IndexRange::lwb
virtual int lwb() const =0
python.PyAthena.v
v
Definition: PyAthena.py:154
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:536
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::FitterData::sed
const ScaledErrorData * sed
Definition: ShapeFitter.cxx:26
LArSamples::ScaledErrorData::errors
const CovMatrix errors(int first=-1, int last=-1) const
Definition: ScaledErrorData.cxx:31
LArSamples::ScaledErrorData::time
double time() const
Definition: ScaledErrorData.h:31
LArSamples::ScaledErrorData::offsets
const TVectorD offsets(int first=-1, int last=-1) const
Definition: ScaledErrorData.cxx:14
LArSamples::ShapeErrorData::m_tbar
double m_tbar
Definition: ShapeErrorData.h:65