ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
LVL1::JGTowerMappingDataCondAlgBase Class Referenceabstract

#include <JGTowerMappingDataCondAlgBase.h>

Inheritance diagram for LVL1::JGTowerMappingDataCondAlgBase:
Collaboration diagram for LVL1::JGTowerMappingDataCondAlgBase:

Public Member Functions

 JGTowerMappingDataCondAlgBase (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~JGTowerMappingDataCondAlgBase () override
 
virtual StatusCode initialize () override
 
virtual StatusCode execute (const EventContext &ctx) const final
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
virtual bool filterPassed (const EventContext &ctx) const
 
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 
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

virtual const JGTowerBase_IDgetJGTowerID () const =0
 
virtual StatusCode buildForwardMapping (JGTowerMappingData &data, const CaloSuperCellDetDescrManager *mgr) const =0
 
virtual StatusCode loadTowerAreas (JGTowerMappingData &data) const =0
 
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Protected Attributes

const CaloCell_SuperCell_IDm_scid {nullptr}
 
const CaloCell_IDm_ccid {nullptr}
 

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

SG::WriteCondHandleKey< JGTowerMappingDatam_outputKey
 
SG::ReadCondHandleKey< CaloSuperCellDetDescrManagerm_caloSuperCellMgrKey
 
Gaudi::Property< bool > m_mapTileCells {this, "MapTileCells", false}
 
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
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 19 of file JGTowerMappingDataCondAlgBase.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ JGTowerMappingDataCondAlgBase()

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

Definition at line 18 of file JGTowerMappingDataCondAlgBase.cxx.

19  : AthReentrantAlgorithm(name, pSvcLocator)
20  {
21  }

◆ ~JGTowerMappingDataCondAlgBase()

LVL1::JGTowerMappingDataCondAlgBase::~JGTowerMappingDataCondAlgBase ( )
overridevirtual

Definition at line 23 of file JGTowerMappingDataCondAlgBase.cxx.

23 {}

Member Function Documentation

◆ buildForwardMapping()

virtual StatusCode LVL1::JGTowerMappingDataCondAlgBase::buildForwardMapping ( JGTowerMappingData data,
const CaloSuperCellDetDescrManager mgr 
) const
protectedpure virtual

◆ cardinality()

unsigned int AthReentrantAlgorithm::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Override this to return 0 for reentrant algorithms.

Definition at line 55 of file AthReentrantAlgorithm.cxx.

56 {
57  return 0;
58 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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 LVL1::JGTowerMappingDataCondAlgBase::execute ( const EventContext &  ctx) const
finalvirtual

Definition at line 34 of file JGTowerMappingDataCondAlgBase.cxx.

35  {
37  if (outputHandle.isValid())
38  {
39  // In serial athena conditions algorithms are run on every event.
40  // Therefore return early if the output object already exists.
41  return StatusCode::SUCCESS;
42  }
43  const JGTowerBase_ID *jgTowerID = getJGTowerID();
45  const CaloSuperCellDetDescrManager *scDetMgr = *caloSuperCellMgrHandle;
46  // JGTowerMappingData is typedef of std::vector<JGTowerHelper>
47  auto data = std::make_unique<JGTowerMappingData>();
48 
49  // Store the towers in a map by their location to identify ones which are in front/behind each other
50  // tuple elements: pos_neg, region, eta, phi
51  std::map<std::tuple<int, int, int, int>, std::vector<std::size_t>> towerGrid;
52  // For speed later, also store the max phi index and min/max eta indices per (int) region code
53  std::map<int, std::tuple<int, int, int>> regionParams;
54 
55  for (std::size_t towerIdx = 0; towerIdx < jgTowerID->tower_hash_max(); ++towerIdx)
56  {
57  Identifier towerID = jgTowerID->tower_id(towerIdx);
58  Identifier regionID = jgTowerID->region_id(towerID);
59 
60  int detSide = jgTowerID->pos_neg(towerID) < 0 ? -1 : +1;
61 
62  // Get the phi and eta boundaries of the towers (only advisable for barrel)
63  float jDEta = jgTowerID->etaGranularity(regionID);
64  float jDPhi = jgTowerID->phiGranularity(regionID);
65  int nTowers = (int)std::ceil(TMath::Pi() / jDPhi);
66  jDPhi = TMath::Pi() / nTowers;
67 
68  float jEta = detSide * ((jgTowerID->eta(towerID) + 0.5) * jDEta + jgTowerID->eta0(regionID));
69  float jPhi = TVector2::Phi_mpi_pi((jgTowerID->phi(towerID) + 0.5) * jDPhi + jgTowerID->phi0(regionID));
70 
71  data->emplace_back(jEta, jDEta, jPhi, jDPhi);
72  JGTowerHelper &helper = data->back();
73  helper.SetSampling(jgTowerID->sampling(towerID));
74 
75  std::vector<std::size_t> &gridLoc = towerGrid[std::make_tuple(
76  jgTowerID->pos_neg(towerID),
77  jgTowerID->region(towerID),
78  jgTowerID->eta(towerID),
79  jgTowerID->phi(towerID))];
80  regionParams[jgTowerID->region(towerID)] = std::make_tuple(
81  jgTowerID->phi_max(regionID),
82  jgTowerID->eta_min(regionID),
83  jgTowerID->eta_max(regionID));
84 
85  // Now insert our index into this such that the vector remains sorted in ascending order of sampling
86  gridLoc.insert(std::lower_bound(
87  gridLoc.begin(), gridLoc.end(), towerIdx,
88  [&data](std::size_t lhs, std::size_t rhs) { return data->at(lhs).sampling() < data->at(rhs).sampling(); }),
89  towerIdx);
90 
91  for (std::size_t scIdx = 0; scIdx < m_scid->calo_cell_hash_max(); ++scIdx)
92  {
93  Identifier scID = m_scid->cell_id(scIdx);
94  const CaloDetDescrElement *dde = scDetMgr->get_element(scID);
95  if (!dde)
96  {
97  ATH_MSG_ERROR("Error loading CaloDetDescrElement");
98  return StatusCode::FAILURE;
99  }
100  if (m_scid->is_tile(scID) && m_scid->sampling(scID) != 2)
101  {
102  if (!m_mapTileCells)
103  continue;
104  if (jgTowerID->sampling(towerID) != 0 && helper.inBox(dde->eta_raw(), dde->phi_raw()))
105  helper.SetTileIndices(scIdx);
106  }
107  else
108  {
109  float superCellEta = dde->eta_raw();
110  // Treat forward super cells separately
111  if (std::abs(superCellEta) > 3.2)
112  continue;
113  // Very special case being handle here. At the end of the barrel there is a constant-eta ring that has
114  // eta_raw=1.4 (which is the midpoint of the scell). These will be put into the g/jTower that starts at eta=1.4
115  if (std::abs(std::abs(superCellEta) - 1.4) < 0.001 &&
116  m_scid->region(scID) == 0 &&
117  m_scid->sampling(scID) == 2)
118  superCellEta += (superCellEta > 0 ? 0.05 : -0.05);
119  if (helper.inBox(superCellEta, dde->phi_raw()) &&
120  jgTowerID->pos_neg(towerID) * m_scid->pos_neg(scID) > 0 &&
121  ((m_scid->is_em(scID) && jgTowerID->sampling(towerID) == 0) ||
122  (!m_scid->is_em(scID) && jgTowerID->sampling(towerID) == 1)))
123  helper.SetSCIndices(scIdx);
124  }
125  } //> end loop over SC indices
126  } //> end loop over tower IDs
127 
128  for (auto &gridLocPair : towerGrid)
129  {
130  std::vector<std::size_t> &towerIndices = gridLocPair.second;
131  // Figure out the relations to this square in the grid
132  int pos_neg = std::get<0>(gridLocPair.first);
133  int region = std::get<1>(gridLocPair.first);
134  int iEta = std::get<2>(gridLocPair.first);
135  int iPhi = std::get<3>(gridLocPair.first);
136  int phiMax = std::get<0>(regionParams[region]);
137  int etaMin = std::get<1>(regionParams[region]);
138  int etaMax = std::get<2>(regionParams[region]);
139  auto nextPhiItr = towerGrid.find(std::make_tuple(pos_neg, region, iEta, iPhi == phiMax ? 0 : iPhi + 1));
140  auto prevPhiItr = towerGrid.find(std::make_tuple(pos_neg, region, iEta, iPhi == 0 ? phiMax : iPhi - 1));
141  auto nextEtaItr = towerGrid.end();
142  auto prevEtaItr = towerGrid.end();
143  // We want 'next' and 'prev' to refer to increasing eta, not increasing |eta|
144  // Increasing 'region' increases |eta| so in what follows we correct for this by
145  // choosing whether we set nextEtaItr or prevEtaItr based on the sign of pos_neg
146  if (iEta == etaMax)
147  {
148  // Check if the next region a) exists and b) has the right phi granularity
149  auto itr = regionParams.find(region + 1);
150  if (itr != regionParams.end() && std::get<0>(itr->second) == phiMax)
151  // Set the next eta index to the next region and the eta_min index of that region (probably 0)
152  (pos_neg > 0 ? nextEtaItr : prevEtaItr) = towerGrid.find(std::make_tuple(pos_neg, region + 1, std::get<1>(itr->second), iPhi));
153  }
154  else
155  (pos_neg > 0 ? nextEtaItr : prevEtaItr) = towerGrid.find(std::make_tuple(pos_neg, region, iEta + 1, iPhi));
156  if (iEta == etaMin)
157  {
158  if (region == 0)
159  (pos_neg > 0 ? prevEtaItr : nextEtaItr) = towerGrid.find(std::make_tuple(pos_neg * -1, region, iEta, iPhi));
160  else
161  {
162  auto itr = regionParams.find(region - 1);
163  if (itr != regionParams.end() && std::get<0>(itr->second) == phiMax)
164  // Set the previous eta index to the previous region and the eta_max index of that region
165  (pos_neg > 0 ? prevEtaItr : nextEtaItr) = towerGrid.find(std::make_tuple(pos_neg, region - 1, std::get<2>(itr->second), iPhi));
166  }
167  }
168  else
169  (pos_neg > 0 ? prevEtaItr : nextEtaItr) = towerGrid.find(std::make_tuple(pos_neg, region, iEta - 1, iPhi));
170 
171  std::vector<std::size_t> nextEtaTowers;
172  std::vector<std::size_t> prevEtaTowers;
173  std::vector<std::size_t> nextPhiTowers;
174  std::vector<std::size_t> prevPhiTowers;
175  if (nextEtaItr != towerGrid.end())
176  nextEtaTowers = nextEtaItr->second;
177  if (prevEtaItr != towerGrid.end())
178  prevEtaTowers = prevEtaItr->second;
179  if (nextPhiItr != towerGrid.end())
180  nextPhiTowers = nextPhiItr->second;
181  if (prevPhiItr != towerGrid.end())
182  prevPhiTowers = prevPhiItr->second;
183  nextEtaTowers.resize(towerIndices.size(), SIZE_MAX);
184  prevEtaTowers.resize(towerIndices.size(), SIZE_MAX);
185  nextPhiTowers.resize(towerIndices.size(), SIZE_MAX);
186  prevPhiTowers.resize(towerIndices.size(), SIZE_MAX);
187 
188  std::size_t previousIdx = SIZE_MAX;
189  for (std::size_t iIdx = 0; iIdx < towerIndices.size(); ++iIdx)
190  {
191  // NB: iIdx here is an index of _indices_, i.e. the position in the towerIndex
192  // vector as well as the next/prev eta/phi towers vectors
193  std::size_t currentIdx = towerIndices.at(iIdx);
194  JGTowerHelper &helper = data->at(currentIdx);
195 
196  helper.setNextEtaIndex(nextEtaTowers.at(iIdx));
197  helper.setPreviousEtaIndex(prevEtaTowers.at(iIdx));
198  helper.setNextPhiIndex(nextPhiTowers.at(iIdx));
199  helper.setPreviousPhiIndex(prevPhiTowers.at(iIdx));
200 
201  helper.setIndexInFront(previousIdx);
202  if (previousIdx != SIZE_MAX)
203  data->at(previousIdx).setIndexBehind(currentIdx);
204  previousIdx = currentIdx;
205  }
206  }
207 
208  ATH_CHECK(buildForwardMapping(*data, scDetMgr));
210 
211  // Set this object to be valid for every event
212  outputHandle.addDependency(IOVInfiniteRange::infiniteRunLB());
213  ATH_CHECK(outputHandle.record(std::move(data)));
214 
215  return StatusCode::SUCCESS;
216  }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::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 & AthReentrantAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 79 of file AthReentrantAlgorithm.cxx.

80 {
81  // If we didn't find any symlinks to add, just return the collection
82  // from the base class. Otherwise, return the extended collection.
83  if (!m_extendedExtraObjects.empty()) {
85  }
86  return Algorithm::extraOutputDeps();
87 }

◆ filterPassed()

virtual bool AthReentrantAlgorithm::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 135 of file AthReentrantAlgorithm.h.

135  {
136  return execState( ctx ).filterPassed();
137  }

◆ getJGTowerID()

virtual const JGTowerBase_ID* LVL1::JGTowerMappingDataCondAlgBase::getJGTowerID ( ) const
protectedpure virtual

◆ initialize()

StatusCode LVL1::JGTowerMappingDataCondAlgBase::initialize ( )
overridevirtual

Reimplemented in LVL1::GTowerMappingDataCondAlg, and LVL1::JTowerMappingDataCondAlg.

Definition at line 25 of file JGTowerMappingDataCondAlgBase.cxx.

26  {
31  return StatusCode::SUCCESS;
32  }

◆ inputHandles()

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

◆ isClonable()

bool AthReentrantAlgorithm::isClonable ( ) const
overridevirtualinherited

◆ loadTowerAreas()

virtual StatusCode LVL1::JGTowerMappingDataCondAlgBase::loadTowerAreas ( JGTowerMappingData data) const
protectedpure virtual

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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  }

◆ setFilterPassed()

virtual void AthReentrantAlgorithm::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 139 of file AthReentrantAlgorithm.h.

139  {
140  execState( ctx ).setFilterPassed( state );
141  }

◆ sysExecute()

StatusCode AthReentrantAlgorithm::sysExecute ( const EventContext &  ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 67 of file AthReentrantAlgorithm.cxx.

68 {
69  return Gaudi::Algorithm::sysExecute (ctx);
70 }

◆ sysInitialize()

StatusCode AthReentrantAlgorithm::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< Gaudi::Algorithm > >.

Reimplemented in InputMakerBase, and HypoBase.

Definition at line 96 of file AthReentrantAlgorithm.cxx.

96  {
98 
99  if (sc.isFailure()) {
100  return sc;
101  }
102 
103  ServiceHandle<ICondSvc> cs("CondSvc",name());
104  for (auto h : outputHandles()) {
105  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
106  // do this inside the loop so we don't create the CondSvc until needed
107  if ( cs.retrieve().isFailure() ) {
108  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
109  return StatusCode::SUCCESS;
110  }
111  if (cs->regHandle(this,*h).isFailure()) {
112  sc = StatusCode::FAILURE;
113  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
114  << " with CondSvc");
115  }
116  }
117  }
118  return sc;
119 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::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< Gaudi::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_caloSuperCellMgrKey

SG::ReadCondHandleKey<CaloSuperCellDetDescrManager> LVL1::JGTowerMappingDataCondAlgBase::m_caloSuperCellMgrKey
private
Initial value:
{
this,"CaloSuperCellDetDescrManager","CaloSuperCellDetDescrManager","SG key of the resulting CaloSuperCellDetDescrManager"}

Definition at line 31 of file JGTowerMappingDataCondAlgBase.h.

◆ m_ccid

const CaloCell_ID* LVL1::JGTowerMappingDataCondAlgBase::m_ccid {nullptr}
protected

Definition at line 42 of file JGTowerMappingDataCondAlgBase.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::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< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthReentrantAlgorithm::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 153 of file AthReentrantAlgorithm.h.

◆ m_mapTileCells

Gaudi::Property<bool> LVL1::JGTowerMappingDataCondAlgBase::m_mapTileCells {this, "MapTileCells", false}
private

Definition at line 33 of file JGTowerMappingDataCondAlgBase.h.

◆ m_outputKey

SG::WriteCondHandleKey<JGTowerMappingData> LVL1::JGTowerMappingDataCondAlgBase::m_outputKey
private
Initial value:
{
this, "MappingData", ""}

Definition at line 29 of file JGTowerMappingDataCondAlgBase.h.

◆ m_scid

const CaloCell_SuperCell_ID* LVL1::JGTowerMappingDataCondAlgBase::m_scid {nullptr}
protected

Definition at line 41 of file JGTowerMappingDataCondAlgBase.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::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
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
JGTowerBase_ID::eta
int eta(const Identifier id) const
return eta according to :
Definition: JGTowerBase_ID.h:486
CaloCell_Base_ID::region
int region(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
JGTowerBase_ID::phi0
float phi0(const Identifier regId) const
Return the minimum phi of region, or NOT_VALID.
Definition: JGTowerBase_ID.cxx:506
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LVL1::JGTowerMappingDataCondAlgBase::m_outputKey
SG::WriteCondHandleKey< JGTowerMappingData > m_outputKey
Definition: JGTowerMappingDataCondAlgBase.h:29
JGTowerBase_ID::phi
int phi(const Identifier id) const
return phi according to :
Definition: JGTowerBase_ID.h:492
CaloCell_Base_ID::pos_neg
int pos_neg(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloDetDescrManager_Base::get_element
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Definition: CaloDetDescrManager.cxx:159
AthCommonDataStore::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 > renounce(T &h)
Definition: AthCommonDataStore.h:380
JGTowerBase_ID::sampling
int sampling(const Identifier id) const
return sampling according to :
Definition: JGTowerBase_ID.h:475
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
xAOD::etaMax
etaMax
Definition: HIEventShape_v2.cxx:46
JGTowerBase_ID::region
int region(const Identifier id) const
return region according to :
Definition: JGTowerBase_ID.h:480
JGTowerBase_ID::phi_max
int phi_max(const Identifier regId) const
min value of phi index (-999 == failure)
Definition: JGTowerBase_ID.cxx:464
LVL1::JGTowerMappingDataCondAlgBase::m_caloSuperCellMgrKey
SG::ReadCondHandleKey< CaloSuperCellDetDescrManager > m_caloSuperCellMgrKey
Definition: JGTowerMappingDataCondAlgBase.h:31
JGTowerBase_ID
Definition: JGTowerBase_ID.h:33
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
LVL1::JGTowerMappingDataCondAlgBase::getJGTowerID
virtual const JGTowerBase_ID * getJGTowerID() const =0
CaloCell_Base_ID::is_tile
bool is_tile(const Identifier id) const
test if the id belongs to the Tiles
JGTowerBase_ID::tower_hash_max
size_type tower_hash_max(void) const
tower hash table max size
Definition: JGTowerBase_ID.h:420
Phi_mpi_pi
__HOSTDEV__ double Phi_mpi_pi(double)
Definition: GeoRegion.cxx:7
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
CaloDetDescrElement::eta_raw
float eta_raw() const
cell eta_raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:350
AthCommonDataStore< AthCommonMsg< Gaudi::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
CaloSuperCellDetDescrManager
Definition: CaloDetDescrManager.h:490
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:112
CaloCell_Base_ID::is_em
bool is_em(const Identifier id) const
test if the id belongs to LArEM
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthReentrantAlgorithm::AthReentrantAlgorithm
AthReentrantAlgorithm()
Default constructor:
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
CaloCell_Base_ID::sampling
int sampling(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IOVInfiniteRange::infiniteRunLB
static EventIDRange infiniteRunLB()
Produces an EventIDRange that is infinite in RunLumi and invalid in Time.
Definition: IOVInfiniteRange.h:39
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LVL1::JGTowerMappingDataCondAlgBase::m_ccid
const CaloCell_ID * m_ccid
Definition: JGTowerMappingDataCondAlgBase.h:42
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
JGTowerBase_ID::eta0
float eta0(const Identifier regId) const
Return the minimum eta of region, or NOT_VALID.
Definition: JGTowerBase_ID.cxx:499
AthReentrantAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthReentrantAlgorithm.h:153
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::JGTowerMappingDataCondAlgBase::loadTowerAreas
virtual StatusCode loadTowerAreas(JGTowerMappingData &data) const =0
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
JGTowerBase_ID::region_id
Identifier region_id(int pos_neg, int sampling, int region) const
build a region (of towers) identifier
Definition: JGTowerBase_ID.h:575
AthReentrantAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthReentrantAlgorithm.cxx:96
LVL1::JGTowerMappingDataCondAlgBase::m_mapTileCells
Gaudi::Property< bool > m_mapTileCells
Definition: JGTowerMappingDataCondAlgBase.h:33
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,...
JGTowerBase_ID::tower_id
Identifier tower_id(int pos_neg, int sampling, int region, int eta, int phi) const
build a tower identifier
Definition: JGTowerBase_ID.h:386
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:47
a
TList * a
Definition: liststreamerinfos.cxx:10
LArCellBinning.etaMin
etaMin
Definition: LArCellBinning.py:84
JGTowerBase_ID::pos_neg
int pos_neg(const Identifier id) const
return pos_neg according to :
Definition: JGTowerBase_ID.h:469
h
JGTowerBase_ID::eta_max
int eta_max(const Identifier regId) const
max value of eta index (-999 == failure)
Definition: JGTowerBase_ID.cxx:443
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
JGTowerBase_ID::eta_min
int eta_min(const Identifier regId) const
min value of eta index (-999 == failure)
Definition: JGTowerBase_ID.cxx:417
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
LVL1::JGTowerMappingDataCondAlgBase::buildForwardMapping
virtual StatusCode buildForwardMapping(JGTowerMappingData &data, const CaloSuperCellDetDescrManager *mgr) const =0
JGTowerBase_ID::phiGranularity
float phiGranularity(const Identifier regId) const
Return the phi granularity of a region, or NOT_VALID.
Definition: JGTowerBase_ID.cxx:492
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:77
JGTowerBase_ID::etaGranularity
float etaGranularity(const Identifier regId) const
Return the eta granularity of a region, or NOT_VALID.
Definition: JGTowerBase_ID.cxx:485
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
LVL1::JGTowerMappingDataCondAlgBase::m_scid
const CaloCell_SuperCell_ID * m_scid
Definition: JGTowerMappingDataCondAlgBase.h:41
fitman.k
k
Definition: fitman.py:528
CaloDetDescrElement::phi_raw
float phi_raw() const
cell phi_raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:352
CaloCell_Base_ID::calo_cell_hash_max
size_type calo_cell_hash_max(void) const
cell 'global' hash table max size
ServiceHandle< ICondSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14