ATLAS Offline Software
PixelDefectsEmulatorCondAlg.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef INDET_PIXELDEFECTSEMULATORCONDALG_H
8 #define INDET_PIXELDEFECTSEMULATORCONDALG_H
9 
11 
14 
15 #include "GaudiKernel/ServiceHandle.h"
16 
18 #include "PixelEmulatedDefects.h"
20 #include "GaudiKernel/ITHistSvc.h"
21 
22 #include "TH2.h"
23 
24 namespace InDet {
30  {
31  public:
32  PixelDefectsEmulatorCondAlg(const std::string& name, ISvcLocator* pSvcLocator);
33  virtual ~PixelDefectsEmulatorCondAlg() override = default;
34 
35  virtual StatusCode initialize() override final;
36  virtual StatusCode execute(const EventContext& ctx) const override final;
37  virtual StatusCode finalize() override final;
38 
39  private:
40  ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", ""};
42  {this, "PixelDetEleCollKey", "ITkPixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};
43  Gaudi::Property<float> m_pixelDefectProbability
44  {this,"DefectProbability", 1e-4};
45  Gaudi::Property<float> m_pixelColGroupdDefectProbability
46  {this, "CoreColumnDefectProbability", };
48  {this, "WriteKey", "", "Key of output PixelDefectsEmulator data"};
49 
50  // Properties to add a checker board like pattern to the defects
51  // for debugging
52  Gaudi::Property<bool> m_oddRowToggle
53  {this, "OddRowToggle", false};
54  Gaudi::Property<bool> m_oddColToggle
55  {this, "OddColToggle", false};
56  Gaudi::Property<bool> m_checkerBoardToggle
57  {this, "CheckerBoardDefects", false};
58 
59  ServiceHandle<ITHistSvc> m_histSvc{this,"HistSvc","THistSvc"};
60  Gaudi::Property<std::string> m_histogramGroupName
61  {this,"HistogramGroupName","", "Histogram group name or empty to disable histogramming"};
62 
63  const PixelID* m_idHelper = nullptr;
64  std::string m_rngName;
65 
66  // calls during execute must be protected by m_histMutex
67  TH2 *findHist(unsigned int n_rows, unsigned int n_cols) const;
69  // during execute the following may only be accessed when m_histMutex is locked
70  mutable std::vector<unsigned int> m_dimPerHist ATLAS_THREAD_SAFE;
71 
72  mutable std::vector< TH2 *> m_hist ATLAS_THREAD_SAFE;
73  mutable TH2 * m_moduleDefectsHist ATLAS_THREAD_SAFE = nullptr;
74  mutable TH2 * m_moduleCoreColDefectsHist ATLAS_THREAD_SAFE = nullptr;
75  mutable TH2 * m_matrixHist ATLAS_THREAD_SAFE = nullptr;
76 
77  bool m_histogrammingEnabled = false;
78  };
79 }
80 #endif
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
InDet::PixelDefectsEmulatorCondAlg::PixelDefectsEmulatorCondAlg
PixelDefectsEmulatorCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: PixelDefectsEmulatorCondAlg.cxx:55
InDet::PixelDefectsEmulatorCondAlg::m_checkerBoardToggle
Gaudi::Property< bool > m_checkerBoardToggle
Definition: PixelDefectsEmulatorCondAlg.h:57
InDet::PixelDefectsEmulatorCondAlg::m_rndmSvc
ServiceHandle< IAthRNGSvc > m_rndmSvc
Definition: PixelDefectsEmulatorCondAlg.h:40
InDet::PixelDefectsEmulatorCondAlg::m_histSvc
ServiceHandle< ITHistSvc > m_histSvc
Definition: PixelDefectsEmulatorCondAlg.h:59
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::PixelDefectsEmulatorCondAlg::m_histMutex
std::mutex m_histMutex
Definition: PixelDefectsEmulatorCondAlg.h:68
InDet::PixelDefectsEmulatorCondAlg::m_pixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
Definition: PixelDefectsEmulatorCondAlg.h:42
InDet::PixelDefectsEmulatorCondAlg::m_pixelDefectProbability
Gaudi::Property< float > m_pixelDefectProbability
Definition: PixelDefectsEmulatorCondAlg.h:44
InDet::PixelDefectsEmulatorCondAlg::m_pixelColGroupdDefectProbability
Gaudi::Property< float > m_pixelColGroupdDefectProbability
Definition: PixelDefectsEmulatorCondAlg.h:46
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
InDet::PixelDefectsEmulatorCondAlg::m_histogrammingEnabled
bool m_histogrammingEnabled
Definition: PixelDefectsEmulatorCondAlg.h:77
InDet::PixelDefectsEmulatorCondAlg::m_idHelper
const PixelID * m_idHelper
Definition: PixelDefectsEmulatorCondAlg.h:63
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
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:53
InDet::PixelDefectsEmulatorCondAlg::ATLAS_THREAD_SAFE
std::vector< unsigned int > m_dimPerHist ATLAS_THREAD_SAFE
Definition: PixelDefectsEmulatorCondAlg.h:70
InDet::PixelDefectsEmulatorCondAlg::finalize
virtual StatusCode finalize() override final
Definition: PixelDefectsEmulatorCondAlg.cxx:101
ReadCondHandleKey.h
AthReentrantAlgorithm.h
InDet::PixelDefectsEmulatorCondAlg::findHist
TH2 * findHist(unsigned int n_rows, unsigned int n_cols) const
Definition: PixelDefectsEmulatorCondAlg.cxx:260
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
InDet::PixelDefectsEmulatorCondAlg::~PixelDefectsEmulatorCondAlg
virtual ~PixelDefectsEmulatorCondAlg() override=default
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
InDet::PixelDefectsEmulatorCondAlg::m_oddColToggle
Gaudi::Property< bool > m_oddColToggle
Definition: PixelDefectsEmulatorCondAlg.h:55
InDet::PixelDefectsEmulatorCondAlg::ATLAS_THREAD_SAFE
std::vector< TH2 * > m_hist ATLAS_THREAD_SAFE
Definition: PixelDefectsEmulatorCondAlg.h:72
InDet::PixelDefectsEmulatorCondAlg::initialize
virtual StatusCode initialize() override final
Definition: PixelDefectsEmulatorCondAlg.cxx:59
InDet::PixelDefectsEmulatorCondAlg::m_histogramGroupName
Gaudi::Property< std::string > m_histogramGroupName
Definition: PixelDefectsEmulatorCondAlg.h:61
SiDetectorElementCollection.h
PixelEmulatedDefects.h
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection >
IAthRNGSvc
manage multiple RandomEngines in thread-safe way.
Definition: IAthRNGSvc.h:28
InDet::PixelDefectsEmulatorCondAlg
Conditions algorithms for emulating ITK pixel defects.
Definition: PixelDefectsEmulatorCondAlg.h:30
SG::WriteCondHandleKey< InDet::PixelEmulatedDefects >
InDet::PixelDefectsEmulatorCondAlg::m_writeKey
SG::WriteCondHandleKey< InDet::PixelEmulatedDefects > m_writeKey
Definition: PixelDefectsEmulatorCondAlg.h:48
PixelID
Definition: PixelID.h:67
InDet::PixelDefectsEmulatorCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition: PixelDefectsEmulatorCondAlg.cxx:105
InDet::PixelDefectsEmulatorCondAlg::m_rngName
std::string m_rngName
Definition: PixelDefectsEmulatorCondAlg.h:64
IAthRNGSvc.h
ServiceHandle
Definition: ClusterMakerTool.h:37