Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4LogicalCrystalVolume.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4LogicalCrystalVolume
27//
28// Class description:
29//
30// Specialised logical volume for the description of crystals.
31// The object can be created only with an extended material
32// with a crystal extension. The class handles the orientation
33// of the crystal axes wrt the solid to which the crystal is attached.
34
35// Author: Enrico Bagli (Ferrara Univ.), 21.04.2016
36// ---------------------------------------------------------------------------
37#ifndef G4LOGICALCRYSTALVOLUME_HH
38#define G4LOGICALCRYSTALVOLUME_HH
39
40#include <vector>
41#include "G4LogicalVolume.hh"
42
45
46/**
47 * @brief G4LogicalCrystalVolume is a specialised logical volume for the
48 * description of crystals. The object can be created only with an extended
49 * material with a crystal extension. The class handles the orientation
50 * of the crystal axes wrt the solid to which the crystal is attached.
51 */
52
54{
55 public:
56
57 /**
58 * Constructor for G4LogicalCrystalVolume.
59 * @param[in] pSolid Pointer to the associated solid primitive.
60 * @param[in] pMaterial Pointer to the associated extended crystal material.
61 * @param[in] name The volume name.
62 * @param[in] pFieldMgr Pointer to optional magnetic field manager.
63 * @param[in] pSDetector Pointer to optional associated sensitive detector.
64 * @param[in] pULimits Pointer to optional user limits.
65 * @param[in] optimise Flag to enable/disable optimisation structure.
66 * @param[in] h Miller orientation parameter h.
67 * @param[in] k Miller orientation parameter k.
68 * @param[in] l Miller orientation parameter l.
69 * @param[in] rot Miller rotation parameter.
70 */
72 G4ExtendedMaterial* pMaterial,
73 const G4String& name,
74 G4FieldManager* pFieldMgr = nullptr,
75 G4VSensitiveDetector* pSDetector = nullptr,
76 G4UserLimits* pULimits = nullptr,
77 G4bool optimise = true,
78 G4int h = 0,
79 G4int k = 0,
80 G4int l = 0,
81 G4double rot = 0.0);
82
83 /**
84 * Destructor.
85 */
86 ~G4LogicalCrystalVolume() override;
87
88 /**
89 * Returns true as it is not a base-class object.
90 */
91 inline G4bool IsExtended() const override { return true; }
92
93 /**
94 * Sets the physical lattice orientation, relative to G4VSolid coordinates.
95 * Miller orientation aligns lattice normal (hkl) with geometry +Z.
96 */
97 void SetMillerOrientation(G4int h, G4int k, G4int l, G4double rot = 0.0);
98
99 /**
100 * Methods to rotate input vector between lattice and solid orientations.
101 * @returns The new vector value for convenience.
102 */
104 const G4ThreeVector& RotateToSolid(G4ThreeVector& dir) const;
105
106 /**
107 * Returns a pointer to the crystal extension object.
108 */
109 const G4CrystalExtension* GetCrystal() const;
110
111 /**
112 * Calls through to get crystal basis vectors.
113 */
114 const G4ThreeVector& GetBasis(G4int i) const;
115
116 /**
117 * Setter for verbosity level.
118 */
119 inline void SetVerbose(G4int aInt) { verboseLevel = aInt; }
120
121 /**
122 * Returns true if the logical volume 'aLV' is a lattice.
123 */
124 static G4bool IsLattice(G4LogicalVolume* aLV);
125
126 private:
127
128 /** Rotates geometry into lattice frame. */
129 G4RotationMatrix fOrient;
130 G4RotationMatrix fInverse;
131
132 /** Cached Miller indices for dump. */
133 G4int hMiller = 1, kMiller = 1, lMiller = 0;
134 G4double fRot = 0.0;
135
136 /** Verbosity level. */
137 G4int verboseLevel = 0;
138
139 static std::vector<G4LogicalVolume*> fLCVvec;
140};
141
142#endif
CLHEP::HepRotation G4RotationMatrix
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4FieldManager is a manager (store) for a pointer to the Field subclass that describes the field of a...
G4LogicalCrystalVolume(G4VSolid *pSolid, G4ExtendedMaterial *pMaterial, const G4String &name, G4FieldManager *pFieldMgr=nullptr, G4VSensitiveDetector *pSDetector=nullptr, G4UserLimits *pULimits=nullptr, G4bool optimise=true, G4int h=0, G4int k=0, G4int l=0, G4double rot=0.0)
const G4ThreeVector & RotateToSolid(G4ThreeVector &dir) const
static G4bool IsLattice(G4LogicalVolume *aLV)
const G4ThreeVector & GetBasis(G4int i) const
const G4ThreeVector & RotateToLattice(G4ThreeVector &dir) const
const G4CrystalExtension * GetCrystal() const
void SetMillerOrientation(G4int h, G4int k, G4int l, G4double rot=0.0)
G4bool IsExtended() const override
G4LogicalVolume represents a leaf node or unpositioned subtree in the geometry hierarchy....
G4LogicalVolume(G4VSolid *pSolid, G4Material *pMaterial, const G4String &name, G4FieldManager *pFieldMgr=nullptr, G4VSensitiveDetector *pSDetector=nullptr, G4UserLimits *pULimits=nullptr, G4bool optimise=true)
G4VSolid is an abstract base class for solids, physical shapes that can be tracked through....
Definition G4VSolid.hh:80