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

#include <TRT_FillCablingData_TB04.h>

Inheritance diagram for TRT_FillCablingData_TB04:
Collaboration diagram for TRT_FillCablingData_TB04:

Public Member Functions

 TRT_FillCablingData_TB04 (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~TRT_FillCablingData_TB04 ()
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
TRT_CablingDatafillData ()
 
void defineCollID ()
 
std::vector< uint32_t > getRobID (Identifier id) const
 
void fillCollID (uint32_t rob_id, std::vector< IdentifierHash > &ids)
 
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 sysInitialize () override
 Perform system initialization for an algorithm. 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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

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

void defineParameters ()
 
void defineTables ()
 
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

const TRT_IDm_TRTHelper
 
IdContext m_cntx
 
TRT_CablingDatam_cabling = nullptr
 
int m_numberOfRings = 0
 
int m_numberOfLayersA = 0
 
int m_numberOfLayersB = 0
 
int m_numberOfLayersC = 0
 
int m_numberOfIdentifierSectors = 0
 
std::vector< uint32_t > m_phi_to_source
 
std::vector< std::vector< Identifier > > m_identfierForAllStraws
 
std::vector< std::vector< IdentifierHash > > m_identfierHashForAllStraws
 
std::vector< std::vector< IdentifierHash > * > m_collID
 
std::vector< std::vector< int > > m_ncol
 
int m_StrawsByModule [3] {}
 
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 34 of file TRT_FillCablingData_TB04.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TRT_FillCablingData_TB04()

TRT_FillCablingData_TB04::TRT_FillCablingData_TB04 ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 48 of file TRT_FillCablingData_TB04.cxx.

50  m_TRTHelper(nullptr)
51 {
52  declareInterface< TRT_FillCablingData_TB04 >( this );
53 }

◆ ~TRT_FillCablingData_TB04()

TRT_FillCablingData_TB04::~TRT_FillCablingData_TB04 ( )
virtual

Definition at line 57 of file TRT_FillCablingData_TB04.cxx.

58 {}

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ defineCollID()

void TRT_FillCablingData_TB04::defineCollID ( )

Definition at line 288 of file TRT_FillCablingData_TB04.cxx.

289 {
290 
291  // Start from 1 because we have no Source ID = 0
292  for(int rod = 1; rod <= m_numberOfIdentifierSectors; rod++ )
293  {
294  uint32_t RODSourceId = 0x310000 + rod;
295 
296  std::vector<IdentifierHash> * vectID = new std::vector<IdentifierHash>();
297  fillCollID(RODSourceId, *vectID);
298 
299  m_cabling->add_collID(RODSourceId, vectID);
300  }
301 
302  return;
303 }

◆ defineParameters()

void TRT_FillCablingData_TB04::defineParameters ( )
private

Definition at line 106 of file TRT_FillCablingData_TB04.cxx.

107 {
108  m_numberOfRings = 3;
109 
110  m_numberOfLayersA = 19;
111  m_numberOfLayersB = 24;
112  m_numberOfLayersC = 30;
113 
115 
116  // Mapping from phi sector index to source id
117  m_phi_to_source.push_back( 0x310003 ); // Phi 0 is Source ID 0x3103
118  m_phi_to_source.push_back( 0x310002 ); // Phi 1 is Source ID 0x3102
119  // NB: Source ID 0x3101 is the 3S boards on BOTH Phi 0 and Phi 1
120 
121 
122  int numberOfStrawsInLayersA[] = {15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18,
123  18, 18, 18, 18, 19, 19, 19, 18};
124 
125  int numberOfStrawsInLayersB[] = {19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21,
126  22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 23};
127 
128  int numberOfStrawsInLayersC[] = {23, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26,
129  26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 28};
130 
131  std::vector<int> ncol0 (std::begin(numberOfStrawsInLayersA),
132  std::end(numberOfStrawsInLayersA));
133  std::vector<int> ncol1 (std::begin(numberOfStrawsInLayersB),
134  std::end(numberOfStrawsInLayersB));
135  std::vector<int> ncol2 (std::begin(numberOfStrawsInLayersC),
136  std::end(numberOfStrawsInLayersC));
137 
138  m_ncol.push_back(ncol0);
139  m_ncol.push_back(ncol1);
140  m_ncol.push_back(ncol2);
141 
142  m_StrawsByModule[0] = 329;
143  m_StrawsByModule[1] = 520;
144  m_StrawsByModule[2] = 793;
145 
146 }

◆ defineTables()

void TRT_FillCablingData_TB04::defineTables ( )
private

Definition at line 150 of file TRT_FillCablingData_TB04.cxx.

151 {
152  // Reading mapping
153  // Important number for converter!!! Pay attention!!!
154  // Another side has Id = -1
155  int barrelId = -1;
156  int phiModuleId, moduleId, strawLayerId, strawInLayerId,
157  strawNumberInModule,BufferLocation;
158  Identifier strawID, IdLayer;
159  IdentifierHash hashId;
160 
161  // Loop over two RODs (not PhiModules!)
162  for (int rod = 0; rod < m_numberOfIdentifierSectors; rod++ )
163  {
164  std::vector<Identifier> tempbuff;
165  std::vector<IdentifierHash> tempbuff2;
166  for (int i = 0; i < 8*13*16; i++){
167  Identifier id(0);
168  tempbuff.push_back(id);
169  tempbuff2.emplace_back(0);
170  }
173 
174  std::ostringstream ssFile;
175  ssFile << rod;
176  std::string dataFile = "TRT_TB04_IdMapping_ROD" + ssFile.str() + ".dat";
177 
178  std::string file = PathResolver::find_file (dataFile, "DATAPATH");
179 
180  std::ifstream inputFile (file.c_str());
181  if (!inputFile)
182  ATH_MSG_FATAL( "TRT_FillCablingData_TB04: Could not open file " << dataFile );
183 
184  /*
185  * We now loop over all buffer locations
186  * Read-out order is:
187  * ROD 0: 3S1, 3S2 (Assumed: UB3S and DB3S)
188  * ROD 1+2: 3L2, 3L1, 2L2, 2S, 2L1, 1S, 1L
189  * Data-files have been assembled in that order
190  * The individual file is ordered first after board and then
191  * after buffer location
192  */
193 
194 
195  while(!inputFile.eof()){
196  /*
197  * Need to add moduleId to data file, as the absolute strawnumber
198  * is relative to the module layer
199  * Also add phiModuleId. This is the easiest.
200  */
201  inputFile >> phiModuleId >> moduleId >> strawNumberInModule
202  >> BufferLocation;
203 
204  // Sanitize input from file
205  const bool validPhi = inRange(phiModuleId, invalidInput, maxPossiblePhiModule);
206  const bool validModule = inRange(moduleId, invalidInput, maxPossibleModule);
207  const bool validStrawNumber = inRange(strawNumberInModule, invalidInput, m_StrawsByModule[moduleId]);
208  const bool validBuffer = inRange(BufferLocation, invalidInput, maxPossibleBufferLocation);
209  if (not (validPhi and validModule and validStrawNumber and validBuffer)) {
210  ATH_MSG_WARNING("One of the following is out of range: " << phiModuleId << ", " << moduleId
211  << ", " << strawNumberInModule << ", " << BufferLocation);
212  continue;
213  }
214 
215  // Swap of phi sectors for ROD 0: 3S1, 3S2
216  if (rod == 0) {
217  if (phiModuleId == 0)
218  phiModuleId = 1;
219  else
220  phiModuleId = 0;
221  }
222 
223 
224  int rodSourceId=0;
225  if ( rod == 0 )
226  rodSourceId = 1;
227  else if ( rod == 1 )
228  rodSourceId = 2;
229  else if ( rod == 2 )
230  rodSourceId = 3;
231  else
232  {
233  ATH_MSG_ERROR( " Bad rod index! (" << rod << ")" );
234  return;
235  }
236 
237  /*
238  * DAQ numbers (seems to) go from 1, whereas offline Identifiers
239  * go from 0, so we'll just fix this:
240  */
241  strawNumberInModule--;
242  if (strawNumberInModule < 0) {
243  ATH_MSG_WARNING("Straw number in module became negative: " << strawNumberInModule);
244  continue;
245  }
246 
247  //Need to retrieve strawLayerId & strawInLayerId from ncols...
248  strawLayerId=0;
249  strawInLayerId=strawNumberInModule;
250 
251  while(strawInLayerId>=0){
252  //std::cout << "moduleID, strawLyerID" << moduleId << strawLayerId << std::endl;
253  strawInLayerId -= m_ncol[moduleId][strawLayerId];
254  strawLayerId++;
255  }
256  // Taking a step back
257  strawLayerId--;
258  strawInLayerId += m_ncol[moduleId][strawLayerId];
259 
260  //Apparently this is needed to skip to the next line
261  inputFile.ignore(256,'\n');
262 
263 
264  // Construct an Identifier and put it in the list
265  strawID = m_TRTHelper->straw_id(barrelId, phiModuleId, moduleId,
266  strawLayerId, strawInLayerId);
267  m_cabling->set_identifierForAllStraws(0x310000 + rodSourceId, BufferLocation, strawID);
268 
269  // Construct Hash and put it in the list
270  IdLayer = m_TRTHelper->layer_id(strawID);
271  if ( !m_TRTHelper->get_hash(IdLayer, hashId, &m_cntx) )
272  m_cabling->set_identifierHashForAllStraws(0x310000 + rodSourceId,
273  BufferLocation, hashId);
274  else
275  ATH_MSG_DEBUG( "defineTables: unable to get hash for IdLayer " << IdLayer );
276 
277  } // end of loop over straw in ROD
278 
279  inputFile.close(); //
280  } // end of loop over RODs
281 
282  return;
283 }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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; }

◆ extraDeps_update_handler()

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

◆ fillCollID()

void TRT_FillCablingData_TB04::fillCollID ( uint32_t  rob_id,
std::vector< IdentifierHash > &  ids 
)

Definition at line 310 of file TRT_FillCablingData_TB04.cxx.

312 {
313 
314  int barrelId, phiModule=-1;
315  IdentifierHash idHash;
316 
317  int module;
318 
319  eformat::helper::SourceIdentifier id (rob_id);
320  module = (int) id.module_id();
321 
322  barrelId = -1;
323 
324  // Define Phi sector depending on ROB number
325  // 3102 - Phi 1; 3103 - Phi 0;
326  if (module == 2)
327  {
328  phiModule = 1;
329  }
330  else if (module == 3)
331  {
332  phiModule = 0;
333  }
334 
335  if ( module == 1 ) // XXX -- ROB with both 3S boards!
336  {
337  int ring = 2; // Only Module Type 3!
338  for ( int phiModule=0; phiModule<2; phiModule++ )
339 
340  {
341  for (int layer = 0; layer < m_numberOfLayersC; ++layer)
342  {
343  Identifier id = m_TRTHelper->layer_id(barrelId, phiModule,
344  ring, layer);
345  if (!m_TRTHelper->get_hash(id, idHash, &m_cntx))
346  {
347  ids.push_back(idHash);
348  }
349  else
350  ATH_MSG_FATAL( " Unable to get hash for id " << m_TRTHelper->show_to_string(id) );
351  }
352  }
353 
354  return;
355  }
356 
357 
358  for (int ring = 0; ring < m_numberOfRings; ++ring)
359  {
360  if (ring == 0) // Module Type 1
361  {
362  for (int layer = 0; layer < m_numberOfLayersA; ++layer)
363  {
364  Identifier id = m_TRTHelper->layer_id(barrelId, phiModule,
365  ring, layer);
366  if (!m_TRTHelper->get_hash(id, idHash, &m_cntx))
367  ids.push_back(idHash);
368  else
369  ATH_MSG_FATAL( " Unable to get hash for id " << m_TRTHelper->show_to_string(id) );
370  }
371  }
372  else if (ring == 1) // Module Type 2
373  {
374  for (int layer = 0; layer < m_numberOfLayersB; ++layer)
375  {
376  Identifier id = m_TRTHelper->layer_id(barrelId, phiModule,
377  ring, layer);
378  if (!m_TRTHelper->get_hash(id, idHash, &m_cntx))
379  ids.push_back(idHash);
380  else
381  ATH_MSG_FATAL( " Unable to get hash for id " << m_TRTHelper->show_to_string(id) );
382  }
383  }
384  else // Module Type 3
385  {
386  for (int layer = 0; layer < m_numberOfLayersC; ++layer)
387  {
388  Identifier id = m_TRTHelper->layer_id(barrelId, phiModule,
389  ring, layer);
390  if (!m_TRTHelper->get_hash(id, idHash, &m_cntx))
391  ids.push_back(idHash);
392  else
393  ATH_MSG_FATAL( " Unable to get hash for id " << m_TRTHelper->show_to_string(id) );
394  }
395  }
396  }
397 
398  return;
399 }

◆ fillData()

TRT_CablingData * TRT_FillCablingData_TB04::fillData ( )

Definition at line 100 of file TRT_FillCablingData_TB04.cxx.

101 {
102  return m_cabling;
103 }

◆ finalize()

StatusCode TRT_FillCablingData_TB04::finalize ( )
virtual

Definition at line 91 of file TRT_FillCablingData_TB04.cxx.

92 {
93  delete m_cabling;
94 
96  return sc;
97 }

◆ getRobID()

std::vector< uint32_t > TRT_FillCablingData_TB04::getRobID ( Identifier  id) const

Definition at line 407 of file TRT_FillCablingData_TB04.cxx.

408 {
409  std::vector<uint32_t> v;
410 
411 
412  int id_barrel_ec = m_TRTHelper->barrel_ec(id);
413  int id_phi_module = m_TRTHelper->phi_module(id);
414 
415  /*
416  * It seems to be assumed that the ROD/ROB source IDs are aligned to
417  * the phi sector numbering. This is NOT the case for TB04, so we
418  * need to fix it up.
419  * In addition, for Module type 3 (ie, layer 2), we need to read out
420  * the ROB with the 3S boards (number 1), as well as the ROB with
421  * the rest of the sector.
422  * We assume only one side here.
423  */
424  if (id_barrel_ec == -1)
425  {
426  v.push_back( m_phi_to_source[id_phi_module] );
427 
428 // !!! Artificial inclusion of the ROB XXX (which is in both
429 // phi-sectors) in list of ROBs for each collection. !!!
430 // This is done in order to have this ROB data to be read in
431 // BS converter
432 
433  v.push_back( 0x310001 );
434  }
435  else
436  ATH_MSG_WARNING ( \
437  " TRT_FillCablingData_TB04 --> Couldn't get RobID for given Identifier " \
438  << m_TRTHelper->print_to_string(id) << ", cabling differs from dictionary " );
439 
440  return v;
441 }

◆ initialize()

StatusCode TRT_FillCablingData_TB04::initialize ( )
virtual

Definition at line 66 of file TRT_FillCablingData_TB04.cxx.

67 {
68  ATH_MSG_INFO( "TRT_FillCablingData_TB04::initialize" );
69 
70 
71  // Get the TRT Helper
72  if (detStore()->retrieve(m_TRTHelper, "TRT_ID").isFailure())
73  {
74  ATH_MSG_FATAL( "Could not get TRT ID helper" );
75  return StatusCode::FAILURE;
76  }
78 
80 
82  defineTables();
83  defineCollID();
84 
85  ATH_MSG_INFO( "TRT_FillCablingData_TB04::initializiation finished" );
86 
87  return StatusCode::SUCCESS;
88 }

◆ inputHandles()

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

◆ interfaceID()

const InterfaceID & TRT_FillCablingData_TB04::interfaceID ( )
static

Definition at line 61 of file TRT_FillCablingData_TB04.cxx.

62 { return IID_ITRT_FillCablingData_TB04; }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::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< AlgTool >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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_cabling

TRT_CablingData* TRT_FillCablingData_TB04::m_cabling = nullptr
private

Definition at line 69 of file TRT_FillCablingData_TB04.h.

◆ m_cntx

IdContext TRT_FillCablingData_TB04::m_cntx
private

Definition at line 67 of file TRT_FillCablingData_TB04.h.

◆ m_collID

std::vector<std::vector<IdentifierHash> *> TRT_FillCablingData_TB04::m_collID
private

Definition at line 100 of file TRT_FillCablingData_TB04.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_identfierForAllStraws

std::vector< std::vector<Identifier> > TRT_FillCablingData_TB04::m_identfierForAllStraws
private

Definition at line 93 of file TRT_FillCablingData_TB04.h.

◆ m_identfierHashForAllStraws

std::vector< std::vector<IdentifierHash> > TRT_FillCablingData_TB04::m_identfierHashForAllStraws
private

Definition at line 97 of file TRT_FillCablingData_TB04.h.

◆ m_ncol

std::vector< std::vector<int> > TRT_FillCablingData_TB04::m_ncol
private

Definition at line 103 of file TRT_FillCablingData_TB04.h.

◆ m_numberOfIdentifierSectors

int TRT_FillCablingData_TB04::m_numberOfIdentifierSectors = 0
private

Definition at line 83 of file TRT_FillCablingData_TB04.h.

◆ m_numberOfLayersA

int TRT_FillCablingData_TB04::m_numberOfLayersA = 0
private

Definition at line 78 of file TRT_FillCablingData_TB04.h.

◆ m_numberOfLayersB

int TRT_FillCablingData_TB04::m_numberOfLayersB = 0
private

Definition at line 79 of file TRT_FillCablingData_TB04.h.

◆ m_numberOfLayersC

int TRT_FillCablingData_TB04::m_numberOfLayersC = 0
private

Definition at line 80 of file TRT_FillCablingData_TB04.h.

◆ m_numberOfRings

int TRT_FillCablingData_TB04::m_numberOfRings = 0
private

Definition at line 77 of file TRT_FillCablingData_TB04.h.

◆ m_phi_to_source

std::vector<uint32_t> TRT_FillCablingData_TB04::m_phi_to_source
private

Definition at line 89 of file TRT_FillCablingData_TB04.h.

◆ m_StrawsByModule

int TRT_FillCablingData_TB04::m_StrawsByModule[3] {}
private

Definition at line 105 of file TRT_FillCablingData_TB04.h.

◆ m_TRTHelper

const TRT_ID* TRT_FillCablingData_TB04::m_TRTHelper
private

Definition at line 65 of file TRT_FillCablingData_TB04.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::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
TRT_ID::layer_id
Identifier layer_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
For an individual straw layer.
Definition: TRT_ID.h:500
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
TRT_FillCablingData_TB04::m_numberOfRings
int m_numberOfRings
Definition: TRT_FillCablingData_TB04.h:77
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
TRT_FillCablingData_TB04::fillCollID
void fillCollID(uint32_t rob_id, std::vector< IdentifierHash > &ids)
Definition: TRT_FillCablingData_TB04.cxx:310
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
PathResolver::find_file
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:251
TRT_CablingData::set_identifierHashForAllStraws
void set_identifierHashForAllStraws(int rod, int bufferPosition, IdentifierHash hashId)
Definition: TRT_CablingData.cxx:107
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TRT_FillCablingData_TB04::m_phi_to_source
std::vector< uint32_t > m_phi_to_source
Definition: TRT_FillCablingData_TB04.h:89
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
TRT_CablingData::set_identifierForAllStraws
void set_identifierForAllStraws(int rod, int bufferPosition, Identifier strawID)
Definition: TRT_CablingData.cxx:86
TRT_FillCablingData_TB04::m_StrawsByModule
int m_StrawsByModule[3]
Definition: TRT_FillCablingData_TB04.h:105
TRT_FillCablingData_TB04::m_numberOfIdentifierSectors
int m_numberOfIdentifierSectors
Definition: TRT_FillCablingData_TB04.h:83
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
TRT_FillCablingData_TB04::defineCollID
void defineCollID()
Definition: TRT_FillCablingData_TB04.cxx:288
TRT_FillCablingData_TB04::defineParameters
void defineParameters()
Definition: TRT_FillCablingData_TB04.cxx:106
ActsProtoTrackCreationAndFitConfig.dataFile
dataFile
Definition: ActsProtoTrackCreationAndFitConfig.py:140
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
TRT_FillCablingData_TB04::m_numberOfLayersA
int m_numberOfLayersA
Definition: TRT_FillCablingData_TB04.h:78
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
python.PyAthena.module
module
Definition: PyAthena.py:131
TRT_CablingData::zero_identifierForAllStraws
void zero_identifierForAllStraws(int rod, const std::vector< Identifier > &tempbuff)
Definition: TRT_CablingData.cxx:35
TRT_FillCablingData_TB04::m_numberOfLayersC
int m_numberOfLayersC
Definition: TRT_FillCablingData_TB04.h:80
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TRT_ID::get_hash
virtual int get_hash(const Identifier &id, IdentifierHash &hash_id, const IdContext *context=0) const override final
Create hash id from compact id (return == 0 for OK)
Definition: TRT_ID.cxx:941
CaloCondBlobAlgs_fillNoiseFromASCII.inputFile
string inputFile
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:17
lumiFormat.i
int i
Definition: lumiFormat.py:85
TRT_CablingData::add_collID
void add_collID(uint32_t rob_id, std::vector< IdentifierHash > *vectID)
Definition: TRT_CablingData.cxx:168
TRT_ID::straw_layer_context
IdContext straw_layer_context(void) const
straw_layer id
Definition: TRT_ID.h:713
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
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
file
TFile * file
Definition: tile_monitor.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TRT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: TRT_ID.h:866
TRT_FillCablingData_TB04::defineTables
void defineTables()
Definition: TRT_FillCablingData_TB04.cxx:150
RunTileMonitoring.rod
rod
Definition: RunTileMonitoring.py:134
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
inRange
bool inRange(const double *boundaries, const double value, const double tolerance=0.02)
Definition: LArSCIdVsIdTest.cxx:5
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
AtlasDetectorID::print_to_string
std::string print_to_string(Identifier id, const IdContext *context=0) const
or provide the printout in string form
Definition: AtlasDetectorID.cxx:655
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
TRT_FillCablingData_TB04::m_cntx
IdContext m_cntx
Definition: TRT_FillCablingData_TB04.h:67
TRT_ID::phi_module
int phi_module(const Identifier &id) const
Definition: TRT_ID.h:875
python.PyAthena.v
v
Definition: PyAthena.py:154
a
TList * a
Definition: liststreamerinfos.cxx:10
h
TRT::Hit::phiModule
@ phiModule
Definition: HitInfo.h:80
AtlasDetectorID::show_to_string
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Definition: AtlasDetectorID.cxx:574
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TRT_FillCablingData_TB04::m_TRTHelper
const TRT_ID * m_TRTHelper
Definition: TRT_FillCablingData_TB04.h:65
TRT_CablingData
Definition: TRT_CablingData.h:18
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
TRT_FillCablingData_TB04::m_cabling
TRT_CablingData * m_cabling
Definition: TRT_FillCablingData_TB04.h:69
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
TRT_FillCablingData_TB04::m_numberOfLayersB
int m_numberOfLayersB
Definition: TRT_FillCablingData_TB04.h:79
fitman.k
k
Definition: fitman.py:528
TRT_ID::straw_id
Identifier straw_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Three ways of getting id for a single straw:
Definition: TRT_ID.h:581
TRT_FillCablingData_TB04::m_ncol
std::vector< std::vector< int > > m_ncol
Definition: TRT_FillCablingData_TB04.h:103
TRT_CablingData::zero_identifierHashForAllStraws
void zero_identifierHashForAllStraws(int rod, const std::vector< IdentifierHash > &tempbuff)
Definition: TRT_CablingData.cxx:42
Identifier
Definition: IdentifierFieldParser.cxx:14