source: trunk/examples/extended/parallel/ParN02/include/ExN02TrackerHit.hh @ 1346

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

update

File size: 4.2 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//   GEANT 4 - Underground Dark Matter Detector Advanced Example
29//
30//      For information related to this code contact: Alex Howard
31//      e-mail: a.s.howard@ic.ac.uk
32// --------------------------------------------------------------
33// Comments
34//
35//
36// TrackerHit header
37// --------------------------------------------------------------
38
39#ifndef ExN02TrackerHit_h
40#define ExN02TrackerHit_h 1
41
42
43//MSH_include_begin
44#include "MarshaledG4String.h"
45//MSH_include_end
46
47#include "G4VHit.hh"
48#include "G4THitsCollection.hh"
49#include "G4Allocator.hh"
50#include "G4ThreeVector.hh"
51
52
53//MSH_BEGIN
54class ExN02TrackerHit : public G4VHit
55{
56  public:
57
58      ExN02TrackerHit();
59     ~ExN02TrackerHit();
60
61      ExN02TrackerHit(const ExN02TrackerHit&);
62      const ExN02TrackerHit& operator=(const ExN02TrackerHit&);
63      int operator==(const ExN02TrackerHit&) const;
64
65      inline void* operator new(size_t);
66      inline void  operator delete(void*);
67
68      void Draw();
69      void Print();
70
71
72  private:
73  G4ThreeVector pos; /*MSH: primitive
74  [elementGet: { $ELEMENT = $THIS->GetPos(); }]
75  [elementSet: { $THIS->SetPos($ELEMENT); }] */
76
77  G4double edep; /*MSH: primitive
78  [elementGet: { $ELEMENT = $THIS->GetEdep(); }]
79  [elementSet: { $THIS->SetEdep($ELEMENT); }] */
80
81  G4int         trackID; /*MSH: primitive
82  [elementGet: { $ELEMENT = $THIS->GetTrackID(); }]
83  [elementSet: { $THIS->SetTrackID($ELEMENT); }] */
84
85  G4int         chamberNb; /*MSH: primitive
86  [elementGet: { $ELEMENT = $THIS->GetChamberNb(); }]
87  [elementSet: { $THIS->SetChamberNb($ELEMENT); }] */
88
89
90  public:
91     
92  inline void SetTrackID  (G4int track)       {trackID = track; };
93  inline void SetChamberNb(G4int chamb)       {chamberNb = chamb; }; 
94  inline void SetEdep(G4double de)            {edep=de;};
95  inline void SetPos(G4ThreeVector xyz)       {pos=xyz;};
96
97  inline G4int GetTrackID()                   const {return trackID; };
98  inline G4int GetChamberNb()                 const {return chamberNb; };
99  inline G4double GetEdep()                   const {return edep;};
100  inline G4ThreeVector GetPos()               const {return pos;};
101
102};
103//MSH_END
104
105// vector collection of one type of hits
106typedef G4THitsCollection<ExN02TrackerHit> ExN02TrackerHitsCollection;
107
108
109extern G4Allocator<ExN02TrackerHit> ExN02TrackerHitAllocator;
110
111
112inline void* ExN02TrackerHit::operator new(size_t) {
113  void* aHit;
114  aHit = (void*) ExN02TrackerHitAllocator.MallocSingle();
115  return aHit;
116}
117
118
119inline void ExN02TrackerHit::operator delete(void* aHit) {
120  ExN02TrackerHitAllocator.FreeSingle((ExN02TrackerHit*) aHit);
121}
122
123#endif
124
125
126
127
128
Note: See TracBrowser for help on using the repository browser.