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
 
RegionSelectionSvcp_reg_sel_svc = nullptr
 pointer to region selection service More...
 
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 30 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 238 of file CalibrationDbIOTool.cxx.

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

◆ 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 203 of file CalibrationDbIOTool.cxx.

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

◆ get_connection()

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

Definition at line 242 of file CalibrationDbIOTool.cxx.

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

◆ initialize()

StatusCode MuonCalib::CalibrationDbIOTool::initialize ( )
override

initialisation

Definition at line 70 of file CalibrationDbIOTool.cxx.

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

◆ 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 162 of file CalibrationDbIOTool.cxx.

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

◆ LoadT0()

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

load t0s

Implements MuonCalib::ICalibrationIOTool.

Definition at line 113 of file CalibrationDbIOTool.cxx.

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

◆ 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 134 of file CalibrationDbIOTool.cxx.

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

◆ 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 95 of file CalibrationDbIOTool.cxx.

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

Member Data Documentation

◆ m_calib_dir

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

path to calibration directory - job option

Definition at line 51 of file CalibrationDbIOTool.h.

◆ m_connection

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

pointer to db connection

Definition at line 69 of file CalibrationDbIOTool.h.

◆ m_data_connections

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

Definition at line 70 of file CalibrationDbIOTool.h.

◆ m_db_ConnectionString

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

Definition at line 55 of file CalibrationDbIOTool.h.

◆ m_db_WorkingSchema

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

Definition at line 57 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 71 of file CalibrationDbIOTool.h.

◆ m_headid

int MuonCalib::CalibrationDbIOTool::m_headid
private

Definition at line 63 of file CalibrationDbIOTool.h.

◆ m_max_rt_points

int MuonCalib::CalibrationDbIOTool::m_max_rt_points
private

Definition at line 62 of file CalibrationDbIOTool.h.

◆ m_reader_account

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

account data

Definition at line 59 of file CalibrationDbIOTool.h.

◆ m_reader_password

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

Definition at line 59 of file CalibrationDbIOTool.h.

◆ m_region_ids

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

Definition at line 67 of file CalibrationDbIOTool.h.

◆ m_sitename

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

Definition at line 64 of file CalibrationDbIOTool.h.

◆ m_use_validated_rt

bool MuonCalib::CalibrationDbIOTool::m_use_validated_rt = false
private

Definition at line 53 of file CalibrationDbIOTool.h.

◆ m_use_validated_t0

bool MuonCalib::CalibrationDbIOTool::m_use_validated_t0
private

if true use validated - jo

Definition at line 53 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 60 of file CalibrationDbIOTool.h.

◆ m_writer_connection_string

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

Definition at line 56 of file CalibrationDbIOTool.h.

◆ m_writer_password

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

Definition at line 60 of file CalibrationDbIOTool.h.

◆ p_reg_sel_svc

RegionSelectionSvc* MuonCalib::CalibrationDbIOTool::p_reg_sel_svc = nullptr
private

pointer to region selection service

Definition at line 66 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
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
MuonCalib::CalibrationDbIOTool::m_data_connections
std::array< std::unique_ptr< CalibDbConnection >, 2 > m_data_connections
Definition: CalibrationDbIOTool.h:70
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:59
RtResolutionFromPoints
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
MuonCalib::CalibrationDbIOTool::m_db_ConnectionString
std::string m_db_ConnectionString
Definition: CalibrationDbIOTool.h:55
ALFA_EventTPCnv_Dict::t0
std::vector< ALFA_RawData_p1 > t0
Definition: ALFA_EventTPCnvDict.h:42
skel.it
it
Definition: skel.GENtoEVGEN.py:423
MuonCalib::CalibrationDbIOTool::fillResPoints
void fillResPoints(const std::shared_ptr< const IRtResolution > &rt_resolution, std::vector< SamplePoint > &points)
Definition: CalibrationDbIOTool.cxx:238
MuonCalib::CalibrationDbIOTool::m_head_ops
std::unique_ptr< CalibHeadOperations > m_head_ops
Definition: CalibrationDbIOTool.h:71
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:67
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:59
MuonCalib::CalibrationDbIOTool::m_db_WorkingSchema
std::string m_db_WorkingSchema
Definition: CalibrationDbIOTool.h:57
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
MuonCalib::CalibrationDbIOTool::m_sitename
std::string m_sitename
Definition: CalibrationDbIOTool.h:64
MuonCalib::CalibrationDbIOTool::m_writer_account
std::string m_writer_account
Definition: CalibrationDbIOTool.h:60
MuonCalib::CalibFunc::ParVec
std::vector< double > ParVec
Definition: CalibFunc.h:36
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:203
AthCommonDataStore
Definition: AthCommonDataStore.h:52
RegionSelectionSvc::GetStationsInRegions
const std::vector< MuonCalib ::NtupleStationId > & GetStationsInRegions() const
get stations/multilayers in region
Definition: RegionSelectionSvc.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:92
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:53
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:63
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:192
MuonCalib::CalibrationDbIOTool::m_writer_password
std::string m_writer_password
Definition: CalibrationDbIOTool.h:60
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
MuonCalib::CalibrationDbIOTool::m_max_rt_points
int m_max_rt_points
Definition: CalibrationDbIOTool.h:62
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::p_reg_sel_svc
RegionSelectionSvc * p_reg_sel_svc
pointer to region selection service
Definition: CalibrationDbIOTool.h:66
calibdata.rts
rts
Definition: calibdata.py:414
MuonCalib::CalibrationDbIOTool::m_connection
std::unique_ptr< CalibDbConnection > m_connection
pointer to db connection
Definition: CalibrationDbIOTool.h:69
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
MuonCalib::CalibrationDbIOTool::m_writer_connection_string
std::string m_writer_connection_string
Definition: CalibrationDbIOTool.h:56
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
MuonCalib::CalibrationDbIOTool::m_use_validated_rt
bool m_use_validated_rt
Definition: CalibrationDbIOTool.h:53
fitman.k
k
Definition: fitman.py:528
MuonCalib::CalibrationDbIOTool::get_connection
CalibDbConnection * get_connection(int write)
Definition: CalibrationDbIOTool.cxx:242