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

#include <MuonCalibDbCalibrationSource.h>

Inheritance diagram for MuonCalib::MuonCalibDbCalibrationSource:
Collaboration diagram for MuonCalib::MuonCalibDbCalibrationSource:

Public Member Functions

 MuonCalibDbCalibrationSource (const std::string &t, const std::string &n, const IInterface *p)
 constructor More...
 
virtual ~MuonCalibDbCalibrationSource ()
 
StatusCode initialize ()
 initialize More...
 
bool StoreT0Chamber (const int &chamber, const std::map< TubeId, coral::AttributeList > &rows)
 call back for t0 More...
 
bool StoreRtChamber (const int &chamber, const std::map< int, SamplePoint > &points)
 
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
 
bool InstertCalibration (CoolInserter *inserter, bool store_t0, bool store_rt)
 insert calibration More...
 
virtual const std::vector< std::string > & RowsFromMdtTubeCTable () const
 

Static Public Member Functions

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

Protected Member Functions

bool insert_calibration (bool store_t0, bool store_rt)
 insert calibration More...
 
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...
 

Protected Attributes

CoolInserterm_inserter = nullptr
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

const std::vector< std::string > & RowsFromMdtTubeTable () const
 
const std::vector< std::string > & RowsFromMdtTubeVTable () const
 
void SetIOV (int &start, int &end) const
 
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_site_name
 
int m_head_id = 0
 
int m_iov_start = 0
 
int m_iov_end = 0
 
std::string m_calib_connection_string
 
std::string m_calib_working_schema
 
std::string m_username
 
std::string m_password
 
std::string m_region_str
 
std::vector< float > m_drift_time_offsets
 
bool m_store_t0
 
bool m_store_rt
 
float m_t0_offset
 
bool m_time_slewing_applied
 
bool m_b_field_correction_applied
 
unsigned int m_creation_flags
 
std::vector< std::string > m_mdt_tube_cols
 
std::vector< std::string > m_mdt_tube_v_cols
 
std::unique_ptr< CalibDbConnectionm_connection
 
std::unique_ptr< CalibDbConnectionm_data_connection
 
std::unique_ptr< CalibHeadOperationsm_head_ops
 
std::unique_ptr< RegionSelectorBasem_region
 
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
 
std::vector< std::string > m_empty
 

Detailed Description

Definition at line 21 of file MuonCalibDbCalibrationSource.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

◆ MuonCalibDbCalibrationSource()

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

constructor

Definition at line 36 of file MuonCalibDbCalibrationSource.cxx.

36  :
37  IMuonCalibConditionsSource(), IConditionsStorage(), AthAlgTool(t, n, p) {
38  declareInterface<IMuonCalibConditionsSource>(this);
39  declareProperty("SiteName", m_site_name);
40  declareProperty("HeadId", m_head_id);
41  declareProperty("ConnectionString", m_calib_connection_string);
42  declareProperty("WorkingSchema", m_calib_working_schema);
43  declareProperty("UserName", m_username);
44  declareProperty("Password", m_password);
45  declareProperty("Region", m_region_str);
46  m_mdt_tube_cols.push_back(std::string("TUBE_ID"));
47  m_mdt_tube_cols.push_back(std::string("P4"));
48  m_mdt_tube_cols.push_back(std::string("VALIDFLAG"));
49  m_mdt_tube_cols.push_back(std::string("ADC_1"));
50  m_store_t0 = true;
51  m_store_rt = true;
52  declareProperty("StoreT0", m_store_t0);
53  declareProperty("StoreRT", m_store_rt);
54  m_t0_offset = 0.0;
55  declareProperty("DriftTimeOffsetsVsR", m_drift_time_offsets);
56  declareProperty("T0Offset", m_t0_offset);
57  m_time_slewing_applied = false;
58  declareProperty("TimeSlewingApplied", m_time_slewing_applied);
60  declareProperty("BFieldCorrectionApplied", m_b_field_correction_applied);
61  m_creation_flags = 0;
62  }

◆ ~MuonCalibDbCalibrationSource()

MuonCalib::MuonCalibDbCalibrationSource::~MuonCalibDbCalibrationSource ( )
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

◆ initialize()

StatusCode MuonCalib::MuonCalibDbCalibrationSource::initialize ( )

initialize

Definition at line 64 of file MuonCalibDbCalibrationSource.cxx.

64  {
65  // process region
67  if (!m_region) {
68  ATH_MSG_FATAL("Error initializing RegionSelectorBase::GetRegion with region string: '" << m_region_str);
69  return StatusCode::FAILURE;
70  }
71  // open conneciton to calibration db
72  m_connection = std::make_unique<CalibDbConnection>(m_calib_connection_string, m_calib_working_schema);
74  if (!m_connection->OpenConnection()) {
75  ATH_MSG_FATAL("Cannot open connection to calibration database!");
76  return StatusCode::FAILURE;
77  }
78  m_head_ops = std::make_unique<CalibHeadOperations>(*m_connection);
79  int lowrun, uprun, lowtime, uptime;
80  if (!m_head_ops->GetHeadInfo(m_head_id, lowrun, uprun, lowtime, uptime)) {
81  ATH_MSG_FATAL("Cannot get header " << m_head_id << "from calib datbase");
82  return StatusCode::FAILURE;
83  }
85  m_iov_end = uprun;
86  m_iov_end++;
87  m_data_connection.reset(m_head_ops->GetDataConnection(m_head_id, false));
88  if (!m_data_connection) {
89  ATH_MSG_FATAL("Cannot open data connection!");
90  return StatusCode::FAILURE;
91  }
92  if (!m_data_connection->OpenConnection()) {
93  ATH_MSG_FATAL("Cannot open data connection!");
94  return StatusCode::FAILURE;
95  }
96  m_creation_flags = 0;
99  return StatusCode::SUCCESS;
100  }

◆ 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.

◆ insert_calibration()

bool MuonCalib::MuonCalibDbCalibrationSource::insert_calibration ( bool  store_t0,
bool  store_rt 
)
protectedvirtual

insert calibration

Implements MuonCalib::IMuonCalibConditionsSource.

Definition at line 149 of file MuonCalibDbCalibrationSource.cxx.

149  {
150  try {
151  if (store_t0 && m_store_t0) {
152  CalibT0DbOperations t0_op(*m_data_connection);
153  if (!t0_op.ReadForConditions(m_site_name, m_head_id, *this)) {
154  ATH_MSG_WARNING("T0 insert failed!");
155  return false;
156  }
157  }
158  if (store_rt && m_store_rt) {
159  CalibRtDbOperations rt_op(*m_data_connection);
160  if (!rt_op.ReadForConditions(m_site_name, m_head_id, *this)) {
161  ATH_MSG_WARNING("RT insert failed!");
162  return false;
163  }
164  }
165  } // try
166  catch (const std::exception& e) {
167  ATH_MSG_FATAL("Exception: " << e.what());
168  return false;
169  }
170  return true;
171  }

◆ InstertCalibration()

bool MuonCalib::IMuonCalibConditionsSource::InstertCalibration ( CoolInserter inserter,
bool  store_t0,
bool  store_rt 
)
inlineinherited

insert calibration

Definition at line 24 of file IMuonCalibConditionsSource.h.

24  {
25  m_inserter = inserter;
26  return insert_calibration(store_t0, store_rt);
27  }

◆ interfaceID()

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

interface method

Definition at line 22 of file IMuonCalibConditionsSource.h.

22 { return IID_IMuonCalibConditionsSource; }

◆ 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  }

◆ RowsFromMdtTubeCTable()

virtual const std::vector<std::string>& MuonCalib::IConditionsStorage::RowsFromMdtTubeCTable ( ) const
inlinevirtualinherited

Definition at line 38 of file IConditionsStorage.h.

38 { return m_empty; }

◆ RowsFromMdtTubeTable()

const std::vector<std::string>& MuonCalib::MuonCalibDbCalibrationSource::RowsFromMdtTubeTable ( ) const
inlineprivatevirtual

Reimplemented from MuonCalib::IConditionsStorage.

Definition at line 39 of file MuonCalibDbCalibrationSource.h.

39 { return m_mdt_tube_cols; }

◆ RowsFromMdtTubeVTable()

const std::vector<std::string>& MuonCalib::MuonCalibDbCalibrationSource::RowsFromMdtTubeVTable ( ) const
inlineprivatevirtual

Reimplemented from MuonCalib::IConditionsStorage.

Definition at line 40 of file MuonCalibDbCalibrationSource.h.

40 { return m_mdt_tube_v_cols; }

◆ SetIOV()

void MuonCalib::MuonCalibDbCalibrationSource::SetIOV ( int &  start,
int &  end 
) const
inlineprivatevirtual

Reimplemented from MuonCalib::IMuonCalibConditionsSource.

Definition at line 42 of file MuonCalibDbCalibrationSource.h.

42  {
43  if (start < 0) { start = m_iov_start; }
44  if (end < 0) { end = m_iov_end; }
45  }

◆ StoreRtChamber()

bool MuonCalib::MuonCalibDbCalibrationSource::StoreRtChamber ( const int &  chamber,
const std::map< int, SamplePoint > &  points 
)
virtual

Implements MuonCalib::IConditionsStorage.

Definition at line 125 of file MuonCalibDbCalibrationSource.cxx.

125  {
126  MuonFixedId id(chamber);
127  if (!m_region->Result(id)) { return true; }
128  NtupleStationId sid(id);
129  sid.SetMultilayer(0);
130  std::ostringstream f;
131  f << chamber << m_site_name << m_head_id;
132  if (m_drift_time_offsets.size()) {
133  float slice_width = 14.6 / static_cast<float>(m_drift_time_offsets.size());
134  std::map<int, SamplePoint> points_cp(points);
135  for (auto & it : points_cp) {
136  int slice_number = static_cast<int>(std::floor(it.second.x2() / slice_width));
137  if (slice_number < 0) slice_number = 0;
138  if (slice_number >= static_cast<int>(m_drift_time_offsets.size()))
139  slice_number = static_cast<int>(m_drift_time_offsets.size()) - 1;
140  it.second.set_x1(it.second.x1() + m_drift_time_offsets[slice_number]);
141  }
142  m_inserter->StoreRtChamber(sid, points_cp, f.str(), m_creation_flags);
143  } else {
145  }
146  return true;
147  }

◆ StoreT0Chamber()

bool MuonCalib::MuonCalibDbCalibrationSource::StoreT0Chamber ( const int &  chamber,
const std::map< TubeId, coral::AttributeList > &  rows 
)
virtual

call back for t0

Implements MuonCalib::IConditionsStorage.

Definition at line 102 of file MuonCalibDbCalibrationSource.cxx.

102  {
103  MuonFixedId id(chamber);
104  if (!m_region->Result(id)) { return true; }
105  NtupleStationId sid(id);
106  sid.SetMultilayer(0);
107  std::string data_string;
108  std::ostringstream f;
109  f << chamber << m_site_name << m_head_id;
110  if (!m_inserter->StartT0Chamber(sid)) {
111  ATH_MSG_WARNING("Cannot insert chamber " << chamber);
112  return true;
113  }
114  for (const auto & row : rows) {
115  if (!m_inserter->AppendT0(row.second["P4"].data<float>() + m_t0_offset, row.second["VALIDFLAG"].data<short>(),
116  row.second["ADC_1"].data<float>())) {
117  ATH_MSG_WARNING("Wrong number of tubes in database for " << sid.regionId() << "!");
118  break;
119  }
120  }
122  return true;
123  }

◆ 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  }

Member Data Documentation

◆ m_b_field_correction_applied

bool MuonCalib::MuonCalibDbCalibrationSource::m_b_field_correction_applied
private

Definition at line 65 of file MuonCalibDbCalibrationSource.h.

◆ m_calib_connection_string

std::string MuonCalib::MuonCalibDbCalibrationSource::m_calib_connection_string
private

Definition at line 53 of file MuonCalibDbCalibrationSource.h.

◆ m_calib_working_schema

std::string MuonCalib::MuonCalibDbCalibrationSource::m_calib_working_schema
private

Definition at line 53 of file MuonCalibDbCalibrationSource.h.

◆ m_connection

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

Definition at line 70 of file MuonCalibDbCalibrationSource.h.

◆ m_creation_flags

unsigned int MuonCalib::MuonCalibDbCalibrationSource::m_creation_flags
private

Definition at line 66 of file MuonCalibDbCalibrationSource.h.

◆ m_data_connection

std::unique_ptr<CalibDbConnection> MuonCalib::MuonCalibDbCalibrationSource::m_data_connection
private

Definition at line 71 of file MuonCalibDbCalibrationSource.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_drift_time_offsets

std::vector<float> MuonCalib::MuonCalibDbCalibrationSource::m_drift_time_offsets
private

Definition at line 59 of file MuonCalibDbCalibrationSource.h.

◆ m_empty

std::vector<std::string> MuonCalib::IConditionsStorage::m_empty
privateinherited

Definition at line 46 of file IConditionsStorage.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_id

int MuonCalib::MuonCalibDbCalibrationSource::m_head_id = 0
private

Definition at line 49 of file MuonCalibDbCalibrationSource.h.

◆ m_head_ops

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

Definition at line 72 of file MuonCalibDbCalibrationSource.h.

◆ m_inserter

CoolInserter* MuonCalib::IMuonCalibConditionsSource::m_inserter = nullptr
protectedinherited

Definition at line 31 of file IMuonCalibConditionsSource.h.

◆ m_iov_end

int MuonCalib::MuonCalibDbCalibrationSource::m_iov_end = 0
private

Definition at line 51 of file MuonCalibDbCalibrationSource.h.

◆ m_iov_start

int MuonCalib::MuonCalibDbCalibrationSource::m_iov_start = 0
private

Definition at line 51 of file MuonCalibDbCalibrationSource.h.

◆ m_mdt_tube_cols

std::vector<std::string> MuonCalib::MuonCalibDbCalibrationSource::m_mdt_tube_cols
private

Definition at line 69 of file MuonCalibDbCalibrationSource.h.

◆ m_mdt_tube_v_cols

std::vector<std::string> MuonCalib::MuonCalibDbCalibrationSource::m_mdt_tube_v_cols
private

Definition at line 69 of file MuonCalibDbCalibrationSource.h.

◆ m_password

std::string MuonCalib::MuonCalibDbCalibrationSource::m_password
private

Definition at line 55 of file MuonCalibDbCalibrationSource.h.

◆ m_region

std::unique_ptr<RegionSelectorBase> MuonCalib::MuonCalibDbCalibrationSource::m_region
private

Definition at line 73 of file MuonCalibDbCalibrationSource.h.

◆ m_region_str

std::string MuonCalib::MuonCalibDbCalibrationSource::m_region_str
private

Definition at line 57 of file MuonCalibDbCalibrationSource.h.

◆ m_site_name

std::string MuonCalib::MuonCalibDbCalibrationSource::m_site_name
private

Definition at line 48 of file MuonCalibDbCalibrationSource.h.

◆ m_store_rt

bool MuonCalib::MuonCalibDbCalibrationSource::m_store_rt
private

Definition at line 61 of file MuonCalibDbCalibrationSource.h.

◆ m_store_t0

bool MuonCalib::MuonCalibDbCalibrationSource::m_store_t0
private

Definition at line 61 of file MuonCalibDbCalibrationSource.h.

◆ m_t0_offset

float MuonCalib::MuonCalibDbCalibrationSource::m_t0_offset
private

Definition at line 63 of file MuonCalibDbCalibrationSource.h.

◆ m_time_slewing_applied

bool MuonCalib::MuonCalibDbCalibrationSource::m_time_slewing_applied
private

Definition at line 65 of file MuonCalibDbCalibrationSource.h.

◆ m_username

std::string MuonCalib::MuonCalibDbCalibrationSource::m_username
private

Definition at line 55 of file MuonCalibDbCalibrationSource.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.


The documentation for this class was generated from the following files:
MuonCalib::MuonCalibDbCalibrationSource::m_calib_connection_string
std::string m_calib_connection_string
Definition: MuonCalibDbCalibrationSource.h:53
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
MuonCalib::IConditionsStorage::IConditionsStorage
IConditionsStorage()
Definition: IConditionsStorage.h:31
query_example.row
row
Definition: query_example.py:24
MuonCalib::MuonCalibDbCalibrationSource::m_head_id
int m_head_id
Definition: MuonCalibDbCalibrationSource.h:49
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
MuonCalib::MuonCalibDbCalibrationSource::m_region
std::unique_ptr< RegionSelectorBase > m_region
Definition: MuonCalibDbCalibrationSource.h:73
MuonCalib::RegionSelectorBase::GetRegion
static std::unique_ptr< RegionSelectorBase > GetRegion(const std::string &input)
create a region from a string
Definition: RegionSelectorBase.cxx:13
MuonCalib::MuonCalibDbCalibrationSource::m_iov_end
int m_iov_end
Definition: MuonCalibDbCalibrationSource.h:51
calibdata.chamber
chamber
Definition: calibdata.py:32
MuonCalib::MuonCalibDbCalibrationSource::m_mdt_tube_cols
std::vector< std::string > m_mdt_tube_cols
Definition: MuonCalibDbCalibrationSource.h:69
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
MuonCalib::IMuonCalibConditionsSource::m_inserter
CoolInserter * m_inserter
Definition: IMuonCalibConditionsSource.h:31
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
skel.it
it
Definition: skel.GENtoEVGEN.py:396
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
calibdata.uptime
uptime
Definition: calibdata.py:36
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
MuonCalib::MuonCalibDbCalibrationSource::m_time_slewing_applied
bool m_time_slewing_applied
Definition: MuonCalibDbCalibrationSource.h:65
MuonCalib::CoolInserter::StoreT0Chamber
bool StoreT0Chamber(const NtupleStationId &id, const std::string &file, unsigned int creation_flags=0)
Definition: CoolInserter.cxx:193
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
MuonCalib::MuonCalibDbCalibrationSource::m_iov_start
int m_iov_start
Definition: MuonCalibDbCalibrationSource.h:51
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
MuonCalib::MuonCalibDbCalibrationSource::m_username
std::string m_username
Definition: MuonCalibDbCalibrationSource.h:55
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
MuonCalib::MuonCalibDbCalibrationSource::m_store_rt
bool m_store_rt
Definition: MuonCalibDbCalibrationSource.h:61
MuonCalib::CoolInserter::AppendT0
bool AppendT0(float t0, int validflag, float adc0)
Definition: CoolInserter.cxx:184
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
MuonCalib::IMuonCalibConditionsSource::insert_calibration
virtual bool insert_calibration(bool store_t0, bool store_rt)=0
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:731
calibdata.uprun
uprun
Definition: calibdata.py:34
MuonCalib::MuonCalibDbCalibrationSource::m_drift_time_offsets
std::vector< float > m_drift_time_offsets
Definition: MuonCalibDbCalibrationSource.h:59
calibdata.exception
exception
Definition: calibdata.py:496
MuonCalib::MuonCalibDbCalibrationSource::m_calib_working_schema
std::string m_calib_working_schema
Definition: MuonCalibDbCalibrationSource.h:53
MuonCalib::MuonCalibDbCalibrationSource::m_password
std::string m_password
Definition: MuonCalibDbCalibrationSource.h:55
hist_file_dump.f
f
Definition: hist_file_dump.py:135
MuonCalib::MuonCalibDbCalibrationSource::m_b_field_correction_applied
bool m_b_field_correction_applied
Definition: MuonCalibDbCalibrationSource.h:65
MuonCalib::MuonCalibDbCalibrationSource::m_region_str
std::string m_region_str
Definition: MuonCalibDbCalibrationSource.h:57
beamspotnt.rows
list rows
Definition: bin/beamspotnt.py:1112
MuonCalib::B_FIELD_CORRECTIONS_APPLIED
@ B_FIELD_CORRECTIONS_APPLIED
Definition: MdtCalibCreationFlags.h:10
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
MuonCalib::TIME_SLEWING_CORRECTION_APPLIED
@ TIME_SLEWING_CORRECTION_APPLIED
Definition: MdtCalibCreationFlags.h:10
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MuonCalib::MuonCalibDbCalibrationSource::m_store_t0
bool m_store_t0
Definition: MuonCalibDbCalibrationSource.h:61
MuonCalib::MuonCalibDbCalibrationSource::m_data_connection
std::unique_ptr< CalibDbConnection > m_data_connection
Definition: MuonCalibDbCalibrationSource.h:71
MuonCalib::MuonCalibDbCalibrationSource::m_creation_flags
unsigned int m_creation_flags
Definition: MuonCalibDbCalibrationSource.h:66
MuonCalib::MuonCalibDbCalibrationSource::m_connection
std::unique_ptr< CalibDbConnection > m_connection
Definition: MuonCalibDbCalibrationSource.h:70
MuonCalib::MuonCalibDbCalibrationSource::m_mdt_tube_v_cols
std::vector< std::string > m_mdt_tube_v_cols
Definition: MuonCalibDbCalibrationSource.h:69
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
calibdata.lowrun
lowrun
Definition: calibdata.py:33
MuonCalib::MuonCalibDbCalibrationSource::m_t0_offset
float m_t0_offset
Definition: MuonCalibDbCalibrationSource.h:63
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::MuonCalibDbCalibrationSource::m_site_name
std::string m_site_name
Definition: MuonCalibDbCalibrationSource.h:48
MuonCalib::IConditionsStorage::m_empty
std::vector< std::string > m_empty
Definition: IConditionsStorage.h:46
MuonCalib::CoolInserter::StoreRtChamber
bool StoreRtChamber(const NtupleStationId &id, const std::map< int, SamplePoint > &points, const std::string &file, unsigned int creation_flags=0)
Definition: CoolInserter.cxx:250
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::CoolInserter::StartT0Chamber
bool StartT0Chamber(const NtupleStationId &sid)
Definition: CoolInserter.cxx:155
jobOptions.points
points
Definition: jobOptions.GenevaPy8_Zmumu.py:97
fitman.k
k
Definition: fitman.py:528
MuonCalib::MuonCalibDbCalibrationSource::m_head_ops
std::unique_ptr< CalibHeadOperations > m_head_ops
Definition: MuonCalibDbCalibrationSource.h:72
calibdata.lowtime
lowtime
Definition: calibdata.py:35