source: trunk/examples/extended/parallel/ParN04/include/ExN04CalorimeterHit.hh@ 809

Last change on this file since 809 was 807, checked in by garnier, 17 years ago

update

File size: 4.3 KB
RevLine 
[807]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#ifndef ExN04CalorimeterHit_h
28#define ExN04CalorimeterHit_h 1
29
30
31//MSH_include_begin
32#include "MarshaledG4String.h"
33//MSH_include_end
34
35
36#include "G4VHit.hh"
37#include "G4THitsCollection.hh"
38#include "G4Allocator.hh"
39#include "G4ThreeVector.hh"
40#include "G4LogicalVolume.hh"
41#include "G4Transform3D.hh"
42#include "G4RotationMatrix.hh"
43
44
45//MSH_BEGIN
46class ExN04CalorimeterHit : public G4VHit
47{
48 public:
49
50 ExN04CalorimeterHit();
51 ExN04CalorimeterHit(G4LogicalVolume* logVol,G4int z,G4int phi);
52 ~ExN04CalorimeterHit();
53 ExN04CalorimeterHit(const ExN04CalorimeterHit &right);
54 const ExN04CalorimeterHit& operator=(const ExN04CalorimeterHit &right);
55 int operator==(const ExN04CalorimeterHit &right) const;
56
57 inline void *operator new(size_t);
58 inline void operator delete(void *aHit);
59
60 void Draw();
61 void Print();
62
63 private:
64
65 G4int ZCellID; /*MSH: primitive
66 [elementGet: { $ELEMENT = $THIS->GetZ(); }]
67 [elementSet: { $THIS->SetCellID($ELEMENT, $THIS->GetPhi()); }] */
68
69 G4int PhiCellID; /*MSH: primitive
70 [elementGet: { $ELEMENT = $THIS->GetPhi(); }]
71 [elementSet: { $THIS->SetCellID($THIS->GetZ(), $ELEMENT); }] */
72
73
74 G4double edep; /*MSH: primitive
75 [elementGet: { $ELEMENT = $THIS->GetEdep(); }]
76 [elementSet: { $THIS->SetEdep($ELEMENT); }] */
77
78 G4ThreeVector pos; /*MSH: primitive
79 [elementGet: { $ELEMENT = $THIS->GetPos(); }]
80 [elementSet: { $THIS->SetPos($ELEMENT); }] */
81
82 G4RotationMatrix rot;
83 const G4LogicalVolume* pLogV;
84
85
86
87 public:
88 inline void SetCellID(G4int z,G4int phi)
89 {
90 ZCellID = z;
91 PhiCellID = phi;
92 }
93 inline G4int GetZ() { return ZCellID; }
94 inline G4int GetPhi() { return PhiCellID; }
95 inline void SetEdep(G4double de)
96 { edep = de; }
97 inline void AddEdep(G4double de)
98 { edep += de; }
99 inline G4double GetEdep()
100 { return edep; }
101 inline void SetPos(G4ThreeVector xyz)
102 { pos = xyz; }
103 inline G4ThreeVector GetPos()
104 { return pos; }
105 inline void SetRot(G4RotationMatrix rmat)
106 { rot = rmat; }
107 inline G4RotationMatrix GetRot()
108 { return rot; }
109 inline const G4LogicalVolume * GetLogV()
110 { return pLogV; }
111
112};
113//MSH_END
114
115typedef G4THitsCollection<ExN04CalorimeterHit> ExN04CalorimeterHitsCollection;
116
117extern G4Allocator<ExN04CalorimeterHit> ExN04CalorimeterHitAllocator;
118
119inline void* ExN04CalorimeterHit::operator new(size_t)
120{
121 void *aHit;
122 aHit = (void *) ExN04CalorimeterHitAllocator.MallocSingle();
123 return aHit;
124}
125
126inline void ExN04CalorimeterHit::operator delete(void *aHit)
127{
128 ExN04CalorimeterHitAllocator.FreeSingle((ExN04CalorimeterHit*) aHit);
129}
130
131#endif
132
133
Note: See TracBrowser for help on using the repository browser.