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

storage of a pulse shape residual set More...

#include <Residual.h>

Inheritance diagram for LArSamples::Residual:
Collaboration diagram for LArSamples::Residual:

Public Member Functions

 Residual (const TVectorD &deltas=TVectorD(), int run=0, int event=0, double adcMax=-1, double time=0)
 
virtual ~Residual ()
 
const TVectorD & deltas () const
 
int run () const
 
int event () const
 
double adcMax () const
 
double time () const
 
double scaledDelta (short i) const
 
TVectorD scaledDeltas () const
 
TVectorD scaledDeltasAndTime () const
 
int lwb () const
 
int upb () const
 
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
 

Static Public Member Functions

static bool test ()
 

Private Attributes

TVectorD m_deltas
 
int m_run
 
int m_event
 
double m_adcMax
 
double m_time
 

Detailed Description

storage of a pulse shape residual set

Definition at line 28 of file LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h.

Constructor & Destructor Documentation

◆ Residual()

Residual::Residual ( const TVectorD &  deltas = TVectorD(),
int  run = 0,
int  event = 0,
double  adcMax = -1,
double  time = 0 
)

◆ ~Residual()

Residual::~Residual ( )
virtual

Definition at line 31 of file LArCalorimeter/LArSamplesMon/src/Residual.cxx.

32 {
34 }

Member Function Documentation

◆ adcMax()

double LArSamples::Residual::adcMax ( ) const
inline

Definition at line 41 of file LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h.

41 { return m_adcMax; }

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

◆ deltas()

const TVectorD& LArSamples::Residual::deltas ( ) const
inline

Definition at line 38 of file LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h.

38 { return m_deltas; }

◆ event()

int LArSamples::Residual::event ( ) const
inline

Definition at line 40 of file LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h.

40 { return m_event; }

◆ 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::Residual::lwb ( ) const
inlinevirtual

Implements LArSamples::IndexRange.

Definition at line 48 of file LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h.

48 { return m_deltas.GetLwb(); }

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

◆ run()

int LArSamples::Residual::run ( ) const
inline

Definition at line 39 of file LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h.

39 { return m_run; }

◆ scaledDelta()

double Residual::scaledDelta ( short  i) const

Definition at line 45 of file LArCalorimeter/LArSamplesMon/src/Residual.cxx.

46 {
47  if (!isInRange(i) || adcMax() <= 0) return 0;
48  return deltas()(i)/adcMax();
49 }

◆ scaledDeltas()

TVectorD Residual::scaledDeltas ( ) const

Definition at line 37 of file LArCalorimeter/LArSamplesMon/src/Residual.cxx.

38 {
39  TVectorD vect = deltas();
40  vect *= 1/adcMax();
41  return vect;
42 }

◆ scaledDeltasAndTime()

TVectorD Residual::scaledDeltasAndTime ( ) const

Definition at line 52 of file LArCalorimeter/LArSamplesMon/src/Residual.cxx.

53 {
54  TVectorD vect(lwb(), upb() + 1);
55  vect.SetSub(lwb(), scaledDeltas());
56  vect(upb() + 1) = time();
57  return vect;
58 }

◆ test()

bool Residual::test ( )
static

Definition at line 302 of file LArCalorimeter/LArSamplesMon/src/Residual.cxx.

303 {
304  Residuals testVect;
305  TRandom r;
306  for (unsigned int i = 0; i < 100000; i++) {
307  TVectorD d(5);
308  //for (unsigned short j = 0; j < 5; j++) d(j) = 0.01*i;
309  for (unsigned short j = 0; j < 5; j++) d(j) = r.Gaus(0, 1);
310  testVect.add(Residual(d, i, i, i, i));
311  }
312 
313 // TVectorD m,w;
314 // if (!getMedianVars(testVect, m, w)) return false;
315 // m.Print();
316 // w.Print();
317 
318  Residuals* truncated = testVect.truncate(2);
319  if (!truncated) return false;
320 
321  TH1D* h = truncated->histogram(0, "h", 100, -5, 5);
322  delete truncated;
323  h->Draw();
324  return true;
325 }

◆ time()

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

Definition at line 42 of file LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h.

42 { return m_time; }

◆ upb()

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

Implements LArSamples::IndexRange.

Definition at line 49 of file LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h.

49 { return m_deltas.GetUpb(); }

Member Data Documentation

◆ m_adcMax

double LArSamples::Residual::m_adcMax
private

◆ m_deltas

TVectorD LArSamples::Residual::m_deltas
private

◆ m_event

int LArSamples::Residual::m_event
private

◆ m_run

int LArSamples::Residual::m_run
private

◆ m_time

double LArSamples::Residual::m_time
private

The documentation for this class was generated from the following files:
beamspotman.r
def r
Definition: beamspotman.py:676
LArSamples::IndexRange::upb
virtual int upb() const =0
LArSamples::Residual::event
int event() const
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h:40
hist_file_dump.d
d
Definition: hist_file_dump.py:137
python.LumiCalcWorking.lw
lw
Definition: LumiCalcWorking.py:112
LArSamples::Residual::scaledDeltas
TVectorD scaledDeltas() const
Definition: LArCalorimeter/LArSamplesMon/src/Residual.cxx:37
LArSamples::IndexRange::hasSameRange
bool hasSameRange(int lw, int up) const
Definition: IndexRange.h:29
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
LArSamples::Residual::m_deltas
TVectorD m_deltas
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h:55
LArSamples::Residual::m_adcMax
double m_adcMax
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h:57
LArSamples::IndexRange::isInRange
bool isInRange(int i) const
Definition: IndexRange.h:27
lumiFormat.i
int i
Definition: lumiFormat.py:92
h
LArSamples::ClassCounts::decrementInstanceCount
void decrementInstanceCount() const
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:33
CalibCoolCompareRT.up
up
Definition: CalibCoolCompareRT.py:109
LArSamples::Residual::upb
int upb() const
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h:49
run
Definition: run.py:1
LArSamples::Residual::lwb
int lwb() const
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h:48
LArSamples::Residuals
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h:72
LArSamples::Residual::m_time
double m_time
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h:57
LArSamples::ClassCounts::incrementInstanceCount
void incrementInstanceCount() const
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:32
LArSamples::Residuals::truncate
Residuals * truncate(double nWidthsRes, double nWidthsTime=-1, unsigned int nMax=0) const
Definition: LArCalorimeter/LArSamplesMon/src/Residual.cxx:143
LArSamples::IndexRange::lwb
virtual int lwb() const =0
python.PyAthena.v
v
Definition: PyAthena.py:157
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
LArSamples::Residual::Residual
Residual(const TVectorD &deltas=TVectorD(), int run=0, int event=0, double adcMax=-1, double time=0)
Definition: LArCalorimeter/LArSamplesMon/src/Residual.cxx:23
LArSamples::Residual::m_event
int m_event
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h:56
LArSamples::Residuals::add
bool add(const Residual &residual)
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h:86
LArSamples::Residual::m_run
int m_run
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h:56
LArSamples::Residuals::histogram
TH1D * histogram(short sample, const TString &name, int nBins, double xMin, double xMax) const
Definition: LArCalorimeter/LArSamplesMon/src/Residual.cxx:176
LArSamples::IndexRange::providesRange
bool providesRange(int lw, int up) const
Definition: IndexRange.h:33
LArSamples::Residual::time
double time() const
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h:42
LArSamples::Residual::adcMax
double adcMax() const
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h:41
LArSamples::Residual::deltas
const TVectorD & deltas() const
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Residual.h:38