ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MuonCalib::CalibrationDbIOTool Class Reference

#include <CalibrationDbIOTool.h>

Inheritance diagram for MuonCalib::CalibrationDbIOTool:
Collaboration diagram for MuonCalib::CalibrationDbIOTool:

Public Member Functions

 CalibrationDbIOTool (const std::string &t, const std::string &n, const IInterface *p)
 constructor More...
 
virtual ~CalibrationDbIOTool ()
 
StatusCode initialize () override
 initialisation More...
 
StatusCode WriteT0 (const MdtTubeFitContainer *t0_output, const NtupleStationId &station_id, int iov_start, int iov_end) override
 write out t0 More...
 
StatusCode LoadT0 (std::map< NtupleStationId, MdtStationT0Container * > &t0s, int) override
 load t0s More...
 
StatusCode WriteRt (const RtCalibrationOutput *rt_relation, std::shared_ptr< const IRtResolution > resolution, const NtupleStationId &station_id, int iov_start, int iov_end, bool, bool) override
 write rt More...
 
StatusCode LoadRt (std::map< NtupleStationId, IRtRelation * > &rts, std::map< NtupleStationId, IRtResolution * > &res, int) override
 load rts More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 interface method More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

void fillRtPoints (const std::shared_ptr< const IRtRelation > &rt_relation, std::vector< SamplePoint > &points)
 convert rt and resolution to points More...
 
void fillResPoints (const std::shared_ptr< const IRtResolution > &rt_resolution, std::vector< SamplePoint > &points)
 
CalibDbConnectionget_connection (int write)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

std::string m_calib_dir
 path to calibration directory - job option More...
 
bool m_use_validated_t0
 if true use validated - jo More...
 
bool m_use_validated_rt = false
 
std::string m_db_ConnectionString
 
std::string m_writer_connection_string
 
std::string m_db_WorkingSchema
 
std::string m_reader_account
 account data More...
 
std::string m_reader_password
 
std::string m_writer_account
 
std::string m_writer_password
 
int m_max_rt_points
 
int m_headid
 
std::string m_sitename
 
std::vector< MuonCalib::NtupleStationIdm_region_ids
 
std::unique_ptr< CalibDbConnectionm_connection
 pointer to db connection More...
 
std::array< std::unique_ptr< CalibDbConnection >, 2 > m_data_connections
 
std::unique_ptr< CalibHeadOperationsm_head_ops
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 29 of file CalibrationDbIOTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ CalibrationDbIOTool()

MuonCalib::CalibrationDbIOTool::CalibrationDbIOTool ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

constructor

Definition at line 49 of file CalibrationDbIOTool.cxx.

49  :
51  declareInterface<ICalibrationIOTool>(this);
52  declareProperty("ConnectionString", m_db_ConnectionString);
53  declareProperty("WriterConnectionString", m_writer_connection_string);
54  declareProperty("WorkingSchema", m_db_WorkingSchema);
55  m_headid = -1;
56  declareProperty("HeadId", m_headid);
57  declareProperty("SiteName", m_sitename);
58  m_max_rt_points = 100;
59  declareProperty("MaxRtPoints", m_max_rt_points);
60  m_use_validated_t0 = true;
61  declareProperty("UseValidaedT0", m_use_validated_t0);
62  m_use_validated_t0 = false;
63  declareProperty("UseValidaedRt", m_use_validated_rt);
64  declareProperty("ReaderAccount", m_reader_account);
65  declareProperty("ReaderPassword", m_reader_password);
66  declareProperty("WriterAccount", m_writer_account);
67  declareProperty("WriterPassword", m_writer_password);
68  }

◆ ~CalibrationDbIOTool()

MuonCalib::CalibrationDbIOTool::~CalibrationDbIOTool ( )
virtualdefault

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ fillResPoints()

void MuonCalib::CalibrationDbIOTool::fillResPoints ( const std::shared_ptr< const IRtResolution > &  rt_resolution,
std::vector< SamplePoint > &  points 
)
private

Definition at line 239 of file CalibrationDbIOTool.cxx.

239  {
240  for (auto & point : points) { point.set_error(rt_resolution->resolution(point.x1())); }
241  }

◆ fillRtPoints()

void MuonCalib::CalibrationDbIOTool::fillRtPoints ( const std::shared_ptr< const IRtRelation > &  rt_relation,
std::vector< SamplePoint > &  points 
)
private

convert rt and resolution to points

Definition at line 204 of file CalibrationDbIOTool.cxx.

204  {
205  points.clear();
206  // for rt relations based on support points, write points
207  std::shared_ptr<const RtRelationLookUp> rt_lookup = std::dynamic_pointer_cast<const RtRelationLookUp>(rt);
208  const CalibFunc::ParVec &rt_param = rt->parameters();
209  if (rt_lookup && static_cast<int>(rt_lookup->nPar() - 2) <= m_max_rt_points) {
210  double t_min(rt_param[0]);
211  double bin_size = rt_param[1];
212  unsigned int nb_points(rt_lookup->nPar() - 2);
213  for (unsigned int k = 0; k < nb_points; k++) {
214  double radius(rt_param[k + 2]);
215  if (std::isnan(radius)) {
216  ATH_MSG_WARNING("Skipping NAN");
217  continue;
218  }
219  SamplePoint point(t_min + bin_size * k, rt_param[k + 2], -1);
220  points.push_back(point);
221  }
222  return;
223  }
224  std::shared_ptr<const RtSpline> rt_spline = std::dynamic_pointer_cast<const RtSpline>(rt);
225  if (rt_spline && static_cast<int>(rt_param.size() / 2) <= m_max_rt_points) {
226  for (unsigned int i = 0; i < rt_param.size(); i += 2) {
227  SamplePoint point(rt_param[i], rt_param[i + 1], -1);
228  points.push_back(point);
229  }
230  return;
231  }
232  // for all others, or if the number of support points is too high, calculate new support points
233  for (int i = 0; i < m_max_rt_points; i++) {
234  double t = rt->tLower() + i * ((rt->tUpper() - rt->tLower()) / (m_max_rt_points - 1));
235  SamplePoint point(t, rt->radius(t), -1.0);
236  }
237  }

◆ get_connection()

CalibDbConnection * MuonCalib::CalibrationDbIOTool::get_connection ( int  write)
private

Definition at line 243 of file CalibrationDbIOTool.cxx.

243  {
244  if (m_data_connections[write]) { return m_data_connections[write].get(); }
245  m_data_connections[write] = std::unique_ptr<CalibDbConnection>{m_head_ops->GetDataConnection(
247  return m_data_connections[write].get();
248  }

◆ initialize()

StatusCode MuonCalib::CalibrationDbIOTool::initialize ( )
override

initialisation

Definition at line 70 of file CalibrationDbIOTool.cxx.

70  {
71  SmartIF<RegionSelectionSvc> reg_sel_svc{service("RegionSelectionSvc")};
72  ATH_CHECK(reg_sel_svc.isValid());
73  m_region_ids = reg_sel_svc->GetStationsInRegions();
74  ATH_MSG_INFO(" CalibrationDbIOTool::initialize() - number of selected regions: " << m_region_ids.size());
75 
76  ATH_MSG_INFO("open connection");
77  m_connection = std::make_unique<CalibDbConnection>(m_db_ConnectionString, m_db_WorkingSchema);
78  ATH_MSG_INFO(".");
80  if (!m_connection->OpenConnection()) {
81  ATH_MSG_FATAL("Cannot open connection to database!");
82  return StatusCode::FAILURE;
83  }
84  ATH_MSG_INFO("..");
85  m_head_ops = std::make_unique<CalibHeadOperations>(*m_connection);
86  if (m_headid < 0) {
87  m_headid = m_head_ops->GetLatestHeadId();
88  if (m_headid < 0) {
89  ATH_MSG_FATAL("Cannot get latest head_id for site " << m_sitename);
90  return StatusCode::FAILURE;
91  }
92  }
93  return StatusCode::SUCCESS;
94  }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

static const InterfaceID& MuonCalib::ICalibrationIOTool::interfaceID ( )
inlinestaticinherited

interface method

Definition at line 35 of file ICalibrationIOTool.h.

35  {
36  static const InterfaceID IID_CalibrationIOTool("MuonCalib::ICalibrationIOTool", 1, 0);
37  return IID_CalibrationIOTool;
38  }

◆ LoadRt()

StatusCode MuonCalib::CalibrationDbIOTool::LoadRt ( std::map< NtupleStationId, IRtRelation * > &  rts,
std::map< NtupleStationId, IRtResolution * > &  res,
int   
)
overridevirtual

load rts

Implements MuonCalib::ICalibrationIOTool.

Definition at line 163 of file CalibrationDbIOTool.cxx.

164  {
165  if (!m_connection->OpenConnection()) {
166  ATH_MSG_FATAL("Open Connection failed!");
167  return StatusCode::FAILURE;
168  } else {
169  if (!get_connection(0)) { return StatusCode::FAILURE; }
170  m_data_connections[0]->OpenConnection();
171  CalibRtDbOperations rt_op(*m_data_connections[0]);
172  // loop on all the ids in the selected calibration region
173  RtFromPoints rt_from_points;
174  RtResolutionFromPoints res_from_points;
176  std::vector<SamplePoint> in_points;
177  RtFullInfo full_info;
178  if (!rt_op.LoadRt(*it, m_headid, m_use_validated_rt, m_sitename, in_points, &full_info)) continue;
179  ATH_MSG_INFO("Reading rts for region " << it->regionId());
180  std::vector<SamplePoint> outpoints;
181  float tmax_diff(-9e9);
182  for (auto & in_point : in_points) {
183  if (in_point.x2() < -99) {
184  tmax_diff = in_point.x1();
185  continue;
186  }
187  SamplePoint outpoint(in_point.x1(), in_point.x2(), 1.0);
188  outpoints.push_back(outpoint);
189  }
190  rts[*it] = new RtRelationLookUp(rt_from_points.getRtRelationLookUp(outpoints));
191  if (tmax_diff > -8e8) { rts[*it]->SetTmaxDiff(tmax_diff); }
192  outpoints.clear();
193  for (auto & in_point : in_points) {
194  if (in_point.x2() < -99) { continue; }
195  SamplePoint outpoint(in_point.x1(), in_point.error(), 1.0);
196  outpoints.push_back(outpoint);
197  }
198  res[*it] = new RtResolutionLookUp(res_from_points.getRtResolutionLookUp(outpoints));
199  }
200  }
201  return StatusCode::SUCCESS;
202  }

◆ LoadT0()

StatusCode MuonCalib::CalibrationDbIOTool::LoadT0 ( std::map< NtupleStationId, MdtStationT0Container * > &  t0s,
int   
)
overridevirtual

load t0s

Implements MuonCalib::ICalibrationIOTool.

Definition at line 114 of file CalibrationDbIOTool.cxx.

114  {
115  if (!m_connection->OpenConnection()) {
116  ATH_MSG_FATAL("Open Connection failed!");
117  return StatusCode::FAILURE;
118  } else {
119  if (!get_connection(0)) { return StatusCode::FAILURE; }
120  m_data_connections[0]->OpenConnection();
121  CalibT0DbOperations t0_op(*m_data_connections[0]);
122  t0s.clear();
123 
124  // loop on all the ids in the selected calibration region
126  ATH_MSG_INFO("Reading t0s for region " << it->regionId());
128  t0 = t0_op.LoadT0Calibration(*it, m_headid, m_sitename);
129  if (t0 != nullptr) t0s[*it] = t0;
130  }
131  }
132  return StatusCode::SUCCESS;
133  }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

◆ WriteRt()

StatusCode MuonCalib::CalibrationDbIOTool::WriteRt ( const RtCalibrationOutput rt_relation,
std::shared_ptr< const IRtResolution resolution,
const NtupleStationId station_id,
int  iov_start,
int  iov_end,
bool  ,
bool   
)
overridevirtual

write rt

Implements MuonCalib::ICalibrationIOTool.

Definition at line 135 of file CalibrationDbIOTool.cxx.

137  {
138  std::vector<SamplePoint> points;
139  // fill rt poits
140  fillRtPoints(rt_relation->rt(), points);
141  // fill resolution points
143  // fill multilayer rt difference as pseudo-point
144  if (rt_relation->rt()->hasTmaxDiff()) {
145  SamplePoint point(rt_relation->rt()->GetTmaxDiff(), -99.9, 0.0);
146  points.push_back(point);
147  }
148  if (!m_connection->OpenConnection()) {
149  ATH_MSG_FATAL("Open Connection failed!");
150  return StatusCode::FAILURE;
151  } else {
152  if (!get_connection(1)) { return StatusCode::FAILURE; }
153  m_data_connections[1]->OpenConnection();
154  CalibRtDbOperations rt_op(*m_data_connections[1]);
155  if (!rt_op.WriteUpdateRt(station_id, m_headid, m_sitename, points, 0, rt_relation->fullInfo().get())) {
156  ATH_MSG_FATAL("Writing rt failed!");
157  return StatusCode::FAILURE;
158  }
159  }
160  return StatusCode::SUCCESS;
161  }

◆ WriteT0()

StatusCode MuonCalib::CalibrationDbIOTool::WriteT0 ( const MdtTubeFitContainer t0_output,
const NtupleStationId station_id,
int  iov_start,
int  iov_end 
)
overridevirtual

write out t0

Implements MuonCalib::ICalibrationIOTool.

Definition at line 96 of file CalibrationDbIOTool.cxx.

96  {
97  ATH_MSG_INFO("Writing to database");
98  if (!m_connection->OpenConnection()) {
99  ATH_MSG_FATAL("Open Connection failed!");
100  return StatusCode::FAILURE;
101  } else {
102  if (!get_connection(1)) { return StatusCode::FAILURE; }
103  m_data_connections[1]->OpenConnection();
104  CalibT0DbOperations t0_op(*m_data_connections[1]);
105  std::vector<int> val(0);
106  if (!t0_op.WriteT0Chamber(it, t0, val, m_headid, m_sitename)) {
107  ATH_MSG_FATAL("Writing t0 failed!");
108  return StatusCode::FAILURE;
109  }
110  }
111  return StatusCode::SUCCESS;
112  }

Member Data Documentation

◆ m_calib_dir

std::string MuonCalib::CalibrationDbIOTool::m_calib_dir
private

path to calibration directory - job option

Definition at line 50 of file CalibrationDbIOTool.h.

◆ m_connection

std::unique_ptr<CalibDbConnection> MuonCalib::CalibrationDbIOTool::m_connection
private

pointer to db connection

Definition at line 66 of file CalibrationDbIOTool.h.

◆ m_data_connections

std::array<std::unique_ptr<CalibDbConnection>, 2> MuonCalib::CalibrationDbIOTool::m_data_connections
private

Definition at line 67 of file CalibrationDbIOTool.h.

◆ m_db_ConnectionString

std::string MuonCalib::CalibrationDbIOTool::m_db_ConnectionString
private

Definition at line 54 of file CalibrationDbIOTool.h.

◆ m_db_WorkingSchema

std::string MuonCalib::CalibrationDbIOTool::m_db_WorkingSchema
private

Definition at line 56 of file CalibrationDbIOTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_head_ops

std::unique_ptr<CalibHeadOperations> MuonCalib::CalibrationDbIOTool::m_head_ops
private

Definition at line 68 of file CalibrationDbIOTool.h.

◆ m_headid

int MuonCalib::CalibrationDbIOTool::m_headid
private

Definition at line 62 of file CalibrationDbIOTool.h.

◆ m_max_rt_points

int MuonCalib::CalibrationDbIOTool::m_max_rt_points
private

Definition at line 61 of file CalibrationDbIOTool.h.

◆ m_reader_account

std::string MuonCalib::CalibrationDbIOTool::m_reader_account
private

account data

Definition at line 58 of file CalibrationDbIOTool.h.

◆ m_reader_password

std::string MuonCalib::CalibrationDbIOTool::m_reader_password
private

Definition at line 58 of file CalibrationDbIOTool.h.

◆ m_region_ids

std::vector<MuonCalib::NtupleStationId> MuonCalib::CalibrationDbIOTool::m_region_ids
private

Definition at line 64 of file CalibrationDbIOTool.h.

◆ m_sitename

std::string MuonCalib::CalibrationDbIOTool::m_sitename
private

Definition at line 63 of file CalibrationDbIOTool.h.

◆ m_use_validated_rt

bool MuonCalib::CalibrationDbIOTool::m_use_validated_rt = false
private

Definition at line 52 of file CalibrationDbIOTool.h.

◆ m_use_validated_t0

bool MuonCalib::CalibrationDbIOTool::m_use_validated_t0
private

if true use validated - jo

Definition at line 52 of file CalibrationDbIOTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writer_account

std::string MuonCalib::CalibrationDbIOTool::m_writer_account
private

Definition at line 59 of file CalibrationDbIOTool.h.

◆ m_writer_connection_string

std::string MuonCalib::CalibrationDbIOTool::m_writer_connection_string
private

Definition at line 55 of file CalibrationDbIOTool.h.

◆ m_writer_password

std::string MuonCalib::CalibrationDbIOTool::m_writer_password
private

Definition at line 59 of file CalibrationDbIOTool.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
MuonCalib::CalibrationDbIOTool::m_data_connections
std::array< std::unique_ptr< CalibDbConnection >, 2 > m_data_connections
Definition: CalibrationDbIOTool.h:67
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
MuonCalib::CalibrationDbIOTool::m_reader_account
std::string m_reader_account
account data
Definition: CalibrationDbIOTool.h:58
RtResolutionFromPoints
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TRTCalib_Extractor.rts
dictionary rts
Definition: TRTCalib_Extractor.py:15
TRTCalib_cfilter.t0s
list t0s
Definition: TRTCalib_cfilter.py:110
MuonCalib::CalibrationDbIOTool::m_db_ConnectionString
std::string m_db_ConnectionString
Definition: CalibrationDbIOTool.h:54
ALFA_EventTPCnv_Dict::t0
std::vector< ALFA_RawData_p1 > t0
Definition: ALFA_EventTPCnvDict.h:42
skel.it
it
Definition: skel.GENtoEVGEN.py:396
MuonCalib::CalibrationDbIOTool::fillResPoints
void fillResPoints(const std::shared_ptr< const IRtResolution > &rt_resolution, std::vector< SamplePoint > &points)
Definition: CalibrationDbIOTool.cxx:239
MuonCalib::CalibrationDbIOTool::m_head_ops
std::unique_ptr< CalibHeadOperations > m_head_ops
Definition: CalibrationDbIOTool.h:68
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
MuonCalib::CalibrationDbIOTool::m_region_ids
std::vector< MuonCalib::NtupleStationId > m_region_ids
Definition: CalibrationDbIOTool.h:64
Dedxcorrection::resolution
double resolution[nGasTypes][nParametersResolution]
Definition: TRT_ToT_Corrections.h:46
MuonCalib::CalibrationDbIOTool::m_reader_password
std::string m_reader_password
Definition: CalibrationDbIOTool.h:58
MuonCalib::CalibrationDbIOTool::m_db_WorkingSchema
std::string m_db_WorkingSchema
Definition: CalibrationDbIOTool.h:56
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
MuonCalib::CalibrationDbIOTool::m_sitename
std::string m_sitename
Definition: CalibrationDbIOTool.h:63
MuonCalib::CalibrationDbIOTool::m_writer_account
std::string m_writer_account
Definition: CalibrationDbIOTool.h:59
MuonCalib::CalibrationDbIOTool::fillRtPoints
void fillRtPoints(const std::shared_ptr< const IRtRelation > &rt_relation, std::vector< SamplePoint > &points)
convert rt and resolution to points
Definition: CalibrationDbIOTool.cxx:204
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
MuonCalib::CalibrationDbIOTool::m_use_validated_t0
bool m_use_validated_t0
if true use validated - jo
Definition: CalibrationDbIOTool.h:52
python.ByteStreamConfig.write
def write
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:248
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
MuonCalib::CalibrationDbIOTool::m_headid
int m_headid
Definition: CalibrationDbIOTool.h:62
MuonCalib::CalibFunc::ParVec
std::vector< double > ParVec
Definition: CalibFunc.h:35
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MuonCalib::CalibrationDbIOTool::m_writer_password
std::string m_writer_password
Definition: CalibrationDbIOTool.h:59
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
MuonCalib::CalibrationDbIOTool::m_max_rt_points
int m_max_rt_points
Definition: CalibrationDbIOTool.h:61
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
MuonCalib::CalibrationDbIOTool::m_connection
std::unique_ptr< CalibDbConnection > m_connection
pointer to db connection
Definition: CalibrationDbIOTool.h:66
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
MuonCalib::CalibrationDbIOTool::m_writer_connection_string
std::string m_writer_connection_string
Definition: CalibrationDbIOTool.h:55
MdtStationT0Container
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
jobOptions.points
points
Definition: jobOptions.GenevaPy8_Zmumu.py:97
MuonCalib::CalibrationDbIOTool::m_use_validated_rt
bool m_use_validated_rt
Definition: CalibrationDbIOTool.h:52
fitman.k
k
Definition: fitman.py:528
MuonCalib::CalibrationDbIOTool::get_connection
CalibDbConnection * get_connection(int write)
Definition: CalibrationDbIOTool.cxx:243