ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
L1CaloHVCorrectionsForDB Class Reference

This algorithms creates a sqlite database of current HV Corrections. More...

#include <L1CaloHVCorrectionsForDB.h>

Inheritance diagram for L1CaloHVCorrectionsForDB:
Collaboration diagram for L1CaloHVCorrectionsForDB:

Public Member Functions

 L1CaloHVCorrectionsForDB (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~L1CaloHVCorrectionsForDB ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. 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 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
 

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

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_triggerTowerCollectionName
 
std::string m_caloCellContainerName
 
ToolHandle< LVL1::IL1TriggerTowerToolm_ttTool
 
ToolHandle< LVL1::IL1CaloOfflineTriggerTowerToolsm_jmTools
 
SG::ReadCondHandleKey< ILArHVScaleCorrm_scaleCorrKey { this, "LArHVScaleCorr", "LArHVScaleCorrRecomputed", "" }
 
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey { this, "CablingKey", "LArOnOffIdMap", "SG Key of LArOnOffIdMapping object" }
 
boost::scoped_ptr< L1CaloRxLayersContainerm_rxLayersContainer
 
boost::scoped_ptr< L1CaloHVCorrectionsContainerm_hvCorrectionsContainer
 
bool m_firstEvent
 
DataObjIDColl m_extendedExtraObjects
 
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

This algorithms creates a sqlite database of current HV Corrections.

Author
Peter Faulkner pjwf@.nosp@m.hep..nosp@m.ph.bh.nosp@m.am.a.nosp@m.c.uk

Definition at line 32 of file L1CaloHVCorrectionsForDB.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ L1CaloHVCorrectionsForDB()

L1CaloHVCorrectionsForDB::L1CaloHVCorrectionsForDB ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 19 of file L1CaloHVCorrectionsForDB.cxx.

20  : AthAlgorithm(name, pSvcLocator),
21  m_triggerTowerCollectionName("TriggerTowers"),
22  m_caloCellContainerName("AllCalo"),
23  m_ttTool("LVL1::L1TriggerTowerTool/L1TriggerTowerTool"),
24  m_jmTools("LVL1::L1CaloOfflineTriggerTowerTools/L1CaloOfflineTriggerTowerTools", this),
27  m_firstEvent(true)
28 {
29  declareProperty("TriggerTowerCollectionName", m_triggerTowerCollectionName);
30  declareProperty("CaloCellContainerName", m_caloCellContainerName);
31 }

◆ ~L1CaloHVCorrectionsForDB()

L1CaloHVCorrectionsForDB::~L1CaloHVCorrectionsForDB ( )
virtual

Definition at line 33 of file L1CaloHVCorrectionsForDB.cxx.

34 {
35 }

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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; }

◆ execute()

StatusCode L1CaloHVCorrectionsForDB::execute ( )

Definition at line 52 of file L1CaloHVCorrectionsForDB.cxx.

53 {
54  if (m_firstEvent) {
55 
56  StatusCode sc;
57 
58  const TriggerTowerCollection *triggerTowerCollection(0);
59  sc = evtStore()->retrieve(triggerTowerCollection, m_triggerTowerCollectionName);
60  if(!sc.isSuccess()) {
61  msg(MSG::ERROR) << "Cannot retrieve TriggerTowerCollection '"
62  << m_triggerTowerCollectionName << "' from StoreGate." << endmsg;
63  return sc;
64  }
65 
66  const CaloCellContainer *caloCellContainer(0);
67  sc = evtStore()->retrieve(caloCellContainer, m_caloCellContainerName);
68  if(!sc.isSuccess()) {
69  msg(MSG::ERROR) << "Cannot retrieve CaloCellContainer '" << m_caloCellContainerName
70  << "'." << endmsg;
71  return sc;
72  }
73 
74  // init trigger tower to cell mapping - needed each event?
75  m_jmTools->caloCells(caloCellContainer);
76 
77  const LVL1::TriggerTower *tt;
78  TriggerTowerCollection::const_iterator p_itTT = triggerTowerCollection->begin();
79  TriggerTowerCollection::const_iterator p_itTTEnd = triggerTowerCollection->end();
80  std::vector<unsigned int> coolIdByRx;
81  std::vector<std::vector<int> > layernamesByRx;
82  std::vector<std::vector<int> > layerNcellsByRx;
83  std::vector<float> meanScaleByRx;
84  std::vector<std::vector<float> > affectedCellsFByRx;
85  std::vector<std::vector<float> > layerMeansByRx;
86  std::vector<int> affectedCells;
87  std::vector<float>::const_iterator affIt;
88  std::vector<float> layerMeans;
89  int hvCount = 0;
90  int rxCount = 0;
91 
92  for(;p_itTT != p_itTTEnd; ++p_itTT) {
93  tt = *p_itTT;
94  for (int sample = 0; sample < 2; ++sample) { // Loop over samples (em/had)
95  const bool isTile = (sample == 1 && fabs(tt->eta()) < 1.5);
96  if (isTile) continue;
97 
98  if (sample == 0) { //em
99  coolIdByRx = m_jmTools->emRxId(tt);
100  layernamesByRx = m_jmTools->emTTCellsLayerNamesByReceiver(tt);
101  layerNcellsByRx = m_jmTools->emNCellsByReceiverByLayer(tt);
102  meanScaleByRx = m_jmTools->emNonNominalMeanScaleByReceiver(tt);
103  affectedCellsFByRx = m_jmTools->emNCellsNonNominalByReceiverByLayer(tt);
104  layerMeansByRx = m_jmTools->emNonNominalMeanScaleByReceiverByLayer(tt);
105  } else { //had
106  coolIdByRx = m_jmTools->hadRxId(tt);
107  layernamesByRx = m_jmTools->hadTTCellsLayerNamesByReceiver(tt);
108  layerNcellsByRx = m_jmTools->hadNCellsByReceiverByLayer(tt);
109  meanScaleByRx = m_jmTools->hadNonNominalMeanScaleByReceiver(tt);
110  affectedCellsFByRx = m_jmTools->hadNCellsNonNominalByReceiverByLayer(tt);
111  layerMeansByRx = m_jmTools->hadNonNominalMeanScaleByReceiverByLayer(tt);
112  }
113  const unsigned int nRx = coolIdByRx.size();
114  if (nRx != layernamesByRx.size() ||
115  nRx != layerNcellsByRx.size() ||
116  nRx != meanScaleByRx.size() ||
117  nRx != affectedCellsFByRx.size() ||
118  nRx != layerMeansByRx.size()) {
119  msg(MSG::ERROR) << "Vectors by receiver have inconsistent size" << endmsg;
120  return StatusCode::FAILURE;
121  }
122  rxCount += nRx;
123  for (unsigned int i = 0; i < nRx; ++i) { // Loop over receivers
124  const unsigned int coolId(coolIdByRx[i]);
125  const std::vector<int>& layernames(layernamesByRx[i]);
126  const std::vector<int>& layerNcells(layerNcellsByRx[i]);
127  const float meanScale(meanScaleByRx[i]);
128  const std::vector<float>& affectedCellsF(affectedCellsFByRx[i]);
129  const std::vector<float>& layerMeans(layerMeansByRx[i]);
130 
131  const unsigned int nLayers = layernames.size();
132  if (nLayers != layerNcells.size()) {
133  msg(MSG::ERROR) << "layernames/layerNcells inconsistent size" << endmsg;
134  return StatusCode::FAILURE;
135  }
136  if (nLayers == 0 || nLayers > 4) {
137  //msg(MSG::ERROR) << "Unexpected number of layers: " << nLayers << endmsg;
138  //return StatusCode::FAILURE;
139  msg(MSG::WARNING) << "Unexpected number of layers: " << nLayers
140  << " eta/phi: " << tt->eta() << "/" << tt->phi()
141  << " sample: " << sample
142  << " Receiver: " << i << endmsg;
143  continue;
144  }
145  for (unsigned int j = 0; j < nLayers; ++j) {
146  if (layerNcells[j] == 0) {
147  msg(MSG::ERROR) << "Layer " << j << " has no cells" << endmsg;
148  return StatusCode::FAILURE;
149  }
150  for (unsigned int k = 0; k < j; ++k) {
151  if (layernames[j] == layernames[k]) {
152  msg(MSG::ERROR) << "Duplicate layernames" << endmsg;
153  return StatusCode::FAILURE;
154  }
155  }
156  }
157 
158  L1CaloRxLayers l1caloRxLayersSample(coolId, std::vector<int>(layernames), std::vector<int>(layerNcells));
159  m_rxLayersContainer->addRxLayers(coolId, std::move(l1caloRxLayersSample));
160 
161  if (nLayers != affectedCellsF.size()) {
162  msg(MSG::ERROR) << "layernames/affectedCellsF inconsistent size" << endmsg;
163  return StatusCode::FAILURE;
164  }
165  if (nLayers != layerMeans.size()) {
166  msg(MSG::ERROR) << "layernames/layerMeans inconsistent size" << endmsg;
167  return StatusCode::FAILURE;
168  }
169  float sum = 0.;
170  float ncells = 0;
171  for (unsigned int j = 0; j < nLayers; ++j) {
172  sum += layerMeans[j]*layerNcells[j];
173  ncells += layerNcells[j];
174  }
175  if (ncells > 0.) sum /= ncells;
176  const float tol = 1.e-4;
177  if (fabs(sum - meanScale) > tol) {
178  msg(MSG::ERROR) << "Total and layer means inconsistent: "
179  << meanScale << " " << sum << endmsg;
180  return StatusCode::FAILURE;
181  }
182  bool affected = (meanScale != 1.);
183  if (!affected) {
184  for (unsigned int j = 0; j < layerMeans.size(); ++j) {
185  if (layerMeans[j] != 1.) affected = true;
186  }
187  }
188 
189  if (affected) {
190  affectedCells.clear();
191  for (affIt = affectedCellsF.begin(); affIt != affectedCellsF.end(); ++affIt) {
192  affectedCells.push_back((int)(*affIt));
193  }
194  L1CaloHVCorrections l1caloHVCorrectionsSample(coolId, meanScale, std::move(affectedCells), std::vector<float>(layerMeans));
195  m_hvCorrectionsContainer->addHVCorrections(coolId, std::move(l1caloHVCorrectionsSample));
196  hvCount++;
197  }
198  }
199  }
200  }
201  const unsigned int ttsize = triggerTowerCollection->size();
202  const unsigned int exsize = 3584;
203  if (ttsize != exsize) {
204  msg(MSG::ERROR) << "First event has " << ttsize
205  << " TriggerTowers, expected " << exsize << endmsg;
206  return StatusCode::FAILURE;
207  } else {
208  msg(MSG::INFO) << "Number of TriggerTowers in first event is "
209  << ttsize << " Number of Receivers is " << rxCount << endmsg;
210  }
211  msg(MSG::INFO) << "Number of HV Correction entries is " << hvCount << endmsg;
212  m_firstEvent = false;
213 
214  }
215 
216  return StatusCode::SUCCESS;
217 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode L1CaloHVCorrectionsForDB::finalize ( )

Definition at line 219 of file L1CaloHVCorrectionsForDB.cxx.

220 {
221  DataObject* dObj = m_rxLayersContainer->makePersistent();
222  if (dObj) {
223  CondAttrListCollection* coll = dynamic_cast<CondAttrListCollection*>(dObj);
224  if (coll) {
225  StatusCode sc;
226  sc = detStore()->record(coll, m_rxLayersContainer->coolOutputKey());
227  if (sc.isFailure()) {
228  msg(MSG::ERROR) << "Failed to record RxLayersContainer" << endmsg;
229  return sc;
230  }
231  } else {
232  msg(MSG::ERROR) << "Could not cast to CondAttrListCollection" << endmsg;
233  return StatusCode::FAILURE;
234  }
235  } else {
236  msg(MSG::ERROR) << "makePersistent failed for RxLayersContainer" << endmsg;
237  return StatusCode::FAILURE;
238  }
239  dObj = m_hvCorrectionsContainer->makePersistent();
240  if (dObj) {
241  CondAttrListCollection* coll = dynamic_cast<CondAttrListCollection*>(dObj);
242  if (coll) {
243  StatusCode sc;
244  sc = detStore()->record(coll, m_hvCorrectionsContainer->coolOutputKey());
245  if (sc.isFailure()) {
246  msg(MSG::ERROR) << "Failed to record HVCorrectionsContainer" << endmsg;
247  return sc;
248  }
249  } else {
250  msg(MSG::ERROR) << "Could not cast to CondAttrListCollection" << endmsg;
251  return StatusCode::FAILURE;
252  }
253  } else {
254  msg(MSG::ERROR) << "makePersistent failed for HVCorrectionsContainer" << endmsg;
255  return StatusCode::FAILURE;
256  }
257 
258  return StatusCode::SUCCESS;
259 }

◆ initialize()

StatusCode L1CaloHVCorrectionsForDB::initialize ( )

Definition at line 37 of file L1CaloHVCorrectionsForDB.cxx.

38 {
39  ATH_CHECK( m_ttTool.retrieve() );
40  ATH_CHECK( m_jmTools.retrieve() );
41 
45 
48 
49  return StatusCode::SUCCESS;
50 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::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.

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::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< Algorithm >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> L1CaloHVCorrectionsForDB::m_cablingKey { this, "CablingKey", "LArOnOffIdMap", "SG Key of LArOnOffIdMapping object" }
private

Definition at line 50 of file L1CaloHVCorrectionsForDB.h.

◆ m_caloCellContainerName

std::string L1CaloHVCorrectionsForDB::m_caloCellContainerName
private

Definition at line 44 of file L1CaloHVCorrectionsForDB.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_firstEvent

bool L1CaloHVCorrectionsForDB::m_firstEvent
private

Definition at line 56 of file L1CaloHVCorrectionsForDB.h.

◆ m_hvCorrectionsContainer

boost::scoped_ptr<L1CaloHVCorrectionsContainer> L1CaloHVCorrectionsForDB::m_hvCorrectionsContainer
private

Definition at line 54 of file L1CaloHVCorrectionsForDB.h.

◆ m_jmTools

ToolHandle<LVL1::IL1CaloOfflineTriggerTowerTools> L1CaloHVCorrectionsForDB::m_jmTools
private

Definition at line 47 of file L1CaloHVCorrectionsForDB.h.

◆ m_rxLayersContainer

boost::scoped_ptr<L1CaloRxLayersContainer> L1CaloHVCorrectionsForDB::m_rxLayersContainer
private

Definition at line 53 of file L1CaloHVCorrectionsForDB.h.

◆ m_scaleCorrKey

SG::ReadCondHandleKey<ILArHVScaleCorr> L1CaloHVCorrectionsForDB::m_scaleCorrKey { this, "LArHVScaleCorr", "LArHVScaleCorrRecomputed", "" }
private

Definition at line 48 of file L1CaloHVCorrectionsForDB.h.

◆ m_triggerTowerCollectionName

std::string L1CaloHVCorrectionsForDB::m_triggerTowerCollectionName
private

Definition at line 43 of file L1CaloHVCorrectionsForDB.h.

◆ m_ttTool

ToolHandle<LVL1::IL1TriggerTowerTool> L1CaloHVCorrectionsForDB::m_ttTool
private

Definition at line 46 of file L1CaloHVCorrectionsForDB.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
L1CaloHVCorrectionsForDB::m_firstEvent
bool m_firstEvent
Definition: L1CaloHVCorrectionsForDB.h:56
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:113
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
lumiFormat.i
int i
Definition: lumiFormat.py:85
L1CaloHVCorrections
Class that holds mean HV corrections for receivers.
Definition: L1CaloHVCorrections.h:19
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
L1CaloHVCorrectionsContainer
Container of L1CaloHVCorrections objects, inherit from the abstract base class AbstractL1CaloConditio...
Definition: L1CaloHVCorrectionsContainer.h:30
L1CaloHVCorrectionsForDB::m_hvCorrectionsContainer
boost::scoped_ptr< L1CaloHVCorrectionsContainer > m_hvCorrectionsContainer
Definition: L1CaloHVCorrectionsForDB.h:54
L1CaloHVCorrectionsForDB::m_rxLayersContainer
boost::scoped_ptr< L1CaloRxLayersContainer > m_rxLayersContainer
Definition: L1CaloHVCorrectionsForDB.h:53
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
L1CaloRxLayersContainer
Container of L1CaloRxLayers objects, inherit from the abstract base class AbstractL1CaloConditionCont...
Definition: L1CaloRxLayersContainer.h:30
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
L1CaloHVCorrectionsForDB::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: L1CaloHVCorrectionsForDB.h:51
DataVector< LVL1::TriggerTower >
L1CaloHVCorrectionsForDB::m_scaleCorrKey
SG::ReadCondHandleKey< ILArHVScaleCorr > m_scaleCorrKey
Definition: L1CaloHVCorrectionsForDB.h:49
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
LVL1::TriggerTower
Trigger towers are the inputs to all other parts of the calorimeter trigger.
Definition: Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/TriggerTower.h:45
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
L1CaloHVCorrectionsForDB::m_ttTool
ToolHandle< LVL1::IL1TriggerTowerTool > m_ttTool
Definition: L1CaloHVCorrectionsForDB.h:46
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
L1CaloRxLayers
Class that holds information about calo layers that make up receivers.
Definition: L1CaloRxLayers.h:19
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
L1CaloHVCorrectionsForDB::m_jmTools
ToolHandle< LVL1::IL1CaloOfflineTriggerTowerTools > m_jmTools
Definition: L1CaloHVCorrectionsForDB.h:47
L1CaloHVCorrectionsForDB::m_caloCellContainerName
std::string m_caloCellContainerName
Definition: L1CaloHVCorrectionsForDB.h:44
TileDCSDataPlotter.tt
tt
Definition: TileDCSDataPlotter.py:874
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
L1CaloHVCorrectionsForDB::m_triggerTowerCollectionName
std::string m_triggerTowerCollectionName
Definition: L1CaloHVCorrectionsForDB.h:43
ServiceHandle< ICondSvc >