"Examples/options/edm4hep_write.py" did not exist on "e9d47ae9d44edc32428c050a8cf0c246b3745276"
Newer
Older
Markus Frank
committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//==========================================================================
// AIDA Detector description implementation
//--------------------------------------------------------------------------
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
// All rights reserved.
//
// For the licensing terms see $DD4hepINSTALL/LICENSE.
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
//
// Author : M.Frank
//
//==========================================================================
/** \addtogroup Geant4PhysicsConstructor
*
* @{
* \package Geant4Optical PhotonPhysics
*
* \brief PhysicsConstructor for Optical Photon physics
This plugin allows to enable Optical Photon physics in the physics list
*
* @}
*/
#ifndef DDG4_GEANT4OPTICALPHOTONPHYSICS_H
#define DDG4_GEANT4OPTICALPHOTONPHYSICS_H 1
// Framework include files
#include "DDG4/Geant4PhysicsList.h"
/// Geant4 include files
#include "G4OpAbsorption.hh"
#include "G4OpRayleigh.hh"
#include "G4OpMieHG.hh"
#include "G4OpBoundaryProcess.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleTypes.hh"
#include "G4ParticleTable.hh"
#include "G4ProcessManager.hh"
/// Namespace for the AIDA detector description toolkit
namespace dd4hep {
/// Namespace for the Geant4 based simulation part of the AIDA detector description toolkit
namespace sim {
/// Geant4 physics list action to enable OpticalPhoton physics
/**
* \author M.Frank
* \version 1.0
* \ingroup DD4HEP_SIMULATION
*/
class Geant4OpticalPhotonPhysics : public Geant4PhysicsList {
public:
/// Default constructor
Geant4OpticalPhotonPhysics() = delete;
/// Copy constructor
Geant4OpticalPhotonPhysics(const Geant4OpticalPhotonPhysics&) = delete;
/// Initializing constructor
Geant4OpticalPhotonPhysics(Geant4Context* ctxt, const std::string& nam)
: Geant4PhysicsList(ctxt, nam)
{
declareProperty("VerboseLevel", m_verbosity = 0);
}
/// Default destructor
virtual ~Geant4OpticalPhotonPhysics() = default;
/// Callback to construct processes (uses the G4 particle table)
virtual void constructProcesses(G4VUserPhysicsList* physics_list) {
this->Geant4PhysicsList::constructProcesses(physics_list);
info("+++ Constructing optical_photon processes:");
info("+++ G4OpAbsorption G4OpRayleigh G4OpMieHG G4OpBoundaryProcess");
G4ParticleTable* table = G4ParticleTable::GetParticleTable();
G4ParticleDefinition* particle = table->FindParticle("opticalphoton");
if (0 == particle) {
except("++ Cannot resolve 'opticalphoton' particle definition!");
}
G4OpBoundaryProcess* fBoundaryProcess = new G4OpBoundaryProcess();
G4OpAbsorption* fAbsorptionProcess = new G4OpAbsorption();
G4OpRayleigh* fRayleighScatteringProcess = new G4OpRayleigh();
G4OpMieHG* fMieHGScatteringProcess = new G4OpMieHG();
fAbsorptionProcess->SetVerboseLevel(m_verbosity);
fRayleighScatteringProcess->SetVerboseLevel(m_verbosity);
fMieHGScatteringProcess->SetVerboseLevel(m_verbosity);
fBoundaryProcess->SetVerboseLevel(m_verbosity);
G4ProcessManager* pmanager = particle->GetProcessManager();
pmanager->AddDiscreteProcess(fAbsorptionProcess);
pmanager->AddDiscreteProcess(fRayleighScatteringProcess);
pmanager->AddDiscreteProcess(fMieHGScatteringProcess);
pmanager->AddDiscreteProcess(fBoundaryProcess);
}
private:
int m_verbosity;
};
}
}
#endif // DDG4_GEANT4OPTICALPHOTONPHYSICS_H
#include "DDG4/Factories.h"
using namespace dd4hep::sim;
DECLARE_GEANT4ACTION(Geant4OpticalPhotonPhysics)