ATLAS Offline Software
BinnedRtRelation.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
13 // $Id: BinnedRtRelation.h,v 1.2 2007-06-13 11:10:40 hansenph Exp $
14 
15 #ifndef TRTCONDITDIONSDATA_BINNEDRTRELATION_H
16 #define TRTCONDITDIONSDATA_BINNEDRTRELATION_H
17 
19 #include <vector>
20 
21 namespace TRTCond
22 {
23 
27  {
28  public:
31 
33  BinnedRtRelation(float tmin, float tmax, const std::vector<float>& values, Status stat = Calibrated)
35 
37  BinnedRtRelation(const BinnedRtRelation& rhs) = default;
38 
40  BinnedRtRelation & operator=(const BinnedRtRelation& rhs) = default;
41 
43  virtual ~BinnedRtRelation() {}
44 
46  virtual RtRelation* clone() const { return new BinnedRtRelation(*this) ; }
47 
49  virtual int status() const { return m_status ; }
50 
52  virtual float radius( float driftime ) const ;
53 
55  virtual float drifttime( float radius ) const ;
56 
58  virtual float drdt( float driftime ) const ;
59 
61  virtual size_t footprint() const { return sizeof(*this) + m_values.size()*sizeof(float) ; }
62 
64  virtual bool isequal( const RtRelation& rhs) const ;
65 
67  virtual std::ostream& write(std::ostream&) const ;
68 
70  virtual std::istream& read(std::istream&) ;
71 
73  float tmin() const { return m_tmin ; }
75  float tmax() const { return m_tmax ; }
77  const std::vector<float>& values() const { return m_values ; }
78 
79  private:
81  float binsize() const { return (m_tmax - m_tmin)/(m_values.size()-1) ; }
82 
83  private:
84  unsigned char m_status ;
85  float m_tmin;
86  float m_tmax ;
87  std::vector<float> m_values;
88  } ;
89 }
90 
91 inline std::ostream& operator<<(std::ostream& os, const TRTCond::BinnedRtRelation& rtr) {
92  return rtr.write(os) ; }
93 
94 #endif
TRTCond::BinnedRtRelation::operator=
BinnedRtRelation & operator=(const BinnedRtRelation &rhs)=default
assignment
TRTCond::BinnedRtRelation::BinnedRtRelation
BinnedRtRelation()
default constructor
Definition: BinnedRtRelation.h:30
TRTCond::BinnedRtRelation::m_tmax
float m_tmax
maximum drifttime
Definition: BinnedRtRelation.h:86
TRTCond::BinnedRtRelation::drdt
virtual float drdt(float driftime) const
driftvelocity for given drifttime
Definition: BinnedRtRelation.cxx:35
TRTCond::BinnedRtRelation::read
virtual std::istream & read(std::istream &)
read from to ascii ostream
Definition: BinnedRtRelation.cxx:68
RtRelation.h
abstract base class for rt-relations
TRTCond::BinnedRtRelation::BinnedRtRelation
BinnedRtRelation(const BinnedRtRelation &rhs)=default
copy constructor
TRTCond::BinnedRtRelation::write
virtual std::ostream & write(std::ostream &) const
write to ascii ostream
Definition: BinnedRtRelation.cxx:61
TRTCond::BinnedRtRelation::BinnedRtRelation
BinnedRtRelation(float tmin, float tmax, const std::vector< float > &values, Status stat=Calibrated)
normal constructor
Definition: BinnedRtRelation.h:33
TRTCond::BinnedRtRelation::m_status
unsigned char m_status
status byte
Definition: BinnedRtRelation.h:84
TRTCond::BinnedRtRelation::drifttime
virtual float drifttime(float radius) const
drifttime for given radius
Definition: BinnedRtRelation.cxx:44
TRTCond::BinnedRtRelation::isequal
virtual bool isequal(const RtRelation &rhs) const
equality operator
Definition: BinnedRtRelation.cxx:13
TRTCond::RtRelation
Definition: RtRelation.h:27
TRTCond::BinnedRtRelation::m_values
std::vector< float > m_values
number of elements
Definition: BinnedRtRelation.h:87
TRTCond::RtRelation::Calibrated
@ Calibrated
Definition: RtRelation.h:30
TRTCond::BinnedRtRelation::tmin
float tmin() const
get access to minimum drifttime
Definition: BinnedRtRelation.h:73
TRTCond::BinnedRtRelation::tmax
float tmax() const
get access to maximum drifttime
Definition: BinnedRtRelation.h:75
TRTCond::BinnedRtRelation::status
virtual int status() const
status flag of (calibrated) rtrelation
Definition: BinnedRtRelation.h:49
TRTCond::RtRelation::Status
Status
enumerates status
Definition: RtRelation.h:30
beamspotman.stat
stat
Definition: beamspotman.py:266
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
TRTCond
Definition: BasicRtRelation.cxx:8
TRTCond::BinnedRtRelation::binsize
float binsize() const
get access to bin size
Definition: BinnedRtRelation.h:81
TRTCond::BinnedRtRelation::~BinnedRtRelation
virtual ~BinnedRtRelation()
desctructor
Definition: BinnedRtRelation.h:43
TRTCond::BinnedRtRelation
Definition: BinnedRtRelation.h:27
TRTCond::BinnedRtRelation::values
const std::vector< float > & values() const
get access to vector of radii for each drifttime bin
Definition: BinnedRtRelation.h:77
TRTCond::BinnedRtRelation::radius
virtual float radius(float driftime) const
radius for given drifttime
Definition: BinnedRtRelation.cxx:20
operator<<
std::ostream & operator<<(std::ostream &os, const TRTCond::BinnedRtRelation &rtr)
Definition: BinnedRtRelation.h:91
TRTCond::RtRelation::Undefined
@ Undefined
Definition: RtRelation.h:30
TRTCond::BinnedRtRelation::m_tmin
float m_tmin
minimum drifttime
Definition: BinnedRtRelation.h:85
TRTCond::BinnedRtRelation::footprint
virtual size_t footprint() const
memory allocated by this rt-relation
Definition: BinnedRtRelation.h:61
readCCLHist.float
float
Definition: readCCLHist.py:83
TRTCond::BinnedRtRelation::clone
virtual RtRelation * clone() const
clone function
Definition: BinnedRtRelation.h:46