source: trunk/examples/extended/runAndEvent/RE01/include/RE01CalorimeterHit.hh

Last change on this file was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 4.5 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// $Id: RE01CalorimeterHit.hh,v 1.3 2006/06/29 17:42:29 gunter Exp $
27// GEANT4 tag $Name: geant4-09-04-beta-01 $
28//
29
30
31
32#ifndef RE01CalorimeterHit_h
33#define RE01CalorimeterHit_h 1
34
35#include "G4VHit.hh"
36#include "G4THitsCollection.hh"
37#include "G4Allocator.hh"
38#include "G4ThreeVector.hh"
39#include "G4LogicalVolume.hh"
40#include "G4Transform3D.hh"
41#include "G4RotationMatrix.hh"
42#include "RE01TrackInformation.hh"
43
44class G4AttDef;
45class G4AttValue;
46
47class RE01CalorimeterHit : public G4VHit
48{
49  public:
50
51      RE01CalorimeterHit();
52      RE01CalorimeterHit(G4LogicalVolume* logVol,G4int z,G4int phi);
53      ~RE01CalorimeterHit();
54      RE01CalorimeterHit(const RE01CalorimeterHit &right);
55      const RE01CalorimeterHit& operator=(const RE01CalorimeterHit &right);
56      G4int operator==(const RE01CalorimeterHit &right) const;
57
58      inline void *operator new(size_t);
59      inline void operator delete(void *aHit);
60
61      void Draw();
62      virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
63      virtual std::vector<G4AttValue>* CreateAttValues() const;
64      void Print();
65
66  private:
67      G4int ZCellID;
68      G4int PhiCellID;
69      G4double edep;
70      G4ThreeVector pos;
71      G4RotationMatrix rot;
72      const G4LogicalVolume* pLogV;
73      G4double edepByATrack;
74      RE01TrackInformation trackInfo;
75
76  public:
77      inline void SetCellID(G4int z,G4int phi)
78      {
79        ZCellID = z;
80        PhiCellID = phi;
81      }
82      inline G4int GetZ() { return ZCellID; }
83      inline G4int GetPhi() { return PhiCellID; }
84      inline void SetEdep(G4double de)
85      { edep = de; edepByATrack = de; }
86      inline void AddEdep(G4double de)
87      { edep += de; edepByATrack += de; }
88      inline G4double GetEdep()
89      { return edep; }
90      inline G4double GetEdepByATrack()
91      { return edepByATrack; }
92      inline void ClearEdepByATrack()
93      { edepByATrack = 0.; trackInfo = RE01TrackInformation(); }
94      inline void SetPos(G4ThreeVector xyz)
95      { pos = xyz; }
96      inline G4ThreeVector GetPos()
97      { return pos; }
98      inline void SetRot(G4RotationMatrix rmat)
99      { rot = rmat; }
100      inline G4RotationMatrix GetRot()
101      { return rot; }
102      inline const G4LogicalVolume * GetLogV()
103      { return pLogV; }
104      inline void SetTrackInformation(const G4Track* aTrack)
105      {
106        RE01TrackInformation* anInfo = (RE01TrackInformation*)(aTrack->GetUserInformation());
107        trackInfo = *anInfo;
108      }
109      inline RE01TrackInformation* GetTrackInformation()
110      { return &trackInfo; }
111};
112
113typedef G4THitsCollection<RE01CalorimeterHit> RE01CalorimeterHitsCollection;
114
115extern G4Allocator<RE01CalorimeterHit> RE01CalorimeterHitAllocator;
116
117inline void* RE01CalorimeterHit::operator new(size_t)
118{
119  void *aHit;
120  aHit = (void *) RE01CalorimeterHitAllocator.MallocSingle();
121  return aHit;
122}
123
124inline void RE01CalorimeterHit::operator delete(void *aHit)
125{
126  RE01CalorimeterHitAllocator.FreeSingle((RE01CalorimeterHit*) aHit);
127}
128
129#endif
130
131
Note: See TracBrowser for help on using the repository browser.