Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
B5HodoscopeHit.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 //
26 // $Id: B5HodoscopeHit.hh 76474 2013-11-11 10:36:34Z gcosmo $
27 //
28 /// \file B5HodoscopeHit.hh
29 /// \brief Definition of the B5HodoscopeHit class
30 
31 #ifndef B5HodoscopeHit_h
32 #define B5HodoscopeHit_h 1
33 
34 #include "G4VHit.hh"
35 #include "G4THitsCollection.hh"
36 #include "G4Allocator.hh"
37 #include "G4ThreeVector.hh"
38 #include "G4LogicalVolume.hh"
39 #include "G4Transform3D.hh"
40 #include "G4RotationMatrix.hh"
41 
42 class G4AttDef;
43 class G4AttValue;
44 
45 /// Hodoscope hit
46 ///
47 /// It records:
48 /// - the strip ID
49 /// - the particle time
50 /// - the strip logical volume, its position and rotation
51 
52 class B5HodoscopeHit : public G4VHit
53 {
54 public:
57  virtual ~B5HodoscopeHit();
58 
59  const B5HodoscopeHit& operator=(const B5HodoscopeHit &right);
60  int operator==(const B5HodoscopeHit &right) const;
61 
62  inline void *operator new(size_t);
63  inline void operator delete(void*aHit);
64 
65  void Draw();
66  virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
67  virtual std::vector<G4AttValue>* CreateAttValues() const;
68  void Print();
69 
70  G4int GetID() const { return fId; }
71 
72  void SetTime(G4double val) { fTime = val; }
73  G4double GetTime() const { return fTime; }
74 
75  void SetPos(G4ThreeVector xyz) { fPos = xyz; }
76  G4ThreeVector GetPos() const { return fPos; }
77 
78  void SetRot(G4RotationMatrix rmat) { fRot = rmat; }
79  G4RotationMatrix GetRot() const { return fRot; }
80 
81  void SetLogV(G4LogicalVolume* val) { fPLogV = val; }
82  const G4LogicalVolume* GetLogV() const { return fPLogV; }
83 
84 private:
85  G4int fId;
86  G4double fTime;
87  G4ThreeVector fPos;
88  G4RotationMatrix fRot;
89  const G4LogicalVolume* fPLogV;
90 };
91 
93 
95 
96 inline void* B5HodoscopeHit::operator new(size_t)
97 {
100  return (void*)B5HodoscopeHitAllocator->MallocSingle();
101 }
102 
103 inline void B5HodoscopeHit::operator delete(void*aHit)
104 {
105  B5HodoscopeHitAllocator->FreeSingle((B5HodoscopeHit*) aHit);
106 }
107 
108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
109 
110 #endif
G4THitsCollection< B5HodoscopeHit > B5HodoscopeHitsCollection
void SetPos(G4ThreeVector xyz)
Definition: G4VHit.hh:48
#define G4ThreadLocal
Definition: tls.hh:52
virtual std::vector< G4AttValue > * CreateAttValues() const
int G4int
Definition: G4Types.hh:78
B5HodoscopeHit(G4int i, G4double t)
void SetTime(G4double val)
const G4LogicalVolume * GetLogV() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual ~B5HodoscopeHit()
G4int GetID() const
G4ThreeVector GetPos() const
int operator==(const B5HodoscopeHit &right) const
G4RotationMatrix GetRot() const
void SetRot(G4RotationMatrix rmat)
const B5HodoscopeHit & operator=(const B5HodoscopeHit &right)
double G4double
Definition: G4Types.hh:76
void SetLogV(G4LogicalVolume *val)
G4ThreadLocal G4Allocator< B5HodoscopeHit > * B5HodoscopeHitAllocator
G4double GetTime() const