ATLAS Offline Software
Loading...
Searching...
No Matches
SleptonsPhysicsTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5// class header
7
8#include <G4ParticleDefinition.hh>
9#include <functional>
10// package headers
12#include "G4SElectronLMinus.hh"
13#include "G4SElectronLPlus.hh"
14#include "G4SElectronRMinus.hh"
15#include "G4SElectronRPlus.hh"
16#include "G4SMuonLMinus.hh"
17#include "G4SMuonLPlus.hh"
18#include "G4SMuonRMinus.hh"
19#include "G4SMuonRPlus.hh"
20#include "G4STau1Minus.hh"
21#include "G4STau1Plus.hh"
22#include "G4STau2Minus.hh"
23#include "G4STau2Plus.hh"
24// Geant4 headers
25#include "G4hIonisation.hh"
26#include "G4hMultipleScattering.hh"
27#include "G4Transportation.hh"
28#include "G4MuIonisation.hh"
29#include "G4ProcessManager.hh"
30#include "G4Version.hh"
31//CLHEP headers
32#include "CLHEP/Units/SystemOfUnits.h"
33
34//-----------------------------------------------------------------------------
35// Implementation file for class : SleptonsPhysicsTool
36//
37// 15-05-2015 : Edoardo Farina
38//-----------------------------------------------------------------------------
39
40#if G4VERSION_NUMBER > 1029
41#define PARTICLEITERATOR (this->GetParticleIterator())
42#elif G4VERSION_NUMBER > 1009
43#define PARTICLEITERATOR aParticleIterator
44#else
45#define PARTICLEITERATOR theParticleIterator
46#endif
47
48//=============================================================================
49// Standard constructor, initializes variables
50//=============================================================================
52 const std::string &name,
53 const IInterface *parent)
54 : base_class(type, name, parent) {
55 m_physicsOptionType = G4AtlasPhysicsOption::Type::BSMPhysics;
56
57 auto& SElectronLMinus = m_particlesConfig.SElectronLMinus;
58 declareProperty("G4SElectronLMinusMass",
59 SElectronLMinus.mass = 100.00 * CLHEP::GeV,
60 "G4SElectronLMinus Mass");
61 declareProperty("G4SElectronLMinusWidth",
62 SElectronLMinus.width = 0.0 * CLHEP::MeV,
63 "G4SElectronLMinus Width");
64 declareProperty("G4SElectronLMinusCharge",
65 SElectronLMinus.charge = -1. * CLHEP::eplus,
66 "G4SElectronLMinus charge");
67 declareProperty("G4SElectronLMinusPDGCode", SElectronLMinus.pdgCode = 2000011,
68 "G4SElectronLMinus PDG CODE");
69 declareProperty("G4SElectronLMinusStable", SElectronLMinus.stable = true,
70 "G4SElectronLMinus Stable");
71 declareProperty("G4SElectronLMinusLifetime", SElectronLMinus.lifetime = -1,
72 "G4SElectronLMinus Lifetime");
73 declareProperty("G4SElectronLMinusShortlived",
74 SElectronLMinus.shortlived = false,
75 "G4SElectronLMinus Shortlived");
76
77 auto& SElectronLPlus = m_particlesConfig.SElectronLPlus;
78 declareProperty("G4SElectronLPlusMass",
79 SElectronLPlus.mass = 100.0 * CLHEP::GeV,
80 "G4SElectronLPlus Mass");
81 declareProperty("G4SElectronLPlusWidth",
82 SElectronLPlus.width = 0.0 * CLHEP::MeV,
83 "G4SElectronLPlus Width");
84 declareProperty("G4SElectronLPlusCharge",
85 SElectronLPlus.charge = +1. * CLHEP::eplus,
86 "G4SElectronLPlus charge");
87 declareProperty("G4SElectronLPlusPDGCode", SElectronLPlus.pdgCode = -2000011,
88 "G4SElectronLPlus PDG CODE");
89 declareProperty("G4SElectronLPlusStable", SElectronLPlus.stable = true,
90 "G4SElectronLPlus Stable");
91 declareProperty("G4SElectronLPlusLifetime", SElectronLPlus.lifetime = -1,
92 "G4SElectronLPlus Lifetime");
93 declareProperty("G4SElectronLPlusShortlived",
94 SElectronLPlus.shortlived = false,
95 "G4SElectronLPlus Shortlived");
96
97 auto& SMuonLMinus = m_particlesConfig.SMuonLMinus;
98 declareProperty("G4SMuonLMinusMass", SMuonLMinus.mass = 100.0 * CLHEP::GeV,
99 "G4SMuonLMinus Mass");
100 declareProperty("G4SMuonLMinusWidth", SMuonLMinus.width = 0.0 * CLHEP::MeV,
101 "G4SMuonLMinus Width");
102 declareProperty("G4SMuonLMinusCharge",
103 SMuonLMinus.charge = -1. * CLHEP::eplus,
104 "G4SMuonLMinus charge");
105 declareProperty("G4SMuonLMinusPDGCode", SMuonLMinus.pdgCode = 2000013,
106 "G4SMuonLMinus PDG CODE");
107 declareProperty("G4SMuonLMinusStable", SMuonLMinus.stable = true,
108 "G4SMuonLMinus Stable");
109 declareProperty("G4SMuonLMinusLifetime", SMuonLMinus.lifetime = -1,
110 "G4SMuonLMinus Lifetime");
111 declareProperty("G4SMuonLMinusShortlived", SMuonLMinus.shortlived = false,
112 "G4SMuonLMinus Shortlived");
113
114 auto& SMuonLPlus = m_particlesConfig.SMuonLPlus;
115 declareProperty("G4SMuonLPlusMass", SMuonLPlus.mass = 100.0 * CLHEP::GeV,
116 "G4SMuonLPlus Mass");
117 declareProperty("G4SMuonLPlusWidth", SMuonLPlus.width = 0.0 * CLHEP::MeV,
118 "G4SMuonLPlus Width");
119 declareProperty("G4SMuonLPlusCharge", SMuonLPlus.charge = 1. * CLHEP::eplus,
120 "G4SMuonLPlus charge");
121 declareProperty("G4SMuonLPlusPDGCode", SMuonLPlus.pdgCode = -2000013,
122 "G4SMuonLPlus PDG CODE");
123 declareProperty("G4SMuonLPlusStable", SMuonLPlus.stable = true,
124 "G4SMuonLPlus Stable");
125 declareProperty("G4SMuonLPlusLifetime", SMuonLPlus.lifetime = -1,
126 "G4SMuonLPlus Lifetime");
127 declareProperty("G4SMuonLPlusShortlived", SMuonLPlus.shortlived = false,
128 "G4SMuonLPlus Shortlived");
129
130 auto& STau1Minus = m_particlesConfig.STau1Minus;
131 declareProperty("G4STau1MinusMass", STau1Minus.mass = 100.0 * CLHEP::GeV,
132 "G4STau1Minus Mass");
133 declareProperty("G4STau1MinusWidth", STau1Minus.width = 0.0 * CLHEP::MeV,
134 "G4STau1Minus Width");
135 declareProperty("G4STau1MinusCharge", STau1Minus.charge = -1. * CLHEP::eplus,
136 "G4STau1Minus charge");
137 declareProperty("G4STau1MinusPDGCode", STau1Minus.pdgCode = 1000015,
138 "G4STau1Minus PDG CODE");
139 declareProperty("G4STau1MinusStable", STau1Minus.stable = true,
140 "G4STau1Minus Stable");
141 declareProperty("G4STau1MinusLifetime", STau1Minus.lifetime = -1,
142 "G4STau1Minus Lifetime");
143 declareProperty("G4STau1MinusShortlived", STau1Minus.shortlived = false,
144 "G4STau1Minus Shortlived");
145
146 auto& STau1Plus = m_particlesConfig.STau1Plus;
147 declareProperty("G4STau1PlusMass", STau1Plus.mass = 100.0 * CLHEP::GeV,
148 "G4STau1Plus Mass");
149 declareProperty("G4STau1PlusWidth", STau1Plus.width = 0.0 * CLHEP::MeV,
150 "G4STau1Plus Width");
151 declareProperty("G4STau1PlusCharge", STau1Plus.charge = +1. * CLHEP::eplus,
152 "G4STau1Plus charge");
153 declareProperty("G4STau1PlusPDGCode", STau1Plus.pdgCode = -1000015,
154 "G4STau1Plus PDG CODE");
155 declareProperty("G4STau1PlusStable", STau1Plus.stable = true,
156 "G4STau1Plus Stable");
157 declareProperty("G4STau1PlusLifetime", STau1Plus.lifetime = -1,
158 "G4STau1Plus Lifetime");
159 declareProperty("G4STau1PlusShortlived", STau1Plus.shortlived = false,
160 "G4STau1Plus Shortlived");
161
162 auto& SElectronRMinus = m_particlesConfig.SElectronRMinus;
163 declareProperty("G4SElectronRMinusMass",
164 SElectronRMinus.mass = 100.00 * CLHEP::GeV,
165 "G4SElectronRMinus Mass");
166 declareProperty("G4SElectronRMinusWidth",
167 SElectronRMinus.width = 0.0 * CLHEP::MeV,
168 "G4SElectronRMinus Width");
169 declareProperty("G4SElectronRMinusCharge",
170 SElectronRMinus.charge = -1. * CLHEP::eplus,
171 "G4SElectronRMinus charge");
172 declareProperty("G4SElectronRMinusPDGCode", SElectronRMinus.pdgCode = 2000011,
173 "G4SElectronRMinus PDG CODE");
174 declareProperty("G4SElectronRMinusStable", SElectronRMinus.stable = true,
175 "G4SElectronRMinus Stable");
176 declareProperty("G4SElectronRMinusLifetime", SElectronRMinus.lifetime = -1,
177 "G4SElectronRMinus Lifetime");
178 declareProperty("G4SElectronRMinusShortlived",
179 SElectronRMinus.shortlived = false,
180 "G4SElectronRMinus Shortlived");
181
182 auto& SElectronRPlus = m_particlesConfig.SElectronRPlus;
183 declareProperty("G4SElectronRPlusMass",
184 SElectronRPlus.mass = 100.0 * CLHEP::GeV,
185 "G4SElectronRPlus Mass");
186 declareProperty("G4SElectronRPlusWidth",
187 SElectronRPlus.width = 0.0 * CLHEP::MeV,
188 "G4SElectronRPlus Width");
189 declareProperty("G4SElectronRPlusCharge",
190 SElectronRPlus.charge = +1. * CLHEP::eplus,
191 "G4SElectronRPlus charge");
192 declareProperty("G4SElectronRPlusPDGCode", SElectronRPlus.pdgCode = -2000011,
193 "G4SElectronRPlus PDG CODE");
194 declareProperty("G4SElectronRPlusStable", SElectronRPlus.stable = true,
195 "G4SElectronRPlus Stable");
196 declareProperty("G4SElectronRPlusLifetime", SElectronRPlus.lifetime = -1,
197 "G4SElectronRPlus Lifetime");
198 declareProperty("G4SElectronRPlusShortlived",
199 SElectronRPlus.shortlived = false,
200 "G4SElectronRPlus Shortlived");
201
202 auto& SMuonRMinus = m_particlesConfig.SMuonRMinus;
203 declareProperty("G4SMuonRMinusMass", SMuonRMinus.mass = 100.0 * CLHEP::GeV,
204 "G4SMuonRMinus Mass");
205 declareProperty("G4SMuonRMinusWidth", SMuonRMinus.width = 0.0 * CLHEP::MeV,
206 "G4SMuonRMinus Width");
207 declareProperty("G4SMuonRMinusCharge",
208 SMuonRMinus.charge = -1. * CLHEP::eplus,
209 "G4SMuonRMinus charge");
210 declareProperty("G4SMuonRMinusPDGCode", SMuonRMinus.pdgCode = 2000013,
211 "G4SMuonRMinus PDG CODE");
212 declareProperty("G4SMuonRMinusStable", SMuonRMinus.stable = true,
213 "G4SMuonRMinus Stable");
214 declareProperty("G4SMuonRMinusLifetime", SMuonRMinus.lifetime = -1,
215 "G4SMuonRMinus Lifetime");
216 declareProperty("G4SMuonRMinusShortlived", SMuonRMinus.shortlived = false,
217 "G4SMuonRMinus Shortlived");
218
219 auto& SMuonRPlus = m_particlesConfig.SMuonRPlus;
220 declareProperty("G4SMuonRPlusMass", SMuonRPlus.mass = 100.0 * CLHEP::GeV,
221 "G4SMuonRPlus Mass");
222 declareProperty("G4SMuonRPlusWidth", SMuonRPlus.width = 0.0 * CLHEP::MeV,
223 "G4SMuonRPlus Width");
224 declareProperty("G4SMuonRPlusCharge", SMuonRPlus.charge = 1. * CLHEP::eplus,
225 "G4SMuonRPlus charge");
226 declareProperty("G4SMuonRPlusPDGCode", SMuonRPlus.pdgCode = -2000013,
227 "G4SMuonRPlus PDG CODE");
228 declareProperty("G4SMuonRPlusStable", SMuonRPlus.stable = true,
229 "G4SMuonRPlus Stable");
230 declareProperty("G4SMuonRPlusLifetime", SMuonRPlus.lifetime = -1,
231 "G4SMuonRPlus Lifetime");
232 declareProperty("G4SMuonRPlusShortlived", SMuonRPlus.shortlived = false,
233 "G4SMuonRPlus Shortlived");
234
235 auto& STau2Minus = m_particlesConfig.STau2Minus;
236 declareProperty("G4STau2MinusMass", STau2Minus.mass = 100.0 * CLHEP::GeV,
237 "G4STau2Minus Mass");
238 declareProperty("G4STau2MinusWidth", STau2Minus.width = 0.0 * CLHEP::MeV,
239 "G4STau2Minus Width");
240 declareProperty("G4STau2MinusCharge", STau2Minus.charge = -1. * CLHEP::eplus,
241 "G4STau2Minus charge");
242 declareProperty("G4STau2MinusPDGCode", STau2Minus.pdgCode = 1000015,
243 "G4STau2Minus PDG CODE");
244 declareProperty("G4STau2MinusStable", STau2Minus.stable = true,
245 "G4STau2Minus Stable");
246 declareProperty("G4STau2MinusLifetime", STau2Minus.lifetime = -1,
247 "G4STau2Minus Lifetime");
248 declareProperty("G4STau2MinusShortlived", STau2Minus.shortlived = false,
249 "G4STau2Minus Shortlived");
250
251 auto& STau2Plus = m_particlesConfig.STau2Plus;
252 declareProperty("G4STau2PlusMass", STau2Plus.mass = 100.0 * CLHEP::GeV,
253 "G4STau2Plus Mass");
254 declareProperty("G4STau2PlusWidth", STau2Plus.width = 0.0 * CLHEP::MeV,
255 "G4STau2Plus Width");
256 declareProperty("G4STau2PlusCharge", STau2Plus.charge = +1. * CLHEP::eplus,
257 "G4STau2Plus charge");
258 declareProperty("G4STau2PlusPDGCode", STau2Plus.pdgCode = -1000015,
259 "G4STau2Plus PDG CODE");
260 declareProperty("G4STau2PlusStable", STau2Plus.stable = true,
261 "G4STau2Plus Stable");
262 declareProperty("G4STau2PlusLifetime", STau2Plus.lifetime = -1,
263 "G4STau2Plus Lifetime");
264 declareProperty("G4STau2PlusShortlived", STau2Plus.shortlived = false,
265 "G4STau2Plus Shortlived");
266}
267
268//=============================================================================
269// Destructor
270//=============================================================================
271
276
277//=============================================================================
278// Initialize
279//=============================================================================
281{
282 ATH_MSG_DEBUG("SleptonsPhysicsTool initialize( )");
283 return StatusCode::SUCCESS;
284}
285
286auto SleptonsPhysicsTool::GetPhysicsOption() -> UPPhysicsConstructor {
287 return std::make_unique<SleptonsPhysicsTool::PhysicsConstructor>(
288 name(), msgLevel(), *this);
289}
290
292 ATH_MSG_DEBUG("ConstructParticle for the Sleptons being run");
293 // Lambda to handle particle definition with consistent logic and reduce
294 // duplication
295 using ParticleDefinitionFn = std::function<G4ParticleDefinition*(
296 double, double, double, double, bool, double, bool)>;
297 auto defineParticle = [](ParticleDefinitionParams const& particleDef,
298 G4ParticleDefinition** particle,
299 ParticleDefinitionFn definitionFn,
300 bool requireLargePDG) {
301 if (particleDef.mass <= 0. ||
302 !(requireLargePDG ? (std::abs(particleDef.pdgCode) >= 2000000)
303 : (std::abs(particleDef.pdgCode) < 2000000))) {
304 return;
305 }
306
307 *particle =
308 definitionFn(particleDef.mass, particleDef.width, particleDef.charge,
309 particleDef.pdgCode, particleDef.stable,
310 particleDef.lifetime, particleDef.shortlived);
311 };
312 // R-types (large PDG code)
313 defineParticle(m_particlesConfig.SElectronRMinus, &m_theSElectronRMinus,
314 G4SElectronRMinus::Definition, true);
315 defineParticle(m_particlesConfig.SElectronRPlus, &m_theSElectronRPlus,
316 G4SElectronRPlus::Definition, true);
317 defineParticle(m_particlesConfig.SMuonRMinus, &m_theSMuonRMinus,
318 G4SMuonRMinus::Definition, true);
319 defineParticle(m_particlesConfig.SMuonRPlus, &m_theSMuonRPlus,
320 G4SMuonRPlus::Definition, true);
321 defineParticle(m_particlesConfig.STau2Minus, &m_theSTau2Minus,
322 G4STau2Minus::Definition, true);
323 defineParticle(m_particlesConfig.STau2Plus, &m_theSTau2Plus,
324 G4STau2Plus::Definition, true);
325
326 // L-types (small PDG code)
327 defineParticle(m_particlesConfig.STau1Minus, &m_theSTau1Minus,
328 G4STau1Minus::Definition, false);
329 defineParticle(m_particlesConfig.STau1Plus, &m_theSTau1Plus,
330 G4STau1Plus::Definition, false);
331 defineParticle(m_particlesConfig.SElectronLMinus, &m_theSElectronLMinus,
332 G4SElectronLMinus::Definition, false);
333 defineParticle(m_particlesConfig.SElectronLPlus, &m_theSElectronLPlus,
334 G4SElectronLPlus::Definition, false);
335 defineParticle(m_particlesConfig.SMuonLMinus, &m_theSMuonLMinus,
336 G4SMuonLMinus::Definition, false);
337 defineParticle(m_particlesConfig.SMuonLPlus, &m_theSMuonLPlus,
338 G4SMuonLPlus::Definition, false);
339}
340
342 ATH_MSG_DEBUG(" ConstructProcess for Sleptons being run");
343 PARTICLEITERATOR->reset();
344 while( (*PARTICLEITERATOR)() ){
345 G4ParticleDefinition* particle = PARTICLEITERATOR->value();
346 int pdgcode=std::abs(particle->GetPDGEncoding());
347 if (pdgcode==2000011 || pdgcode==2000013 || pdgcode==1000015 || pdgcode==1000011 || pdgcode==1000013 || pdgcode==2000015)
348 {
349 G4ProcessManager* proc=particle->GetProcessManager();
350 proc->AddProcess(new G4hMultipleScattering,-1,1,1);
351 proc->AddProcess(new G4hIonisation,-1,2,2);
352 }
353 }
354}
#define ATH_MSG_DEBUG(x)
#define PARTICLEITERATOR
SleptonsParticlesConfig const & m_particlesConfig
SleptonsParticlesConfig m_particlesConfig
SleptonsPhysicsTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
virtual StatusCode initialize() override final
Initialize method.
virtual UPPhysicsConstructor GetPhysicsOption() override final
Implements.
virtual ~SleptonsPhysicsTool()
Destructor.
Struct to hold the parameters of a particle definition.