ATLAS Offline Software
EnergyDepositionTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3  */
11 #ifndef PIXELDIGITIZATION_EnergyDepositionTool_H
12 #define PIXELDIGITIZATION_EnergyDepositionTool_H
13 
14 #include "GaudiKernel/ServiceHandle.h"
16 #include "GaudiKernel/ToolHandle.h"
17 #include "Gaudi/Property.h"
18 #include "GaudiKernel/Service.h"
20 #include "BichselData.h"
21 
24 #include <vector>
25 #include <utility> //for std::pair
26 
27 
28 class PixelID;
29 namespace InDetDD{
30  class SiDetectorElement;
31 }
32 
33 namespace CLHEP{
34  class HepRandomEngine;
35 }
36 class SiHit;
37 
38 
39 
40 //====================
41 // C L A S S D E F
42 //====================
44 public:
45  EnergyDepositionTool(const std::string& type, const std::string& name, const IInterface* parent);
46 
47  static const InterfaceID& interfaceID();
48  virtual StatusCode initialize();
49  virtual StatusCode finalize();
50 
53 
54  std::vector<std::pair<double, double> > bichselSim(double BetaGamma, int ParticleType, double TotalLength,
55  double InciEnergy, CLHEP::HepRandomEngine* rndmEngine) const; // output hit record in the format (hit position, energy loss)
56 
57  std::vector<std::pair<double, double> > clusterHits(std::vector<std::pair<double, double> >& rawHitRecord,
58  int n_pieces) const; // cluster hits into n steps (there could be thousands of hit)
59 
60  virtual StatusCode depositEnergy(const TimedHitPtr<SiHit>& phit, const InDetDD::SiDetectorElement& Module,
61  std::vector<std::pair<double, double> >& trfHitRecord,
62  std::vector<double>& initialConditions, CLHEP::HepRandomEngine* rndmEngine,
63  const EventContext &ctx);
64 
65  // Variables
66 private:
68 
69  const PixelID* m_pixelID {
70  nullptr
71  };
72 
73  std::vector<BichselData> m_bichselData; // vector to store Bichsel Data. Each entry is for one particle type
74 
75  Gaudi::Property<int> m_numberOfSteps
76  {
77  this, "numberOfSteps", 50, "Geant4:number of steps for PixelPlanar"
78  };
79 
80  Gaudi::Property<int> m_numberOfCharges
81  {
82  this, "numberOfCharges", 10, "Geant4:number of charges for PixelPlanar"
83  };
84 
85  Gaudi::Property<bool> m_disableDistortions
86  {
87  this, "DisableDistortions", false, "Disable simulation of module distortions"
88  };
89 
90  Gaudi::Property<bool> m_doBichsel
91  {
92  this, "doBichsel", true, "re-do charge deposition following Bichsel model"
93  };
94 
95  Gaudi::Property<double> m_doBichselBetaGammaCut
96  {
97  this, "doBichselBetaGammaCut", 0.1, "minimum beta-gamma for particle to be re-simulated through Bichsel Model"
98  };
99 
100  Gaudi::Property<bool> m_doDeltaRay
101  {
102  this, "doDeltaRay", false, "whether we simulate delta-ray using Bichsel model"
103  };
104 
105  Gaudi::Property<double> m_DeltaRayCut
106  {
107  this, "DeltaRayCut", 80.7687, "Cut of delta ray [keV] - Value should be consistent with range cut in simulation"
108  };
109 
110  Gaudi::Property<bool> m_doPU
111  {
112  this, "doPU", true, "Whether we apply Bichsel model on PU"
113  };
114 
115  Gaudi::Property<int> m_nCols
116  {
117  this, "nCols", 1, "Number of collision for each sampling"
118  };
119 
120  Gaudi::Property<int> m_LoopLimit
121  {
122  this, "LoopLimit", 100000, "Limit assuming 1 collision per sampling"
123  };
124 
126  {
127  this, "PixelDistortionData", "PixelDistortionData", "Output readout distortion data"
128  };
129 private:
130  void simulateBow(const InDetDD::SiDetectorElement* element, double& xi, double& yi, const double zi, double& xf,
131  double& yf, const double zf) const;
132  // ! unit is eV
133 };
134 
135 #endif //PIXELDIGITIZATION_EnergyDepositionTool_H
EnergyDepositionTool::bichselSim
std::vector< std::pair< double, double > > bichselSim(double BetaGamma, int ParticleType, double TotalLength, double InciEnergy, CLHEP::HepRandomEngine *rndmEngine) const
Definition: EnergyDepositionTool.cxx:308
PixelDistortionData.h
Hold pixel distortion data produced by PixelDistortionAlg.
EnergyDepositionTool::m_doBichsel
Gaudi::Property< bool > m_doBichsel
Definition: EnergyDepositionTool.h:91
EnergyDepositionTool::simulateBow
void simulateBow(const InDetDD::SiDetectorElement *element, double &xi, double &yi, const double zi, double &xf, double &yf, const double zf) const
Definition: EnergyDepositionTool.cxx:273
EnergyDepositionTool::initialize
virtual StatusCode initialize()
Definition: EnergyDepositionTool.cxx:91
EnergyDepositionTool::EnergyDepositionTool
EnergyDepositionTool()
python.HLT.MinBias.MinBiasMenuSequences.zf
zf
Definition: MinBiasMenuSequences.py:187
EnergyDepositionTool::m_doBichselBetaGammaCut
Gaudi::Property< double > m_doBichselBetaGammaCut
Definition: EnergyDepositionTool.h:96
TimedHitPtr< SiHit >
SiHit
Definition: SiHit.h:19
TimedHitPtr.h
EnergyDepositionTool
Definition: EnergyDepositionTool.h:43
EnergyDepositionTool::m_distortionKey
SG::ReadCondHandleKey< PixelDistortionData > m_distortionKey
Definition: EnergyDepositionTool.h:126
EnergyDepositionTool::m_pixelID
const PixelID * m_pixelID
Definition: EnergyDepositionTool.h:69
EnergyDepositionTool::m_nCols
Gaudi::Property< int > m_nCols
Definition: EnergyDepositionTool.h:116
EnergyDepositionTool::m_doPU
Gaudi::Property< bool > m_doPU
Definition: EnergyDepositionTool.h:111
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EnergyDepositionTool::m_DeltaRayCut
Gaudi::Property< double > m_DeltaRayCut
Definition: EnergyDepositionTool.h:106
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
AthAlgTool.h
EnergyDepositionTool::initTools
StatusCode initTools()
test_pyathena.parent
parent
Definition: test_pyathena.py:15
EnergyDepositionTool::m_numberOfCharges
Gaudi::Property< int > m_numberOfCharges
Definition: EnergyDepositionTool.h:81
EnergyDepositionTool::finalize
virtual StatusCode finalize()
Definition: EnergyDepositionTool.cxx:127
ReadCondHandleKey.h
EnergyDepositionTool::depositEnergy
virtual StatusCode depositEnergy(const TimedHitPtr< SiHit > &phit, const InDetDD::SiDetectorElement &Module, std::vector< std::pair< double, double > > &trfHitRecord, std::vector< double > &initialConditions, CLHEP::HepRandomEngine *rndmEngine, const EventContext &ctx)
Definition: EnergyDepositionTool.cxx:135
EnergyDepositionTool::m_disableDistortions
Gaudi::Property< bool > m_disableDistortions
Definition: EnergyDepositionTool.h:86
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
EnergyDepositionTool::m_bichselData
std::vector< BichselData > m_bichselData
Definition: EnergyDepositionTool.h:73
BichselData.h
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
EnergyDepositionTool::interfaceID
static const InterfaceID & interfaceID()
SG::ReadCondHandleKey< PixelDistortionData >
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
EnergyDepositionTool::~EnergyDepositionTool
virtual ~EnergyDepositionTool()
EnergyDepositionTool::m_LoopLimit
Gaudi::Property< int > m_LoopLimit
Definition: EnergyDepositionTool.h:121
AthAlgTool
Definition: AthAlgTool.h:26
EnergyDepositionTool::m_doDeltaRay
Gaudi::Property< bool > m_doDeltaRay
Definition: EnergyDepositionTool.h:101
PixelID
Definition: PixelID.h:67
ParticleType
ParticleType
Definition: TruthClasses.h:8
EnergyDepositionTool::clusterHits
std::vector< std::pair< double, double > > clusterHits(std::vector< std::pair< double, double > > &rawHitRecord, int n_pieces) const
Definition: EnergyDepositionTool.cxx:422
EnergyDepositionTool::m_numberOfSteps
Gaudi::Property< int > m_numberOfSteps
Definition: EnergyDepositionTool.h:76