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

HitMapBuilder.h. More...

#include <HitMapBuilder.h>

Inheritance diagram for HitMapBuilder:
Collaboration diagram for HitMapBuilder:

Public Member Functions

 ~HitMapBuilder ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
 AthAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor with parameters: More...
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

std::string getDCSIDFromPosition (int bec, int layer, int modPhi, int modEta)
 
std::vector< std::string > & splitter (const std::string &str, char delim, std::vector< std::string > &elems)
 
std::vector< std::string > splitter (const std::string &str, char delim)
 
StatusCode registerHistograms ()
 
const std::string histoSuffix (const int bec, const int layer)
 
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

ServiceHandle< ITHistSvc > m_tHistSvc {this, "THistSvc", "THistSvc/THistSvc"}
 
SG::ReadHandleKey< PixelRDO_Containerm_pixelRDOKey {this,"PixelRDOKey","PixelRDOs","StoreGate Key of Pixel RDOs"}
 
const InDetDD::PixelDetectorManagerm_pixman =nullptr
 
const PixelIDm_pixelID =nullptr
 
std::vector< std::pair< std::string, std::vector< int > > > m_pixelMapping
 
double m_nEvents =0
 
std::vector< double > m_nEventsLB
 
std::vector< double > m_nEventsLBCategory
 
std::unique_ptr< TH1Fm_nEventsHist
 
std::unique_ptr< TH1Fm_nEventsLBHist
 
std::vector< std::unique_ptr< TH2F > > m_occupancyMaps
 
std::vector< std::unique_ptr< TH2F > > m_occupancyMapsIBL2dLB
 
std::vector< std::unique_ptr< TH1F > > m_TOTdistributions
 
std::vector< std::unique_ptr< TH1F > > m_TOTdistributionsIBL2dLB
 
std::vector< std::unique_ptr< TH1F > > m_occupancyLB
 
Gaudi::Property< int > m_hist_lbMax {this,"nLBmax", 3001, "Maximum number of LB (for histograms binning)"}
 
Gaudi::Property< int > m_evt_lbMin {this,"LBMin",0,"First lumi block to consider"}
 
Gaudi::Property< int > m_evt_lbMax {this,"LBMax",-1,"Last lumi block to consider"}
 
int m_LBrange_max = -9999
 
const unsigned int m_nIblFes = 14 * (4 + 6*2) * 2
 
const int m_perLB_min =0
 
const int m_perLB_max =3000
 
const int m_perLB_step =100
 
const int m_perLB_n = (m_perLB_max-m_perLB_min)/m_perLB_step
 
const int m_fei4bPixels = 26880
 
const int m_pixModPixels = 46080
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

HitMapBuilder.h.

Creates hit maps and maps of noisy pixels for every module of the pixel detector. The maps are stored in a root file. They can be written to the conditions database using the algorithm NoiseMapDBWriter.

ruwie.nosp@m.del@.nosp@m.physi.nosp@m.k.un.nosp@m.i-bon.nosp@m.n.de

Definition at line 46 of file HitMapBuilder.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ~HitMapBuilder()

HitMapBuilder::~HitMapBuilder ( )

Definition at line 24 of file HitMapBuilder.cxx.

24  {
25 }

Member Function Documentation

◆ AthAlgorithm()

AthAlgorithm::AthAlgorithm

Constructor with parameters:

Definition at line 51 of file AthAlgorithm.cxx.

25  :
27 {
28  // Set up to run AthAlgorithmDHUpdate in sysInitialize before
29  // merging dependency lists. This extends the output dependency
30  // list with any symlinks implied by inheritance relations.
31  m_updateDataHandles =
32  std::make_unique<AthenaBaseComps::AthAlgorithmDHUpdate>
34  std::move (m_updateDataHandles));
35 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode HitMapBuilder::execute ( )

Definition at line 334 of file HitMapBuilder.cxx.

334  {
335  ATH_MSG_DEBUG( "Executing HitMapBuilder" );
336 
337  const EventContext& ctx = Gaudi::Hive::currentContext();
338 
339  // check LB is in allowed range
340  int LB = static_cast<int>(ctx.eventID().lumi_block());
341  if ((LB < m_evt_lbMin) || (m_evt_lbMax >= m_evt_lbMin && LB > m_evt_lbMax)) {
342  ATH_MSG_VERBOSE("Event in lumiblock " << LB << " not in selected range [" << m_evt_lbMin << "," << m_evt_lbMax << "] => skipped");
343  return StatusCode::SUCCESS;
344  }
345 
346  // Get max LB range
347  if (m_LBrange_max < LB) m_LBrange_max = LB;
348 
349 // retrieve PixelRDO container
351  ATH_MSG_DEBUG( "Pixel RDO container retrieved" );
352  // loop in RDO container
353  for (const auto pPixelRDOCollection: *pixelRDOs) {
354  if (pPixelRDOCollection) {
355  Identifier moduleID = pPixelRDOCollection->identify();
356  IdentifierHash modHash = m_pixelID->wafer_hash(moduleID);
357  ATH_MSG_VERBOSE("moduleID, modHash = " << moduleID << " , " << modHash);
358 
359  for (DataVector<PixelRDORawData>::const_iterator rdo=pPixelRDOCollection->begin(); rdo!=pPixelRDOCollection->end(); ++rdo) {
360  Identifier rdoID = (*rdo)->identify();
361  int bec = m_pixelID->barrel_ec(rdoID);
362  //
363  if (std::abs(bec) == 4) continue; // Skip DBM
364  //
365  unsigned int pixel_eta = m_pixelID->eta_index(rdoID);
366  unsigned int pixel_phi = m_pixelID->phi_index(rdoID);
367  int layer = m_pixelID->layer_disk(rdoID);
368  int modPhi = m_pixelID->phi_module(rdoID);
369  int modEta = m_pixelID->eta_module(rdoID);
371 
372 
373 
374  int iblFeHash = -99;
375  if (bec==0 && layer==0) { // IBL FE order: {0..3}: 3D C, {4..15}: 2D C, {16..27}: 2D A, {28..31}: 3D A
376  if (modEta <= -7) iblFeHash = modPhi*32 + (modEta+10); // 3D C
377  else if (-6<=modEta && modEta<=5) iblFeHash = modPhi*32 + ((modEta+6)*2+4); // 2D
378  else iblFeHash = modPhi*32 + (modEta+22); // 3D A
379  if (pixel_eta/80) iblFeHash++; // For 2D, C side '_1', or A side '_2' for pixel_eta 80~159
380  }
381 
382  int TOT = (*rdo)->getToT(); // it returns a 8 bits "word"
383 
384  // Category: All
385  if (bec == 0 && layer == 0 && -6 <= modEta && modEta <= 5) { // IBL 2D
386  int ibl2dHash = maxHash + iblFeHash;
387  m_occupancyMaps[ibl2dHash]->Fill(pixel_eta%80, pixel_phi);
388  m_occupancyLB[ibl2dHash]->Fill(LB);
389  m_TOTdistributions[ibl2dHash]->Fill(TOT);
390  }
391  else { // None IBL 2D
392  m_occupancyMaps[modHash]->Fill(pixel_eta, pixel_phi);
393  m_occupancyLB[modHash]->Fill(LB);
394  m_TOTdistributions[modHash]->Fill(TOT);
395  }
396 
397  // Category: LB
398  if (0 <= iblFeHash) { // IBL
399  for (int i=0; i<m_perLB_n; i++) {
400  if ((m_perLB_min+m_perLB_step*i < LB) && (LB <= m_perLB_min+m_perLB_step*(i+1))) { // LB
401  int ibl2dHash = m_nIblFes*i + iblFeHash;
402  m_occupancyMapsIBL2dLB[ibl2dHash]->Fill(pixel_eta%80, pixel_phi);
403  m_TOTdistributionsIBL2dLB[ibl2dHash]->Fill(TOT);
404  }
405  }
406  }
407  }
408  }
409  }
410  m_nEvents++;
411  m_nEventsHist->Fill(0.5);
412  m_nEventsLBHist->Fill(LB);
413 
414  m_nEventsLB[LB]++;
416 
417  return StatusCode::SUCCESS;
418 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode HitMapBuilder::finalize ( )

Definition at line 425 of file HitMapBuilder.cxx.

425  {
426  ATH_MSG_INFO("Finalizing HitMapBuilder");
427 
428  ATH_CHECK(m_tHistSvc->regHist("/histfile/NEvents", std::move(m_nEventsHist)));
429  ATH_CHECK(m_tHistSvc->regHist("/histfile/NEventsLB", std::move(m_nEventsLBHist)));
430 
431  //
432  // loop in detector elements
433  //
434  for (InDetDD::SiDetectorElementCollection::const_iterator iter=m_pixman->getDetectorElementBegin(); iter!=m_pixman->getDetectorElementEnd(); ++iter) {
435  const InDetDD::SiDetectorElement* element = *iter;
436  if (element == 0) continue;
437 
438  Identifier ident = element->identify();
439  if (!m_pixelID->is_pixel(ident)) continue;
440 
441  int bec = m_pixelID->barrel_ec (ident);
443  int modPhi = m_pixelID->phi_module(ident);
444  int modEta = m_pixelID->eta_module(ident);
445  int modHash = m_pixelID->wafer_hash(ident);
447 
448  if (abs(bec) == 4) continue; // Skip DBM
449 
450  int iblFeHash = -99;
451  if (bec==0 && layer==0) { // IBL FE order: {0..3}: 3D C, {4..15}: 2D C, {16..27}: 2D A, {28..31}: 3D A
452  if (modEta <= -7) iblFeHash = modPhi*32 + (modEta+10); // 3D C
453  else if (-6<=modEta && modEta<=5) iblFeHash = modPhi*32 + ((modEta+6)*2+4); // 2D
454  else iblFeHash = modPhi*32 + (modEta+22); // 3D A
455  }
456 
457  // Divide by events for Occupancy Map
458  // Category: All
459  if (bec == 0 && layer == 0 && -6 <= modEta && modEta <= 5) { // IBL 2D
460  int ibl2dHash = maxHash + iblFeHash;
461  for (int chipId=0; chipId<2; chipId++) { // 2 Fes in double module
462  //yosuke m_occupancyMaps[ibl2dHash+chipId]->Scale(1.0/(m_nEvents));
463  // Occupancy LB
464  int entries = m_occupancyLB[ibl2dHash+chipId]->GetEntries();
465  for (int lb=0; lb<m_hist_lbMax; lb++) {
466  if (m_nEventsLB[lb] == 0) continue;
467  m_occupancyLB[ibl2dHash+chipId]->SetBinContent(lb+1, m_occupancyLB[ibl2dHash+chipId]->GetBinContent(lb+1)/(m_nEventsLB[lb]*m_fei4bPixels)); // Also divide by fei4 pixels
468  }
469  m_occupancyLB[ibl2dHash+chipId]->SetEntries(entries);
470  m_occupancyLB[ibl2dHash+chipId]->SetBins(m_LBrange_max+100, -0.5, m_LBrange_max+99.5);
471  }
472  }
473  else { // None IBL 2D
474  //yosuke m_occupancyMaps[modHash]->Scale(1.0/(m_nEvents));
475  // Occupancy LB
476  int entries = m_occupancyLB[modHash]->GetEntries();
477  for (int lb=0; lb<m_hist_lbMax; lb++) {
478  if (m_nEventsLB[lb] == 0) continue;
479  if (0 <= iblFeHash) m_occupancyLB[modHash]->SetBinContent(lb+1, m_occupancyLB[modHash]->GetBinContent(lb+1)/(m_nEventsLB[lb]*m_fei4bPixels)); // IBL 3D, divide by fei4 pixels
480  else m_occupancyLB[modHash]->SetBinContent(lb+1, m_occupancyLB[modHash]->GetBinContent(lb+1)/(m_nEventsLB[lb]*m_pixModPixels)); // Pixel module, divide by pixel module pixels
481  }
482  m_occupancyLB[modHash]->SetEntries(entries);
483  m_occupancyLB[modHash]->SetBins(m_LBrange_max+100, -0.5, m_LBrange_max+99.5);
484  }
485 
486  std::string onlineID = getDCSIDFromPosition(bec,layer,modPhi,modEta);
487 
488  std::ostringstream name;
489  std::string axisTitle;
490 
491  // Construct IBL Planar later
492  std::string LBCategory;
493  std::string occ2dDir = "Occupancy2d";
494  std::string occLBDir = "OccupancyLb";
495  std::string totDir = "ToT";
496 
497  // Category: All
498  LBCategory = "All";
499  if (bec == 0 && layer == 0 && -6 <= modEta && modEta <= 5) { // IBL 2D
500  for (unsigned chipId=0; chipId<=1; chipId++) { // FE chips in double module
501  int ibl2dHash;
502  if (chipId) {
503  if (modEta <= -1) ibl2dHash = maxHash + iblFeHash; // C side, '_2'
504  else ibl2dHash = maxHash + iblFeHash + chipId; // A side, '_2'
505  }
506  else {
507  if (modEta <= -1) ibl2dHash = maxHash + iblFeHash + 1; // C side, '_1'
508  else ibl2dHash = maxHash + iblFeHash; // A side, '_1'
509  }
510  // Occupancy Map
511  axisTitle = ";pixel_eta;pixel_phi;# hits/pixel/event";
512  name << "/histfile/" << LBCategory << "/" << occ2dDir << "/" << histoSuffix(bec,layer) << "/" << onlineID << "_" << chipId+1;
513  ATH_CHECK(m_tHistSvc->regHist(name.str(), std::move(m_occupancyMaps[ibl2dHash])));
514  name.str(""); name.clear();
515 
516  // Occupancy vs. LB
517  axisTitle = ";LB;# hits/pixel/event";
518  name << "/histfile/" << LBCategory << "/" << occLBDir << "/" << histoSuffix(bec,layer) << "/" << onlineID << "_" << chipId+1;
519  ATH_CHECK(m_tHistSvc->regHist(name.str(), std::move(m_occupancyLB[ibl2dHash])));
520  name.str(""); name.clear();
521 
522  // ToT
523  axisTitle = ";ToT;# hits";
524  name << "/histfile/" << LBCategory << "/" << totDir << "/" << histoSuffix(bec,layer) << "/" << onlineID << "_" << chipId+1;
525  ATH_CHECK(m_tHistSvc->regHist(name.str(), std::move(m_TOTdistributions[ibl2dHash])));
526  name.str(""); name.clear();
527  }
528  }
529  else { // None IBL 2D
530  // Occupancy Map
531  axisTitle = ";pixel_eta;pixel_phi;# hits/pixel/event";
532  name << "/histfile/" << LBCategory << "/" << occ2dDir << "/" << histoSuffix(bec,layer) << "/" << onlineID;
533  ATH_CHECK(m_tHistSvc->regHist(name.str(), std::move(m_occupancyMaps[modHash])));
534  name.str(""); name.clear();
535 
536  // Occupancy vs. LB
537  axisTitle = ";LB;# hits/pixel/event";
538  name << "/histfile/" << LBCategory << "/" << occLBDir << "/" << histoSuffix(bec,layer) << "/" << onlineID;
539  ATH_CHECK(m_tHistSvc->regHist(name.str(), std::move(m_occupancyLB[modHash])));
540  name.str(""); name.clear();
541 
542  // ToT
543  axisTitle = ";ToT;# hits";
544  name << "/histfile/" << LBCategory << "/" << totDir << "/" << histoSuffix(bec,layer) << "/" << onlineID;
545  ATH_CHECK(m_tHistSvc->regHist(name.str(), std::move(m_TOTdistributions[modHash])));
546  name.str(""); name.clear();
547  } // End of if ibl 2d
548 
549  // Category: LB1-100, 101-200, ...
550  if (0 <= iblFeHash) { // IBL
551  for (int i=0; i<m_perLB_n; i++) {
552  LBCategory = "LB" + std::to_string(m_perLB_min+m_perLB_step*i+1) + "-" + std::to_string(m_perLB_min+m_perLB_step*(i+1));
553  if (-6 <= modEta && modEta <= 5) { // IBL 2D
554  for (int chipId=0; chipId<=1; chipId++) { // FE chips in double module
555  int ibl2dHash;
556  if (chipId) {
557  if (modEta <= -1) ibl2dHash = m_nIblFes*i + iblFeHash; // C side, '_2'
558  else ibl2dHash = m_nIblFes*i + iblFeHash + chipId; // A side, '_2'
559  }
560  else {
561  if (modEta <= -1) ibl2dHash = m_nIblFes*i + iblFeHash + 1; // C side, '_1'
562  else ibl2dHash = m_nIblFes*i + iblFeHash; // A side, '_1'
563  }
564  std::string histTitle = onlineID + "_" + std::to_string(chipId+1);
565  // Occupancy Map
566  axisTitle = ";pixel_eta;pixel_phi;# hits/pixel/event";
567  name << "/histfile/" << LBCategory << "/" << occ2dDir << "/" << histoSuffix(bec,layer) << "/" << histTitle;
568  ATH_CHECK(m_tHistSvc->regHist(name.str(), std::move(m_occupancyMapsIBL2dLB[ibl2dHash])));
569  name.str(""); name.clear();
570 
571  // ToT
572  axisTitle = ";ToT;# hits";
573  name << "/histfile/" << LBCategory << "/" << totDir << "/" << histoSuffix(bec,layer) << "/" << histTitle;
574  ATH_CHECK(m_tHistSvc->regHist(name.str(), std::move(m_TOTdistributionsIBL2dLB[ibl2dHash])));
575  name.str(""); name.clear();
576  }
577  }
578  else { // IBL 3D
579  int ibl2dHash = m_nIblFes*i + iblFeHash;
580  // Occupancy Map
581  axisTitle = ";pixel_eta;pixel_phi;# hits/pixel/event";
582  name << "/histfile/" << LBCategory << "/" << occ2dDir << "/" << histoSuffix(bec,layer) << "/" << onlineID;
583  ATH_CHECK(m_tHistSvc->regHist(name.str(), std::move(m_occupancyMapsIBL2dLB[ibl2dHash])));
584  name.str(""); name.clear();
585 
586  // ToT
587  axisTitle = ";ToT;# hits";
588  name << "/histfile/" << LBCategory << "/" << totDir << "/" << histoSuffix(bec,layer) << "/" << onlineID;
589  ATH_CHECK(m_tHistSvc->regHist(name.str(), std::move(m_TOTdistributionsIBL2dLB[ibl2dHash])));
590  name.str(""); name.clear();
591  } // End of if ibl 2d
592  } // End of loop of category: LB
593  } // End of if IBL
594  } // end loop in detector elements
595 
596  return StatusCode::SUCCESS;
597 
598 } // end finalize

◆ getDCSIDFromPosition()

std::string HitMapBuilder::getDCSIDFromPosition ( int  bec,
int  layer,
int  modPhi,
int  modEta 
)
private

Definition at line 27 of file HitMapBuilder.cxx.

27  {
28  for (unsigned int ii = 0; ii < m_pixelMapping.size(); ii++) {
29  if (m_pixelMapping[ii].second.size() != 4) {
30  ATH_MSG_FATAL("getDCSIDFromPosition: Vector size is not 4!");
31  return std::string("Error!");
32  }
33  if (m_pixelMapping[ii].second[0] != barrel_ec) continue;
34  if (m_pixelMapping[ii].second[1] != layer) continue;
35  if (m_pixelMapping[ii].second[2] != modPhi) continue;
36  if (m_pixelMapping[ii].second[3] != module_eta) continue;
37  return m_pixelMapping[ii].first;
38  }
39  ATH_MSG_FATAL("DCS ID is not found!");
40  return std::string("Error!");
41 }

◆ histoSuffix()

const std::string HitMapBuilder::histoSuffix ( const int  bec,
const int  layer 
)
private

Definition at line 43 of file HitMapBuilder.cxx.

43  {
44  std::ostringstream out;
45  switch (bec) {
46  case 0:
47  if (layer==0) out << "IBL";
48  else out << "B" << layer-1;
49  break;
50  case +2: out << "Disk" << layer+1 << "A"; break;
51  case -2: out << "Disk" << layer+1 << "C"; break;
52  case +4: out << "DBM" << layer+1 << "A"; break;
53  case -4: out << "DBM" << layer+1 << "C"; break;
54  default: break;
55  }
56  return out.str();
57 }

◆ initialize()

StatusCode HitMapBuilder::initialize ( )

Definition at line 79 of file HitMapBuilder.cxx.

79  {
80  ATH_MSG_INFO("Initializing HitMapBuilder");
81 
82  ATH_CHECK(m_pixelRDOKey.initialize());
83 
84  // retrieve THistSvc
85  StatusCode sc = m_tHistSvc.retrieve();
86  if (!sc.isSuccess()) {
87  ATH_MSG_FATAL("Unable to retrieve THistSvc");
88  return StatusCode::FAILURE;
89  }
90  // retrieve PixelDetectorManager
91  sc = detStore()->retrieve(m_pixman,"Pixel");
92  if (!sc.isSuccess()) {
93  ATH_MSG_FATAL("Unable to retrieve PixelDetectorManager");
94  return StatusCode::FAILURE;
95  }
96 
97  // retrieve PixelID helper
98  sc = detStore()->retrieve(m_pixelID, "PixelID");
99  if (!sc.isSuccess()) {
100  ATH_MSG_FATAL("Unable to retrieve PixelID helper");
101  return StatusCode::FAILURE;
102  }
103 
104  // resize vectors of histograms
106  ATH_MSG_DEBUG("PixelID maxHash = " << maxHash);
107  m_occupancyMaps.resize(maxHash+m_nIblFes);
109  m_TOTdistributions.resize(maxHash+m_nIblFes);
111  m_occupancyLB.resize(maxHash+m_nIblFes);
112 
113  // Resize vector of variables
114  m_nEventsLB.resize(m_hist_lbMax);
116 
117  return (registerHistograms());
118 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ registerHistograms()

StatusCode HitMapBuilder::registerHistograms ( )
private

Definition at line 121 of file HitMapBuilder.cxx.

121  {
122  const std::string mapFile = "PixelMapping_Run2.dat";
123 
124  std::vector<std::string> paths = splitter(std::getenv("DATAPATH"), ':');
125  bool found(false);
126  for (const auto& x : paths) {
127  std::ifstream infile((x+"/"+mapFile).c_str());
128  if (infile.is_open()) {
129  ATH_MSG_INFO("Mapping file '" << mapFile << "' found in " << x);
130 
131  int tmp_barrel_ec; int tmp_layer; int tmp_modPhi; int tmp_module_eta; std::string tmp_module_name;
132  std::vector<int> tmp_position;
133  tmp_position.resize(4);
134  while(infile >> tmp_barrel_ec >> tmp_layer >> tmp_modPhi >> tmp_module_eta >> tmp_module_name) {
135  tmp_position[0] = tmp_barrel_ec;
136  tmp_position[1] = tmp_layer;
137  tmp_position[2] = tmp_modPhi;
138  tmp_position[3] = tmp_module_eta;
139  m_pixelMapping.push_back(std::make_pair(tmp_module_name, tmp_position));
140  }
141 
142  found=true;
143  infile.close();
144  break;
145  }
146  }
147 
148  if (!found) {
149  ATH_MSG_FATAL("Mapping file '" << mapFile << "' not found in DATAPATH !!!");
150  return StatusCode::FAILURE;
151  }
152 
153  // Register event histogram
154  m_nEventsHist = std::make_unique<TH1F>("NEvents", "NEvents;;# events", 1, 0, 1);
155  m_nEventsLBHist = std::make_unique<TH1F>("NEventsLB", "NEventsLB;LB;# events", m_hist_lbMax, -0.5, m_hist_lbMax+0.5);
156 
157  // Regist TDirectory first
158  // HARD CODING, TODO do in a smarter way
159  std::vector<std::pair<int, int>> temp_bec_layer{std::make_pair(2, 3), std::make_pair(-2, 3), std::make_pair(0, 4)};
160  std::vector<std::string> temp_dir{"Occupancy2d", "OccupancyLb", "ToT"};
161  for (auto const& bl : temp_bec_layer) {
162  for (int l=0; l<bl.second; l++) {
163  for (auto const& d: temp_dir) {
164  std::string temp_str = "/histfile/All/" + d + "/" + histoSuffix(bl.first, l) + "/" + d + histoSuffix(bl.first, l);
165  std::unique_ptr<TH1F>temp_h1d = std::make_unique<TH1F>((d+histoSuffix(bl.first, l)).c_str(), (d+histoSuffix(bl.first, l)).c_str(), 1, 0, 1);
166  ATH_CHECK(m_tHistSvc->regHist(temp_str.c_str(), std::move(temp_h1d)));
167  ATH_CHECK(m_tHistSvc->deReg(temp_str));
168  }
169  }
170  }
171 
172  for (InDetDD::SiDetectorElementCollection::const_iterator iter=m_pixman->getDetectorElementBegin(); iter!=m_pixman->getDetectorElementEnd(); ++iter) {
173  const InDetDD::SiDetectorElement* element = *iter;
174  if (!element) continue;
175 
176  Identifier ident = element->identify();
177  if (!m_pixelID->is_pixel(ident)) continue;
178 
179  int bec = m_pixelID->barrel_ec(ident);
181  int modPhi = m_pixelID->phi_module(ident);
182  int modEta = m_pixelID->eta_module(ident);
183  int modHash = m_pixelID->wafer_hash(ident);
185 
186  if (abs(bec) == 4) continue; // Skip DBM
187 
188  int iblFeHash = -99;
189  // Use special fe chip index for IBL
190  // {0..3}: 3D C, C8_2, C8_1, C7_2, C7_1
191  // {4..15}: 2D C, C6_2, C6_1, ..., C1_2, C1_1
192  // {16..27}: 2D A, A1_1, A1_2, ..., A6_1, A6_2
193  // {28..31}: 3D A, A7_1, A7_2, A8_1, A8_2
194  if (bec == 0 && layer == 0) {
195  if (modEta <= -7) iblFeHash = modPhi*32 + (modEta+10); // 3D C
196  else if (-6<=modEta && modEta<=5) iblFeHash = modPhi*32 + ((modEta+6)*2+4); // 2D
197  else iblFeHash = modPhi*32 + (modEta+22); // 3D A
198  // iblFeHash, here, is even
199  }
200 
201  std::string onlineID = getDCSIDFromPosition(bec,layer,modPhi,modEta);
202 
203  std::ostringstream name;
204  std::string axisTitle;
205 
206  // Construct IBL Planar later
207  std::string LBCategory;
208  std::string occ2dDir = "Occupancy2d";
209  std::string occLBDir = "OccupancyLb";
210  std::string totDir = "ToT";
211 
212  // Category: All
213  LBCategory = "All";
214  if (bec == 0 && layer == 0 && -6 <= modEta && modEta <= 5) { // IBL 2D
215  for (unsigned chipId=0; chipId<=1; chipId++) { // FE chips in double module
216  int ibl2dHash;
217  if (chipId) {
218  if (modEta <= -1) ibl2dHash = maxHash + iblFeHash; // C side, '_2'
219  else ibl2dHash = maxHash + iblFeHash + chipId; // A side, '_2'
220  }
221  else {
222  if (modEta <= -1) ibl2dHash = maxHash + iblFeHash + 1; // C side, '_1'
223  else ibl2dHash = maxHash + iblFeHash; // A side, '_1'
224  }
225  std::string histTitle = onlineID + "_" + std::to_string(chipId+1);
226  // Occupancy Map
227  axisTitle = ";pixel_eta;pixel_phi;# hits/pixel/event";
228  m_occupancyMaps[ibl2dHash] = std::make_unique<TH2F>(histTitle.c_str(), (histTitle+axisTitle).c_str(), 80, -0.5, 79.5, 336, -0.5, 335.5);
229  name << "/histfile/" << LBCategory << "/" << occ2dDir << "/" << histoSuffix(bec,layer) << "/" << onlineID << "_" << chipId+1;
230  name.str(""); name.clear();
231  m_occupancyMaps[ibl2dHash]->SetOption("colz");
232 
233  // Occupancy vs. LB
234  axisTitle = ";LB;# hits/pixel/event";
235  m_occupancyLB[ibl2dHash] = std::make_unique<TH1F>(histTitle.c_str(), (histTitle+axisTitle).c_str(), m_hist_lbMax, -0.5, m_hist_lbMax-0.5);
236  name << "/histfile/" << LBCategory << "/" << occLBDir << "/" << histoSuffix(bec,layer) << "/" << onlineID << "_" << chipId+1;
237  name.str(""); name.clear();
238 
239  // ToT
240  axisTitle = ";ToT;# hits";
241  m_TOTdistributions[ibl2dHash] = std::make_unique<TH1F>(histTitle.c_str(), (histTitle+axisTitle).c_str(), 19, -0.5, 18.5);
242  name << "/histfile/" << LBCategory << "/" << totDir << "/" << histoSuffix(bec,layer) << "/" << onlineID << "_" << chipId+1;
243  name.str(""); name.clear();
244  }
245  }
246  else { // None IBL 2D
247  // Occupancy Map
248  axisTitle = ";pixel_eta;pixel_phi;# hits/pixel/event";
249  if (bec == 0 && layer == 0) {
250  m_occupancyMaps[modHash] = std::make_unique<TH2F>(onlineID.c_str(), (onlineID+axisTitle).c_str(), 80, -0.5, 79.5, 336, -0.5, 335.5); // IBL 3D
251  }
252  else {
253  m_occupancyMaps[modHash] = std::make_unique<TH2F>(onlineID.c_str(), (onlineID+axisTitle).c_str(), 144, -0.5, 143.5, 328, -0.5, 327.5);
254  }
255  name << "/histfile/" << LBCategory << "/" << occ2dDir << "/" << histoSuffix(bec,layer) << "/" << onlineID;
256  name.str(""); name.clear();
257  m_occupancyMaps[modHash].get()->SetOption("colz");
258 
259  // Occupancy vs. LB
260  axisTitle = ";LB;# hits/pixel/event";
261  m_occupancyLB[modHash] = std::make_unique<TH1F>(onlineID.c_str(), (onlineID+axisTitle).c_str(), m_hist_lbMax, -0.5, m_hist_lbMax-0.5);
262  name << "/histfile/" << LBCategory << "/" << occLBDir << "/" << histoSuffix(bec,layer) << "/" << onlineID;
263  name.str(""); name.clear();
264 
265  // ToT
266  axisTitle = ";ToT;# hits";
267  if (bec == 0 && layer == 0) {
268  m_TOTdistributions[modHash] = std::make_unique<TH1F>(onlineID.c_str(), (onlineID+axisTitle).c_str(), 19, -0.5, 18.5); // IBL 3D
269  }
270  else {
271  m_TOTdistributions[modHash] = std::make_unique<TH1F>(onlineID.c_str(), (onlineID+axisTitle).c_str(), 256, -0.5, 255.5);
272  }
273  name << "/histfile/" << LBCategory << "/" << totDir << "/" << histoSuffix(bec,layer) << "/" << onlineID;
274  name.str(""); name.clear();
275  } // End of if ibl 2d
276 
277  // Category: LB1-100, 101-200, ...
278  if (0 <= iblFeHash) { // IBL
279  for (int i=0; i<m_perLB_n; i++) {
280  LBCategory = "LB" + std::to_string(m_perLB_min+m_perLB_step*i+1) + "-" + std::to_string(m_perLB_min+m_perLB_step*(i+1));
281  if (-6 <= modEta && modEta <= 5) { // IBL 2D
282  for (int chipId=0; chipId<=1; chipId++) { // FE chips in double module
283  int ibl2dHash;
284  if (chipId) {
285  if (modEta <= -1) ibl2dHash = m_nIblFes*i + iblFeHash; // C side, '_2'
286  else ibl2dHash = m_nIblFes*i + iblFeHash + chipId; // A side, '_2'
287  }
288  else {
289  if (modEta <= -1) ibl2dHash = m_nIblFes*i + iblFeHash + 1; // C side, '_1'
290  else ibl2dHash = m_nIblFes*i + iblFeHash; // A side, '_1'
291  }
292  std::string histTitle = onlineID + "_" + std::to_string(chipId+1);
293  // Occupancy Map
294  axisTitle = ";pixel_eta;pixel_phi;# hits/pixel/event";
295  m_occupancyMapsIBL2dLB[ibl2dHash] = std::make_unique<TH2F>(histTitle.c_str(), (histTitle+axisTitle).c_str(), 80, -0.5, 79.5, 336, -0.5, 335.5);
296  name << "/histfile/" << LBCategory << "/" << occ2dDir << "/" << histoSuffix(bec,layer) << "/" << histTitle;
297  name.str(""); name.clear();
298  m_occupancyMapsIBL2dLB[ibl2dHash]->SetOption("colz");
299 
300  // ToT
301  axisTitle = ";ToT;# hits";
302  m_TOTdistributionsIBL2dLB[ibl2dHash] = std::make_unique<TH1F>(histTitle.c_str(), (histTitle+axisTitle).c_str(), 19, -0.5, 18.5);
303  name << "/histfile/" << LBCategory << "/" << totDir << "/" << histoSuffix(bec,layer) << "/" << histTitle;
304  name.str(""); name.clear();
305  }
306  }
307  else { // IBL 3D
308  int ibl2dHash = m_nIblFes*i + iblFeHash;
309  // Occupancy Map
310  axisTitle = ";pixel_eta;pixel_phi;# hits/pixel/event";
311  m_occupancyMapsIBL2dLB[ibl2dHash] = std::make_unique<TH2F>(onlineID.c_str(), (onlineID+axisTitle).c_str(), 80, -0.5, 79.5, 336, -0.5, 335.5);
312  name << "/histfile/" << LBCategory << "/" << occ2dDir << "/" << histoSuffix(bec,layer) << "/" << onlineID;
313  name.str(""); name.clear();
314  m_occupancyMapsIBL2dLB[ibl2dHash]->SetOption("colz");
315 
316  // ToT
317  axisTitle = ";ToT;# hits";
318  m_TOTdistributionsIBL2dLB[ibl2dHash] = std::make_unique<TH1F>(onlineID.c_str(), (onlineID+axisTitle).c_str(), 19, -0.5, 18.5);
319  name << "/histfile/" << LBCategory << "/" << totDir << "/" << histoSuffix(bec,layer) << "/" << onlineID;
320  name.str(""); name.clear();
321  } // End of if ibl 2d
322  } // End of loop of category: LB
323  } // End of if IBL
324  } // end loop in detector elements
325 
326  return StatusCode::SUCCESS;
327 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ splitter() [1/2]

std::vector< std::string > HitMapBuilder::splitter ( const std::string &  str,
char  delim 
)
private

Definition at line 68 of file HitMapBuilder.cxx.

68  {
69  std::vector<std::string> elems;
70  splitter(str, delim, elems);
71  return elems;
72 }

◆ splitter() [2/2]

std::vector< std::string > & HitMapBuilder::splitter ( const std::string &  str,
char  delim,
std::vector< std::string > &  elems 
)
private

Definition at line 59 of file HitMapBuilder.cxx.

59  {
60  std::stringstream ss(str);
61  std::string item;
62  while (std::getline(ss, item, delim)) {
63  elems.push_back(item);
64  }
65  return elems;
66 }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evt_lbMax

Gaudi::Property<int> HitMapBuilder::m_evt_lbMax {this,"LBMax",-1,"Last lumi block to consider"}
private

Definition at line 90 of file HitMapBuilder.h.

◆ m_evt_lbMin

Gaudi::Property<int> HitMapBuilder::m_evt_lbMin {this,"LBMin",0,"First lumi block to consider"}
private

Definition at line 89 of file HitMapBuilder.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_fei4bPixels

const int HitMapBuilder::m_fei4bPixels = 26880
private

Definition at line 98 of file HitMapBuilder.h.

◆ m_hist_lbMax

Gaudi::Property<int> HitMapBuilder::m_hist_lbMax {this,"nLBmax", 3001, "Maximum number of LB (for histograms binning)"}
private

Definition at line 88 of file HitMapBuilder.h.

◆ m_LBrange_max

int HitMapBuilder::m_LBrange_max = -9999
private

Definition at line 92 of file HitMapBuilder.h.

◆ m_nEvents

double HitMapBuilder::m_nEvents =0
private

Definition at line 76 of file HitMapBuilder.h.

◆ m_nEventsHist

std::unique_ptr<TH1F> HitMapBuilder::m_nEventsHist
private

Definition at line 80 of file HitMapBuilder.h.

◆ m_nEventsLB

std::vector<double> HitMapBuilder::m_nEventsLB
private

Definition at line 77 of file HitMapBuilder.h.

◆ m_nEventsLBCategory

std::vector<double> HitMapBuilder::m_nEventsLBCategory
private

Definition at line 78 of file HitMapBuilder.h.

◆ m_nEventsLBHist

std::unique_ptr<TH1F> HitMapBuilder::m_nEventsLBHist
private

Definition at line 81 of file HitMapBuilder.h.

◆ m_nIblFes

const unsigned int HitMapBuilder::m_nIblFes = 14 * (4 + 6*2) * 2
private

Definition at line 94 of file HitMapBuilder.h.

◆ m_occupancyLB

std::vector<std::unique_ptr<TH1F> > HitMapBuilder::m_occupancyLB
private

Definition at line 86 of file HitMapBuilder.h.

◆ m_occupancyMaps

std::vector<std::unique_ptr<TH2F> > HitMapBuilder::m_occupancyMaps
private

Definition at line 82 of file HitMapBuilder.h.

◆ m_occupancyMapsIBL2dLB

std::vector<std::unique_ptr<TH2F> > HitMapBuilder::m_occupancyMapsIBL2dLB
private

Definition at line 83 of file HitMapBuilder.h.

◆ m_perLB_max

const int HitMapBuilder::m_perLB_max =3000
private

Definition at line 95 of file HitMapBuilder.h.

◆ m_perLB_min

const int HitMapBuilder::m_perLB_min =0
private

Definition at line 95 of file HitMapBuilder.h.

◆ m_perLB_n

const int HitMapBuilder::m_perLB_n = (m_perLB_max-m_perLB_min)/m_perLB_step
private

Definition at line 96 of file HitMapBuilder.h.

◆ m_perLB_step

const int HitMapBuilder::m_perLB_step =100
private

Definition at line 95 of file HitMapBuilder.h.

◆ m_pixelID

const PixelID* HitMapBuilder::m_pixelID =nullptr
private

Definition at line 71 of file HitMapBuilder.h.

◆ m_pixelMapping

std::vector< std::pair< std::string, std::vector<int> > > HitMapBuilder::m_pixelMapping
private

Definition at line 74 of file HitMapBuilder.h.

◆ m_pixelRDOKey

SG::ReadHandleKey<PixelRDO_Container> HitMapBuilder::m_pixelRDOKey {this,"PixelRDOKey","PixelRDOs","StoreGate Key of Pixel RDOs"}
private

Definition at line 68 of file HitMapBuilder.h.

◆ m_pixman

const InDetDD::PixelDetectorManager* HitMapBuilder::m_pixman =nullptr
private

Definition at line 70 of file HitMapBuilder.h.

◆ m_pixModPixels

const int HitMapBuilder::m_pixModPixels = 46080
private

Definition at line 99 of file HitMapBuilder.h.

◆ m_tHistSvc

ServiceHandle<ITHistSvc> HitMapBuilder::m_tHistSvc {this, "THistSvc", "THistSvc/THistSvc"}
private

Definition at line 67 of file HitMapBuilder.h.

◆ m_TOTdistributions

std::vector<std::unique_ptr<TH1F> > HitMapBuilder::m_TOTdistributions
private

Definition at line 84 of file HitMapBuilder.h.

◆ m_TOTdistributionsIBL2dLB

std::vector<std::unique_ptr<TH1F> > HitMapBuilder::m_TOTdistributionsIBL2dLB
private

Definition at line 85 of file HitMapBuilder.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
HitMapBuilder::splitter
std::vector< std::string > & splitter(const std::string &str, char delim, std::vector< std::string > &elems)
Definition: HitMapBuilder.cxx:59
AtlasDetectorID::is_pixel
bool is_pixel(Identifier id) const
Definition: AtlasDetectorID.h:760
HitMapBuilder::m_nEventsLBCategory
std::vector< double > m_nEventsLBCategory
Definition: HitMapBuilder.h:78
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
HitMapBuilder::m_nEventsLBHist
std::unique_ptr< TH1F > m_nEventsLBHist
Definition: HitMapBuilder.h:81
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
HitMapBuilder::m_pixelID
const PixelID * m_pixelID
Definition: HitMapBuilder.h:71
PixelID::phi_index
int phi_index(const Identifier &id) const
Definition: PixelID.h:658
HitMapBuilder::m_tHistSvc
ServiceHandle< ITHistSvc > m_tHistSvc
Definition: HitMapBuilder.h:67
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
HitMapBuilder::m_evt_lbMin
Gaudi::Property< int > m_evt_lbMin
Definition: HitMapBuilder.h:89
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
run.infile
string infile
Definition: run.py:13
CaloCellTimeCorrFiller.LB
LB
Definition: CaloCellTimeCorrFiller.py:37
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
HitMapBuilder::m_perLB_min
const int m_perLB_min
Definition: HitMapBuilder.h:95
HitMapBuilder::histoSuffix
const std::string histoSuffix(const int bec, const int layer)
Definition: HitMapBuilder.cxx:43
ParticleGun_SamplingFraction.bec
int bec
Definition: ParticleGun_SamplingFraction.py:89
PixelID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: PixelID.h:619
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
hist_file_dump.d
d
Definition: hist_file_dump.py:137
HitMapBuilder::m_TOTdistributionsIBL2dLB
std::vector< std::unique_ptr< TH1F > > m_TOTdistributionsIBL2dLB
Definition: HitMapBuilder.h:85
HitMapBuilder::registerHistograms
StatusCode registerHistograms()
Definition: HitMapBuilder.cxx:121
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
HitMapBuilder::m_pixModPixels
const int m_pixModPixels
Definition: HitMapBuilder.h:99
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
x
#define x
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
PyPoolBrowser.item
item
Definition: PyPoolBrowser.py:129
HitMapBuilder::m_occupancyMapsIBL2dLB
std::vector< std::unique_ptr< TH2F > > m_occupancyMapsIBL2dLB
Definition: HitMapBuilder.h:83
HitMapBuilder::m_occupancyMaps
std::vector< std::unique_ptr< TH2F > > m_occupancyMaps
Definition: HitMapBuilder.h:82
PixelID::wafer_hash
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition: PixelID.h:387
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
python.BunchSpacingUtils.lb
lb
Definition: BunchSpacingUtils.py:88
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
lumiFormat.i
int i
Definition: lumiFormat.py:92
HitMapBuilder::m_pixelMapping
std::vector< std::pair< std::string, std::vector< int > > > m_pixelMapping
Definition: HitMapBuilder.h:74
HitMapBuilder::m_TOTdistributions
std::vector< std::unique_ptr< TH1F > > m_TOTdistributions
Definition: HitMapBuilder.h:84
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
HitMapBuilder::m_perLB_step
const int m_perLB_step
Definition: HitMapBuilder.h:95
HitMapBuilder::m_nIblFes
const unsigned int m_nIblFes
Definition: HitMapBuilder.h:94
PixelID::eta_index
int eta_index(const Identifier &id) const
Definition: PixelID.h:664
InDetDD::PixelDetectorManager::getDetectorElementBegin
virtual SiDetectorElementCollection::const_iterator getDetectorElementBegin() const override
Definition: PixelDetectorManager.cxx:110
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
HitMapBuilder::m_nEvents
double m_nEvents
Definition: HitMapBuilder.h:76
HitMapBuilder::m_pixelRDOKey
SG::ReadHandleKey< PixelRDO_Container > m_pixelRDOKey
Definition: HitMapBuilder.h:68
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
HitMapBuilder::m_nEventsLB
std::vector< double > m_nEventsLB
Definition: HitMapBuilder.h:77
PixelID::layer_disk
int layer_disk(const Identifier &id) const
Definition: PixelID.h:626
HitMapBuilder::m_LBrange_max
int m_LBrange_max
Definition: HitMapBuilder.h:92
PixelID::eta_module
int eta_module(const Identifier &id) const
Definition: PixelID.h:651
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
HitMapBuilder::m_nEventsHist
std::unique_ptr< TH1F > m_nEventsHist
Definition: HitMapBuilder.h:80
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
PixelID::wafer_hash_max
size_type wafer_hash_max(void) const
Definition: PixelID.cxx:912
item
Definition: ItemListSvc.h:43
TRT::Hit::ident
@ ident
Definition: HitInfo.h:77
HitMapBuilder::m_perLB_n
const int m_perLB_n
Definition: HitMapBuilder.h:96
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
HitMapBuilder::m_hist_lbMax
Gaudi::Property< int > m_hist_lbMax
Definition: HitMapBuilder.h:88
a
TList * a
Definition: liststreamerinfos.cxx:10
SCT_ConditionsAlgorithms::CoveritySafe::getenv
std::string getenv(const std::string &variableName)
get an environment variable
Definition: SCT_ConditionsUtilities.cxx:17
h
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
HitMapBuilder::m_occupancyLB
std::vector< std::unique_ptr< TH1F > > m_occupancyLB
Definition: HitMapBuilder.h:86
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
entries
double entries
Definition: listroot.cxx:49
HitMapBuilder::m_fei4bPixels
const int m_fei4bPixels
Definition: HitMapBuilder.h:98
Identifier::size_type
IDENTIFIER_TYPE size_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:41
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
InDetDD::PixelDetectorManager::getDetectorElementEnd
virtual SiDetectorElementCollection::const_iterator getDetectorElementEnd() const override
Definition: PixelDetectorManager.cxx:115
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
IdentifierHash
Definition: IdentifierHash.h:38
PixelID::phi_module
int phi_module(const Identifier &id) const
Definition: PixelID.h:644
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
InDetDD::SolidStateDetectorElementBase::identify
virtual Identifier identify() const override final
identifier of this detector element (inline)
HitMapBuilder::getDCSIDFromPosition
std::string getDCSIDFromPosition(int bec, int layer, int modPhi, int modEta)
Definition: HitMapBuilder.cxx:27
HitMapBuilder::m_evt_lbMax
Gaudi::Property< int > m_evt_lbMax
Definition: HitMapBuilder.h:90
fitman.k
k
Definition: fitman.py:528
test_athena_ntuple_dumper.paths
paths
Definition: test_athena_ntuple_dumper.py:7
HitMapBuilder::m_pixman
const InDetDD::PixelDetectorManager * m_pixman
Definition: HitMapBuilder.h:70
ServiceHandle< ICondSvc >