ATLAS Offline Software
LUCID_SimHit.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "GetQuantumEfficiency.h"
7 #include <sstream>
8 
9 LUCID_SimHit::LUCID_SimHit(): m_partLink() {
10 
11  m_tubeID = 0;
12  m_pdgCode = 0;
13  m_genVolume = 0;
14  m_stepStartPosX = 0;
15  m_stepStartPosY = 0;
16  m_stepStartPosZ = 0;
17  m_stepEndPosX = 0;
18  m_stepEndPosY = 0;
19  m_stepEndPosZ = 0;
20  m_preStepTime = 0;
21  m_postStepTime = 0;
22  m_wavelength = 0;
23  m_energy = 0;
24 }
25 
26 LUCID_SimHit::LUCID_SimHit(const LUCID_SimHit& simhit) { *this = simhit; }
27 
29  int pdgCode,
30  int truthBarcode,
31  int genVolume,
32  float stepStartPosX,
33  float stepStartPosY,
34  float stepStartPosZ,
35  float stepEndPosX,
36  float stepEndPosY,
37  float stepEndPosZ,
38  float preStepTime,
39  float postStepTime,
40  float wavelength,
41  float energy):
42 
43  m_tubeID (tubeID),
44  m_pdgCode (pdgCode),
45  m_partLink (truthBarcode, 0, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE), // FIXME barcode-based
46  m_genVolume (genVolume),
47  m_stepStartPosX(stepStartPosX),
48  m_stepStartPosY(stepStartPosY),
49  m_stepStartPosZ(stepStartPosZ),
50  m_stepEndPosX (stepEndPosX),
51  m_stepEndPosY (stepEndPosY),
52  m_stepEndPosZ (stepEndPosZ),
53  m_preStepTime (preStepTime),
54  m_postStepTime (postStepTime),
55  m_wavelength (wavelength),
56  m_energy (energy) {}
57 
59  int pdgCode,
60  const HepMcParticleLink& partLink,
61  int genVolume,
62  float stepStartPosX,
63  float stepStartPosY,
64  float stepStartPosZ,
65  float stepEndPosX,
66  float stepEndPosY,
67  float stepEndPosZ,
68  float preStepTime,
69  float postStepTime,
70  float wavelength,
71  float energy):
72 
73  m_tubeID (tubeID),
74  m_pdgCode (pdgCode),
75  m_partLink (partLink),
76  m_genVolume (genVolume),
77  m_stepStartPosX(stepStartPosX),
78  m_stepStartPosY(stepStartPosY),
79  m_stepStartPosZ(stepStartPosZ),
80  m_stepEndPosX (stepEndPosX),
81  m_stepEndPosY (stepEndPosY),
82  m_stepEndPosZ (stepEndPosZ),
83  m_preStepTime (preStepTime),
84  m_postStepTime (postStepTime),
85  m_wavelength (wavelength),
86  m_energy (energy) {}
87 
88 std::string LUCID_SimHit::print() const {
89 
90  std::stringstream ss;
91 
92  ss << "LUCID_SimHit:";
93  ss << " tubeID: " << m_tubeID;
94  ss << " preStepTime: " << m_preStepTime;
95  ss << " postStepTime: " << m_postStepTime;
96  ss << " energy: " << m_energy;
97  ss << " wavelength : " << m_wavelength;
98  ss << " position: (" << m_stepStartPosX
99  << "," << m_stepStartPosY
100  << "," << m_stepStartPosZ
101  << ")";
102 
103  return ss.str();
104 }
105 
107 
108  m_tubeID = simhit.m_tubeID;
109  m_pdgCode = simhit.m_pdgCode;
110  m_partLink = simhit.m_partLink;
111  m_genVolume = simhit.m_genVolume;
115  m_stepEndPosX = simhit.m_stepEndPosX;
116  m_stepEndPosY = simhit.m_stepEndPosY;
117  m_stepEndPosZ = simhit.m_stepEndPosZ;
118  m_preStepTime = simhit.m_preStepTime;
120  m_wavelength = simhit.m_wavelength;
121  m_energy = simhit.m_energy;
122 
123  return *this;
124 }
125 
126 bool LUCID_SimHit::isDetected(CLHEP::HepRandomEngine* rndEngine) const {
127 
129  double ran = CLHEP::RandFlat::shoot(rndEngine, 0., 1.);
130  bool det = (ran<qef);
131 
132  return det;
133 }
134 
135 int LUCID_SimHit::operator == (const LUCID_SimHit& simhit) const { return (this==&simhit) ? 1 : 0; }
136 
137 bool LUCID_SimHit::operator < (const LUCID_SimHit& rhs) const { return m_tubeID < rhs.m_tubeID; }
LUCID_SimHit::m_stepEndPosX
float m_stepEndPosX
Definition: LUCID_SimHit.h:90
LUCID_SimHit::m_stepEndPosY
float m_stepEndPosY
Definition: LUCID_SimHit.h:91
LUCID_SimHit::m_pdgCode
int m_pdgCode
Definition: LUCID_SimHit.h:84
LUCID_SimHit::operator==
int operator==(const LUCID_SimHit &) const
Definition: LUCID_SimHit.cxx:135
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
LUCID_SimHit::m_partLink
HepMcParticleLink m_partLink
Definition: LUCID_SimHit.h:85
LUCID_SimHit::operator<
bool operator<(const LUCID_SimHit &) const
Definition: LUCID_SimHit.cxx:137
LUCID_SimHit::m_stepStartPosZ
float m_stepStartPosZ
Definition: LUCID_SimHit.h:89
LUCID_SimHit::m_genVolume
int m_genVolume
Definition: LUCID_SimHit.h:86
LUCID_SimHit::m_preStepTime
float m_preStepTime
Definition: LUCID_SimHit.h:93
LUCID_SimHit::print
std::string print() const
Definition: LUCID_SimHit.cxx:88
LUCID_SimHit::m_stepStartPosY
float m_stepStartPosY
Definition: LUCID_SimHit.h:88
LUCID_SimHit::m_postStepTime
float m_postStepTime
Definition: LUCID_SimHit.h:94
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
LUCID_SimHit::operator=
const LUCID_SimHit & operator=(const LUCID_SimHit &t)
Definition: LUCID_SimHit.cxx:106
LUCID_SimHit::isDetected
bool isDetected(CLHEP::HepRandomEngine *rndEngine) const
Definition: LUCID_SimHit.cxx:126
GetQuantumEfficiencyR762
double GetQuantumEfficiencyR762(double lambda)
Definition: GetQuantumEfficiency.cxx:97
LUCID_SimHit::LUCID_SimHit
LUCID_SimHit()
Definition: LUCID_SimHit.cxx:9
WritePulseShapeToCool.det
det
Definition: WritePulseShapeToCool.py:204
LUCID_SimHit
Definition: LUCID_SimHit.h:17
LUCID_SimHit::m_stepEndPosZ
float m_stepEndPosZ
Definition: LUCID_SimHit.h:92
LUCID_SimHit::m_energy
float m_energy
Definition: LUCID_SimHit.h:96
LUCID_SimHit::m_stepStartPosX
float m_stepStartPosX
Definition: LUCID_SimHit.h:87
LUCID_SimHit.h
LUCID_SimHit::m_tubeID
short m_tubeID
Definition: LUCID_SimHit.h:83
LUCID_SimHit::m_wavelength
float m_wavelength
Definition: LUCID_SimHit.h:95
GetQuantumEfficiency.h