Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XLogicalAtomicLattice.cc
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 //
28 //
29 
30 #include "XLogicalAtomicLattice.hh"
31 #include "G4PhysicalConstants.hh"
32 #include <cmath>
33 
36 }
37 
38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
39 
41 }
42 
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
44 
46  fLatticeAtomNumber = 1;
47  for(G4int i=0;i<MAXLATTICEATOMS;i++)
48  fLatticeAtomPosition[i] = G4ThreeVector(0.,0.,0.);
49 }
50 
51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
52 
54  if(i<fLatticeAtomNumber){
55  return fLatticeAtomPosition[i];
56  }
57  else{
58  G4cout << "XLogicalAtomicLattice::GetAtomPosition - atom " <<
59  i << " does not exist!!" <<std::endl;
60  }
61  return G4ThreeVector(-1.,-1.,-1.);
62 }
63 
64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
65 
67  return fLatticeAtomNumber;
68 }
69 
70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
71 
73  fLatticeAtomNumber++;
74  //Add an atom to the lattice
75  fLatticeAtomPosition[fLatticeAtomNumber - 1] = vAtomPosition;
76 }
77 
78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
79 
81  //Delete atoms in the lattice in the selected position
82 
83  for(G4int i=0;i<fLatticeAtomNumber;i++)
84  if(vAtomPosition == fLatticeAtomPosition[i])
85  {
86  for(G4int j=(i+1);j<fLatticeAtomNumber;j++)
87  {
88  fLatticeAtomPosition[j-1]=fLatticeAtomPosition[j];
89  }
90  i--;
91  fLatticeAtomNumber--;
92  }
93 }
94 
95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
96 
99  G4int k,
100  G4int l){
101  G4double vTempDouble = 0.;
102  G4complex vResult = G4complex(0.,0.);
103 
104  for(G4int i=0;i<fLatticeAtomNumber;i++)
105  {
106  vTempDouble = 0.0;
107  vTempDouble += h * fLatticeAtomPosition[i].x();
108  vTempDouble += k * fLatticeAtomPosition[i].y();
109  vTempDouble += l * fLatticeAtomPosition[i].z();
110  vResult += G4complex(std::cos(2 * CLHEP::pi * vTempDouble),
111  std::sin(2 * CLHEP::pi * vTempDouble));
112  }
113 
114  return vResult;
115 }
116 
117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4complex ComputeGeometricalStructureFactorSingleKind(G4int, G4int, G4int)
CLHEP::Hep3Vector G4ThreeVector
double x() const
int G4int
Definition: G4Types.hh:78
void AddAtom(G4ThreeVector)
double z() const
std::complex< G4double > G4complex
Definition: G4Types.hh:81
G4GLOB_DLL std::ostream G4cout
#define MAXLATTICEATOMS
double y() const
Definition of the XLogicalAtomicLattice class.
void DeleteAtom(G4ThreeVector)
double G4double
Definition: G4Types.hh:76
static constexpr double pi
Definition: SystemOfUnits.h:54
G4ThreeVector GetAtomPosition(G4int i)