ATLAS Offline Software
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 
11 #ifndef LArSamples_ShapeInfo_H
12 #define LArSamples_ShapeInfo_H
13 
14 #include <vector>
16 
17 class TH1D;
18 class TGraph;
19 
20 namespace 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;
70  unsigned char m_nSamples, m_binSize, m_nPhases;
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 
LArSamples::ShapeInfo::nIntervals
unsigned int nIntervals() const
Definition: ShapeInfo.h:41
ReadOfcFromCool.phase
phase
Definition: ReadOfcFromCool.py:127
LArSamples::ShapeInfo::nPhases
unsigned char nPhases() const
Definition: ShapeInfo.h:40
xAOD::short
short
Definition: Vertex_v1.cxx:165
LArSamples::ShapeInfo::nPoints
unsigned int nPoints() const
Definition: ShapeInfo.h:37
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
LArSamples::ShapeInfo::m_timeShift
static double m_timeShift
Definition: ShapeInfo.h:72
athena.value
value
Definition: athena.py:124
LArSamples
Definition: AbsShape.h:24
isValid
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition: AtlasPID.h:620
LArSamples::ShapeInfo
Definition: ShapeInfo.h:24
LArSamples::ShapeInfo::m_values
std::vector< short > m_values
Definition: ShapeInfo.h:69
LArSamples::ShapeInfo::nSamples
unsigned char nSamples() const
Definition: ShapeInfo.h:39
LArSamples::ShapeInfo::timeShift
static double timeShift()
Definition: ShapeInfo.h:64
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArSamples::ShapeInfo::m_shift
float m_shift
Definition: ShapeInfo.h:71
LArSamples::ShapeInfo::m_nSamples
unsigned char m_nSamples
Definition: ShapeInfo.h:70
LArSamples::ShapeInfo::binSize
unsigned char binSize() const
Definition: ShapeInfo.h:38
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
LArSamples::ShapeInfo::shift
float shift() const
Definition: ShapeInfo.h:42
LArSamples::ShapeInfo::setTimeShift
static void setTimeShift(double shift=0)
Definition: ShapeInfo.h:65
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
LArSamples::ShapeInfo::footprint
double footprint() const
Definition: ShapeInfo.h:55
LArDigits2NtupleDumper.nSamples
nSamples
Definition: LArDigits2NtupleDumper.py:70
checker_macros.h
Define macros for attributes used to control the static checker.