Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-08 07:53:40

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /// \file PDBbarycenter.cc
0027 /// \brief Implementation of the PDBbarycenter class
0028 
0029 // This example is provided by the Geant4-DNA collaboration
0030 // Any report or published results obtained using the Geant4-DNA software
0031 // shall cite the following Geant4-DNA collaboration publication:
0032 // Med. Phys. 37 (2010) 4692-4708
0033 // Delage et al. PDB4DNA: implementation of DNA geometry from the Protein Data
0034 //                  Bank (PDB) description for Geant4-DNA Monte-Carlo
0035 //                  simulations (submitted to Comput. Phys. Commun.)
0036 // The Geant4-DNA web site is available at http://geant4-dna.org
0037 //
0038 //
0039 
0040 #include "PDBbarycenter.hh"
0041 
0042 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0043 
0044 Barycenter::Barycenter()
0045   : fBaryNum(0),
0046     fRadius(0),
0047     fCenterX(0),
0048     fCenterY(0),
0049     fCenterZ(0),
0050     fCenterBaseX(0),
0051     fCenterBaseY(0),
0052     fCenterBaseZ(0),
0053     fCenterSugarX(0),
0054     fCenterSugarY(0),
0055     fCenterSugarZ(0),
0056     fCenterPhosphateX(0),
0057     fCenterPhosphateY(0),
0058     fCenterPhosphateZ(0),
0059     fpNext(0)
0060 {
0061   for (int i = 0; i < 33; ++i) {
0062     fDistanceTab[i] = 0.;  // initialization
0063   }
0064 }
0065 
0066 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0067 
0068 Barycenter::Barycenter(int bNum, double x, double y, double z, double Bx, double By,
0069                        double Bz,  // Base barycenter coordinates
0070                        double Sx, double Sy, double Sz,  // Sugar barycenter coordinates
0071                        double Px, double Py, double Pz)  // Phosphate barycenter coordinates
0072 {
0073   fBaryNum = bNum;  //!< Barycenter number
0074   fRadius = 0;
0075   fCenterX = x;
0076   fCenterY = y;
0077   fCenterZ = z;
0078   for (int i = 0; i < 33; ++i) {
0079     fDistanceTab[i] = 0.;  // initialization
0080   }
0081   fCenterBaseX = Bx;  //!< "X coordinate" of this Base Barycenter
0082   fCenterBaseY = By;  //!< "Y coordinate" of this Base Barycenter
0083   fCenterBaseZ = Bz;  //!< "Z coordinate" of this Base Barycenter
0084   fCenterSugarX = Sx;  //!< "X coordinate" of this Sugar Barycenter
0085   fCenterSugarY = Sy;  //!< "Y coordinate" of this Sugar Barycenter
0086   fCenterSugarZ = Sz;  //!< "Z coordinate" of this Sugar Barycenter
0087   fCenterPhosphateX = Px;  //!< "X coordinate" of this Phosphate Barycenter
0088   fCenterPhosphateY = Py;  //!< "Y coordinate" of this Phosphate Barycenter
0089   fCenterPhosphateZ = Pz;  //!< "Z coordinate" of this Phosphate Barycenter
0090   fpNext = 0;
0091 }
0092 
0093 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0094 
0095 Barycenter* Barycenter::GetNext()
0096 {
0097   return fpNext;
0098 }
0099 
0100 int Barycenter::GetID()
0101 {
0102   return fBaryNum;
0103 }
0104 
0105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0106 
0107 void Barycenter::SetNext(Barycenter* barycenterNext)
0108 {
0109   fpNext = barycenterNext;
0110 }
0111 
0112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0113 
0114 void Barycenter::SetDistance(int i, double dist)
0115 {
0116   fDistanceTab[i] = dist;
0117 }
0118 
0119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0120 
0121 double Barycenter::GetDistance(int i)
0122 {
0123   return fDistanceTab[i];
0124 }
0125 
0126 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0127 
0128 void Barycenter::SetRadius(double rds)
0129 {
0130   fRadius = rds;
0131 }
0132 
0133 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0134 
0135 double Barycenter::GetRadius()
0136 {
0137   return fRadius;
0138 }