ATLAS Offline Software
Loading...
Searching...
No Matches
StrawT0Container.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: StrawT0Container.h,v 1.7 2007-06-13 11:10:44 hansenph Exp $
13
14#ifndef TRT_CONDITIONSDATA_STRAWT0CONTAINER_H
15#define TRT_CONDITIONSDATA_STRAWT0CONTAINER_H
16
17#include <string>
22
23namespace TRTCond
24{
25
29 {
30 public:
31 static void erase( StrawT0& x) { x = StrawT0() ; }
32 static void copy( StrawT0& out, const StrawT0& in) { out = in ; }
33 static bool isvalid( const StrawT0& x ) { return x.isvalid() ; }
34 static void initialize( StrawT0& x) { x = StrawT0() ; }
35 static size_t footprint( const StrawT0& x) { return sizeof(x) ; }
36 static void print(const StrawT0& x) { x.print() ; }
37 static StrawT0 initialvalue() { return StrawT0() ; }
38 static bool isequal(const StrawT0& x, const StrawT0& y) { return x==y ; }
39 } ;
40
41
43 template <int LEVEL>
44 class StrawT0ContainerTemplate : public NestedContainer<LEVEL, StrawT0,StrawT0Trait>
45 {
46 private:
50 public:
53
56
58 float getT0(const ExpandedIdentifier& id) const {
60 return StrawT0Trait::isvalid(sd) ? m_t0packer.unpack(sd.packedt0()) : 0 ;
61 }
62
64 float getT0Err(const ExpandedIdentifier& id) const {
66 return StrawT0Trait::isvalid(sd) ? m_t0errpacker.unpack(sd.packedt0err()) : 0 ;
67 }
68
70 void setT0(const ExpandedIdentifier& id, float t0, float t0err) {
72 }
73
75 void setT0(float t0, float t0err) {
77 }
78
80 void unpack(const StrawT0& sd, float& t0 , float& t0err) const {
81 t0 = m_t0packer.unpack(sd.packedt0()) ;
82 t0err = m_t0errpacker.unpack(sd.packedt0err()) ;
83 }
84
86 float unpackT0( const StrawT0& sd ) const { return m_t0packer.unpack(sd.packedt0()); }
87 float unpackT0Err( const StrawT0& sd ) const { return m_t0errpacker.unpack(sd.packedt0err()); }
88
90 void setPackingLimits( float t0min, float t0max, float t0errmin, float t0errmax) ;
91
93 static const char* classname() { return "TRTCond::StrawT0Container" ; }
94 } ;
95
96 template <int LEVEL>
97 void StrawT0ContainerTemplate<LEVEL>::setPackingLimits( float t0min, float t0max, float t0errmin, float t0errmax)
98 {
100 LinearPacker<float,unsigned char> newt0packer(t0min,t0max) ;
101 LinearPacker<float,unsigned char> newt0errpacker(t0errmin,t0errmax) ;
104
107 this->getall( entries ) ;
108 for(typename NestedContainer<LEVEL,StrawT0,StrawT0Trait>::FlatContainer::iterator
109 it = entries.begin() ; it != entries.end(); ++it) {
110 StrawT0& sd = const_cast<StrawT0&>(*(it->second)) ;
111 float t0 = oldt0packer.unpack(sd.packedt0());
112 float t0err = oldt0errpacker. unpack(sd.packedt0err());
113 unsigned char newpackedt0 = newt0packer.pack(t0) ;
114 unsigned char newpackedt0err = newt0errpacker.pack(t0err) ;
115 sd = StrawT0( newpackedt0, newpackedt0err ) ;
116 }
117 m_t0packer = newt0packer ;
118 m_t0errpacker = newt0errpacker ;
119 }
120
121 // The typedef gives problems when generating the reflex dictionary
122 //typedef StrawT0ContainerTemplate<ExpandedIdentifier::DETECTOR> StrawT0Container ;
126 class StrawT0Container : public StrawT0ContainerTemplate<ExpandedIdentifier::DETECTOR>
127 {
128 } ;
129}
130
132
133#endif
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
static Double_t t0
'Nested' template container for storing TRT conditions data.
TRT straw t0 object.
#define y
#define x
Template class for packing data.
PackedType pack(UnpackedType x) const
Pack method.
UnpackedType unpack(PackedType val) const
Unpack method.
Nested container class, ie a base class at level l with daugthers at level l+1.
void setPackingLimits(float t0min, float t0max, float t0errmin, float t0errmax)
change the packing limits
static const char * classname()
classname used to talk to iovservice
float getT0(const ExpandedIdentifier &id) const
access to unpacked t0
virtual ~StrawT0ContainerTemplate()
destructor
void setT0(float t0, float t0err)
set the top-level t0
float unpackT0Err(const StrawT0 &sd) const
float getT0Err(const ExpandedIdentifier &id) const
access to unpacked t0 error
float unpackT0(const StrawT0 &sd) const
more public methods
void unpack(const StrawT0 &sd, float &t0, float &t0err) const
public method to unpack a StrawT0 object
void setT0(const ExpandedIdentifier &id, float t0, float t0err)
set t0
toplevel container for storing T0
trait class to deal with StrawT0 in NestedContainers
static void print(const StrawT0 &x)
static void initialize(StrawT0 &x)
static void copy(StrawT0 &out, const StrawT0 &in)
static bool isvalid(const StrawT0 &x)
static void erase(StrawT0 &x)
static StrawT0 initialvalue()
static bool isequal(const StrawT0 &x, const StrawT0 &y)
static size_t footprint(const StrawT0 &x)
class for t0 data for one straw
Definition StrawT0.h:23
double entries
Definition listroot.cxx:49