ATLAS Offline Software
Loading...
Searching...
No Matches
ShapeInfo.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5
10
11#ifndef LArSamples_ShapeInfo_H
12#define LArSamples_ShapeInfo_H
13
14#include <vector>
16
17class TH1D;
18class TGraph;
19
20namespace LArSamples {
21
22 class SimpleShape;
23
25
26 public:
27
29 ShapeInfo(unsigned char nSamples = 5, unsigned char binSize = 3,
30 unsigned char nPhases = 8, float shift = 0);
31
32 ShapeInfo(const ShapeInfo& other);
33
34 ~ShapeInfo();
35
37 unsigned int nPoints() const { return m_values.size() + 1; } // add one more point by extrapolation
38 unsigned char binSize() const { return m_binSize; } // in ns. 3 ns for now, may move to 1 ns
39 unsigned char nSamples() const { return m_nSamples; }
40 unsigned char nPhases() const { return m_nPhases; }
41 unsigned int nIntervals() const { return nBuckets/binSize(); }
42 float shift() const { return m_shift + m_timeShift; }
43
44 //double timeInterval() const { return (1.0*samplingTime()/nIntervals()); }
45 //double startTime() const { return -shift()*timeInterval(); }
46
48 double value(unsigned int i) const;
49 //double covariance(unsigned int /*i*/, unsigned int /*j*/) const { return 0; }
50 unsigned char phase(unsigned int i) const;
51
52 void set(unsigned char iSample, unsigned char iPhase, float value);
53
54 bool isValid() const;
55 double footprint() const { return sizeof(*this) + m_values.size()*sizeof(short); }
56
57 // MIG: TBR
58 //SimpleShape* simpleShape(double scale = 1, double shift = 0) const;
59 //SimpleShape* sampleShape(double scale = 1, double shift = 0) const;
60 //void Draw() const;
61
62 static constexpr unsigned int nBuckets = 24;
63
64 static double timeShift() { return m_timeShift; }
65 static void setTimeShift(double shift = 0) { m_timeShift = shift; }
66
67 private:
68
69 std::vector<short> m_values;
71 float m_shift;
72 static double m_timeShift; // specify a global time shift between first sample time and reported ofc time
73
74 ShapeInfo& operator= (const ShapeInfo&);
75 };
76}
77
78#endif
79
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878
Define macros for attributes used to control the static checker.
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
static double m_timeShift
Definition ShapeInfo.h:72
unsigned char m_binSize
Definition ShapeInfo.h:70
static void setTimeShift(double shift=0)
Definition ShapeInfo.h:65
unsigned char m_nSamples
Definition ShapeInfo.h:70
double footprint() const
Definition ShapeInfo.h:55
unsigned char nPhases() const
Definition ShapeInfo.h:40
float shift() const
Definition ShapeInfo.h:42
static double timeShift()
Definition ShapeInfo.h:64
unsigned char binSize() const
Definition ShapeInfo.h:38
static constexpr unsigned int nBuckets
Definition ShapeInfo.h:62
unsigned int nPoints() const
Definition ShapeInfo.h:37
std::vector< short > m_values
Definition ShapeInfo.h:69
ShapeInfo(unsigned char nSamples=5, unsigned char binSize=3, unsigned char nPhases=8, float shift=0)
Constructor.
Definition ShapeInfo.cxx:28
unsigned int nIntervals() const
Definition ShapeInfo.h:41
unsigned char m_nPhases
Definition ShapeInfo.h:70
unsigned char nSamples() const
Definition ShapeInfo.h:39
STL class.