ATLAS Offline Software
Loading...
Searching...
No Matches
StrawDxMultChanContainer.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
12// $Id: StrawDxMultChanContainer.h,v 1.2 2007-06-13 11:10:43 hansenph Exp $
13
14#ifndef TRTCONDITIONSDATA_STRAWDXMULTCHANCONTAINER_H
15#define TRTCONDITIONSDATA_STRAWDXMULTCHANCONTAINER_H
16
20#include "GaudiKernel/MsgStream.h"
21
22namespace TRTCond
23{
25
28 class StrawDxMultChanContainer : public MultChanContainer<StrawDxContainerTemplate<ExpandedIdentifier::LAYERWHEEL> >
29 {
30 public:
33
36
39
41 float getDx1(const ExpandedIdentifier& id) const {
42 ContainerWithValue valwithcontainer = getWithContainer( id ) ;
43 return StrawDxTrait::isvalid(*valwithcontainer.second) ? valwithcontainer.first->unpackDx1( *valwithcontainer.second ) : 0 ;
44 }
45
46 float getDx2(const ExpandedIdentifier& id) const {
47 ContainerWithValue valwithcontainer = getWithContainer( id ) ;
48 return StrawDxTrait::isvalid(*valwithcontainer.second) ? valwithcontainer.first->unpackDx2( *valwithcontainer.second ) : 0 ;
49 }
50
52 float getDxErr(const ExpandedIdentifier& id) const {
53 ContainerWithValue valwithcontainer = getWithContainer( id ) ;
54 return StrawDxTrait::isvalid(*valwithcontainer.second) ? valwithcontainer.first->unpackDxErr( *valwithcontainer.second ) : 0 ;
55 }
56
58 void setDx(const ExpandedIdentifier& id, float dx1, float dx2, float dxerr) {
59 if( id.level()==ExpandedIdentifier::DETECTOR ) {
60 findContainer(id)->setDx(dx1,dx2,dxerr) ;
61 } else if( id.level()==ExpandedIdentifier::BARRELEC ) {
62 MsgStream log(Athena::getMessageSvc(),"StrawDxMultChanContainer");
63 log << MSG::WARNING << "Sorry: cannot store containers at BARREL_EC granularity" << endmsg ;
64 } else {
65 findContainer(id)->setDx( id, dx1, dx2, dxerr) ;
66 }
67 }
68
70 void unpack(const ExpandedIdentifier& id, float& dx1 , float& dx2, float& dxerr) const {
72 if(container==nullptr) {
73 MsgStream log(Athena::getMessageSvc(),"StrawDxMultChanContainer");
74 log << MSG::ERROR << "cannot find container channel " << channelId(id) << endmsg;
75 } else{
76 dx1 = container->getDx1(id);
77 dx2 = container->getDx2(id);
78 dxerr = container->getDxErr(id);
79 }
80 }
81
83 static const char* classname() { return "TRTCond::StrawDxMultChanContainer" ; }
84 } ;
85
86}
87
89
90#endif
#define endmsg
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
CondMultChanCollection for storing TRT conditions data.
Class for storing/accessing trt endpoint corrections data.
StrawDxContainerTemplate< ExpandedIdentifier::LAYERWHEEL > * findContainer(const ExpandedIdentifier &id)
const StrawDxContainerTemplate< ExpandedIdentifier::LAYERWHEEL > * getContainer(size_t chanid) const
std::pair< const StrawDxContainerTemplate< ExpandedIdentifier::LAYERWHEEL > *, const typename StrawDxContainerTemplate< ExpandedIdentifier::LAYERWHEEL >::value_type * > ContainerWithValue
Template class for storing/accessing trt endpoint correction data.
void setDx(const ExpandedIdentifier &id, float dx1, float dx2, float dxerr)
set dx
Multichannel container for StrawDx objects.
float getDx2(const ExpandedIdentifier &id) const
access to unpacked dx far from electronics
void unpack(const ExpandedIdentifier &id, float &dx1, float &dx2, float &dxerr) const
method to unpack a StrawDx object
float getDx1(const ExpandedIdentifier &id) const
access to unpacked dx near electronics
StrawDxContainerTemplate< ExpandedIdentifier::LAYERWHEEL >::FlatContainer FlatContainer
typedefs
void setDx(const ExpandedIdentifier &id, float dx1, float dx2, float dxerr)
set dx
static const char * classname()
classname used to talk to iovservice
float getDxErr(const ExpandedIdentifier &id) const
access to unpacked dx error
static bool isvalid(const StrawDx &x)
singleton-like access to IMessageSvc via open function and helper
IMessageSvc * getMessageSvc(bool quiet=false)
StrawDxContainerTemplate< ExpandedIdentifier::LAYERWHEEL > StrawDxLayerContainer