ATLAS Offline Software
Loading...
Searching...
No Matches
StrawT0MultChanContainer.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
5// @file StrawT0MultChanContainer.h
6//
7// @brief
8// Class for storing/accessing trt t0 data with channels
9//
10// @author Wouter Hulsbergen <wouter.hulsbergen@cern.ch>
11//
12// $Id: StrawT0MultChanContainer.h,v 1.5 2007-06-13 11:10:44 hansenph Exp $
13
14#ifndef TRTCONDITIONSDATA_STRAWT0MULTCHANCONTAINER_H
15#define TRTCONDITIONSDATA_STRAWT0MULTCHANCONTAINER_H
16
21#include "GaudiKernel/MsgStream.h"
22
23namespace TRTCond
24{
26
30 class StrawT0MultChanContainer : public MultChanContainer<StrawT0ContainerTemplate<ExpandedIdentifier::LAYERWHEEL> >
31 {
32 public:
35
38
41
43 float getT0(const ExpandedIdentifier& id) const {
44 ContainerWithValue valwithcontainer = getWithContainer( id ) ;
45 return StrawT0Trait::isvalid(*valwithcontainer.second) ? valwithcontainer.first->unpackT0( *valwithcontainer.second ) : 0 ;
46 }
47
49 float getT0Err(const ExpandedIdentifier& id) const {
50 ContainerWithValue valwithcontainer = getWithContainer( id ) ;
51 return StrawT0Trait::isvalid(*valwithcontainer.second) ? valwithcontainer.first->unpackT0Err( *valwithcontainer.second ) : 0 ;
52 }
53
55 void setT0(const ExpandedIdentifier& id, float t0, float t0err) {
56 if( id.level()==ExpandedIdentifier::DETECTOR ) {
57 findContainer(id)->setT0(t0,t0err) ;
58 } else if( id.level()==ExpandedIdentifier::BARRELEC ) {
59 MsgStream log(Athena::getMessageSvc(),"StrawT0MultChanContainer");
60 log << MSG::WARNING << "Sorry: cannot store containers at BARREL_EC granularity" << endmsg;
61 } else {
62 findContainer(id)->setT0( id, t0,t0err) ;
63 }
64 }
65
66 void unpack(const ExpandedIdentifier& id, const StrawT0& sd, float& t0 , float& t0err) const {
68 if(not container){
69 MsgStream log(Athena::getMessageSvc(),"StrawT0MultChanContainer");
70 log << MSG::ERROR << "cannot find container channel" << channelId(id) << endmsg ;
71 } else {
72 container->unpack( sd,t0,t0err ) ;
73 }
74 }
75
77 void setPackingLimits( float t0min, float t0max, float t0errmin, float t0errmax) ;
78
80 static const char* classname() { return "TRTCond::StrawT0MultChanContainer" ; }
81 } ;
82
83 inline void StrawT0MultChanContainer::setPackingLimits( float t0min, float t0max, float t0errmin, float t0errmax)
84 {
86 for(dauit = this->begin() ; dauit != this->end(); ++dauit)
87 (*dauit)->setPackingLimits( t0min,t0max,t0errmin,t0errmax ) ;
88 }
89}
90
91
93CONDCONT_DEF(TRTCond::StrawT0MultChanContainer,182150756);
94
95
96#endif
#define endmsg
Hold mappings of ranges to condition objects.
#define CONDCONT_DEF(...)
Definition CondCont.h:1413
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
static Double_t t0
CondMultChanCollection for storing TRT conditions data.
Class for storing/accessing trt t0 data.
StrawT0ContainerTemplate< ExpandedIdentifier::LAYERWHEEL > * findContainer(const ExpandedIdentifier &id)
const StrawT0ContainerTemplate< ExpandedIdentifier::LAYERWHEEL > * getContainer(size_t chanid) const
std::pair< const StrawT0ContainerTemplate< ExpandedIdentifier::LAYERWHEEL > *, const typename StrawT0ContainerTemplate< ExpandedIdentifier::LAYERWHEEL >::value_type * > ContainerWithValue
class for storing/accessing trt t0 data
void setT0(const ExpandedIdentifier &id, float t0, float t0err)
set t0
A COOL Multichannel container for StrawT0 objects.
void unpack(const ExpandedIdentifier &id, 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
void setPackingLimits(float t0min, float t0max, float t0errmin, float t0errmax)
change the packing limits. NOTE: this only works for channels that already exist!
static const char * classname()
classname used to talk to iovservice
float getT0(const ExpandedIdentifier &id) const
access to unpacked t0
float getT0Err(const ExpandedIdentifier &id) const
access to unpacked t0 error
StrawT0ContainerTemplate< ExpandedIdentifier::LAYERWHEEL >::FlatContainer FlatContainer
typedefs
static bool isvalid(const StrawT0 &x)
class for t0 data for one straw
Definition StrawT0.h:23
singleton-like access to IMessageSvc via open function and helper
IMessageSvc * getMessageSvc(bool quiet=false)
StrawT0ContainerTemplate< ExpandedIdentifier::LAYERWHEEL > StrawT0LayerContainer