Geant4  10.02
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 //
26 
27 #include "XLogicalAtomicLattice.hh"
28 #include "G4PhysicalConstants.hh"
29 #include <cmath>
30 
33 }
34 
35 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
36 
38 }
39 
40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
41 
44  for(G4int i=0;i<MAXLATTICEATOMS;i++)
45  fLatticeAtomPosition[i] = G4ThreeVector(0.,0.,0.);
46 }
47 
48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
49 
51  if(i<fLatticeAtomNumber){
52  return fLatticeAtomPosition[i];
53  }
54  else{
55  G4cout << "XLogicalAtomicLattice::GetAtomPosition - atom " <<
56  i << " does not exist!!" <<std::endl;
57  }
58  return G4ThreeVector(-1.,-1.,-1.);
59 }
60 
61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
62 
64  return fLatticeAtomNumber;
65 }
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
68 
71  //Add an atom to the lattice
72  fLatticeAtomPosition[fLatticeAtomNumber - 1] = vAtomPosition;
73 }
74 
75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
76 
78  //Delete atoms in the lattice in the selected position
79 
80  for(G4int i=0;i<fLatticeAtomNumber;i++)
81  if(vAtomPosition == fLatticeAtomPosition[i])
82  {
83  for(G4int j=(i+1);j<fLatticeAtomNumber;j++)
84  {
86  }
87  i--;
88  fLatticeAtomNumber--;
89  }
90 }
91 
92 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
93 
96  G4int k,
97  G4int l){
98  G4double vTempDouble = 0.;
99  G4complex vResult = G4complex(0.,0.);
100 
101  for(G4int i=0;i<fLatticeAtomNumber;i++)
102  {
103  vTempDouble = 0.0;
104  vTempDouble += h * fLatticeAtomPosition[i].x();
105  vTempDouble += k * fLatticeAtomPosition[i].y();
106  vTempDouble += l * fLatticeAtomPosition[i].z();
107  vResult += G4complex(std::cos(2 * CLHEP::pi * vTempDouble),
108  std::sin(2 * CLHEP::pi * vTempDouble));
109  }
110 
111  return vResult;
112 }
113 
114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4complex ComputeGeometricalStructureFactorSingleKind(G4int, G4int, G4int)
CLHEP::Hep3Vector G4ThreeVector
int G4int
Definition: G4Types.hh:78
void AddAtom(G4ThreeVector)
std::complex< G4double > G4complex
Definition: G4Types.hh:81
G4GLOB_DLL std::ostream G4cout
#define MAXLATTICEATOMS
G4ThreeVector fLatticeAtomPosition[MAXLATTICEATOMS]
static const double pi
Definition: G4SIunits.hh:74
void DeleteAtom(G4ThreeVector)
double G4double
Definition: G4Types.hh:76
G4ThreeVector GetAtomPosition(G4int i)