ATLAS Offline Software
StrawDxContainer.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
12 // $Id: StrawDxContainer.h,v 1.4 2007-06-13 11:10:43 hansenph Exp $
13 
14 #ifndef TRT_CONDITIONSDATA_STRAWDXCONTAINER_H
15 #define TRT_CONDITIONSDATA_STRAWDXCONTAINER_H
16 
17 #include <string>
18 #include "AthenaKernel/CLASS_DEF.h"
19 #include "AthenaKernel/CondCont.h"
20 
24 
25 namespace TRTCond
26 {
31  {
32  public:
33  static void erase( StrawDx& x) { initialize(x) ; }
34  static void copy( StrawDx& out, const StrawDx& in) { out = in ; }
35  static bool isvalid( const StrawDx& x ) { return x.isvalid() ; }
36  static void initialize( StrawDx& x) { x = initialvalue() ; }
37  static size_t footprint( const StrawDx& x) { return sizeof(x) ; }
38  static void print(const StrawDx& x) { x.print() ; }
39  static StrawDx initialvalue() { return StrawDx() ; }
40  static bool isequal(const StrawDx& x, const StrawDx& y) { return x==y ; }
41  } ;
42 
43 
46  template <int LEVEL>
47  class StrawDxContainerTemplate : public NestedContainer<LEVEL, StrawDx,StrawDxTrait>
48  {
49  private:
53  public:
56 
59 
61  float getDx1(const ExpandedIdentifier& id) const {
63  return StrawDxTrait::isvalid(sd) ? m_dxpacker.unpack(sd.packeddx1()) : 0 ;
64  }
65  float getDx2(const ExpandedIdentifier& id) const {
67  return StrawDxTrait::isvalid(sd) ? m_dxpacker.unpack(sd.packeddx2()) : 0 ;
68  }
70  float getDxErr(const ExpandedIdentifier& id) const {
72  return m_dxerrpacker.unpack(sd.packeddxerr());
73  }
74 
76  void setDx(const ExpandedIdentifier& id, float dx1, float dx2, float dxerr) {
78  }
79 
81  void setDx(float dx1, float dx2, float dxerr) {
83  }
84 
86  void unpack(const StrawDx& sd, float& dx1 , float& dx2, float& dxerr) const {
87  dx1 = m_dxpacker.unpack(sd.packeddx1()) ;
88  dx2 = m_dxpacker.unpack(sd.packeddx2()) ;
89  dxerr = m_dxerrpacker.unpack(sd.packeddxerr()) ;
90  }
91 
93  float unpackDx1( const StrawDx& sd ) const { return m_dxpacker.unpack(sd.packeddx1()); }
95  float unpackDx2( const StrawDx& sd ) const { return m_dxpacker.unpack(sd.packeddx2()); }
97  float unpackDxErr( const StrawDx& sd ) const { return m_dxerrpacker.unpack(sd.packeddxerr()); }
98 
100  static const char* classname() { return "TRTCond::StrawDxContainer" ; }
101  } ;
102 
103  // The typedef gives problems when generating the reflex dictionary
104  //typedef StrawDxContainerTemplate<ExpandedIdentifier::DETECTOR> StrawDxContainer ;
108  class StrawDxContainer : public StrawDxContainerTemplate<ExpandedIdentifier::DETECTOR>
109  {
110  } ;
111 }
112 
114 CONDCONT_DEF(TRTCond::StrawDxContainer,1168594249);
115 
116 #endif
TRTCond::StrawDxTrait::isvalid
static bool isvalid(const StrawDx &x)
Definition: StrawDxContainer.h:35
TRTCond::StrawDxContainerTemplate
Definition: StrawDxContainer.h:48
CondCont.h
Hold mappings of ranges to condition objects.
TRTCond::StrawDx
Definition: StrawDx.h:29
TRTCond::StrawDxContainerTemplate::unpackDxErr
float unpackDxErr(const StrawDx &sd) const
unpack dx near unterminated fixation
Definition: StrawDxContainer.h:97
TRTCond::StrawDxContainerTemplate::unpackDx1
float unpackDx1(const StrawDx &sd) const
unpack dx near electronics
Definition: StrawDxContainer.h:93
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
TRTCond::NestedContainerBase< NestingLevel, NestedContainer< NestingLevel+1, T, Trait >, T, Trait >::set
void set(const ExpandedIdentifier &id, const T &t)
set a value.
Definition: NestedContainer.h:191
TRTCond::StrawDxContainerTemplate::unpack
void unpack(const StrawDx &sd, float &dx1, float &dx2, float &dxerr) const
public method to unpack a StrawDx object
Definition: StrawDxContainer.h:86
TRTCond::StrawDxTrait::erase
static void erase(StrawDx &x)
Definition: StrawDxContainer.h:33
TRTCond::StrawDxTrait::initialvalue
static StrawDx initialvalue()
Definition: StrawDxContainer.h:39
StrawDx.h
TRT straw endpoint correction object.
x
#define x
TRTCond::StrawDxContainerTemplate::m_dxpacker
LinearPacker< float, unsigned char > m_dxpacker
packing borders
Definition: StrawDxContainer.h:51
python.selector.AtlRunQuerySelectorLhcOlc.sd
sd
Definition: AtlRunQuerySelectorLhcOlc.py:612
TRTCond::NestedContainer
Definition: NestedContainer.h:373
TRTCond::LinearPacker< float, unsigned char >
TRTCond::LinearPacker::unpack
UnpackedType unpack(PackedType val) const
Unpack method.
Definition: LinearPacker.h:27
TRTCond::StrawDxContainerTemplate::unpackDx2
float unpackDx2(const StrawDx &sd) const
unpack dx near unterminated fixation
Definition: StrawDxContainer.h:95
TRTCond::StrawDxContainerTemplate::~StrawDxContainerTemplate
virtual ~StrawDxContainerTemplate()
destructor
Definition: StrawDxContainer.h:58
TRTCond::StrawDxContainerTemplate::m_dxerrpacker
LinearPacker< float, unsigned char > m_dxerrpacker
Definition: StrawDxContainer.h:52
TRTCond::StrawDxContainerTemplate::setDx
void setDx(float dx1, float dx2, float dxerr)
set the top-level dx
Definition: StrawDxContainer.h:81
TRTCond::StrawDxTrait::print
static void print(const StrawDx &x)
Definition: StrawDxContainer.h:38
TRTCond::StrawDxContainer
Definition: StrawDxContainer.h:109
TRTCond::StrawDxContainerTemplate::getDx1
float getDx1(const ExpandedIdentifier &id) const
access to unpacked dx
Definition: StrawDxContainer.h:61
TRTCond
Definition: BasicRtRelation.cxx:8
TRTCond::StrawDxContainerTemplate::StrawDxContainerTemplate
StrawDxContainerTemplate()
constructor
Definition: StrawDxContainer.h:55
NestedContainer.h
'Nested' template container for storing TRT conditions data.
TRTCond::StrawDxTrait::initialize
static void initialize(StrawDx &x)
Definition: StrawDxContainer.h:36
y
#define y
TRTCond::StrawDxContainerTemplate::classname
static const char * classname()
classname used to talk to iovservice
Definition: StrawDxContainer.h:100
TRTCond::NestedContainerBase< NestingLevel, NestedContainer< NestingLevel+1, T, Trait >, T, Trait >::get
const T & get() const
get the default value
Definition: NestedContainer.h:232
TRTCond::StrawDxContainerTemplate::getDxErr
float getDxErr(const ExpandedIdentifier &id) const
access to unpacked dx error
Definition: StrawDxContainer.h:70
TRTCond::StrawDxTrait::copy
static void copy(StrawDx &out, const StrawDx &in)
Definition: StrawDxContainer.h:34
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
TRTCond::StrawDxTrait
Definition: StrawDxContainer.h:31
TRTCond::LinearPacker::pack
PackedType pack(UnpackedType x) const
Pack method.
Definition: LinearPacker.h:30
TRTCond::StrawDxContainerTemplate::setDx
void setDx(const ExpandedIdentifier &id, float dx1, float dx2, float dxerr)
set dx
Definition: StrawDxContainer.h:76
TRTCond::StrawDxTrait::footprint
static size_t footprint(const StrawDx &x)
Definition: StrawDxContainer.h:37
TRTCond::StrawDxTrait::isequal
static bool isequal(const StrawDx &x, const StrawDx &y)
Definition: StrawDxContainer.h:40
TRTCond::ExpandedIdentifier
Identifier for TRT detector elements in the conditions code.
Definition: InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h:30
CLASS_DEF.h
macros to associate a CLID to a type
TRTCond::StrawDxContainerTemplate::getDx2
float getDx2(const ExpandedIdentifier &id) const
Definition: StrawDxContainer.h:65
LinearPacker.h
CONDCONT_DEF
CONDCONT_DEF(TRTCond::StrawDxContainer, 1168594249)