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

#include <gFexTowerSummer.h>

Inheritance diagram for LVL1::gFexTowerSummer:
Collaboration diagram for LVL1::gFexTowerSummer:

Public Types

typedef std::array< std::array< int, LVL1::gFEXPos::AB_COLUMNS >, LVL1::gFEXPos::ABC_ROWSgtFPGA
 

Public Member Functions

 gFexTowerSummer (const std::string &name, ISvcLocator *svc)
 
virtual StatusCode initialize () override
 Function initialising the algorithm. More...
 
virtual StatusCode execute (const EventContext &) const override
 Function executing the algorithm. More...
 
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, V, H > &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

StatusCode gtReconstructABC (const EventContext &ctx, unsigned int XFPGA, gtFPGA &XgtF, gtFPGA &Xgt, gtFPGA &Xsaturation) const
 
void undoMLE (int &datumPtr) const
 
void signExtend (int *xptr, int upto) const
 
void getEtaPhi (float &Eta, float &Phi, int iEta, int iPhi, int gFEXtowerID) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

SG::ReadHandleKey< xAOD::gFexTowerContainerm_gFexFiberTowersReadKey
 
SG::WriteHandleKey< xAOD::gFexTowerContainerm_gTowersWriteKey
 
SG::WriteHandleKey< xAOD::gFexTowerContainerm_gTowers50WriteKey
 
SG::WriteHandleKey< xAOD::gFexTowerContainerm_gTowersEMWriteKey
 
SG::WriteHandleKey< xAOD::gFexTowerContainerm_gTowersHADWriteKey
 
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 31 of file gFexTowerSummer.h.

Member Typedef Documentation

◆ gtFPGA

Definition at line 41 of file gFexTowerSummer.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ gFexTowerSummer()

LVL1::gFexTowerSummer::gFexTowerSummer ( const std::string &  name,
ISvcLocator *  svc 
)

Definition at line 28 of file gFexTowerSummer.cxx.

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality
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 75 of file AthCommonReentrantAlgorithm.cxx.

64 {
65  return 0;
66 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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::gFexTowerSummer::execute ( const EventContext &  ctx) const
overridevirtual

Function executing the algorithm.

Definition at line 49 of file gFexTowerSummer.cxx.

49  {
50 
51  // WriteHandle for gFEX Input Towers
53  ATH_CHECK( gTowersContainer.record(std::make_unique<xAOD::gFexTowerContainer>(), std::make_unique<xAOD::gFexTowerAuxContainer>()));
54  ATH_MSG_DEBUG("Recorded gFexEmulatedTower 200 MeV container with key "<< gTowersContainer.key());
55 
57  ATH_CHECK( gTowers50Container.record(std::make_unique<xAOD::gFexTowerContainer>(), std::make_unique<xAOD::gFexTowerAuxContainer>()));
58  ATH_MSG_DEBUG("Recorded gFexEmulatedTower 50 MeV container with key "<< gTowers50Container.key());
59 
60  xAOD::gFexTowerContainer* gTowersEMContainerPtr = nullptr;
61  xAOD::gFexTowerContainer* gTowersHADContainerPtr = nullptr;
64 
65  if (!m_gTowersEMWriteKey.empty()) {
66  ATH_CHECK( gTowersEMContainer.record(std::make_unique<xAOD::gFexTowerContainer>(), std::make_unique<xAOD::gFexTowerAuxContainer>()));
67  ATH_MSG_DEBUG("Recorded gFexEmulatedTower 200 MeV EM container with key "<< m_gTowersEMWriteKey.key());
68  gTowersEMContainerPtr = &*gTowersEMContainer;
69  }
70  if (!m_gTowersHADWriteKey.empty()) {
71  ATH_CHECK( gTowersHADContainer.record(std::make_unique<xAOD::gFexTowerContainer>(), std::make_unique<xAOD::gFexTowerAuxContainer>()));
72  ATH_MSG_DEBUG("Recorded gFexEmulatedTower 200 MeV HAD container with key "<< m_gTowersHADWriteKey.key());
73  gTowersHADContainerPtr = &*gTowersHADContainer;
74  }
75 
76  // Atwr, Btwr, Ctwr will contain gTowers towers for each FPGA
77  gtFPGA Atwr = {{{0}}};
78  gtFPGA Btwr = {{{0}}};
79  gtFPGA Ctwr = {{{0}}};
80 
81  gtFPGA AtwrF = {{{0}}};
82  gtFPGA BtwrF = {{{0}}};
83  gtFPGA CtwrF = {{{0}}};
84 
85  gtFPGA Asatur = {{{0}}};
86  gtFPGA Bsatur = {{{0}}};
87  gtFPGA Csatur = {{{0}}};
88 
89  for(int irow=0; irow<LVL1::gFEXPos::ABC_ROWS; irow++){
90  for(int icolumn=0; icolumn<LVL1::gFEXPos::AB_COLUMNS; icolumn++){
91  Atwr[irow][icolumn] = 0;
92  AtwrF[irow][icolumn] = 0;
93  Asatur[irow][icolumn] = 0;
94  Btwr[irow][icolumn] = 0;
95  BtwrF[irow][icolumn] = 0;
96  Bsatur[irow][icolumn] = 0;
97  Ctwr[irow][icolumn] = 0;
98  CtwrF[irow][icolumn] = 0;
99  Csatur[irow][icolumn] = 0;
100  }
101  }
102 
103  // reconstruct the gTowers/saturation
104  ATH_CHECK( gtReconstructABC(ctx, 0, AtwrF, Atwr, Asatur));
105  ATH_CHECK( gtReconstructABC(ctx, 1, BtwrF, Btwr, Bsatur));
106  ATH_CHECK( gtReconstructABC(ctx, 2, CtwrF, Ctwr, Csatur));
107 
108 
109  // Write the towers
110  int iEta = 0;
111  int iPhi = 0;
112  float Eta = 0;
113  float Phi = 0;
114  int Et = 0;
115  int EtF = 0;
116  int Fpga = 0;
117  char IsSaturated = 0;
118  int towerID = 0;
119 
120  // Assign ID based on FPGA (FPGA-A 0->0; FPGA-B 1->10000, FPGA-C 2->20000) and gTower number assigned as per firmware convention
121 
122  int twr_rows = Atwr.size(); // 32
123  int twr_cols = Atwr[0].size(); // 12
124 
125  Fpga = 0;
126 
127  // Save towers from FPGA A in gTower EDM
128  for (int irow = 0; irow < twr_rows; irow++){
129  for (int icol = 0; icol < twr_cols; icol++){
130  iEta = icol + 8;
131  iPhi = irow;
132  Et = Atwr[irow][icol];
133  EtF = AtwrF[irow][icol];
134  IsSaturated = Asatur[irow][icol];
135  getEtaPhi(Eta, Phi, iEta, iPhi, towerID);
136  gTowersContainer->push_back( std::make_unique<xAOD::gFexTower>() );
137  gTowersContainer->back()->initialize(iEta, iPhi, Eta, Phi, Et, Fpga, IsSaturated, towerID);
138  gTowers50Container->push_back( std::make_unique<xAOD::gFexTower>() );
139  gTowers50Container->back()->initialize(iEta, iPhi, Eta, Phi, EtF, Fpga, IsSaturated, towerID);
140  if (gTowersEMContainerPtr) {
141  gTowersEMContainerPtr->push_back( std::make_unique<xAOD::gFexTower>() );
142  gTowersEMContainerPtr->back()->initialize(iEta, iPhi, Eta, Phi, Et, Fpga, IsSaturated, towerID);
143  }
144  if (gTowersHADContainerPtr) {
145  gTowersHADContainerPtr->push_back( std::make_unique<xAOD::gFexTower>() );
146  gTowersHADContainerPtr->back()->initialize(iEta, iPhi, Eta, Phi, Et, Fpga, IsSaturated, towerID);
147  }
148  towerID += 1;
149 
150  }
151  }
152 
153  // Save towers from FPGA B in gTower EDM
154  Fpga = 1;
155  towerID = 10000;
156  // Save towers from FPGA B in gTower EDM
157  for (int irow = 0; irow < twr_rows; irow++){
158  for (int icol = 0; icol < twr_cols; icol++){
159  iEta = icol + 20;
160  iPhi = irow;
161  Et = Btwr[irow][icol];
162  EtF = BtwrF[irow][icol];
163  IsSaturated = Bsatur[irow][icol];
164  getEtaPhi(Eta, Phi, iEta, iPhi, towerID);
165  gTowersContainer->push_back( std::make_unique<xAOD::gFexTower>() );
166  gTowersContainer->back()->initialize(iEta, iPhi, Eta, Phi, Et, Fpga, IsSaturated, towerID);
167  gTowers50Container->push_back( std::make_unique<xAOD::gFexTower>() );
168  gTowers50Container->back()->initialize(iEta, iPhi, Eta, Phi, EtF, Fpga, IsSaturated, towerID);
169  if (gTowersEMContainerPtr) {
170  gTowersEMContainerPtr->push_back( std::make_unique<xAOD::gFexTower>() );
171  gTowersEMContainerPtr->back()->initialize(iEta, iPhi, Eta, Phi, Et, Fpga, IsSaturated, towerID);
172  }
173  if (gTowersHADContainerPtr) {
174  gTowersHADContainerPtr->push_back( std::make_unique<xAOD::gFexTower>() );
175  gTowersHADContainerPtr->back()->initialize(iEta, iPhi, Eta, Phi, Et, Fpga, IsSaturated, towerID);
176  }
177  towerID += 1;
178  }
179  }
180 
181  // Save towers from FPGA C in gTower EDM
182  Fpga = 2;
183  towerID = 20000;
184  for (int irow = 0; irow < twr_rows; irow++){
185  for (int icol = 0; icol < twr_cols/2; icol++){
186  iEta = icol + 2;
187  iPhi = irow;
188  Et = Ctwr[irow][icol];
189  EtF = CtwrF[irow][icol];
190  IsSaturated = Csatur[irow][icol];
191  getEtaPhi(Eta, Phi, iEta, iPhi, towerID);
192  gTowersContainer->push_back( std::make_unique<xAOD::gFexTower>() );
193  gTowersContainer->back()->initialize(iEta, iPhi, Eta, Phi, Et, Fpga, IsSaturated, towerID);
194  gTowers50Container->push_back( std::make_unique<xAOD::gFexTower>() );
195  gTowers50Container->back()->initialize(iEta, iPhi, Eta, Phi, EtF, Fpga, IsSaturated, towerID);
196  if (gTowersEMContainerPtr) {
197  gTowersEMContainerPtr->push_back( std::make_unique<xAOD::gFexTower>() );
198  gTowersEMContainerPtr->back()->initialize(iEta, iPhi, Eta, Phi, Et, Fpga, IsSaturated, towerID);
199  }
200  if (gTowersHADContainerPtr) {
201  gTowersHADContainerPtr->push_back( std::make_unique<xAOD::gFexTower>() );
202  gTowersHADContainerPtr->back()->initialize(iEta, iPhi, Eta, Phi, Et, Fpga, IsSaturated, towerID);
203  }
204  towerID += 1;
205  }
206  for (int icol = twr_cols/2; icol < twr_cols; icol++){
207  iEta = icol + 26;
208  iPhi = irow;
209  Et = Ctwr[irow][icol];
210  EtF = CtwrF[irow][icol];
211  IsSaturated = Csatur[irow][icol];
212  getEtaPhi(Eta, Phi, iEta, iPhi, towerID);
213  gTowersContainer->push_back( std::make_unique<xAOD::gFexTower>() );
214  gTowersContainer->back()->initialize(iEta, iPhi, Eta, Phi, Et, Fpga, IsSaturated, towerID);
215  gTowers50Container->push_back( std::make_unique<xAOD::gFexTower>() );
216  gTowers50Container->back()->initialize(iEta, iPhi, Eta, Phi, EtF, Fpga, IsSaturated, towerID);
217  if (gTowersEMContainerPtr) {
218  gTowersEMContainerPtr->push_back( std::make_unique<xAOD::gFexTower>() );
219  gTowersEMContainerPtr->back()->initialize(iEta, iPhi, Eta, Phi, Et, Fpga, IsSaturated, towerID);
220  }
221  if (gTowersHADContainerPtr) {
222  gTowersHADContainerPtr->push_back( std::make_unique<xAOD::gFexTower>() );
223  gTowersHADContainerPtr->back()->initialize(iEta, iPhi, Eta, Phi, Et, Fpga, IsSaturated, towerID);
224  }
225  towerID += 1;
226  }
227  }
228 
229  return StatusCode::SUCCESS;
230 }

◆ 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 & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90 {
91  // If we didn't find any symlinks to add, just return the collection
92  // from the base class. Otherwise, return the extended collection.
93  if (!m_extendedExtraObjects.empty()) {
95  }
96  return BaseAlg::extraOutputDeps();
97 }

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96  {
97  return execState( ctx ).filterPassed();
98  }

◆ getEtaPhi()

void LVL1::gFexTowerSummer::getEtaPhi ( float &  Eta,
float &  Phi,
int  iEta,
int  iPhi,
int  gFEXtowerID 
) const
private

Definition at line 675 of file gFexTowerSummer.cxx.

676  {
677 
678  float s_centralPhiWidth =
679  (2 * M_PI) / 32; // In central region, gFex has 32 bins in phi
680  float s_forwardPhiWidth =
681  (2 * M_PI) / 16; // In forward region, gFex has 16 bins in phi (before
682  // rearranging bins)
683 
684  const std::vector<float> s_EtaCenter = {
685  -4.5, -3.8, -3.38, -3.18, -3.15, -3, -2.8, -2.6, -2.35, -2.1,
686  -1.9, -1.7, -1.5, -1.3, -1.1, -0.9, -0.7, -0.5, -0.3, -0.1,
687  0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3, 1.5, 1.7, 1.9,
688  2.1, 2.35, 2.6, 2.8, 3.0, 3.15, 3.18, 3.38, 3.8, 4.5};
689 
690  // Transform Eta and Phi indices for the most forward towers into the
691  // "original" indices, as before rearranging the towers such that the forward
692  // region is 12(ieta)x32(iphi). The FPGA-C has now the same format (12*32) as
693  // FPGA-A and FPGA-B. This is the result of a transformation in the firmware.
694  // Note that for the most forward towers, the Phi index and Eta index have
695  // been considered accordingly, so in order to get the correct float values of
696  // Phi and Eta we need to retrieve the "original" indices.
697  int towerID_base = 20000;
698  int iEtaOld = 0, iPhiOld = 0;
699 
700  if (iEta == 2) {
701  if (iPhi == ((gFEXtowerID - towerID_base) / 24) * 2) {
702  iEtaOld = 0;
703  iPhiOld = iPhi / 2;
704  }
705  if (iPhi == (((gFEXtowerID - towerID_base - 12) / 24) * 2) + 1) {
706  iEtaOld = 1;
707  iPhiOld = (iPhi - 1) / 2;
708  }
709  }
710 
711  else if (iEta == 3) {
712  if (iPhi == ((gFEXtowerID - towerID_base - 1) / 24) * 2) {
713  iEtaOld = 2;
714  iPhiOld = iPhi / 2;
715  }
716  if (iPhi == (((gFEXtowerID - towerID_base - 13) / 24) * 2) + 1) {
717  iEtaOld = 3;
718  iPhiOld = (iPhi - 1) / 2;
719  }
720  }
721 
722  else if (iEta == 36) {
723  if (iPhi == (((gFEXtowerID - towerID_base - 22) / 24) * 2) + 1) {
724  iEtaOld = 36;
725  iPhiOld = (iPhi - 1) / 2;
726  }
727  if (iPhi == ((gFEXtowerID - towerID_base - 10) / 24) * 2) {
728  iEtaOld = 37;
729  iPhiOld = iPhi / 2;
730  }
731  }
732 
733  else if (iEta == 37) {
734  if (iPhi == (((gFEXtowerID - towerID_base - 23) / 24) * 2) + 1) {
735  iEtaOld = 38;
736  iPhiOld = (iPhi - 1) / 2;
737  }
738  if (iPhi == ((gFEXtowerID - towerID_base - 11) / 24) * 2) {
739  iEtaOld = 39;
740  iPhiOld = iPhi / 2;
741  }
742  }
743 
744  else {
745  iEtaOld = iEta;
746  iPhiOld = iPhi;
747  }
748 
749  Eta = s_EtaCenter[iEtaOld];
750 
751  float Phi_gFex = -99;
752 
753  if ((iEtaOld <= 3) || ((iEtaOld >= 36))) {
754  Phi_gFex = ((iPhiOld * s_forwardPhiWidth) + s_forwardPhiWidth / 2);
755  } else {
756  Phi_gFex = ((iPhiOld * s_centralPhiWidth) + s_centralPhiWidth / 2);
757  }
758 
759  if (Phi_gFex < M_PI) {
760  Phi = Phi_gFex;
761  } else {
762  Phi = (Phi_gFex - 2 * M_PI);
763  }
764 }

◆ gtReconstructABC()

StatusCode LVL1::gFexTowerSummer::gtReconstructABC ( const EventContext &  ctx,
unsigned int  XFPGA,
gtFPGA XgtF,
gtFPGA Xgt,
gtFPGA Xsaturation 
) const
private

Definition at line 233 of file gFexTowerSummer.cxx.

236  {
237 
238  // Loop over the Fiber Towers and fill gTower arrays as per original byte stream decoder
239 
240  // Reading the Fiber Tower container
242  if (!gFexFiberTowerContainer.isValid()) {
243  ATH_MSG_ERROR("Could not retrieve Fiber tower collection "
244  << gFexFiberTowerContainer.key());
245  return StatusCode::FAILURE;
246  }
247 
248  if (gFexFiberTowerContainer->empty()) {
249  ATH_MSG_WARNING("Cannot fill gTowers here, fiber container is empty. "
250  << gFexFiberTowerContainer->size());
251  return StatusCode::SUCCESS;
252  }
253 
254  // Zero the input gTower sums/saturation
255  for(int irow=0; irow<LVL1::gFEXPos::ABC_ROWS; irow++){
256  for(int icolumn=0; icolumn<LVL1::gFEXPos::AB_COLUMNS; icolumn++){
257  Xgt[irow][icolumn] = 0;
258  XgtF[irow][icolumn] = 0;
259  Xsaturation[irow][icolumn] = 0;
260  }
261  }
262 
263  // Energy arrays for the EM and hadronic in standard and extra eta regions
264  // 200 MeV towers
265  std::array<int, LVL1::gFEXPos::AB_TOWERS> etowerData{}; // 384
266  std::array<int, LVL1::gFEXPos::AB_TOWERS> htowerData{};
267  std::array<int, LVL1::gFEXPos::ABC_ROWS> xetowerData{}; // 32
268  std::array<int, LVL1::gFEXPos::ABC_ROWS> xhtowerData{};
269  std::array<int, LVL1::gFEXPos::ABC_ROWS> ohtowerData{};
270 
271  // 50 MeV towers
272  std::array<int, LVL1::gFEXPos::AB_TOWERS> etowerDataF{};
273  std::array<int, LVL1::gFEXPos::AB_TOWERS> htowerDataF{};
274  std::array<int, LVL1::gFEXPos::ABC_ROWS> xetowerDataF{};
275  std::array<int, LVL1::gFEXPos::ABC_ROWS> xhtowerDataF{};
276  std::array<int, LVL1::gFEXPos::ABC_ROWS> ohtowerDataF{};
277 
278  // saturation
279  std::array<bool, LVL1::gFEXPos::AB_TOWERS> saturationData{}; // 384
280 
281  // loop over the Fiber towers, and fill the tower energy arrays
282  for(const xAOD::gFexTower* gfexFiberTower : *gFexFiberTowerContainer){
283  // first match the FPGA
284  unsigned int fiberTowerFpga = gfexFiberTower->fpga();
285  if (fiberTowerFpga != XFPGA) continue;
286 
287  // working with "local" fiber number, iFiber
288  unsigned int fiberTowerId = gfexFiberTower->gFEXtowerID();
289  unsigned int offset = (XFPGA == 2) ? 20000 : (XFPGA == 1) ? 10000 : 0;
290  unsigned int iFiber = (fiberTowerId - offset)/16;
291 
292  // Do not exceed maximum number of fibers for FPGA
293  unsigned int maxFiberN = (XFPGA == 2) ? LVL1::gFEXPos::C_FIBERS : LVL1::gFEXPos::AB_FIBERS;
294  if (iFiber >= maxFiberN) continue;
295 
296  ATH_MSG_DEBUG(" accessing " << fiberTowerId << " " << XFPGA << " " << offset << " " << iFiber);
297 
298  unsigned int iDatum = fiberTowerId%16;
299 
300  int fiber_type = (XFPGA == 0) ? LVL1::gFEXPos::AMPD_NFI[iFiber] :
301  (XFPGA == 1) ? LVL1::gFEXPos::BMPD_NFI[iFiber] : LVL1::gFEXPos::CMPD_NFI[iFiber];
302 
303  // tells where the data is coming from
304  // - 0 - EMB, EMB/EMEC -> EM contribution
305  // - 1 - TREX,HEC - Had contribution
306  // - 2 - extended region ( EMEC)
307  // - 3 - extended region ( HEC)
308  // - 6 - 200MeV region only ( HEC)
309  // - 11 - HEC - Had contribution
310 
311  int dataType = (XFPGA == 0) ? LVL1::gFEXPos::AMPD_DTYP_ARR[fiber_type][iDatum] :
312  (XFPGA == 1) ? LVL1::gFEXPos::BMPD_DTYP_ARR[fiber_type][iDatum] :
313  LVL1::gFEXPos::CMPD_DTYP_ARR[fiber_type][iDatum];
314 
315  // tower number 0 - 383
316  int ntower = (XFPGA == 0) ? LVL1::gFEXPos::AMPD_GTRN_ARR[iFiber][iDatum] :
317  (XFPGA == 1) ? LVL1::gFEXPos::BMPD_GTRN_ARR[iFiber][iDatum] :
318  LVL1::gFEXPos::CMPD_GTRN_ARR[iFiber][iDatum];
319 
320  // calo type
321  // FPGA 0/1 0,1,2
322  // FPGA 2 3
323  int caloType = (XFPGA == 0) ? LVL1::gFEXPos::ACALO_TYPE[iFiber] :
324  (XFPGA == 1) ? LVL1::gFEXPos::BCALO_TYPE[iFiber] : LVL1::gFEXPos::CCALO_TYPE[iFiber];
325 
326  // saturation
327  bool fiberSaturation = (bool)(gfexFiberTower->isSaturated());
328  if (fiberSaturation) {
329  saturationData[ntower] = fiberSaturation;
330  }
331 
332  // Get the MLE from the EDM (stored as float)
333  unsigned int Toweret_mle = (unsigned int)(gfexFiberTower->towerEt());
334 
335  // FPGA 0/1
336  if(caloType < 3) {
337  switch(dataType){
338  case 0:
339  etowerData[ntower] = Toweret_mle;
340  undoMLE( etowerData[ntower] );
341  etowerDataF[ntower] = etowerData[ntower];
342  break;
343  case 1:
344  htowerData[ntower] = Toweret_mle;
345 
346  // mulitply by 20 to make 50 MeV LSB
347  // include this here before mulitplication by 20
348  htowerData[ntower] = 20*htowerData[ntower];
349  htowerDataF[ntower] = htowerData[ntower];
350  break;
351 
352  case 2:
353  xetowerData[ntower] = Toweret_mle;
354  undoMLE( xetowerData[ntower] );
355  xetowerDataF[ntower] = xetowerData[ntower];
356  break;
357 
358  case 3:
359  xhtowerData[ntower] = Toweret_mle;
360  undoMLE( xhtowerData[ntower] );
361  xhtowerDataF[ntower] = xhtowerData[ntower];
362  break;
363 
364  case 6:
365  ohtowerData[ntower] = Toweret_mle;
366  undoMLE( ohtowerData[ntower] );
367  ohtowerDataF[ntower] = ohtowerData[ntower];
368  break;
369 
370  case 11:
371  htowerData[ntower] = Toweret_mle;
372  undoMLE( htowerData[ntower] );
373  htowerDataF[ntower] = htowerData[ntower];
374  break;
375  }
376  } else {
377 
378  // this is FPGA C
379  // only types 2 and 3 exist in FPGA C
380  switch(dataType){
381  case 2:
382  //
383  etowerData[ntower] = Toweret_mle;
384  undoMLE( etowerData[ntower] );
385  etowerDataF[ntower] = etowerData[ntower];
386 
387  break;
388 
389  case 3:
390  htowerData[ntower] = Toweret_mle;
391  undoMLE( htowerData[ntower] );
392  htowerDataF[ntower] = htowerData[ntower];
393  break;
394 
395  case 15:
396  break;
397 
398  case 99:
399  break;
400 
401  default:
402  ATH_MSG_ERROR("Tower with unknown datatype "
403  << dataType);
404  return StatusCode::FAILURE;
405 
406  }
407  } // end of case statement for FPGAC
408 
409  ATH_MSG_DEBUG(" end of loop: " << XFPGA << " tower: " << ntower << " e " << etowerDataF[ntower] << " h " << htowerData[ntower] << " fibertower " << fiberTowerId);
410 
411  } // end of loop over fiber towers
412 
413  // Sum the energy arrays into the output gTowers
414  if( XFPGA == 0 ) {
415  for(int itower=0;itower<384;itower++){
416  int icolumn = itower%12;
417  int irow = itower/12;
418 
419  // saturation
420  Xsaturation[irow][icolumn] = saturationData[itower];
421 
422 
423  // 50 MeV towers
424  int xF = etowerDataF[itower] + htowerDataF[itower];
425  // 200 MeV towers
426  int x = ( (etowerData[itower]>>2) + (htowerData[itower]>>2) );
427 
428  ATH_MSG_DEBUG("sss1 " << icolumn << " " << irow << " " << xF << " " << x << " " << etowerDataF[itower] <<" " << htowerDataF[itower]);
429 
430  signExtend(&xF,18);
431  signExtend(&x,18);
432 
433  ATH_MSG_DEBUG("sss2 " << icolumn << " " << irow << " " << xF << " " << x);
434 
435  Xgt[irow][icolumn] = x;
436  XgtF[irow][icolumn] = xF;
437 
438  ATH_MSG_DEBUG("sss3 " << icolumn << " " << irow << " " << XgtF[irow][icolumn] << " " << Xgt[irow][icolumn]);
439 
440  // eta region in FPGA A (eta ~ -2.5)
441  if ( icolumn == 0) {
442  int xx = ( (xetowerData[irow]>>2) + (xhtowerData[irow]>>2) );
443  signExtend(&xx,18);
444  Xgt[irow][icolumn] = Xgt[irow][icolumn] + xx;
445  ATH_MSG_DEBUG("sss4 " << icolumn << " " << irow << " " << XgtF[irow][icolumn] << " " << Xgt[irow][icolumn]);
446  }
447 
448  if ( icolumn == 4) {
449  // 200 MeV towers
450  int ox = (ohtowerData[irow] >> 2 ) ;
451  signExtend(&ox,18);
452  Xgt[irow][icolumn] = Xgt[irow][icolumn] + ox ;
453  ATH_MSG_DEBUG("sss5 " << icolumn << " " << irow << " " << XgtF[irow][icolumn] << " " << Xgt[irow][icolumn]);
454  }
455 
456  ATH_MSG_DEBUG("sss filling standard " << Xgt[irow][icolumn] << " fiber " << XgtF[irow][icolumn]);
457  }
458  }
459  else if ( XFPGA == 1 ) {
460  for(int itower=0;itower<384;itower++){
461  int icolumn = itower%12;
462  int irow = itower/12;
463 
464  // saturation
465  Xsaturation[irow][icolumn] = saturationData[itower];
466 
467  // 50 MeV towers
468  int xF = etowerDataF[itower] + htowerDataF[itower] ;
469  // 200 MeV towers
470  int x = ( (etowerData[itower]>>2) + (htowerData[itower] >> 2) );
471 
472  signExtend(&xF,18);
473  signExtend(&x,18);
474 
475  Xgt[irow][icolumn] = x;
476  XgtF[irow][icolumn] = xF;
477 
478  // extra region FPGA B (eta ~ 2.5)
479  if ( icolumn == 11) {
480  // 200 MeV towers
481  int xx = ( (xetowerData[irow]>>2) + (xhtowerData[irow]>>2) );
482  signExtend(&xx,18);
483  Xgt[irow][icolumn] = Xgt[irow][icolumn] + xx;
484  }
485  if ( icolumn == 7 ) {
486  // 200 MeV towers
487  int xo = ohtowerData[irow]>>2;
488  signExtend(&xo,18);
489  Xgt[irow][icolumn] = Xgt[irow][icolumn] + xo;
490  }
491  }
492  }
493  else if ( XFPGA == 2 ) {
494  for(int itower=0;itower<384;itower++){
495  int icolumn = itower%12;
496  int irow = itower/12;
497 
498  // saturation
499  Xsaturation[irow][icolumn] = saturationData[itower];
500 
501  // 50 MeV towers
502  int xF = etowerDataF[itower] + htowerDataF[itower] ;
503  // 200 MeV towers
504  int x = ( (etowerData[itower]>>2 ) + (htowerData[itower]>>2));
505  signExtend(&xF,18);
506  signExtend(&x,18);
507 
508  Xgt[irow][icolumn] = x;
509  XgtF[irow][icolumn] = xF;
510  }
511  }
512 
513  return StatusCode::SUCCESS;
514 }

◆ initialize()

StatusCode LVL1::gFexTowerSummer::initialize ( )
overridevirtual

Function initialising the algorithm.

Definition at line 31 of file gFexTowerSummer.cxx.

31  {
32 
34  "Initializing L1CaloFEXAlgos/gFexEmulatedTowers algorithm with name: "
35  << name());
36  ATH_MSG_INFO("Writing into SG key: " << m_gTowersWriteKey);
37 
38  // initialise keys
39  ATH_CHECK( m_gFexFiberTowersReadKey.initialize());
40  ATH_CHECK( m_gTowersWriteKey.initialize() );
41  ATH_CHECK( m_gTowers50WriteKey.initialize() );
42 
45 
46  return StatusCode::SUCCESS;
47 }

◆ 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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::isClonable
overridevirtualinherited

Specify if the algorithm is clonable.

Reentrant algorithms are clonable.

Definition at line 68 of file AthCommonReentrantAlgorithm.cxx.

52 {
53  // Reentrant algorithms are clonable.
54  return true;
55 }

◆ 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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100  {
101  execState( ctx ).setFilterPassed( state );
102  }

◆ signExtend()

void LVL1::gFexTowerSummer::signExtend ( int *  xptr,
int  upto 
) const
private

Definition at line 657 of file gFexTowerSummer.cxx.

657  {
658 
659  // sign extend x to 32 bits assuming a hardware word length upto+1 bits (e.g. for 16 bit word upto should be 15 as in firmware)
660  // xptr pointer to input datum
661  // word length in hardware
662  int x = *xptr;
663  //printf("before %x \n", x);
664  //printf("masks %x %x \n", (0x00000001<<upto) , (0xFFFFFFFF<<(upto+1)) );
665  if( x & (0x00000001<<upto) ) {
666  x = ( x | (0xFFFFFFFF<<(upto+1)) );
667  } else {
668  // for now assume 17 bits -- but could be up to 18 bits
669  x = ( x & 0x000FFFF);
670  }
671  *xptr = x;
672 
673 }

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::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 85 of file AthCommonReentrantAlgorithm.cxx.

77 {
78  return BaseAlg::sysExecute (ctx);
79 }

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::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 61 of file AthCommonReentrantAlgorithm.cxx.

107  {
109 
110  if (sc.isFailure()) {
111  return sc;
112  }
113 
114  ServiceHandle<ICondSvc> cs("CondSvc",name());
115  for (auto h : outputHandles()) {
116  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117  // do this inside the loop so we don't create the CondSvc until needed
118  if ( cs.retrieve().isFailure() ) {
119  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120  return StatusCode::SUCCESS;
121  }
122  if (cs->regHandle(this,*h).isFailure()) {
123  sc = StatusCode::FAILURE;
124  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125  << " with CondSvc");
126  }
127  }
128  }
129  return sc;
130 }

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

◆ undoMLE()

void LVL1::gFexTowerSummer::undoMLE ( int &  datumPtr) const
private

Definition at line 516 of file gFexTowerSummer.cxx.

516  {
517 
518  // limit input to 12 bits to avoid accidental sign extension
519  int din = (0x00000FFF & datumPtr );
520  // map all special cases to zero for now
521  // limit negative values
522  if( (din > 0) && ( din < 962 ) ) din = 962;
523  //zeroZero
524  if( din == 0) din = 0x4EE;
525 
526  int dout = 0;
527 
528  int FPGA_CONVLIN_TH1 = 5;
529  int FPGA_CONVLIN_TH2 = 749;
530  int FPGA_CONVLIN_TH3 = 1773;
531  int FPGA_CONVLIN_TH4 = 2541;
532  int FPGA_CONVLIN_TH5 = 4029;
533  int FPGA_CONVLIN_TH6 = 4062;
534 
535  int FPGA_CONVLIN_OF0 = -5072;
536  int FPGA_CONVLIN_OF1 = -2012;
537  int FPGA_CONVLIN_OF2 = -1262;
538  int FPGA_CONVLIN_OF3 = -3036;
539  int FPGA_CONVLIN_OF4 = -8120;
540  int FPGA_CONVLIN_OF5 = -4118720;
541 
542  int oth0 = 0;
543  int oth1 = 0;
544  int oth2 = 0;
545  int oth3 = 0;
546  int oth4 = 0;
547  int oth5 = 0;
548  int oth6 = 0;
549 
550  int r1shv = 0;
551  int r2shv = 0;
552  int r3shv = 0;
553  int r4shv = 0;
554  int r5shv = 0;
555  int r6shv = 0;
556  // int trxv = 0;
557 
558  int r1conv = 0;
559  int r2conv = 0;
560  int r3conv = 0;
561  int r4conv = 0;
562  int r5conv = 0;
563  int r6conv = 0;
564  // int r3offs = 0;
565 
566  r1shv = ((din & 0x0000007F) << 9 ) & 0x0000FE00 ;
567  r2shv = ((din & 0x00000FFF) << 1 ) & 0x00001FFE ;
568  r3shv = (din & 0x00000FFF) ;
569  r4shv = ((din & 0x00000FFF) << 1 ) & 0x00001FFE ;
570  r5shv = ((din & 0x00000FFF) << 2 ) & 0x00003FFC ;
571  r6shv = ((din & 0x00000FFF) << 10 ) & 0x003FFC00 ;
572 
573  r1conv = r1shv + FPGA_CONVLIN_OF0;
574  r2conv = r2shv + FPGA_CONVLIN_OF1;
575  r3conv = r3shv + FPGA_CONVLIN_OF2;
576  r4conv = r4shv + FPGA_CONVLIN_OF3;
577  r5conv = r5shv + FPGA_CONVLIN_OF4;
578  r6conv = r6shv + FPGA_CONVLIN_OF5;
579 
580  if( din > 0 ) {
581  oth0 = 1;
582  }
583  else{
584  oth0 = 0;
585  }
586  if ( din > FPGA_CONVLIN_TH1 ){
587  oth1 = 1;
588  }
589  else{
590  oth1 = 0;
591  }
592  if ( din > FPGA_CONVLIN_TH2 ){
593  oth2 = 1;
594  }else{
595  oth2 = 0;
596  }
597  if ( din > FPGA_CONVLIN_TH3 ){
598  oth3 = 1;
599  }else{
600  oth3 = 0;
601  }
602  if ( din > FPGA_CONVLIN_TH4 ){
603  oth4 = 1;
604  }else{
605  oth4 = 0;
606  }
607  if ( din > FPGA_CONVLIN_TH5 ){
608  oth5 = 1;
609  }
610  else{
611  oth5 = 0;
612  }
613  if ( din > FPGA_CONVLIN_TH6 ){
614  oth6 = 1;
615  }
616  else{
617  oth6 = 0;
618  }
619 
620 
621  // divide by 2 to 50 MeV LSB
622 
623  if( (! oth0) & (! oth1 ) & (! oth2 ) & (! oth3 ) & (! oth4 ) & (! oth5 ) & (! oth6 ) ) {
624  dout = 0;
625  }
626  else if( ( oth0) & (! oth1 ) & (! oth2 ) & (! oth3 ) & (! oth4 ) & (! oth5 ) & (! oth6 ) ) {
627  dout = r1conv >>1;
628  }
629  else if( ( oth0) & ( oth1 ) & (! oth2 ) & (! oth3 ) & (! oth4 ) & (! oth5 ) & (! oth6 ) ) {
630  dout = r2conv >>1;
631  }
632  else if( ( oth0) & ( oth1 ) & ( oth2 ) & (! oth3 ) & (! oth4 ) & (! oth5 ) & (! oth6 ) ) {
633  dout = r3conv >>1;
634  }
635  else if( ( oth0) & ( oth1 ) & ( oth2 ) & ( oth3 ) & (! oth4 ) & (! oth5 ) & (! oth6 ) ) {
636  dout = r4conv >>1;
637  }
638  else if( ( oth0) & ( oth1 ) & ( oth2 ) & ( oth3 ) & ( oth4 ) & (! oth5 ) & (! oth6 ) ) {
639  dout = r5conv >>1;
640  }
641  else if( ( oth0) & ( oth1 ) & ( oth2 ) & ( oth3 ) & ( oth4 ) & ( oth5 ) & (! oth6 ) ) {
642  dout = r6conv >>1;
643  }
644  else if( ( oth0) & ( oth1 ) & ( oth2 ) & ( oth3 ) & ( oth4 ) & ( oth5 ) & ( oth6 ) ) {
645  dout = 0;
646  }
647  else {
648  dout = 0;
649  }
650 
651  signExtend(&dout,15);
652 
653  datumPtr = dout;
654 }

◆ 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_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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_gFexFiberTowersReadKey

SG::ReadHandleKey<xAOD::gFexTowerContainer> LVL1::gFexTowerSummer::m_gFexFiberTowersReadKey
private
Initial value:
{
this, "gFexDataTowers", "L1_gFexDataTowers","gFexDataTowers container"}

Definition at line 48 of file gFexTowerSummer.h.

◆ m_gTowers50WriteKey

SG::WriteHandleKey<xAOD::gFexTowerContainer> LVL1::gFexTowerSummer::m_gTowers50WriteKey
private
Initial value:
{
this, "gTowers50WriteKey", "L1_gFexDataTowers50", "Write gFEX 50 MeV Trigger Tower container"}

Definition at line 55 of file gFexTowerSummer.h.

◆ m_gTowersEMWriteKey

SG::WriteHandleKey<xAOD::gFexTowerContainer> LVL1::gFexTowerSummer::m_gTowersEMWriteKey
private
Initial value:
{
this, "gTowersEMWriteKey", "L1_gFexEmulatedEMTowers", "Write gFEX 200 MeV Trigger Tower EM container"}

Definition at line 59 of file gFexTowerSummer.h.

◆ m_gTowersHADWriteKey

SG::WriteHandleKey<xAOD::gFexTowerContainer> LVL1::gFexTowerSummer::m_gTowersHADWriteKey
private
Initial value:
{
this, "gTowersHADWriteKey", "L1_gFexEmulatedHADTowers", "Write gFEX 200 MeV Trigger Tower HAD container"}

Definition at line 62 of file gFexTowerSummer.h.

◆ m_gTowersWriteKey

SG::WriteHandleKey<xAOD::gFexTowerContainer> LVL1::gFexTowerSummer::m_gTowersWriteKey
private
Initial value:
{
this, "gTowers200WriteKey", "L1_gFexDataTowers200","Write gFEX 200 MeV Trigger Tower container"}

Definition at line 52 of file gFexTowerSummer.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:
cmd-l1calo-dq-test.xx
xx
Definition: cmd-l1calo-dq-test.py:16
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
LVL1::gFEXPos::AB_COLUMNS
constexpr int AB_COLUMNS
Definition: gFexPos.h:62
LVL1::gFEXPos::CMPD_DTYP_ARR
constexpr std::array< std::array< char, 20 >, 4 > CMPD_DTYP_ARR
Definition: gFexPos.h:492
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
M_PI
#define M_PI
Definition: ActiveFraction.h:11
LVL1::gFexTowerSummer::undoMLE
void undoMLE(int &datumPtr) const
Definition: gFexTowerSummer.cxx:516
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
downloadSingle.dataType
string dataType
Definition: downloadSingle.py:18
LVL1::gFEXPos::CMPD_NFI
constexpr std::array< int, 100 > CMPD_NFI
Definition: gFexPos.h:373
Phi
@ Phi
Definition: RPCdef.h:8
LVL1::gFEXPos::BMPD_NFI
constexpr std::array< int, 100 > BMPD_NFI
Definition: gFexPos.h:239
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
LVL1::gFexTowerSummer::m_gTowersHADWriteKey
SG::WriteHandleKey< xAOD::gFexTowerContainer > m_gTowersHADWriteKey
Definition: gFexTowerSummer.h:62
x
#define x
LVL1::gFexTowerSummer::m_gTowersEMWriteKey
SG::WriteHandleKey< xAOD::gFexTowerContainer > m_gTowersEMWriteKey
Definition: gFexTowerSummer.h:59
LVL1::gFexTowerSummer::signExtend
void signExtend(int *xptr, int upto) const
Definition: gFexTowerSummer.cxx:657
LVL1::gFEXPos::CMPD_GTRN_ARR
constexpr std::array< std::array< int, 16 >, 100 > CMPD_GTRN_ARR
Definition: gFexPos.h:395
LVL1::gFEXPos::AB_FIBERS
constexpr int AB_FIBERS
Definition: gFexPos.h:57
atlasStyleMacro.icol
int icol
Definition: atlasStyleMacro.py:13
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LVL1::gFEXPos::BMPD_GTRN_ARR
constexpr std::array< std::array< int, 16 >, 100 > BMPD_GTRN_ARR
Definition: gFexPos.h:255
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
LVL1::gFEXPos::BMPD_DTYP_ARR
constexpr std::array< std::array< char, 20 >, 4 > BMPD_DTYP_ARR
Definition: gFexPos.h:349
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AthCommonReentrantAlgorithm::extraOutputDeps
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
Definition: AthCommonReentrantAlgorithm.cxx:89
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
LVL1::gFexTowerSummer::m_gTowersWriteKey
SG::WriteHandleKey< xAOD::gFexTowerContainer > m_gTowersWriteKey
Definition: gFexTowerSummer.h:52
LVL1::gFEXPos::ACALO_TYPE
constexpr std::array< int, 100 > ACALO_TYPE
Definition: gFexPos.h:112
AthCommonDataStore
Definition: AthCommonDataStore.h:52
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.
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
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
AthCommonReentrantAlgorithm::sysExecute
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Definition: AthCommonReentrantAlgorithm.cxx:76
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::gFexTower_v1
Class describing input data of a LVL1 eFEX.
Definition: gFexTower_v1.h:22
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
DataVector::back
const T * back() const
Access the last element in the collection as an rvalue.
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
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::gFexTowerSummer::m_gFexFiberTowersReadKey
SG::ReadHandleKey< xAOD::gFexTowerContainer > m_gFexFiberTowersReadKey
Definition: gFexTowerSummer.h:48
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
LVL1::gFexTowerSummer::m_gTowers50WriteKey
SG::WriteHandleKey< xAOD::gFexTowerContainer > m_gTowers50WriteKey
Definition: gFexTowerSummer.h:55
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
LVL1::gFEXPos::C_FIBERS
constexpr int C_FIBERS
Definition: gFexPos.h:58
LVL1::gFEXPos::AMPD_GTRN_ARR
constexpr std::array< std::array< int, 16 >, 100 > AMPD_GTRN_ARR
Definition: gFexPos.h:122
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
LVL1::gFEXPos::CCALO_TYPE
constexpr std::array< int, 100 > CCALO_TYPE
Definition: gFexPos.h:387
samplesNtuple.caloType
caloType
Definition: samplesNtuple.py:4
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:47
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
a
TList * a
Definition: liststreamerinfos.cxx:10
LVL1::gFEXPos::AMPD_NFI
constexpr std::array< int, 100 > AMPD_NFI
Definition: gFexPos.h:103
h
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
LVL1::gFEXPos::ABC_ROWS
constexpr int ABC_ROWS
Definition: gFexPos.h:61
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthCommonReentrantAlgorithm.cxx:107
LVL1::gFEXPos::AMPD_DTYP_ARR
constexpr std::array< std::array< char, 20 >, 4 > AMPD_DTYP_ARR
Definition: gFexPos.h:214
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
LVL1::gFexTowerSummer::gtReconstructABC
StatusCode gtReconstructABC(const EventContext &ctx, unsigned int XFPGA, gtFPGA &XgtF, gtFPGA &Xgt, gtFPGA &Xsaturation) const
Definition: gFexTowerSummer.cxx:233
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthCommonReentrantAlgorithm.h:114
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:77
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
LVL1::gFexTowerSummer::gtFPGA
std::array< std::array< int, LVL1::gFEXPos::AB_COLUMNS >, LVL1::gFEXPos::ABC_ROWS > gtFPGA
Definition: gFexTowerSummer.h:41
Eta
@ Eta
Definition: RPCdef.h:8
fitman.k
k
Definition: fitman.py:528
LVL1::gFexTowerSummer::getEtaPhi
void getEtaPhi(float &Eta, float &Phi, int iEta, int iPhi, int gFEXtowerID) const
Definition: gFexTowerSummer.cxx:675
ServiceHandle< ICondSvc >
LVL1::gFEXPos::BCALO_TYPE
constexpr std::array< int, 100 > BCALO_TYPE
Definition: gFexPos.h:247