Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 /// \file field/field01/include/F01CalorHit.hh << 27 /// \brief Definition of the F01CalorHit class << 28 // 23 // >> 24 // $Id: F01CalorHit.hh,v 1.3 2003/06/25 17:40:46 gcosmo Exp $ >> 25 // GEANT4 tag $Name: geant4-07-00-patch-01 $ 29 // 26 // 30 // << 27 // 31 // << 28 32 //....oooOO0OOooo........oooOO0OOooo........oo << 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 33 //....oooOO0OOooo........oooOO0OOooo........oo << 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 34 31 35 #ifndef F01CalorHit_h 32 #ifndef F01CalorHit_h 36 #define F01CalorHit_h 1 33 #define F01CalorHit_h 1 37 34 38 #include "G4Allocator.hh" << 39 #include "G4THitsCollection.hh" << 40 #include "G4VHit.hh" 35 #include "G4VHit.hh" >> 36 #include "G4THitsCollection.hh" >> 37 #include "G4Allocator.hh" 41 38 42 //....oooOO0OOooo........oooOO0OOooo........oo << 39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 43 40 44 class F01CalorHit : public G4VHit 41 class F01CalorHit : public G4VHit 45 { 42 { 46 public: 43 public: 47 F01CalorHit() = default; << 48 F01CalorHit(const F01CalorHit&); << 49 ~F01CalorHit() override = default; << 50 << 51 const F01CalorHit& operator=(const F01Calo << 52 G4bool operator==(const F01CalorHit&) cons << 53 44 54 inline void* operator new(size_t); << 45 F01CalorHit(); 55 inline void operator delete(void*); << 46 ~F01CalorHit(); >> 47 F01CalorHit(const F01CalorHit&); >> 48 const F01CalorHit& operator=(const F01CalorHit&); >> 49 G4int operator==(const F01CalorHit&) const; 56 50 57 void Print() override; << 51 inline void* operator new(size_t); >> 52 inline void operator delete(void*); 58 53 >> 54 void Print(); >> 55 59 public: 56 public: 60 void AddAbs(G4double de, G4double dl) << 57 61 { << 58 void AddAbs(G4double de, G4double dl) {EdepAbs += de; TrackLengthAbs += dl;}; 62 fEdepAbs += de; << 59 void AddGap(G4double de, G4double dl) {EdepGap += de; TrackLengthGap += dl;}; 63 fTrackLengthAbs += dl; << 60 64 }; << 61 G4double GetEdepAbs() { return EdepAbs; }; 65 void AddGap(G4double de, G4double dl) << 62 G4double GetTrakAbs() { return TrackLengthAbs; }; 66 { << 63 G4double GetEdepGap() { return EdepGap; }; 67 fEdepGap += de; << 64 G4double GetTrakGap() { return TrackLengthGap; }; 68 fTrackLengthGap += dl; << 65 69 }; << 70 << 71 G4double GetEdepAbs() { return fEdepAbs; } << 72 G4double GetTrackAbs() { return fTrackLeng << 73 G4double GetEdepGap() { return fEdepGap; } << 74 G4double GetTrackGap() { return fTrackLeng << 75 << 76 private: 66 private: 77 G4double fEdepAbs = 0.; << 67 78 G4double fTrackLengthAbs = 0.; << 68 G4double EdepAbs, TrackLengthAbs; 79 G4double fEdepGap = 0.; << 69 G4double EdepGap, TrackLengthGap; 80 G4double fTrackLengthGap = 0.; << 70 81 }; 71 }; 82 72 83 //....oooOO0OOooo........oooOO0OOooo........oo << 73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 84 74 85 using F01CalorHitsCollection = G4THitsCollecti << 75 typedef G4THitsCollection<F01CalorHit> F01CalorHitsCollection; 86 76 87 extern G4ThreadLocal G4Allocator<F01CalorHit>* << 77 extern G4Allocator<F01CalorHit> F01CalorHitAllocator; 88 78 89 //....oooOO0OOooo........oooOO0OOooo........oo << 79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 90 80 91 inline void* F01CalorHit::operator new(size_t) 81 inline void* F01CalorHit::operator new(size_t) 92 { 82 { 93 if (!F01CalorHitAllocator) F01CalorHitAlloca << 83 void* aHit; 94 return (void*)F01CalorHitAllocator->MallocSi << 84 aHit = (void*) F01CalorHitAllocator.MallocSingle(); >> 85 return aHit; 95 } 86 } 96 87 97 //....oooOO0OOooo........oooOO0OOooo........oo << 88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 98 89 99 inline void F01CalorHit::operator delete(void* 90 inline void F01CalorHit::operator delete(void* aHit) 100 { 91 { 101 F01CalorHitAllocator->FreeSingle((F01CalorHi << 92 F01CalorHitAllocator.FreeSingle((F01CalorHit*) aHit); 102 } 93 } 103 94 104 #endif 95 #endif >> 96 >> 97 105 98