LDMX Software
G4BertiniHack.h
Go to the documentation of this file.
1
10#ifndef SIMCORE_BERTINI_G4BERTINIHACK_H
11#define SIMCORE_BERTINI_G4BERTINIHACK_H
12
13// Include standard library headers before the hack or it affects std::
14// internals
15// IWYU pragma: begin_keep
16#include <algorithm>
17#include <cmath>
18#include <cstdlib>
19#include <deque>
20#include <fstream>
21#include <iomanip>
22#include <ios>
23#include <iostream>
24#include <limits>
25#include <list>
26#include <map>
27#include <memory>
28#include <set>
29#include <sstream>
30#include <stack>
31#include <string>
32#include <utility>
33#include <vector>
34
35// Also include CLHEP headers before the hack since they're used by Geant4
36#include "CLHEP/Units/PhysicalConstants.h"
37#include "CLHEP/Units/SystemOfUnits.h"
38#include "CLHEP/Vector/LorentzVector.h"
39#include "CLHEP/Vector/ThreeVector.h"
40
41// Include Geant4 base headers that don't need hacking
42#include "G4LorentzVector.hh"
43#include "G4ThreeVector.hh"
44#include "globals.hh"
45
46// ============================================================================
47// BEGIN HACK: make private AND protected members accessible as public
48// ============================================================================
49// We need public (not protected) because protected members are only accessible
50// from derived classes of that SPECIFIC class. When we have:
51// G4CascadeInterface::collider (G4InuclCollider*)
52// and want to access:
53// collider->theIntraNucleiCascader
54// we need theIntraNucleiCascader to be public, since G4CascadeInterface
55// doesn't inherit from G4InuclCollider.
56//
57// We also need to hack 'protected' because some members like
58// G4CascadeHistory::HistoryEntry are declared protected, not private.
59#define private public
60#define protected public
61
62// Include the Geant4 Bertini cascade headers we need to hack
63// Order matters: include base classes before derived classes
64#include "G4CascadParticle.hh"
65#include "G4CascadeHistory.hh"
66#include "G4CollisionOutput.hh"
67#include "G4ElementaryParticleCollider.hh"
68#include "G4IntraNucleiCascader.hh"
69#include "G4InuclCollider.hh"
70#include "G4InuclElementaryParticle.hh"
71#include "G4InuclNuclei.hh"
72#include "G4NucleiModel.hh"
73
74// Include the main interface last
75#include "G4CascadeInterface.hh"
76// IWYU pragma: end_keep
77
78// ============================================================================
79// END HACK: restore private and protected keywords
80// ============================================================================
81#undef private
82#undef protected
83
84#endif // SIMCORE_BERTINI_G4BERTINIHACK_H