 |
ATLAS Offline Software
|
Go to the documentation of this file.
18 #include "GaudiKernel/IToolSvc.h"
22 #include "Identifier/Identifier.h"
28 ISvcLocator* pSvcLocator )
29 : base_class(
name,pSvcLocator),
30 m_detStore(
"DetectorStore",
name),
31 m_par_dxcontainerkey(
"/TRT/Calib/DX"),
32 m_par_strawtextfile(
""),
33 m_par_forcecallback(false),
36 m_streamer(
"AthenaOutputStreamTool/CondStream1")
51 ATH_MSG_INFO (
"TRT_StrawAlignDbSvc initialize method called");
59 if( dxcontainerexists ) {
68 auto dxcontainer = std::make_unique<StrawDxContainer>();
79 return StatusCode::SUCCESS;
85 ATH_MSG_INFO (
"TRT_StrawAlignDbSvc finalize method called");
86 return StatusCode::SUCCESS;
98 StrawDxContainer::FlatContainer packedstrawdata ;
100 dxcontainer->getall( packedstrawdata ) ;
104 << packedstrawdata.size());
106 for(
auto &
it : packedstrawdata) {
109 float dx1=dxcontainer->getDx1(calid) ;
110 float dx2=dxcontainer->getDx2(calid) ;
111 float dxerr=dxcontainer->getDxErr(calid) ;
113 << std::setprecision(5)
114 << std::setw(12) << dx1 <<
" "
115 << std::setw(12) << dx2 <<
" "
116 << std::setw(12) << dxerr << std::endl ;
119 return StatusCode::SUCCESS ;
137 return StatusCode::FAILURE;
139 dxcontainer->clear() ;
144 while ((
infile >>
id >> dx1 >> dx2 >> dxerr ) ) {
145 setDx(
id,dx1,dx2,dxerr) ;
146 ATH_MSG_DEBUG (
" read from file: dx1 " << dx1 <<
" dx2 " << dx2 <<
" dxerr " << dxerr);
149 size_t dxfootprint = dxcontainer->footprint() ;
156 std::list<std::string>
keys ;
159 return StatusCode::SUCCESS ;
181 ATH_MSG_INFO (
" Streamed out and committed " << typeKeys.size() <<
" objects ");
182 return StatusCode::SUCCESS;
193 SmartIF<IIOVRegistrationSvc> regsvc{service(
"IOVRegistrationSvc")};
196 if (StatusCode::SUCCESS==regsvc->registerIOV(StrawDxContainer::classname(),
202 return( StatusCode::SUCCESS);
208 for (std::list<std::string>::const_iterator
209 itr=
keys.begin(); itr!=
keys.end(); ++itr)
210 ATH_MSG_INFO (
" IOVCALLBACK for key " << *itr <<
" number " <<
I);
215 return StatusCode::SUCCESS;
const InDetDD::TRT_DetectorManager * m_trtman
id helper
const StrawDxContainer * getConstDxContainer() const
ToolHandle< IAthenaOutputStreamTool > m_streamer
persistifiable container
void setDx(const TRTCond::ExpandedIdentifier &id, float dx1, float dx2, float dxerr)
set endpoints for a TRTCond::ExpandedIdentifier
StatusCode IOVCallBack(IOVSVC_CALLBACK_ARGS)
IOV call back for dx objects. normally this doesn't do anything.
interface to TRT straw alignment constants
bool m_par_forcecallback
input text file
This is an interface to a tool used to register conditions objects in the Interval of Validity (IOV) ...
#define IOVSVC_CALLBACK_ARGS_P(I, K)
short hand for IOVSvc call back argument list, to be used when access to formal arguments is needed,...
virtual StatusCode readTextFile(const std::string &file)
read calibration from text file into TDS
StatusCode writeTextFile(const std::string &file) const
write calibration constants to flat text file
TRT_StrawAlignDbSvc(const std::string &name, ISvcLocator *pSvcLocator)
constructor
const DataHandle< StrawDxContainer > m_dxcontainer
detector manager
virtual ~TRT_StrawAlignDbSvc()
destructor
StatusCode registerObjects(std::string tag, int run1, int event1, int run2, int event2) const
register calibration objects with the IoV service
::StatusCode StatusCode
StatusCode definition for legacy code.
ServiceHandle< StoreGateSvc > m_detStore
std::string m_par_strawtextfile
folder name
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
#define ATH_MSG_WARNING(x)
StrawDxContainer * getDxContainer() const
access to containers
StatusCode streamOutObjects() const
write the calibration objects to output, after cleaning
const TRT_ID * m_trtid
force callback to manager
virtual StatusCode finalize()
tool finalize
Identifier for TRT detector elements in the conditions code.
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
virtual StatusCode initialize()
tool initialize
std::string m_par_dxcontainerkey