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