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

#include <LArCalibShortCorrector.h>

Inheritance diagram for LArCalibShortCorrector:
Collaboration diagram for LArCalibShortCorrector:

Public Member Functions

 LArCalibShortCorrector (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~LArCalibShortCorrector ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode stop ()
 
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 std::vector< std::pair< HWIdentifier, HWIdentifier > >::const_iterator SHORT_IT
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode findShortedNeighbors ()
 
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

SG::ReadCondHandleKey< LArBadChannelContm_BCKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"}
 
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"}
 
const LArOnlineIDm_onlineId
 
const CaloCell_IDm_caloCellId
 
const DataHandle< ILArPedestalm_larPedestal
 
std::vector< std::string > m_keylist
 
std::string m_pedKey
 
std::vector< std::pair< HWIdentifier, HWIdentifier > > m_shortedNeighbors
 
bool m_shortsCached
 
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

Definition at line 25 of file LArCalibShortCorrector.h.

Member Typedef Documentation

◆ SHORT_IT

typedef std::vector<std::pair<HWIdentifier,HWIdentifier> >::const_iterator LArCalibShortCorrector::SHORT_IT
private

Definition at line 56 of file LArCalibShortCorrector.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ LArCalibShortCorrector()

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

Definition at line 16 of file LArCalibShortCorrector.cxx.

16  :
17  AthAlgorithm(name, pSvcLocator),
18  m_onlineId(nullptr),
19  m_caloCellId(nullptr)
20 {
21  declareProperty("KeyList", m_keylist,
22  "List of input keys (normally the 'HIGH','MEDIUM','LOW')");
23  declareProperty("PedestalKey",m_pedKey="Pedestal",
24  "Key of the pedestal object (to be subtracted)");
25  m_shortsCached=false;
26 }

◆ ~LArCalibShortCorrector()

LArCalibShortCorrector::~LArCalibShortCorrector ( )
default

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 LArCalibShortCorrector::execute ( )

Definition at line 120 of file LArCalibShortCorrector.cxx.

120  {
121  if (!m_shortsCached){
123  m_shortsCached=true;
124  }
125  const size_t nShorts=m_shortedNeighbors.size();
126 
127  //Loop over all digits in all containers to find the shorted ones
128 
129  const LArAccumulatedCalibDigitContainer* larAccumulatedCalibDigitContainer;
130 
131  // now start to deal with digits
132 
133  for (const std::string& key : m_keylist) {
134  StatusCode sc = evtStore()->retrieve(larAccumulatedCalibDigitContainer,key);
135  if (sc.isFailure()){
136  ATH_MSG_WARNING ( "Cannot read LArAccumulatedCalibDigitContainer from StoreGate! key=" << key );
137  continue; // Try next container
138  }
139 
140 
141  std::vector<std::pair<const LArAccumulatedCalibDigit*, const LArAccumulatedCalibDigit*> > shortedDigits;
142  shortedDigits.resize(nShorts);
143 
144  LArAccumulatedCalibDigitContainer::const_iterator it=larAccumulatedCalibDigitContainer->begin();
145  LArAccumulatedCalibDigitContainer::const_iterator it_e=larAccumulatedCalibDigitContainer->end();
146  if(it == it_e) {
147  ATH_MSG_VERBOSE ( "LArAccumulatedCalibDigitContainer with key = " << key << " is empty " );
148  //return StatusCode::SUCCESS;
149  continue; // Try next container
150  } else {
151  ATH_MSG_DEBUG ( "Processing LArAccumulatedCalibDigitContainer with key = " << key
152  << ". Size: " << larAccumulatedCalibDigitContainer->size() );
153  }
154 
155  for(;it!=it_e;++it) { //Loop over calib-digits
156  const HWIdentifier chid=(*it)->hardwareID();
157  size_t ii;
158  for (ii=0;ii<nShorts;ii++)
159  if (m_shortedNeighbors[ii].first==chid || m_shortedNeighbors[ii].second==chid) break;
160  if (ii==nShorts) continue; //Not found on the list of shorts
161 
162  //Got a channel on the list of shorted channels: Remember their pointers!
163  if ((*it)->isPulsed())
164  shortedDigits[ii].first=*it;
165  else
166  shortedDigits[ii].second=*it;
167  }//end loop over cells
168 
169 
170  for (size_t ii=0;ii<nShorts;ii++) {
171  if (shortedDigits[ii].first==NULL) continue; //Not in the data at all, or only the not-pulsed channel in the data
172  if (shortedDigits[ii].second==NULL) { //Only the pulsed channel in the data
173  ATH_MSG_WARNING ( "Second channel of a shorted pair not found in data. Try factor 2 correction." );
174  shortedDigits[ii].second=shortedDigits[ii].first;
175  }
176 
177  const std::vector<uint64_t>& sampleSumsPulsed=shortedDigits[ii].first->sampleSum();
178  const std::vector<uint64_t>& sampleSumsNeighbor=shortedDigits[ii].second->sampleSum();
179 
180  std::vector<uint64_t> newSampleSum(sampleSumsPulsed.size());
181 
182 
183  if (sampleSumsPulsed.size() != sampleSumsNeighbor.size()) {
184  ATH_MSG_ERROR ( "Inconsistent size of samples-vector!" );
185  return StatusCode::FAILURE;
186  }
187 
188  if (shortedDigits[ii].first->nTriggers() != shortedDigits[ii].second->nTriggers()) {
189  ATH_MSG_ERROR ( "Inconsistent number of Triggers!" );
190  return StatusCode::FAILURE;
191  }
192 
193 
194  float pedestal = m_larPedestal->pedestal(shortedDigits[ii].second->hardwareID(),
195  shortedDigits[ii].second->gain());
196  if (pedestal<= (1.0+LArElecCalib::ERRORCODE)) {
197  ATH_MSG_ERROR ( "Failed to get pedestal for channel " << m_onlineId->channel_name(shortedDigits[ii].second->hardwareID())
198  << ", gain=" << shortedDigits[ii].second->gain() );
199  return StatusCode::FAILURE;
200  }
201  const unsigned int ped=(unsigned)round(double(pedestal)*shortedDigits[ii].second->nTriggers());
202 
203 
204  for (size_t is=0;is<sampleSumsPulsed.size();++is) {
205  //std::cout << "Sample #"<< is << "=" << sampleSumsPulsed[is] << "+" << sampleSumsNeighbor[ii] << "-" << ped << "=";
206  newSampleSum[is]=sampleSumsPulsed[is]+(sampleSumsNeighbor[is]-ped);
207  //std::cout << newSampleSum[is] << std::endl;
208  }
209  // FIXME: const_cast can change objects in SG.
210  const_cast<LArAccumulatedCalibDigit*>(shortedDigits[ii].first)->setSampleSum(newSampleSum);
211  }//end loop over pairs of shorted digits
212  }//end loop over container keys
213  return StatusCode::SUCCESS;
214 }

◆ 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 LArCalibShortCorrector::finalize ( )
inline

Definition at line 35 of file LArCalibShortCorrector.h.

35 {return StatusCode::SUCCESS;}

◆ findShortedNeighbors()

StatusCode LArCalibShortCorrector::findShortedNeighbors ( )
private

Definition at line 39 of file LArCalibShortCorrector.cxx.

39  {
40  //The current implementation assumes that we have very few shorted cells.
41  //Currently we have 2 pairs (one in EMBA, one in EMBC).
42  //If we find more shorts, the simple, un-ordered vector and linear search should be
43  //replaced by something faster
45  const LArBadChannelCont* bcCont{*bcHdl};
46  if(!bcCont) {
47  ATH_MSG_ERROR( "Do not have bad channels !" );
48  return StatusCode::FAILURE;
49  }
51  const LArOnOffIdMapping* cabling{*cablingHdl};
52  if(!cabling) {
53  ATH_MSG_ERROR( "Do not have cabling object LArOnOffIdMapping");
54  return StatusCode::FAILURE;
55  }
56 
57  m_shortedNeighbors.clear();
58  //Loop over all identifers (maybe better if we would have a loop only over bad-cahnnels)
59  for (const HWIdentifier chid1 : m_onlineId->channel_range()) {
60  if (bcCont->status(chid1).shortProblem()) {
61  //Already found?
62  SHORT_IT sit=m_shortedNeighbors.begin();
63  SHORT_IT sit_e=m_shortedNeighbors.end();
64  for (;sit!=sit_e && sit->second!=chid1;++sit)
65  ;
66  if (sit!=sit_e) continue; //This short was already found as neighbor of another shorted cell
67 
68  const Identifier id1=cabling->cnvToIdentifier(chid1);
69  const IdentifierHash id1_h=m_caloCellId->calo_cell_hash(id1);
70  ATH_MSG_DEBUG ( "Channel " << chid1.get_compact() << " marked as short" );
71  //Find neighbor
72  std::vector<IdentifierHash> neighbors;
74  HWIdentifier chid2;
75  if (neighbors.empty()) {
76  ATH_MSG_ERROR ( "No neighbors found for channel with id " << m_onlineId->channel_name(chid1) );
77  return StatusCode::FAILURE;
78  }
79  else
80  ATH_MSG_DEBUG ( " Found " << neighbors.size() << " neighbors found for channel with id " << m_onlineId->channel_name(chid1) );
81 
82 
83  std::vector<IdentifierHash>::const_iterator nbrit=neighbors.begin();
84  std::vector<IdentifierHash>::const_iterator nbrit_e=neighbors.end();
85  for (;nbrit!=nbrit_e;++nbrit) {
86  const HWIdentifier chid_nbr=cabling->createSignalChannelIDFromHash(*nbrit);
87  if (bcCont->status(chid_nbr).shortProblem()) { //Found neighbor with 'short'
88  if (chid2.is_valid()) {
89  ATH_MSG_ERROR ( "Found more than one neighbor with short bit set! Identifiers: "
90  << m_onlineId->channel_name(chid1) << ", "
91  << m_onlineId->channel_name(chid2) << ", "
92  << m_onlineId->channel_name(chid_nbr) );
93  return StatusCode::FAILURE;
94  }
95  else {
96  chid2=chid_nbr;
97  ATH_MSG_DEBUG ( "Found pair " << m_onlineId->channel_name(chid1) << " " << m_onlineId->channel_name(chid2) );
98  }
99  }
100  }//End loop over neighbors
101  if (!chid2.is_valid()) {
102  ATH_MSG_ERROR ( "No neighbor with 'short' bit set for channel with id: " << chid1.get_compact() );
103  return StatusCode::FAILURE;
104  }
105  m_shortedNeighbors.emplace_back(chid1,chid2);
106  }//end this channel has a short
107  }//End loop over all identifiers
108 
109  if (msgLvl(MSG::INFO)) {
110  ATH_MSG_INFO ( "Found " << m_shortedNeighbors.size() << " pairs of shorted neighbors" );
111  for (const std::pair<HWIdentifier, HWIdentifier>& p : m_shortedNeighbors)
112  ATH_MSG_INFO ( " Shorted pair: " << m_onlineId->channel_name(p.first) << ", " << m_onlineId->channel_name(p.second) );
113  }
114 
115  return StatusCode::SUCCESS;
116 }

◆ initialize()

StatusCode LArCalibShortCorrector::initialize ( )

Definition at line 30 of file LArCalibShortCorrector.cxx.

30  {
31  ATH_CHECK( m_BCKey.initialize() );
33  ATH_CHECK( detStore()->retrieve(m_onlineId, "LArOnlineID") );
34  ATH_CHECK( detStore()->retrieve(m_caloCellId, "CaloCell_ID") );
35  ATH_CHECK( detStore()->regHandle(m_larPedestal,m_pedKey) );
36  return StatusCode::SUCCESS;
37 }

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

◆ stop()

StatusCode LArCalibShortCorrector::stop ( )

Definition at line 217 of file LArCalibShortCorrector.cxx.

217  {
218  ATH_MSG_INFO ( "in stop." );
219  return StatusCode::SUCCESS;
220 }

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

SG::ReadCondHandleKey<LArBadChannelCont> LArCalibShortCorrector::m_BCKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"}
private

Definition at line 42 of file LArCalibShortCorrector.h.

◆ m_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> LArCalibShortCorrector::m_cablingKey {this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"}
private

Definition at line 43 of file LArCalibShortCorrector.h.

◆ m_caloCellId

const CaloCell_ID* LArCalibShortCorrector::m_caloCellId
private

Definition at line 46 of file LArCalibShortCorrector.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_keylist

std::vector<std::string> LArCalibShortCorrector::m_keylist
private

Definition at line 51 of file LArCalibShortCorrector.h.

◆ m_larPedestal

const DataHandle<ILArPedestal> LArCalibShortCorrector::m_larPedestal
private

Definition at line 48 of file LArCalibShortCorrector.h.

◆ m_onlineId

const LArOnlineID* LArCalibShortCorrector::m_onlineId
private

Definition at line 45 of file LArCalibShortCorrector.h.

◆ m_pedKey

std::string LArCalibShortCorrector::m_pedKey
private

Definition at line 52 of file LArCalibShortCorrector.h.

◆ m_shortedNeighbors

std::vector<std::pair<HWIdentifier,HWIdentifier> > LArCalibShortCorrector::m_shortedNeighbors
private

Definition at line 55 of file LArCalibShortCorrector.h.

◆ m_shortsCached

bool LArCalibShortCorrector::m_shortsCached
private

Definition at line 58 of file LArCalibShortCorrector.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:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ILArPedestal::pedestal
virtual float pedestal(const HWIdentifier &id, int gain) const =0
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
LArAccumulatedCalibDigit
Data class for calibration ADC samples preprocessed by the DSP.
Definition: LArAccumulatedCalibDigit.h:42
LArCalibShortCorrector::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: LArCalibShortCorrector.h:43
LArCalibShortCorrector::m_BCKey
SG::ReadCondHandleKey< LArBadChannelCont > m_BCKey
Definition: LArCalibShortCorrector.h:42
LArCalibShortCorrector::m_keylist
std::vector< std::string > m_keylist
Definition: LArCalibShortCorrector.h:51
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LArBadXCont
Conditions-Data class holding LAr Bad Channel or Bad Feb information.
Definition: LArBadChannelCont.h:28
LArNeighbours::faces2D
@ faces2D
Definition: LArNeighbours.h:16
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
skel.it
it
Definition: skel.GENtoEVGEN.py:423
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
LArCalibShortCorrector::m_shortsCached
bool m_shortsCached
Definition: LArCalibShortCorrector.h:58
AthCommonMsg< Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
LArCalibShortCorrector::m_larPedestal
const DataHandle< ILArPedestal > m_larPedestal
Definition: LArCalibShortCorrector.h:48
HWIdentifier
Definition: HWIdentifier.h:13
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
xAOD::unsigned
unsigned
Definition: RingSetConf_v1.cxx:662
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
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
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
LArOnlineID_Base::channel_range
id_range channel_range() const
Definition: LArOnlineID_Base.cxx:1936
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LArCalibShortCorrector::m_caloCellId
const CaloCell_ID * m_caloCellId
Definition: LArCalibShortCorrector.h:46
LArCalibShortCorrector::m_onlineId
const LArOnlineID * m_onlineId
Definition: LArCalibShortCorrector.h:45
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LArCalibShortCorrector::m_shortedNeighbors
std::vector< std::pair< HWIdentifier, HWIdentifier > > m_shortedNeighbors
Definition: LArCalibShortCorrector.h:55
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
LArCalibShortCorrector::findShortedNeighbors
StatusCode findShortedNeighbors()
Definition: LArCalibShortCorrector.cxx:39
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
LArCalibShortCorrector::m_pedKey
std::string m_pedKey
Definition: LArCalibShortCorrector.h:52
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
CaloCell_Base_ID::get_neighbours
int get_neighbours(const IdentifierHash caloHash, const LArNeighbours::neighbourOption &option, std::vector< IdentifierHash > &neighbourList) const
access to hashes for neighbours return == 0 for neighbours found
Definition: CaloCell_Base_ID.cxx:190
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
Example_ReadSampleNoise.ped
ped
Definition: Example_ReadSampleNoise.py:45
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
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
DeMoScan.first
bool first
Definition: DeMoScan.py:534
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
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
LArElecCalib::ERRORCODE
@ ERRORCODE
Definition: LArCalibErrorCode.h:17
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
IdentifierHash
Definition: IdentifierHash.h:38
LArOnlineID_Base::channel_name
std::string channel_name(const HWIdentifier id) const
Return a string corresponding to a feedthrough name given an identifier.
Definition: LArOnlineID_Base.cxx:218
LArAccumulatedCalibDigitContainer
Container class for LArAccumulatedCalibDigit.
Definition: LArAccumulatedCalibDigitContainer.h:25
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
LArCalibShortCorrector::SHORT_IT
std::vector< std::pair< HWIdentifier, HWIdentifier > >::const_iterator SHORT_IT
Definition: LArCalibShortCorrector.h:56
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37