ATLAS Offline Software
Loading...
Searching...
No Matches
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
9
10#ifndef LArSamples_GraphShape_H
11#define LArSamples_GraphShape_H
12
13#include "LArCafJobs/AbsShape.h"
14#include <vector>
15
16class TH1D;
17class TGraph;
18
19namespace LArSamples {
20
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;
28 GraphPoint& operator=(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
39 GraphShape(const GraphShape& other) :
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
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
TVectorD values(int lwb, int upb) const
Definition AbsShape.cxx:135
GraphShape(const GraphShape &other)
Definition GraphShape.h:39
double time(unsigned int i) const
Definition GraphShape.h:52
double covariance(unsigned int i, unsigned int j) const
Definition GraphShape.h:53
double value(unsigned int i) const
Definition GraphShape.h:51
GraphShape(const std::vector< double > &times, const std::vector< double > &values, const std::vector< double > &errors)
Constructor.
std::vector< GraphPoint > m_points
Definition GraphShape.h:57
unsigned int nPoints() const
Definition GraphShape.h:50
bool add(const std::string &hname, TKey *tobj)
Definition fastadd.cxx:55
GraphPoint & operator=(const GraphPoint &other)=default
GraphPoint(double t, double v, double e)
Definition GraphShape.h:23
bool operator<(const GraphPoint &other) const
Definition GraphShape.h:24
GraphPoint(const GraphPoint &other)=default
GraphPoint(GraphPoint &&other)=default
GraphPoint & operator=(GraphPoint &&other)=default