ATLAS Offline Software
ScaledErrorData.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <iostream>
8 using std::cout;
9 using std::endl;
10 
11 using namespace LArSamples;
12 
13 
14 const TVectorD ScaledErrorData::offsets(int first, int last) const
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 }
29 
30 
31 const CovMatrix ScaledErrorData::errors(int first, int last) const
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 }
45 
LArSamples::ShapeErrorData::tbar
double tbar() const
Definition: ShapeErrorData.h:53
ScaledErrorData.h
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
LArSamples
Definition: AbsShape.h:24
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
LArSamples::ShapeErrorData::xip
const TVectorD & xip() const
Definition: ShapeErrorData.h:41
LArSamples::ShapeErrorData::xipErr
const CovMatrix & xipErr() const
Definition: ShapeErrorData.h:43
LArSamples::ScaledErrorData::scale
double scale() const
Definition: ScaledErrorData.h:30
LArSamples::ShapeErrorData::xiErr
const CovMatrix & xiErr() const
Definition: ShapeErrorData.h:42
DeMoScan.first
bool first
Definition: DeMoScan.py:536
LArSamples::ShapeErrorData::xi
const TVectorD & xi() const
Definition: ShapeErrorData.h:40
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