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 // 26 // 27 /// \file optical/wls/src/WLSPhotonDetHit.cc 27 /// \file optical/wls/src/WLSPhotonDetHit.cc 28 /// \brief Implementation of the WLSPhotonDetH 28 /// \brief Implementation of the WLSPhotonDetHit class 29 // 29 // 30 // 30 // 31 #include "WLSPhotonDetHit.hh" 31 #include "WLSPhotonDetHit.hh" 32 32 33 #include "G4UnitsTable.hh" 33 #include "G4UnitsTable.hh" 34 34 35 G4ThreadLocal G4Allocator<WLSPhotonDetHit>* WL 35 G4ThreadLocal G4Allocator<WLSPhotonDetHit>* WLSPhotonDetHitAllocator = nullptr; 36 36 37 //....oooOO0OOooo........oooOO0OOooo........oo 37 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 38 38 39 WLSPhotonDetHit::WLSPhotonDetHit() 39 WLSPhotonDetHit::WLSPhotonDetHit() 40 { 40 { 41 fPosArrive = G4ThreeVector(0., 0., 0.); << 41 fArrivalTime = 0.; 42 fPosExit = G4ThreeVector(0., 0., 0.); << 42 fEnergy = 0.; >> 43 fPosArrive = G4ThreeVector(0., 0., 0.); >> 44 fPosExit = G4ThreeVector(0., 0., 0.); 43 } 45 } 44 46 45 //....oooOO0OOooo........oooOO0OOooo........oo 47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 46 48 47 WLSPhotonDetHit::WLSPhotonDetHit(G4ThreeVector << 49 WLSPhotonDetHit::WLSPhotonDetHit(G4ThreeVector pExit, G4ThreeVector pArrive, 48 G4double pEne << 50 G4double pTime, G4double pEnergy) 49 { 51 { 50 fPosExit = pExit; << 52 fPosExit = pExit; 51 fPosArrive = pArrive; << 53 fPosArrive = pArrive; 52 fArrivalTime = pTime; 54 fArrivalTime = pTime; 53 fEnergy = pEnergy; << 55 fEnergy = pEnergy; 54 } 56 } 55 57 56 //....oooOO0OOooo........oooOO0OOooo........oo 58 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 57 59 58 WLSPhotonDetHit::WLSPhotonDetHit(const WLSPhot << 60 WLSPhotonDetHit::~WLSPhotonDetHit() {} >> 61 >> 62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 63 >> 64 WLSPhotonDetHit::WLSPhotonDetHit(const WLSPhotonDetHit& right) >> 65 : G4VHit() 59 { 66 { 60 *this = right; 67 *this = right; 61 } 68 } 62 69 63 //....oooOO0OOooo........oooOO0OOooo........oo 70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 64 71 65 const WLSPhotonDetHit& WLSPhotonDetHit::operat 72 const WLSPhotonDetHit& WLSPhotonDetHit::operator=(const WLSPhotonDetHit& right) 66 { 73 { 67 fPosExit = right.fPosExit; << 74 fPosExit = right.fPosExit; 68 fPosArrive = right.fPosArrive; << 75 fPosArrive = right.fPosArrive; 69 fArrivalTime = right.fArrivalTime; 76 fArrivalTime = right.fArrivalTime; 70 fEnergy = right.fEnergy; << 77 fEnergy = right.fEnergy; 71 78 72 return *this; 79 return *this; 73 } 80 } 74 81 75 //....oooOO0OOooo........oooOO0OOooo........oo 82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 76 83 77 G4bool WLSPhotonDetHit::operator==(const WLSPh 84 G4bool WLSPhotonDetHit::operator==(const WLSPhotonDetHit& right) const 78 { 85 { 79 return fPosExit == right.fPosExit && fPosArr << 86 return fPosExit == right.fPosExit && fPosArrive == right.fPosArrive && 80 && fArrivalTime == right.fArrivalTime << 87 fArrivalTime == right.fArrivalTime && fEnergy == right.fEnergy; 81 } 88 } 82 89 83 void WLSPhotonDetHit::Print() 90 void WLSPhotonDetHit::Print() 84 { 91 { 85 G4cout << "Arrival time: " << std::setw(7) < << 92 G4cout 86 << "Arrival position: (" << std::setw << 93 << "Arrival time: " 87 << std::setw(7) << G4BestUnit(fPosArr << 94 << std::setw(7) << G4BestUnit(fArrivalTime, "Time") 88 << "Exit position: (" << std::setw(7) << 95 << "Arrival position: (" 89 << std::setw(7) << G4BestUnit(fPosExi << 96 << std::setw(7) << G4BestUnit(fPosArrive.x(), "Length") << ", " 90 << "Energy: " << std::setw(7) << G4Be << 97 << std::setw(7) << G4BestUnit(fPosArrive.y(), "Length") << "); " >> 98 << "Exit position: (" >> 99 << std::setw(7) << G4BestUnit(fPosExit.x(), "Length") << ", " >> 100 << std::setw(7) << G4BestUnit(fPosExit.y(), "Length") << "); " >> 101 << "Energy: " >> 102 << std::setw(7) << G4BestUnit(fEnergy, "Energy") >> 103 << G4endl; 91 } 104 } 92 105