Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // Implementation of G4PolyconeHistorical, pol << 27 // 26 // 28 // Author: David C. Williams (davidw@scipp.ucs << 27 // $Id:$ >> 28 // >> 29 // >> 30 // -------------------------------------------------------------------- >> 31 // GEANT 4 class source file >> 32 // >> 33 // >> 34 // G4PolyconeHistorical.cc >> 35 // >> 36 // Implementation of polycone data >> 37 // 29 // ------------------------------------------- 38 // -------------------------------------------------------------------- 30 39 31 #include "G4PolyconeHistorical.hh" 40 #include "G4PolyconeHistorical.hh" 32 41 33 G4PolyconeHistorical::G4PolyconeHistorical() = << 42 G4PolyconeHistorical::G4PolyconeHistorical() >> 43 : Start_angle(0.), Opening_angle(0.), Num_z_planes(0), >> 44 Z_values(0), Rmin(0), Rmax(0) >> 45 { >> 46 } 34 47 35 G4PolyconeHistorical:: 48 G4PolyconeHistorical:: 36 G4PolyconeHistorical( G4int z_planes ) 49 G4PolyconeHistorical( G4int z_planes ) 37 : Num_z_planes(z_planes) << 50 : Start_angle(0.), Opening_angle(0.), Num_z_planes(z_planes) 38 { 51 { 39 Z_values = new G4double[z_planes]; 52 Z_values = new G4double[z_planes]; 40 Rmin = new G4double[z_planes]; 53 Rmin = new G4double[z_planes]; 41 Rmax = new G4double[z_planes]; 54 Rmax = new G4double[z_planes]; 42 55 43 for( G4int i = 0; i < z_planes; ++i) << 56 for( G4int i = 0; i < z_planes; i++) 44 { 57 { 45 Z_values[i] = 0.0; 58 Z_values[i] = 0.0; 46 Rmin[i] = 0.0; 59 Rmin[i] = 0.0; 47 Rmax[i] = 0.0; 60 Rmax[i] = 0.0; 48 } 61 } 49 } 62 } 50 63 51 G4PolyconeHistorical::~G4PolyconeHistorical() 64 G4PolyconeHistorical::~G4PolyconeHistorical() 52 { 65 { 53 delete [] Z_values; 66 delete [] Z_values; 54 delete [] Rmin; 67 delete [] Rmin; 55 delete [] Rmax; 68 delete [] Rmax; 56 } 69 } 57 70 58 G4PolyconeHistorical:: 71 G4PolyconeHistorical:: 59 G4PolyconeHistorical( const G4PolyconeHistoric << 72 G4PolyconeHistorical( const G4PolyconeHistorical &source ) 60 { 73 { 61 Start_angle = source.Start_angle; 74 Start_angle = source.Start_angle; 62 Opening_angle = source.Opening_angle; 75 Opening_angle = source.Opening_angle; 63 Num_z_planes = source.Num_z_planes; 76 Num_z_planes = source.Num_z_planes; 64 77 65 Z_values = new G4double[Num_z_planes]; 78 Z_values = new G4double[Num_z_planes]; 66 Rmin = new G4double[Num_z_planes]; 79 Rmin = new G4double[Num_z_planes]; 67 Rmax = new G4double[Num_z_planes]; 80 Rmax = new G4double[Num_z_planes]; 68 81 69 for( G4int i = 0; i < Num_z_planes; ++i) << 82 for( G4int i = 0; i < Num_z_planes; i++) 70 { 83 { 71 Z_values[i] = source.Z_values[i]; 84 Z_values[i] = source.Z_values[i]; 72 Rmin[i] = source.Rmin[i]; 85 Rmin[i] = source.Rmin[i]; 73 Rmax[i] = source.Rmax[i]; 86 Rmax[i] = source.Rmax[i]; 74 } 87 } 75 } 88 } 76 89 77 G4PolyconeHistorical& 90 G4PolyconeHistorical& 78 G4PolyconeHistorical::operator=( const G4Polyc 91 G4PolyconeHistorical::operator=( const G4PolyconeHistorical& right ) 79 { 92 { 80 if ( &right == this ) return *this; 93 if ( &right == this ) return *this; 81 94 82 Start_angle = right.Start_angle; 95 Start_angle = right.Start_angle; 83 Opening_angle = right.Opening_angle; 96 Opening_angle = right.Opening_angle; 84 Num_z_planes = right.Num_z_planes; 97 Num_z_planes = right.Num_z_planes; 85 98 86 delete [] Z_values; 99 delete [] Z_values; 87 delete [] Rmin; 100 delete [] Rmin; 88 delete [] Rmax; 101 delete [] Rmax; 89 Z_values = new G4double[Num_z_planes]; 102 Z_values = new G4double[Num_z_planes]; 90 Rmin = new G4double[Num_z_planes]; 103 Rmin = new G4double[Num_z_planes]; 91 Rmax = new G4double[Num_z_planes]; 104 Rmax = new G4double[Num_z_planes]; 92 105 93 for( G4int i = 0; i < Num_z_planes; ++i) << 106 for( G4int i = 0; i < Num_z_planes; i++) 94 { 107 { 95 Z_values[i] = right.Z_values[i]; 108 Z_values[i] = right.Z_values[i]; 96 Rmin[i] = right.Rmin[i]; 109 Rmin[i] = right.Rmin[i]; 97 Rmax[i] = right.Rmax[i]; 110 Rmax[i] = right.Rmax[i]; 98 } 111 } 99 112 100 return *this; 113 return *this; 101 } 114 } 102 115