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

#include <LArHVCorrToSCHVCorr.h>

Inheritance diagram for LArHVCorrToSCHVCorr:
Collaboration diagram for LArHVCorrToSCHVCorr:

Public Member Functions

 LArHVCorrToSCHVCorr (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor with parameters: More...
 
virtual ~LArHVCorrToSCHVCorr ()=default
 Destructor: More...
 
virtual StatusCode initialize () override
 
virtual StatusCode execute () override
 
virtual StatusCode stop () override
 
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

float getWeight (const LArHEC_ID *hecID, const Identifier &id, std::map< int, std::vector< float > > &wmap)
 
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< LArOnOffIdMappingm_cablingKeySC {this,"SCCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"}
 
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
 
SG::ReadCondHandleKey< ILArHVScaleCorrm_contKey {this,"ContainerKey","LArHVScaleCorr","SG Key of regular cells HV scale corr object"}
 
SG::WriteCondHandleKey< LArHVCorrm_outKey {this,"OutputKey","LARSCHVScaleCorr","SG Key of produced SC HV scale corr object"}
 
StringProperty m_folderName {this, "OutputFolder", "/LAR/ElecCalibFlatSC/HVScaleCorr", "Output folder for CondAttrListCollection"}
 
StringProperty m_weightsName {this, "PhysicsWeights", "TrigT1CaloCalibUtils/HVcorrPhysicsWeights.txt", "File with layer weights"}
 
ToolHandle< ICaloSuperCellIDToolm_scidTool {this, "CaloSuperCellIDTool", "CaloSuperCellIDTool"}
 
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 21 of file LArHVCorrToSCHVCorr.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

◆ LArHVCorrToSCHVCorr()

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

Constructor with parameters:

Definition at line 21 of file LArHVCorrToSCHVCorr.cxx.

22  :
23  ::AthAlgorithm( name, pSvcLocator )
24 {
25 }

◆ ~LArHVCorrToSCHVCorr()

virtual LArHVCorrToSCHVCorr::~LArHVCorrToSCHVCorr ( )
virtualdefault

Destructor:

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

virtual StatusCode LArHVCorrToSCHVCorr::execute ( )
inlineoverridevirtual

Definition at line 34 of file LArHVCorrToSCHVCorr.h.

34 {return StatusCode::SUCCESS;};

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

◆ getWeight()

float LArHVCorrToSCHVCorr::getWeight ( const LArHEC_ID hecID,
const Identifier id,
std::map< int, std::vector< float > > &  wmap 
)
private

Definition at line 183 of file LArHVCorrToSCHVCorr.cxx.

183  {
184  int side = hecID->pos_neg(id);
185  int reg = hecID->region(id);
186  int eta = hecID->eta(id);
187  int ttbin=0;
188  switch(side){
189  case -2: if(reg==0) ttbin=-16-eta; else ttbin=-27-2*eta; if(ttbin==-33) ttbin=-32; break;
190  case 2: if(reg==0) ttbin=15+eta; else ttbin=25+2*eta;
191  }
192  if(ttbin!=0 && wmap.find(ttbin) != wmap.end()){
193  ATH_MSG_DEBUG("Found weight "<<wmap[ttbin][hecID->sampling(id)] <<" for "<<side<<" "<<reg<<" "<<eta);
194  return wmap[ttbin][hecID->sampling(id)];
195  } else {
196  ATH_MSG_DEBUG("Returning 1 for "<<side<<" "<<reg<<" "<<eta);
197  return 1.;
198  }
199 }

◆ initialize()

StatusCode LArHVCorrToSCHVCorr::initialize ( )
overridevirtual

Definition at line 27 of file LArHVCorrToSCHVCorr.cxx.

28 {
29 
30  ATH_CHECK(m_scidTool.retrieve());
35 
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 LArHVCorrToSCHVCorr::stop ( )
overridevirtual

Definition at line 40 of file LArHVCorrToSCHVCorr.cxx.

41 {
42 
43  //Retrieve HVCorr for regular cells
44  const EventContext& ctx = Gaudi::Hive::currentContext();
46  if(!hvHdl.isValid()) {
47  ATH_MSG_ERROR( "Do not have HVScaleCorr from key " << m_contKey.key() );
48  return StatusCode::FAILURE;
49  }
50 
51  //Retrive SuperCell online id
52  const LArOnline_SuperCellID* onlSCID = nullptr;
53  CHECK(detStore()->retrieve(onlSCID));
54 
56  const LArOnOffIdMapping* cabling{*cablingHdl};
57  if(!cabling) {
58  ATH_MSG_ERROR( "Do not have cabling mapping from key " << m_cablingKey.key() );
59  return StatusCode::FAILURE;
60  }
61 
63  const LArOnOffIdMapping* cablingSC{*cablingHdlSC};
64  if(!cablingSC) {
65  ATH_MSG_ERROR( "Do not have cabling mapping from key " << m_cablingKeySC.key() );
66  return StatusCode::FAILURE;
67  }
68 
69  const CaloCell_SuperCell_ID* calosccellID=nullptr;
70  ATH_CHECK( detStore()->retrieve (calosccellID, "CaloCell_SuperCell_ID") );
71  const unsigned hashMax=calosccellID->calo_cell_hash_max();
72  ATH_MSG_INFO("SuperCell hash max: " << hashMax);
73 
74  // get the HEC layer weights
75  std::string file = PathResolver::find_file (m_weightsName.value(), "JOBOPTSEARCHPATH");
76  ATH_MSG_INFO( "Reading file " << file << " configured: " << m_weightsName.value() );
77  std::ifstream fin(file.c_str());
78  if (!fin.is_open()) {
79  ATH_MSG_ERROR( "Could not open input file " << file );
80  return StatusCode::FAILURE;
81  }
82  std::string line;
83  int ttbin;
84  float em0,em1,em2,em3,em4;
85  float had0,had1,had2,had3;
86  std::map<int,std::vector<float> > wmap;
87  while (std::getline(fin, line)){
88  int nread = sscanf(line.c_str(), "%d %f %f %f %f %f %f %f %f %f",
89  &ttbin,&em0,&em1,&em2,&em3,&em4,&had0,&had1,&had2,&had3);
90  if(nread != 10) continue;
91  wmap[ttbin]=std::vector<float>{had0,had1,had2,had3};
92  }
93  // need also online ID helper
94  const LArHEC_ID* hecID = nullptr;
95  ATH_CHECK(detStore()->retrieve(hecID,"LArHEC_ID"));
96 
97  //Set up AttributeListCollection
98  coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
99  spec->extend("HVScaleCorr", "blob");
100  spec->extend<unsigned>("version");
101 
102  coral::AttributeList attrList(*spec);
103  attrList["version"].setValue(0U);
104  coral::Blob& hvBlob=attrList["HVScaleCorr"].data<coral::Blob>();
105 
106  spec->release();
107  // cppcheck-suppress memleak
108  spec = nullptr;
109 
110  // Important, blob is ordered by LAr online hash, but LArHVCorr by cell offline hash !!!!
111  hvBlob.resize(onlSCID->channelHashMax()*sizeof(float));
112 
113  float *pHV=static_cast<float*>(hvBlob.startingAddress());
114  std::vector<float> vScale;
115  //Initialize blobs to ERRORCODE
116  for (unsigned i=0;i<onlSCID->channelHashMax();++i) {
118  }
119  if(!m_outKey.empty()) vScale.resize(hashMax,(float)1.0);
120 
121  unsigned nFilledIds=0;
122  unsigned nTotalIds=0;
123  for (unsigned i=0; i < hashMax; ++i) {
124  if(calosccellID->sub_calo(IdentifierHash(i)) > 2) continue; // not a LAr channel
125  const Identifier scId=calosccellID->cell_id(IdentifierHash(i));
126  nTotalIds += 1;
127  const std::vector<Identifier> &cellIds=m_scidTool->superCellToOfflineID(scId);
128  if (cellIds.empty()) {
129  ATH_MSG_ERROR("Got empty vector of cell ids for super cell id 0x"
130  << std::hex << scId.get_compact()<<std::dec);
131  return StatusCode::FAILURE;
132  }
133  float hvcorr=0.;
134  float weight=1.;
135  float wsum=0.;
136  for(const Identifier cellId : cellIds) {
137  if(hecID->is_lar_hec(cellId)) { // find a weight
138  weight = getWeight(hecID,cellId,wmap);
139  }
140  hvcorr += weight * hvHdl->HVScaleCorr(cabling->createSignalChannelID(cellId));
141  wsum += weight;
142  }
143  if(wsum>0.) hvcorr /= wsum;
144  nFilledIds += 1;
145 
146  // Important, blob is ordered by LAr online hash, but LArHVCorr by cell offline hash !!!!
147  pHV[onlSCID->channel_Hash(cablingSC->createSignalChannelID(scId))]=hvcorr;
148 
149  if(!m_outKey.empty()) vScale[i]=hvcorr;
150 
151  }//end loop over super-cell hash
152 
153  //Add to collection
155  CHECK(detStore()->record(coll,m_folderName));
156  coll->add(0,attrList);
157 
158  ATH_MSG_INFO("Total number of SuperCells:" << nTotalIds << ", filled:" << nFilledIds);
159 
160  if(!m_outKey.empty()) {
161  SG::WriteCondHandle<LArHVCorr> writeHandle{m_outKey, ctx};
162  const EventIDRange fullRange=IOVInfiniteRange::infiniteMixed();
163  writeHandle.addDependency (fullRange);
164  writeHandle.addDependency(hvHdl);
165  writeHandle.addDependency(cablingHdl);
166  writeHandle.addDependency(cablingHdlSC);
167 
168  auto scHvCorr = std::make_unique<LArHVCorr>(std::move(vScale), cablingSC, calosccellID);
169  if (writeHandle.record(std::move(scHvCorr)).isFailure()) {
170  ATH_MSG_ERROR("Could not record LArHVCorr object with " << m_outKey.key()
171  << " with EventRange " << writeHandle.getRange() << " into Conditions Store");
172  return StatusCode::FAILURE;
173  }
174  ATH_MSG_INFO("Recorded new " << writeHandle.key() << " with range " << writeHandle.getRange() << " into Conditions Store");
175  ILArHVScaleCorr *imscale = nullptr;
176  if(detStore()->symLink(scHvCorr.get(), imscale).isFailure()) {
177  ATH_MSG_WARNING("Could not symlink " << writeHandle.key() << " to ILArHVScaleCorr");
178  }
179  }
180  return StatusCode::SUCCESS;
181 }

◆ 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> LArHVCorrToSCHVCorr::m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
private

Definition at line 40 of file LArHVCorrToSCHVCorr.h.

◆ m_cablingKeySC

SG::ReadCondHandleKey<LArOnOffIdMapping> LArHVCorrToSCHVCorr::m_cablingKeySC {this,"SCCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"}
private

Definition at line 39 of file LArHVCorrToSCHVCorr.h.

◆ m_contKey

SG::ReadCondHandleKey<ILArHVScaleCorr> LArHVCorrToSCHVCorr::m_contKey {this,"ContainerKey","LArHVScaleCorr","SG Key of regular cells HV scale corr object"}
private

Definition at line 41 of file LArHVCorrToSCHVCorr.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_folderName

StringProperty LArHVCorrToSCHVCorr::m_folderName {this, "OutputFolder", "/LAR/ElecCalibFlatSC/HVScaleCorr", "Output folder for CondAttrListCollection"}
private

Definition at line 45 of file LArHVCorrToSCHVCorr.h.

◆ m_outKey

SG::WriteCondHandleKey<LArHVCorr> LArHVCorrToSCHVCorr::m_outKey {this,"OutputKey","LARSCHVScaleCorr","SG Key of produced SC HV scale corr object"}
private

Definition at line 43 of file LArHVCorrToSCHVCorr.h.

◆ m_scidTool

ToolHandle<ICaloSuperCellIDTool> LArHVCorrToSCHVCorr::m_scidTool {this, "CaloSuperCellIDTool", "CaloSuperCellIDTool"}
private

Definition at line 49 of file LArHVCorrToSCHVCorr.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.

◆ m_weightsName

StringProperty LArHVCorrToSCHVCorr::m_weightsName {this, "PhysicsWeights", "TrigT1CaloCalibUtils/HVcorrPhysicsWeights.txt", "File with layer weights"}
private

Definition at line 47 of file LArHVCorrToSCHVCorr.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
checkFileSG.line
line
Definition: checkFileSG.py:75
LArOnlineID_Base::channel_Hash
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
Definition: LArOnlineID_Base.cxx:1636
ILArHVScaleCorr
Definition: ILArHVScaleCorr.h:13
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
LArHEC_Base_ID::eta
int eta(const Identifier id) const
return eta [0,9] outer part [0,3] inner part
LArHVCorrToSCHVCorr::m_scidTool
ToolHandle< ICaloSuperCellIDTool > m_scidTool
Definition: LArHVCorrToSCHVCorr.h:49
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
PathResolver::find_file
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:251
LArHVCorrToSCHVCorr::m_cablingKeySC
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeySC
Definition: LArHVCorrToSCHVCorr.h:39
CaloCondBlobAlgs_fillNoiseFromASCII.spec
spec
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:47
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
IOVInfiniteRange::infiniteMixed
static EventIDRange infiniteMixed()
Produces an mixed EventIDRange that is infinite in Time and RunLumi.
Definition: IOVInfiniteRange.h:55
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
LArHEC_ID
Helper class for LArHEC offline identifiers.
Definition: LArHEC_ID.h:85
python.subdetectors.tile.Blob
Blob
Definition: tile.py:17
LArHVCorrToSCHVCorr::m_contKey
SG::ReadCondHandleKey< ILArHVScaleCorr > m_contKey
Definition: LArHVCorrToSCHVCorr.h:41
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
python.DomainsRegistry.reg
reg
globals -----------------------------------------------------------------—
Definition: DomainsRegistry.py:343
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
LArHVCorrToSCHVCorr::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: LArHVCorrToSCHVCorr.h:40
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
TRT::Hit::side
@ side
Definition: HitInfo.h:83
LArHVCorrToSCHVCorr::m_weightsName
StringProperty m_weightsName
Definition: LArHVCorrToSCHVCorr.h:47
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
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
CaloCell_SuperCell_ID
Helper class for offline supercell identifiers.
Definition: CaloCell_SuperCell_ID.h:48
lumiFormat.i
int i
Definition: lumiFormat.py:92
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
LArHVCorrToSCHVCorr::m_folderName
StringProperty m_folderName
Definition: LArHVCorrToSCHVCorr.h:45
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
file
TFile * file
Definition: tile_monitor.h:29
CaloCell_Base_ID::sub_calo
int sub_calo(const Identifier id) const
returns an int taken from SUBCALO enum and describing the subCalo to which the Id belongs.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AtlasDetectorID::is_lar_hec
bool is_lar_hec(Identifier id) const
Definition: AtlasDetectorID.h:829
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
LArOnlineID_Base::channelHashMax
size_type channelHashMax(void) const
Define channel hash tables max size.
Definition: LArOnlineID_Base.cxx:1901
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloCell_Base_ID::cell_id
Identifier cell_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy, const int eta, const int phi) const
Make a cell (== channel) ID from constituting fields and subCalo index; for (Mini)FCAL,...
LArOnline_SuperCellID
Definition: LArOnline_SuperCellID.h:20
LArHVCorrToSCHVCorr::getWeight
float getWeight(const LArHEC_ID *hecID, const Identifier &id, std::map< int, std::vector< float > > &wmap)
Definition: LArHVCorrToSCHVCorr.cxx:183
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
Identifier::get_compact
value_type get_compact(void) const
Get the compact id.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
LArHEC_Base_ID::sampling
int sampling(const Identifier id) const
return sampling [0,3] (only 0 for supercells)
LArHEC_Base_ID::pos_neg
int pos_neg(const Identifier id) const
return pos_neg -2 (C side) or 2 (A side)
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
compute_lumi.fin
fin
Definition: compute_lumi.py:19
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
LArHVCorrToSCHVCorr::m_outKey
SG::WriteCondHandleKey< LArHVCorr > m_outKey
Definition: LArHVCorrToSCHVCorr.h:43
IdentifierHash
Definition: IdentifierHash.h:38
CondAttrListCollection::add
bool add(ChanNum chanNum, const AttributeList &attributeList)
Adding in chan/attrList pairs.
Definition: CondAttrListCollection.h:452
LArHEC_Base_ID::region
int region(const Identifier id) const
return region [0,1]
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
readCCLHist.float
float
Definition: readCCLHist.py:83
fitman.k
k
Definition: fitman.py:528
CaloCell_Base_ID::calo_cell_hash_max
size_type calo_cell_hash_max(void) const
cell 'global' hash table max size
ServiceHandle< ICondSvc >
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20