[807] | 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 | // |
---|
| 28 | // H02MuonHit.hh |
---|
| 29 | // $Id: H02MuonHit.hh,v 1.4 2006/06/29 17:09:53 gunter Exp $ |
---|
| 30 | // |
---|
| 31 | // ==================================================================== |
---|
| 32 | #ifndef H02_MUON_HIT_H |
---|
| 33 | #define H02_MUON_HIT_H |
---|
| 34 | |
---|
| 35 | #include "G4VHit.hh" |
---|
| 36 | #include "G4THitsCollection.hh" |
---|
| 37 | #include "G4Allocator.hh" |
---|
| 38 | #include "G4ThreeVector.hh" |
---|
| 39 | |
---|
| 40 | class H02MuonHit : public G4VHit { |
---|
| 41 | private: |
---|
| 42 | G4int moduleID; |
---|
| 43 | G4String pname; |
---|
| 44 | G4ThreeVector momentum; |
---|
| 45 | G4ThreeVector position; |
---|
| 46 | G4double tof; |
---|
| 47 | |
---|
| 48 | public: |
---|
| 49 | H02MuonHit(); |
---|
| 50 | H02MuonHit(G4int imod, G4String aname, const G4ThreeVector& pxyz, |
---|
| 51 | const G4ThreeVector& xyz, G4double atof); |
---|
| 52 | ~H02MuonHit(); |
---|
| 53 | |
---|
| 54 | H02MuonHit(const H02MuonHit& right); |
---|
| 55 | const H02MuonHit& operator=(const H02MuonHit& right); |
---|
| 56 | G4int operator==(const H02MuonHit& right) const; |
---|
| 57 | |
---|
| 58 | void* operator new(size_t); |
---|
| 59 | void operator delete(void* aHit); |
---|
| 60 | |
---|
| 61 | // set/get functions... |
---|
| 62 | void SetModuleID(G4int i); |
---|
| 63 | G4int GetModuleID() const; |
---|
| 64 | |
---|
| 65 | void SetParticle(G4String aname); |
---|
| 66 | G4String GetParticle() const; |
---|
| 67 | |
---|
| 68 | void SetMomentum(const G4ThreeVector& pxyz); |
---|
| 69 | G4ThreeVector GetMomentum() const; |
---|
| 70 | |
---|
| 71 | void SetPosition(const G4ThreeVector& xyz); |
---|
| 72 | G4ThreeVector GetPosition() const; |
---|
| 73 | |
---|
| 74 | void SetTOF(G4double atof); |
---|
| 75 | G4double GetTOF() const; |
---|
| 76 | |
---|
| 77 | // methods... |
---|
| 78 | virtual void Draw(); |
---|
| 79 | virtual void Print(); |
---|
| 80 | }; |
---|
| 81 | |
---|
| 82 | // ==================================================================== |
---|
| 83 | // inline functions |
---|
| 84 | // ==================================================================== |
---|
| 85 | |
---|
| 86 | inline void H02MuonHit::SetModuleID(G4int i) { moduleID=i; } |
---|
| 87 | inline G4int H02MuonHit::GetModuleID() const { return moduleID; } |
---|
| 88 | |
---|
| 89 | inline void H02MuonHit::SetParticle(G4String aname) { pname=aname; } |
---|
| 90 | inline G4String H02MuonHit::GetParticle() const { return pname; } |
---|
| 91 | |
---|
| 92 | inline void H02MuonHit::SetMomentum(const G4ThreeVector& pxyz) |
---|
| 93 | { momentum=pxyz; } |
---|
| 94 | inline G4ThreeVector H02MuonHit::GetMomentum() const { return momentum; } |
---|
| 95 | |
---|
| 96 | inline void H02MuonHit::SetPosition(const G4ThreeVector& xyz) { position=xyz; } |
---|
| 97 | inline G4ThreeVector H02MuonHit::GetPosition() const { return position; } |
---|
| 98 | |
---|
| 99 | inline void H02MuonHit::SetTOF(G4double atof) { tof=atof; } |
---|
| 100 | inline G4double H02MuonHit::GetTOF() const { return tof; } |
---|
| 101 | |
---|
| 102 | typedef G4THitsCollection<H02MuonHit> H02MuonHitsCollection; |
---|
| 103 | extern G4Allocator<H02MuonHit> H02MuonHitAllocator; |
---|
| 104 | |
---|
| 105 | inline void* H02MuonHit::operator new(size_t) |
---|
| 106 | { |
---|
| 107 | void* aHit; |
---|
| 108 | aHit= (void*)H02MuonHitAllocator.MallocSingle(); |
---|
| 109 | return aHit; |
---|
| 110 | } |
---|
| 111 | |
---|
| 112 | inline void H02MuonHit::operator delete(void* aHit) |
---|
| 113 | { |
---|
| 114 | H02MuonHitAllocator.FreeSingle((H02MuonHit*) aHit); |
---|
| 115 | } |
---|
| 116 | |
---|
| 117 | #endif |
---|