source: trunk/examples/extended/eventgenerator/HepMC/HepMCEx02/include/H02MuonHit.hh @ 828

Last change on this file since 828 was 807, checked in by garnier, 16 years ago

update

File size: 4.1 KB
Line 
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
40class H02MuonHit : public G4VHit {
41private:
42  G4int moduleID;
43  G4String pname;
44  G4ThreeVector momentum;
45  G4ThreeVector position;
46  G4double tof;
47
48public:
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
86inline void H02MuonHit::SetModuleID(G4int i) { moduleID=i; }
87inline G4int H02MuonHit::GetModuleID() const { return moduleID; }
88
89inline void H02MuonHit::SetParticle(G4String aname) { pname=aname; }
90inline G4String H02MuonHit::GetParticle() const { return pname; }
91
92inline void H02MuonHit::SetMomentum(const G4ThreeVector& pxyz) 
93{ momentum=pxyz; }
94inline G4ThreeVector H02MuonHit::GetMomentum() const { return momentum; }
95
96inline void H02MuonHit::SetPosition(const G4ThreeVector& xyz) { position=xyz; }
97inline G4ThreeVector H02MuonHit::GetPosition() const { return position; }
98
99inline void H02MuonHit::SetTOF(G4double atof) { tof=atof; }
100inline G4double H02MuonHit::GetTOF() const { return tof; }
101
102typedef G4THitsCollection<H02MuonHit> H02MuonHitsCollection;
103extern G4Allocator<H02MuonHit> H02MuonHitAllocator;
104
105inline void* H02MuonHit::operator new(size_t)
106{
107  void* aHit;
108  aHit= (void*)H02MuonHitAllocator.MallocSingle();
109  return aHit;
110}
111
112inline void H02MuonHit::operator delete(void* aHit)
113{
114  H02MuonHitAllocator.FreeSingle((H02MuonHit*) aHit);
115}
116
117#endif
Note: See TracBrowser for help on using the repository browser.