ATLAS Offline Software
GraphShape.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
10 #ifndef LArSamples_GraphShape_H
11 #define LArSamples_GraphShape_H
12 
13 #include "LArCafJobs/AbsShape.h"
14 #include <vector>
15 
16 class TH1D;
17 class TGraph;
18 
19 namespace LArSamples {
20 
21  struct GraphPoint
22  {
23  GraphPoint(double t, double v, double e) : time(t), value(v), error(e) { }
24  bool operator<(const GraphPoint& other) const { return time < other.time; }
25  GraphPoint(const GraphPoint& other) = default;
26  GraphPoint(GraphPoint&& other) = default;
27  GraphPoint& operator=(const GraphPoint& other) = default;
29  double time, value, error;
30  };
31 
33 
34  public:
35 
37  GraphShape(const std::vector<double>& times, const std::vector<double>& values, const std::vector<double>& errors);
38 
40  AbsShape(),
41  m_points(other.m_points) { }
42 
43  GraphShape(const AbsShape& other, double scale = 1, double shift = 0);
44 
45  virtual ~GraphShape() { }
46 
47  bool add(const AbsShape& other);
48 
50  unsigned int nPoints() const { return m_points.size(); }
51  double value(unsigned int i) const { return m_points[i].value; }
52  double time(unsigned int i) const { return m_points[i].time; }
53  double covariance(unsigned int i, unsigned int j) const { return (i == j ? m_points[i].error*m_points[i].error : 0); }
54 
55  private:
56 
57  std::vector<GraphPoint> m_points;
58  };
59 }
60 
61 #endif
62 
LArSamples::GraphPoint::operator=
GraphPoint & operator=(GraphPoint &&other)=default
AbsShape.h
LArSamples::GraphPoint::GraphPoint
GraphPoint(GraphPoint &&other)=default
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
TH1D
Definition: rootspy.cxx:342
LArSamples::GraphPoint::operator=
GraphPoint & operator=(const GraphPoint &other)=default
LArSamples
Definition: AbsShape.h:24
LArSamples::GraphShape::m_points
std::vector< GraphPoint > m_points
Definition: GraphShape.h:57
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
LArSamples::GraphShape::covariance
double covariance(unsigned int i, unsigned int j) const
Definition: GraphShape.h:53
LArSamples::GraphShape::value
double value(unsigned int i) const
Definition: GraphShape.h:51
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
LArSamples::GraphShape::nPoints
unsigned int nPoints() const
Definition: GraphShape.h:50
python.Bindings.values
values
Definition: Control/AthenaPython/python/Bindings.py:797
LArSamples::GraphPoint::time
double time
Definition: GraphShape.h:29
LArSamples::GraphPoint::operator<
bool operator<(const GraphPoint &other) const
Definition: GraphShape.h:24
LArSamples::GraphPoint::GraphPoint
GraphPoint(double t, double v, double e)
Definition: GraphShape.h:23
lumiFormat.i
int i
Definition: lumiFormat.py:92
LArSamples::GraphShape::GraphShape
GraphShape(const GraphShape &other)
Definition: GraphShape.h:39
LArSamples::GraphShape::time
double time(unsigned int i) const
Definition: GraphShape.h:52
add
bool add(const std::string &hname, TKey *tobj)
Definition: fastadd.cxx:55
mergePhysValFiles.errors
list errors
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:43
LArSamples::GraphPoint::GraphPoint
GraphPoint(const GraphPoint &other)=default
LArSamples::GraphShape::~GraphShape
virtual ~GraphShape()
Definition: GraphShape.h:45
LArSamples::GraphPoint::value
double value
Definition: GraphShape.h:29
LArSamples::GraphPoint::error
double error
Definition: GraphShape.h:29
python.PyAthena.v
v
Definition: PyAthena.py:157
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
LArSamples::AbsShape
Definition: AbsShape.h:28
LArSamples::GraphShape
Definition: GraphShape.h:32
error
Definition: IImpactPoint3dEstimator.h:70
LArSamples::GraphPoint
Definition: GraphShape.h:22
plot_times.times
def times(fn)
Definition: plot_times.py:11