Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
H02MuonHit.hh
Go to the documentation of this file.
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 //
28 //
29 // ====================================================================
30 //
31 // H02MuonHit.hh
32 // $Id$
33 //
34 // ====================================================================
35 #ifndef H02_MUON_HIT_H
36 #define H02_MUON_HIT_H
37 
38 #include "G4VHit.hh"
39 #include "G4THitsCollection.hh"
40 #include "G4Allocator.hh"
41 #include "G4ThreeVector.hh"
42 
43 class H02MuonHit : public G4VHit {
44 private:
45  G4int moduleID;
46  G4String pname;
47  G4ThreeVector momentum;
49  G4double tof;
50 
51 public:
52  H02MuonHit();
53  H02MuonHit(G4int imod, G4String aname, const G4ThreeVector& pxyz,
54  const G4ThreeVector& xyz, G4double atof);
55  ~H02MuonHit();
56 
57  H02MuonHit(const H02MuonHit& right);
58  const H02MuonHit& operator=(const H02MuonHit& right);
59  G4int operator==(const H02MuonHit& right) const;
60 
61  void* operator new(size_t);
62  void operator delete(void* aHit);
63 
64  // set/get functions...
65  void SetModuleID(G4int i);
66  G4int GetModuleID() const;
67 
68  void SetParticle(G4String aname);
69  G4String GetParticle() const;
70 
71  void SetMomentum(const G4ThreeVector& pxyz);
72  G4ThreeVector GetMomentum() const;
73 
74  void SetPosition(const G4ThreeVector& xyz);
75  G4ThreeVector GetPosition() const;
76 
77  void SetTOF(G4double atof);
78  G4double GetTOF() const;
79 
80  // methods...
81  virtual void Draw();
82  virtual void Print();
83 };
84 
85 // ====================================================================
86 // inline functions
87 // ====================================================================
88 
89 inline void H02MuonHit::SetModuleID(G4int i) { moduleID=i; }
90 inline G4int H02MuonHit::GetModuleID() const { return moduleID; }
91 
92 inline void H02MuonHit::SetParticle(G4String aname) { pname=aname; }
93 inline G4String H02MuonHit::GetParticle() const { return pname; }
94 
95 inline void H02MuonHit::SetMomentum(const G4ThreeVector& pxyz)
96 { momentum=pxyz; }
97 inline G4ThreeVector H02MuonHit::GetMomentum() const { return momentum; }
98 
99 inline void H02MuonHit::SetPosition(const G4ThreeVector& xyz) { position=xyz; }
101 
102 inline void H02MuonHit::SetTOF(G4double atof) { tof=atof; }
103 inline G4double H02MuonHit::GetTOF() const { return tof; }
104 
107 
108 inline void* H02MuonHit::operator new(size_t)
109 {
110  void* aHit;
111  aHit= (void*)H02MuonHitAllocator.MallocSingle();
112  return aHit;
113 }
114 
115 inline void H02MuonHit::operator delete(void* aHit)
116 {
117  H02MuonHitAllocator.FreeSingle((H02MuonHit*) aHit);
118 }
119 
120 #endif