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

Conditions algorithms for emulating ITK pixel defects. More...

#include <PixelDefectsEmulatorCondAlg.h>

Inheritance diagram for InDet::PixelDefectsEmulatorCondAlg:
Collaboration diagram for InDet::PixelDefectsEmulatorCondAlg:

Public Member Functions

 PixelDefectsEmulatorCondAlg (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~PixelDefectsEmulatorCondAlg () override=default
 
virtual StatusCode initialize () override final
 
virtual StatusCode execute (const EventContext &ctx) const override final
 
virtual StatusCode finalize () override final
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
virtual bool filterPassed (const EventContext &ctx) const
 
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

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

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode initializeProbabilities ()
 
TH2 * findHist (unsigned int n_rows, unsigned int n_cols) const
 
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< IAthRNGSvcm_rndmSvc {this, "RndmSvc", "AthRNGSvc", ""}
 
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollectionm_pixelDetEleCollKey {this, "PixelDetEleCollKey", "ITkPixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"}
 
Gaudi::Property< float > m_pixelDefectProbability {this,"DefectProbability", 1e-4}
 
Gaudi::Property< std::vector< unsigned int > > m_matrixColumns {this, "MatrixColumns", {} , "Associated defintion is for a matrix with this number of sensor columns."}
 
Gaudi::Property< std::vector< float > > m_probabilityModuleHasCoreColumnDefects {this, "ProbabilityOfModuleWithCoreColumnDefects", {}, "Probability of a module to have core column defects." }
 
Gaudi::Property< std::vector< float > > m_pixelColGroupdDefectProbability
 
std::vector< unsigned int > m_matrixTypeNColumns
 
std::vector< std::vector< float > > m_perMatrixTypeFractions
 
SG::WriteCondHandleKey< InDet::PixelEmulatedDefectsm_writeKey {this, "WriteKey", "", "Key of output PixelDefectsEmulator data"}
 
Gaudi::Property< bool > m_oddRowToggle {this, "OddRowToggle", false}
 
Gaudi::Property< bool > m_oddColToggle {this, "OddColToggle", false}
 
Gaudi::Property< bool > m_checkerBoardToggle {this, "CheckerBoardDefects", false}
 
Gaudi::Property< unsigned int > m_maxAttempts {this, "MaxRandomPositionAttempts", 10}
 
ServiceHandle< ITHistSvc > m_histSvc {this,"HistSvc","THistSvc"}
 
Gaudi::Property< std::string > m_histogramGroupName {this,"HistogramGroupName","", "Histogram group name or empty to disable histogramming"}
 
const PixelIDm_idHelper = nullptr
 
std::string m_rngName
 
std::mutex m_histMutex
 
std::vector< unsigned int > m_dimPerHist ATLAS_THREAD_SAFE
 
std::vector< TH2 * > m_hist ATLAS_THREAD_SAFE
 
std::vector< TH1 * > m_histNCoreColumnDefects ATLAS_THREAD_SAFE
 
TH2 *m_moduleDefectsHist ATLAS_THREAD_SAFE = nullptr
 
TH2 *m_moduleCoreColDefectsHist ATLAS_THREAD_SAFE = nullptr
 
TH2 *m_matrixHist ATLAS_THREAD_SAFE = nullptr
 
std::atomic< unsigned int > m_modulesWithoutDefectParameters {}
 
bool m_histogrammingEnabled = false
 
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Conditions algorithms for emulating ITK pixel defects.

The algorithm mask random pixels and core columns (group of 8 consecutive columns of a chip) as defect. This data can be used to reject hits associated to these pixels or core columns.

Definition at line 29 of file PixelDefectsEmulatorCondAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ PixelDefectsEmulatorCondAlg()

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

Definition at line 55 of file PixelDefectsEmulatorCondAlg.cxx.

55  :
56  AthReentrantAlgorithm(name, pSvcLocator),
57  m_idHelper(nullptr) {}

◆ ~PixelDefectsEmulatorCondAlg()

virtual InDet::PixelDefectsEmulatorCondAlg::~PixelDefectsEmulatorCondAlg ( )
overridevirtualdefault

Member Function Documentation

◆ cardinality()

unsigned int AthReentrantAlgorithm::cardinality ( ) const
overridevirtualinherited

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

Override this to return 0 for reentrant algorithms.

Override this to return 0 for reentrant algorithms.

Definition at line 55 of file AthReentrantAlgorithm.cxx.

56 {
57  return 0;
58 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [4/4]

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

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

Definition at line 199 of file AthCommonDataStore.h.

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

◆ declareProperty() [1/6]

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

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode InDet::PixelDefectsEmulatorCondAlg::execute ( const EventContext &  ctx) const
finaloverridevirtual

Definition at line 125 of file PixelDefectsEmulatorCondAlg.cxx.

125  {
127  if (defectsOut.isValid()) {
128  return StatusCode::SUCCESS;
129  }
131 
132  defectsOut.addDependency(pixelDetEleColl);
133 
134  std::size_t n_pixel=0u;
135  std::size_t n_column_groups=0u;
136  std::size_t n_error=0u;
137  unsigned int max_n_defects=0u;
138  unsigned int max_n_col_group_defects=0u;
139  unsigned int no_unique_position=0u;
140  std::size_t retries_column_group_defect=0u;
141  std::size_t retries_pixel_defect=0u;
142  std::size_t n_col_group_defects_total=0u;
143  std::unique_ptr<InDet::PixelEmulatedDefects> defects = std::make_unique<InDet::PixelEmulatedDefects>();
144  defects->m_detectorElements=pixelDetEleColl.cptr();
145  defects->resize( pixelDetEleColl.cptr()->size());
146  unsigned int n_defects_total=0;
147  unsigned int n_attempts_max=m_maxAttempts.value();
148  unsigned int no_column_group_defects_for_matrix_type=0u;
149  std::array<unsigned short, 8> no_column_group_defects_n_columns{};
150  {
151  ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this, m_rngName);
152  rngWrapper->setSeed( m_rngName, ctx );
153  CLHEP::HepRandomEngine *rndmEngine = rngWrapper->getEngine(ctx);
154  unsigned int module_i=0;
155  --module_i;
156 
157  for (const InDetDD::SiDetectorElement *det_ele: *(pixelDetEleColl.cptr())) {
158  ++module_i;
159  PixelModuleHelper helper(det_ele->design());
160 
161  if (!helper) {
162  ++n_error;
163  continue;
164  }
165  unsigned int pixels = helper.nPixels();
166  n_pixel += pixels;
167 
168  // bad to lock for the entire loop, but this algorithm is intended to run
169  // only once per job anyway
170  MyLockGuard lock(m_histMutex, m_histogrammingEnabled);
171  TH2 *h2=findHist(helper.nSensorRows(), helper.nSensorColumns());
172 
173  std::vector<unsigned int>::const_iterator
174  matrix_type_iter = std::lower_bound(m_matrixTypeNColumns.begin(),m_matrixTypeNColumns.end(),
175  helper.nSensorColumns() );
176  if (matrix_type_iter == m_matrixTypeNColumns.end() || *matrix_type_iter != helper.nSensorColumns()) {
177  // if there are no defect parameters for this module type, issue warning but remember for which
178  // module type this warning has been already issued to issue the warning only once.
179  unsigned int n_types=std::min(static_cast<unsigned int>(no_column_group_defects_n_columns.size()), no_column_group_defects_for_matrix_type);
180  if (n_types < no_column_group_defects_n_columns.size()) {
181  auto no_column_group_defects_n_columns_iter
182  = std::find(no_column_group_defects_n_columns.begin(),no_column_group_defects_n_columns.begin()+n_types, helper.nSensorColumns());
183  if (no_column_group_defects_n_columns_iter == no_column_group_defects_n_columns.begin()+n_types) {
184  no_column_group_defects_n_columns.at(n_types)=helper.nSensorColumns();
185  ATH_MSG_WARNING("No defect parameters for pixel matrices with " << helper.nSensorColumns() << " columns and "
186  << helper.nSensorRows() << " rows.");
187  ++n_types;
188  if (n_types>=no_column_group_defects_n_columns.size()) {
189  ATH_MSG_INFO("Too many matrices miss defect parameters. No further such warnings.");
190  }
191  }
192  }
193  ++no_column_group_defects_for_matrix_type;
194  continue;
195  }
196  unsigned int matrix_type_idx = static_cast<unsigned int>(matrix_type_iter - m_matrixTypeNColumns.begin());
197  float prob = CLHEP::RandFlat::shoot(rndmEngine,1.);
198  unsigned int n_col_group_defects_idx=m_perMatrixTypeFractions.at(matrix_type_idx).size();
199  for (; n_col_group_defects_idx>0 && prob <= m_perMatrixTypeFractions.at(matrix_type_idx)[n_col_group_defects_idx-1]; --n_col_group_defects_idx);
201  m_histNCoreColumnDefects.at(matrix_type_idx)->Fill(n_col_group_defects_idx>=m_perMatrixTypeFractions.at(matrix_type_idx).size()
202  ? 0
203  : n_col_group_defects_idx + 1 );
204  }
205  std::vector<unsigned int> &module_defects=(*defects).at(module_i);
206 
207  unsigned int n_col_group_defects = n_col_group_defects_idx<m_perMatrixTypeFractions.at(matrix_type_idx).size()
208  ? n_col_group_defects_idx + 1
209  :0; // n_col_group_defects_idx == 1 core column defect
210  unsigned int n_defects=static_cast<unsigned int>(std::max(0,static_cast<int>(CLHEP::RandPoisson::shoot(rndmEngine,
211  pixels * m_pixelDefectProbability.value()))));
212  max_n_defects = std::max(max_n_defects,n_defects);
213  module_defects.reserve(n_defects + n_col_group_defects);
214 
215  if (n_col_group_defects>0) {
216  // module with core column defects;
217 
218  n_col_group_defects_total += n_col_group_defects;
219  max_n_col_group_defects = std::max(max_n_col_group_defects, n_col_group_defects);
220 
221 
222  for (unsigned int defect_i=0; defect_i < n_col_group_defects; ++defect_i) {
223  unsigned int attempt_i=0;
224  for (attempt_i=0; attempt_i<n_attempts_max; ++attempt_i) {
225  unsigned int pixel_idx=CLHEP::RandFlat::shoot(rndmEngine,pixels); // %pixels;
226 
227  // accumulate defects on checker board
228  if (m_checkerBoardToggle) {
229  pixel_idx=makeCheckerboard(pixel_idx,helper.nSensorRows(), helper.nSensorColumns(), m_oddRowToggle.value(), m_oddColToggle.value() );
230  }
231 
232  unsigned int key = helper.columnGroupDefect(pixel_idx / helper.nSensorColumns(), pixel_idx % helper.nSensorColumns());
233  auto [insert_iter,end_iter] = PixelEmulatedDefects::lower_bound( module_defects, key);
234  if (insert_iter == end_iter) {
235  module_defects.push_back(key);
236  if (h2) {
237  std::array<unsigned int,4> ranges_row_col = helper.offlineRange(key);
238  for (unsigned int row_i=ranges_row_col[0]; row_i<ranges_row_col[1]; ++row_i) {
239  for (unsigned int col_i=ranges_row_col[2]; col_i<ranges_row_col[3]; ++col_i) {
240  h2->Fill(col_i, row_i);
241  }
242  }
243  }
244  break;
245  }
246  else {
247  if (!helper.isSameDefectWithGroups(*insert_iter, key,helper.columnGroupRowColumnMask())) {
248  module_defects.insert( insert_iter, key);
249  if (h2) {
250  std::array<unsigned int,4> ranges_row_col = helper.offlineRange(key);
251  for (unsigned int row_i=ranges_row_col[0]; row_i<ranges_row_col[1]; ++row_i) {
252  for (unsigned int col_i=ranges_row_col[2]; col_i<ranges_row_col[3]; ++col_i) {
253  h2->Fill(col_i, row_i);
254  }
255  }
256  }
257  break;
258  }
259  }
260  ++retries_column_group_defect;
261  }
262  no_unique_position += attempt_i >= n_attempts_max;
263  }
264  }
265  unsigned int n_col_group_defects_registered=module_defects.size();
266 
267  for (unsigned int defect_i=0; defect_i < n_defects; ++defect_i) {
268  unsigned int attempt_i=0;
269  for (attempt_i=0; attempt_i<n_attempts_max; ++attempt_i) {
270  unsigned int pixel_idx=CLHEP::RandFlat::shoot(rndmEngine,pixels); // %pixels;
271 
272  // accumulate defects on checker board
273  if (m_checkerBoardToggle) {
274  pixel_idx=makeCheckerboard(pixel_idx,helper.nSensorRows(), helper.nSensorColumns(), m_oddRowToggle.value(), m_oddColToggle.value());
275  }
276 
277  unsigned int key = helper.hardwareCoordinates(pixel_idx / helper.nSensorColumns(), pixel_idx % helper.nSensorColumns());
278  // order keys in descending order
279  // such that lower_bound with greater will return the matching element or the element before
280  auto [insert_iter,end_iter] = PixelEmulatedDefects::lower_bound( module_defects, key);
281  if (insert_iter != end_iter && !helper.isColumnGroupDefect(*insert_iter) && *insert_iter==key) {
282  // duplicate
283  ++retries_pixel_defect;
284  continue;
285  }
286  if (insert_iter == end_iter) {
287  module_defects.push_back(key);
288  if (h2) {
289  std::array<unsigned int,4> ranges_row_col = helper.offlineRange(key);
290  for (unsigned int row_i=ranges_row_col[0]; row_i<ranges_row_col[1]; ++row_i) {
291  for (unsigned int col_i=ranges_row_col[2]; col_i<ranges_row_col[3]; ++col_i) {
292  h2->Fill(col_i, row_i);
293  }
294  }
295  }
296  }
297  else if (!helper.isSameDefectWithGroups(*insert_iter, key,helper.columnGroupRowColumnMask())) {
298  module_defects.insert( insert_iter, key);
299  if (h2) {
300  std::array<unsigned int,4> ranges_row_col = helper.offlineRange(key);
301  for (unsigned int row_i=ranges_row_col[0]; row_i<ranges_row_col[1]; ++row_i) {
302  for (unsigned int col_i=ranges_row_col[2]; col_i<ranges_row_col[3]; ++col_i) {
303  h2->Fill(col_i, row_i);
304  }
305  }
306  }
307  }
308  break;
309  }
310  no_unique_position += attempt_i >= n_attempts_max;
311  }
313  // all the following histograms are expected to have the same binning
314  // i.e. one bin per ID hash organised in a matrix
315  unsigned int ids_per_col = static_cast<unsigned int>(m_moduleDefectsHist->GetNbinsX());
316  unsigned int bin_i=m_moduleDefectsHist->GetBin( module_i%ids_per_col+1, module_i/ids_per_col+1);
317  m_moduleDefectsHist->SetBinContent(bin_i, module_defects.size()-n_col_group_defects_registered );
318  m_moduleCoreColDefectsHist->SetBinContent(bin_i, n_col_group_defects_registered );
319  // get the matrix "ID"
320  for (unsigned int hist_i=0; hist_i < m_hist.size(); ++hist_i) {
321  if (m_hist[hist_i]==h2) {
322  m_matrixHist->SetBinContent(bin_i, hist_i+1);
323  break;
324  }
325  }
326  }
327  n_defects_total+=module_defects.size();
328  }
329  }
330  m_modulesWithoutDefectParameters += no_column_group_defects_for_matrix_type;
331 
332  ATH_CHECK( defectsOut.record (std::move(defects)) );
333 
334  ATH_MSG_INFO("Total pixel " << n_pixel << " non-pixel modules " << n_error << " defects " << n_defects_total << " max /mod " << max_n_defects
335  << " core columns total " << n_column_groups << " core column defects " << n_col_group_defects_total << " max. / mod " << max_n_col_group_defects);
336  if (retries_pixel_defect+retries_column_group_defect+no_unique_position>0) {
337  ATH_MSG_INFO("Retried to create unique defects : for pixel defects " << retries_pixel_defect << ", for column group defects " << retries_column_group_defect
338  << ", insufficient number of retries " << no_unique_position);
339  }
340 
341  return StatusCode::SUCCESS;
342  }

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ extraOutputDeps()

const DataObjIDColl & AthReentrantAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 79 of file AthReentrantAlgorithm.cxx.

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

◆ filterPassed()

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

Definition at line 135 of file AthReentrantAlgorithm.h.

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

◆ finalize()

StatusCode InDet::PixelDefectsEmulatorCondAlg::finalize ( )
finaloverridevirtual

Definition at line 118 of file PixelDefectsEmulatorCondAlg.cxx.

118  {
120  ATH_MSG_WARNING("No defect parameters for " << m_modulesWithoutDefectParameters << " modules.");
121  }
122  return StatusCode::SUCCESS;
123  }

◆ findHist()

TH2 * InDet::PixelDefectsEmulatorCondAlg::findHist ( unsigned int  n_rows,
unsigned int  n_cols 
) const
private

Definition at line 344 of file PixelDefectsEmulatorCondAlg.cxx.

344  {
345  unsigned int key=(n_rows << 16) | n_cols;
346  std::vector<unsigned int>::const_iterator iter = std::find(m_dimPerHist.begin(),m_dimPerHist.end(), key );
347  if (iter == m_dimPerHist.end()) {
348  if (m_dimPerHist.size() == m_dimPerHist.capacity()) {
349  if (m_dimPerHist.capacity()==0) {
350  return nullptr;
351  }
352  return m_hist.back();
353  }
354  else {
355  std::stringstream name;
356  name << "defects_" << (m_hist.size()+1) << "_" << n_rows << "_" << n_cols;
357  std::stringstream title;
358  title << "Defects for " << n_rows << "(rows) #times " << n_cols << " (columns) ID " << (m_hist.size()+1);
359  m_hist.push_back(new TH2F(name.str().c_str(), title.str().c_str(),
360  n_cols, -0.5, n_cols-0.5,
361  n_rows, -0.5, n_rows-0.5
362  ));
363  m_hist.back()->GetXaxis()->SetTitle("offline column");
364  m_hist.back()->GetYaxis()->SetTitle("offline row");
365  if ( m_histSvc->regHist(m_histogramGroupName.value() + name.str(),m_hist.back()).isFailure() ) {
366  throw std::runtime_error("Failed to register histogram.");
367  }
368  m_dimPerHist.push_back(key);
369  return m_hist.back();
370  }
371  }
372  else {
373  return m_hist.at(iter-m_dimPerHist.begin());
374  }
375  }

◆ initialize()

StatusCode InDet::PixelDefectsEmulatorCondAlg::initialize ( )
finaloverridevirtual

Definition at line 59 of file PixelDefectsEmulatorCondAlg.cxx.

59  {
60  ATH_CHECK(m_rndmSvc.retrieve());
63  ATH_CHECK(detStore()->retrieve(m_idHelper,"PixelID"));
64  m_rngName = name()+"RandomEngine";
66 
67  if (!m_histSvc.name().empty() && !m_histogramGroupName.value().empty()) {
68  ATH_CHECK(m_histSvc.retrieve());
70  // allow histogramming for at most 6 different pixel module types
71  // histgram for additional module types will end up in the last histogram
72  constexpr unsigned int n_different_pixel_matrices_max=6;
73  m_dimPerHist.reserve(n_different_pixel_matrices_max);
74  m_hist.reserve(n_different_pixel_matrices_max);
75  std::array<TH2 *,3> hists {};
76  std::array<std::string,3> hist_name {"defects_per_module",
77  "corecolumn_defects_per_module",
78  "matrix_type_id_per_module"};
79  std::array<std::string,3> hist_title{"Defects per module",
80  "Core column defects per module",
81  "Matrix type id per module"};
82  for (unsigned int hist_i=0; hist_i<hists.size(); ++hist_i) {
83  // support idHashes from 0 to 10k
84  hists.at(hist_i) = new TH2F(hist_name.at(hist_i).c_str(), hist_title.at(hist_i).c_str(),
85  100, -0.5, 100-0.5,
86  100, -0.5, 100-0.5
87  );
88  hists[hist_i]->GetXaxis()->SetTitle("ID hash % 100");
89  hists[hist_i]->GetYaxis()->SetTitle("ID hash / 100");
90  if ( m_histSvc->regHist(m_histogramGroupName.value() + hists[hist_i]->GetName(),hists[hist_i]).isFailure() ) {
91  return StatusCode::FAILURE;
92  }
93  }
94  m_moduleDefectsHist = hists[0];
95  m_moduleCoreColDefectsHist = hists[1];
96  m_matrixHist = hists[2];
97 
98  unsigned int max_n=0;
99  for (std::vector<float> &per_matrix_type_fractions : m_perMatrixTypeFractions) {
100  max_n = std::max(max_n, static_cast<unsigned int>(per_matrix_type_fractions.size()));
101  }
102 
103  m_histNCoreColumnDefects.reserve(m_matrixTypeNColumns.size());
104  for (unsigned int n_columns : m_matrixTypeNColumns) {
105  std::stringstream hname;
106  hname << "n_core_column_defects_" << n_columns;
107  m_histNCoreColumnDefects.push_back( new TH1F(hname.str().c_str(), hname.str().c_str(),max_n+1, -0.5,max_n+.5) );
108  if (m_histSvc->regHist(m_histogramGroupName.value() + m_histNCoreColumnDefects.back()->GetName(),
109  m_histNCoreColumnDefects.back()).isFailure() ) {
110  return StatusCode::FAILURE;
111  }
112  }
113  }
114 
115  return StatusCode::SUCCESS;
116  }

◆ initializeProbabilities()

StatusCode InDet::PixelDefectsEmulatorCondAlg::initializeProbabilities ( )
private

Definition at line 377 of file PixelDefectsEmulatorCondAlg.cxx.

377  {
378  if (m_matrixColumns.value().size() != m_probabilityModuleHasCoreColumnDefects.value().size()
379  || m_matrixColumns.value().size()*2 > m_pixelColGroupdDefectProbability.value().size()) {
380  ATH_MSG_ERROR( "The properties " << m_matrixColumns.name() << "and " << m_probabilityModuleHasCoreColumnDefects.name()
381  << " have to contain the same number of elements but contain "
382  << " and " << m_pixelColGroupdDefectProbability.name()
383  << " most contain at least one element and the end marker -1 for each element in "
384  << m_matrixColumns.name()
385  << " but the properties contain "
386  << m_matrixColumns.value().size() << ", " << m_probabilityModuleHasCoreColumnDefects.value().size()
387  << " and " << m_pixelColGroupdDefectProbability.value().size() << " elements.");
388  return StatusCode::FAILURE;
389  }
390  for (unsigned int n_columns : m_matrixColumns.value()) {
391  std::vector<unsigned int>::const_iterator iter = std::lower_bound(m_matrixTypeNColumns.begin(),m_matrixTypeNColumns.end(), n_columns );
392  if (iter == m_matrixTypeNColumns.end() || *iter != n_columns) {
393  m_matrixTypeNColumns.insert(iter, n_columns);
394  }
395  }
396  // create vector with fractions per matrix type
398  std::vector<float> matrixTypeCoreColumnDefectProbability;
399  matrixTypeCoreColumnDefectProbability.resize(m_matrixTypeNColumns.size(),0.);
400  unsigned idx=0;
401  --idx;
402  unsigned int fraction_idx=0;
403  for (unsigned int n_columns : m_matrixColumns.value()) {
404  ++idx;
405  std::vector<unsigned int>::const_iterator iter = std::lower_bound(m_matrixTypeNColumns.begin(),m_matrixTypeNColumns.end(), n_columns );
406  unsigned int type_idx = static_cast<unsigned int>(iter - m_matrixTypeNColumns.begin());
407  matrixTypeCoreColumnDefectProbability.at(type_idx) = m_probabilityModuleHasCoreColumnDefects.value().at(idx);
408  for (;fraction_idx < m_pixelColGroupdDefectProbability.value().size() && m_pixelColGroupdDefectProbability.value().at(fraction_idx)>=0.;
409  ++fraction_idx) {
410  m_perMatrixTypeFractions.at(type_idx).push_back(m_pixelColGroupdDefectProbability.value().at(fraction_idx) * m_probabilityModuleHasCoreColumnDefects.value().at(idx) );
411  }
412  ++fraction_idx;
413  }
414 
415  // compute cummulative distribution
416  for (std::vector<float> &per_matrix_type_fractions : m_perMatrixTypeFractions) {
417  float total=0.;
418  for (float &a_fraction : per_matrix_type_fractions) {
419  a_fraction += total;
420  total=a_fraction;
421  }
422  }
423 
424  std::stringstream msg;
425  for (unsigned int idx=0; idx< m_matrixTypeNColumns.size() ; ++idx) {
426  msg << m_matrixTypeNColumns.at(idx) << "|";
427  unsigned int defects=0;
428  for (float fraction : m_perMatrixTypeFractions.at(idx)) {
429  ++defects;
430  msg << " " << defects << ":" << fraction;
431  }
432  msg << "\n";
433  }
434  ATH_MSG_INFO(msg.str());
435 
436  return StatusCode::SUCCESS;
437  }

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ isClonable()

bool AthReentrantAlgorithm::isClonable ( ) const
overridevirtualinherited

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ setFilterPassed()

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

Definition at line 139 of file AthReentrantAlgorithm.h.

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

◆ sysExecute()

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

Execute an algorithm.

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

Definition at line 67 of file AthReentrantAlgorithm.cxx.

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

◆ sysInitialize()

StatusCode AthReentrantAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

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

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

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in InputMakerBase, and HypoBase.

Definition at line 96 of file AthReentrantAlgorithm.cxx.

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

◆ sysStart()

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

Handle START transition.

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

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/6]

std::vector<unsigned int> m_dimPerHist InDet::PixelDefectsEmulatorCondAlg::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 88 of file PixelDefectsEmulatorCondAlg.h.

◆ ATLAS_THREAD_SAFE [2/6]

std::vector< TH2 *> m_hist InDet::PixelDefectsEmulatorCondAlg::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 90 of file PixelDefectsEmulatorCondAlg.h.

◆ ATLAS_THREAD_SAFE [3/6]

std::vector< TH1 *> m_histNCoreColumnDefects InDet::PixelDefectsEmulatorCondAlg::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 91 of file PixelDefectsEmulatorCondAlg.h.

◆ ATLAS_THREAD_SAFE [4/6]

TH2* m_moduleDefectsHist InDet::PixelDefectsEmulatorCondAlg::ATLAS_THREAD_SAFE = nullptr
mutableprivate

Definition at line 92 of file PixelDefectsEmulatorCondAlg.h.

◆ ATLAS_THREAD_SAFE [5/6]

TH2* m_moduleCoreColDefectsHist InDet::PixelDefectsEmulatorCondAlg::ATLAS_THREAD_SAFE = nullptr
mutableprivate

Definition at line 93 of file PixelDefectsEmulatorCondAlg.h.

◆ ATLAS_THREAD_SAFE [6/6]

TH2* m_matrixHist InDet::PixelDefectsEmulatorCondAlg::ATLAS_THREAD_SAFE = nullptr
mutableprivate

Definition at line 94 of file PixelDefectsEmulatorCondAlg.h.

◆ m_checkerBoardToggle

Gaudi::Property<bool> InDet::PixelDefectsEmulatorCondAlg::m_checkerBoardToggle {this, "CheckerBoardDefects", false}
private

Definition at line 72 of file PixelDefectsEmulatorCondAlg.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthReentrantAlgorithm::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 153 of file AthReentrantAlgorithm.h.

◆ m_histMutex

std::mutex InDet::PixelDefectsEmulatorCondAlg::m_histMutex
mutableprivate

Definition at line 86 of file PixelDefectsEmulatorCondAlg.h.

◆ m_histogramGroupName

Gaudi::Property<std::string> InDet::PixelDefectsEmulatorCondAlg::m_histogramGroupName {this,"HistogramGroupName","", "Histogram group name or empty to disable histogramming"}
private

Definition at line 78 of file PixelDefectsEmulatorCondAlg.h.

◆ m_histogrammingEnabled

bool InDet::PixelDefectsEmulatorCondAlg::m_histogrammingEnabled = false
private

Definition at line 98 of file PixelDefectsEmulatorCondAlg.h.

◆ m_histSvc

ServiceHandle<ITHistSvc> InDet::PixelDefectsEmulatorCondAlg::m_histSvc {this,"HistSvc","THistSvc"}
private

Definition at line 77 of file PixelDefectsEmulatorCondAlg.h.

◆ m_idHelper

const PixelID* InDet::PixelDefectsEmulatorCondAlg::m_idHelper = nullptr
private

Definition at line 81 of file PixelDefectsEmulatorCondAlg.h.

◆ m_matrixColumns

Gaudi::Property<std::vector<unsigned int> > InDet::PixelDefectsEmulatorCondAlg::m_matrixColumns {this, "MatrixColumns", {} , "Associated defintion is for a matrix with this number of sensor columns."}
private

Definition at line 48 of file PixelDefectsEmulatorCondAlg.h.

◆ m_matrixTypeNColumns

std::vector<unsigned int> InDet::PixelDefectsEmulatorCondAlg::m_matrixTypeNColumns
private

Definition at line 60 of file PixelDefectsEmulatorCondAlg.h.

◆ m_maxAttempts

Gaudi::Property<unsigned int> InDet::PixelDefectsEmulatorCondAlg::m_maxAttempts {this, "MaxRandomPositionAttempts", 10}
private

Definition at line 74 of file PixelDefectsEmulatorCondAlg.h.

◆ m_modulesWithoutDefectParameters

std::atomic<unsigned int> InDet::PixelDefectsEmulatorCondAlg::m_modulesWithoutDefectParameters {}
mutableprivate

Definition at line 96 of file PixelDefectsEmulatorCondAlg.h.

◆ m_oddColToggle

Gaudi::Property<bool> InDet::PixelDefectsEmulatorCondAlg::m_oddColToggle {this, "OddColToggle", false}
private

Definition at line 70 of file PixelDefectsEmulatorCondAlg.h.

◆ m_oddRowToggle

Gaudi::Property<bool> InDet::PixelDefectsEmulatorCondAlg::m_oddRowToggle {this, "OddRowToggle", false}
private

Definition at line 68 of file PixelDefectsEmulatorCondAlg.h.

◆ m_perMatrixTypeFractions

std::vector<std::vector<float> > InDet::PixelDefectsEmulatorCondAlg::m_perMatrixTypeFractions
private

Definition at line 61 of file PixelDefectsEmulatorCondAlg.h.

◆ m_pixelColGroupdDefectProbability

Gaudi::Property<std::vector<float> > InDet::PixelDefectsEmulatorCondAlg::m_pixelColGroupdDefectProbability
private
Initial value:
{this, "CoreColumnDefectProbability", {},
"Probability of a certain core column defect for modules with core colmn defects."
"First probability for a certain matrix type means exactly 1 defect core column "
"and so forth until extactly n defect core columns. Probabilities should add up to 1." }

Definition at line 54 of file PixelDefectsEmulatorCondAlg.h.

◆ m_pixelDefectProbability

Gaudi::Property<float> InDet::PixelDefectsEmulatorCondAlg::m_pixelDefectProbability {this,"DefectProbability", 1e-4}
private

Definition at line 45 of file PixelDefectsEmulatorCondAlg.h.

◆ m_pixelDetEleCollKey

SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> InDet::PixelDefectsEmulatorCondAlg::m_pixelDetEleCollKey {this, "PixelDetEleCollKey", "ITkPixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"}
private

Definition at line 43 of file PixelDefectsEmulatorCondAlg.h.

◆ m_probabilityModuleHasCoreColumnDefects

Gaudi::Property<std::vector<float> > InDet::PixelDefectsEmulatorCondAlg::m_probabilityModuleHasCoreColumnDefects {this, "ProbabilityOfModuleWithCoreColumnDefects", {}, "Probability of a module to have core column defects." }
private

Definition at line 51 of file PixelDefectsEmulatorCondAlg.h.

◆ m_rndmSvc

ServiceHandle<IAthRNGSvc> InDet::PixelDefectsEmulatorCondAlg::m_rndmSvc {this, "RndmSvc", "AthRNGSvc", ""}
private

Definition at line 42 of file PixelDefectsEmulatorCondAlg.h.

◆ m_rngName

std::string InDet::PixelDefectsEmulatorCondAlg::m_rngName
private

Definition at line 82 of file PixelDefectsEmulatorCondAlg.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeKey

SG::WriteCondHandleKey<InDet::PixelEmulatedDefects> InDet::PixelDefectsEmulatorCondAlg::m_writeKey {this, "WriteKey", "", "Key of output PixelDefectsEmulator data"}
private

Definition at line 63 of file PixelDefectsEmulatorCondAlg.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
InDet::PixelDefectsEmulatorCondAlg::m_perMatrixTypeFractions
std::vector< std::vector< float > > m_perMatrixTypeFractions
Definition: PixelDefectsEmulatorCondAlg.h:61
ATHRNG::RNGWrapper::setSeed
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition: RNGWrapper.h:169
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
InDet::PixelDefectsEmulatorCondAlg::m_checkerBoardToggle
Gaudi::Property< bool > m_checkerBoardToggle
Definition: PixelDefectsEmulatorCondAlg.h:73
InDet::PixelDefectsEmulatorCondAlg::m_rndmSvc
ServiceHandle< IAthRNGSvc > m_rndmSvc
Definition: PixelDefectsEmulatorCondAlg.h:42
InDet::PixelDefectsEmulatorCondAlg::m_histSvc
ServiceHandle< ITHistSvc > m_histSvc
Definition: PixelDefectsEmulatorCondAlg.h:77
dqt_zlumi_pandas.hname
string hname
Definition: dqt_zlumi_pandas.py:279
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
InDet::PixelModuleHelper
Helper class to convert between offline column, row and hardware chip, column, row coordinates.
Definition: PixelModuleHelper.h:33
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
InDet::PixelDefectsEmulatorCondAlg::m_histMutex
std::mutex m_histMutex
Definition: PixelDefectsEmulatorCondAlg.h:86
AthCommonDataStore::renounce
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
Definition: AthCommonDataStore.h:380
InDet::PixelDefectsEmulatorCondAlg::m_maxAttempts
Gaudi::Property< unsigned int > m_maxAttempts
Definition: PixelDefectsEmulatorCondAlg.h:75
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
InDet::PixelDefectsEmulatorCondAlg::m_pixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
Definition: PixelDefectsEmulatorCondAlg.h:44
InDet::PixelDefectsEmulatorCondAlg::m_pixelDefectProbability
Gaudi::Property< float > m_pixelDefectProbability
Definition: PixelDefectsEmulatorCondAlg.h:46
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
covarianceTool.prob
prob
Definition: covarianceTool.py:678
InDet::PixelDefectsEmulatorCondAlg::m_histogrammingEnabled
bool m_histogrammingEnabled
Definition: PixelDefectsEmulatorCondAlg.h:98
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
InDet::PixelDefectsEmulatorCondAlg::m_idHelper
const PixelID * m_idHelper
Definition: PixelDefectsEmulatorCondAlg.h:81
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:112
InDet::PixelDefectsEmulatorCondAlg::m_matrixTypeNColumns
std::vector< unsigned int > m_matrixTypeNColumns
Definition: PixelDefectsEmulatorCondAlg.h:60
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthReentrantAlgorithm::AthReentrantAlgorithm
AthReentrantAlgorithm()
Default constructor:
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::PixelDefectsEmulatorCondAlg::m_oddRowToggle
Gaudi::Property< bool > m_oddRowToggle
Definition: PixelDefectsEmulatorCondAlg.h:69
covarianceTool.title
title
Definition: covarianceTool.py:542
InDet::PixelDefectsEmulatorCondAlg::m_matrixColumns
Gaudi::Property< std::vector< unsigned int > > m_matrixColumns
Definition: PixelDefectsEmulatorCondAlg.h:49
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDet::PixelDefectsEmulatorCondAlg::m_probabilityModuleHasCoreColumnDefects
Gaudi::Property< std::vector< float > > m_probabilityModuleHasCoreColumnDefects
Definition: PixelDefectsEmulatorCondAlg.h:52
MakeTH3DFromTH2Ds.hists
hists
Definition: MakeTH3DFromTH2Ds.py:72
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
AthReentrantAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthReentrantAlgorithm.h:153
DeMoScan.defects
defects
Definition: DeMoScan.py:297
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
InDet::PixelDefectsEmulatorCondAlg::initializeProbabilities
StatusCode initializeProbabilities()
Definition: PixelDefectsEmulatorCondAlg.cxx:377
InDet::PixelDefectsEmulatorCondAlg::findHist
TH2 * findHist(unsigned int n_rows, unsigned int n_cols) const
Definition: PixelDefectsEmulatorCondAlg.cxx:344
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
InDet::PixelDefectsEmulatorCondAlg::m_oddColToggle
Gaudi::Property< bool > m_oddColToggle
Definition: PixelDefectsEmulatorCondAlg.h:71
InDet::PixelDefectsEmulatorCondAlg::m_histogramGroupName
Gaudi::Property< std::string > m_histogramGroupName
Definition: PixelDefectsEmulatorCondAlg.h:79
AthReentrantAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthReentrantAlgorithm.cxx:96
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
InDet::EmulatedDefects< PixelModuleHelper >::lower_bound
static std::pair< std::vector< unsigned int >::iterator, std::vector< unsigned int >::iterator > lower_bound(std::vector< unsigned int > &module_defects, unsigned int key)
Convenience method to find the preceding defect.
Definition: EmulatedDefects.h:46
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
InDet::PixelDefectsEmulatorCondAlg::m_modulesWithoutDefectParameters
std::atomic< unsigned int > m_modulesWithoutDefectParameters
Definition: PixelDefectsEmulatorCondAlg.h:96
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AthCommonMsg< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
InDet::PixelDefectsEmulatorCondAlg::m_pixelColGroupdDefectProbability
Gaudi::Property< std::vector< float > > m_pixelColGroupdDefectProbability
Definition: PixelDefectsEmulatorCondAlg.h:55
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
InDet::PixelDefectsEmulatorCondAlg::m_writeKey
SG::WriteCondHandleKey< InDet::PixelEmulatedDefects > m_writeKey
Definition: PixelDefectsEmulatorCondAlg.h:64
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
InDet::PixelDefectsEmulatorCondAlg::m_rngName
std::string m_rngName
Definition: PixelDefectsEmulatorCondAlg.h:82
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37