source: trunk/examples/novice/N04/include/ExN04CalorimeterHit.hh @ 1309

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

update

File size: 3.9 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#ifndef ExN04CalorimeterHit_h
28#define ExN04CalorimeterHit_h 1
29
30#include "G4VHit.hh"
31#include "G4THitsCollection.hh"
32#include "G4Allocator.hh"
33#include "G4ThreeVector.hh"
34#include "G4LogicalVolume.hh"
35#include "G4Transform3D.hh"
36#include "G4RotationMatrix.hh"
37
38class G4AttDef;
39
40class ExN04CalorimeterHit : public G4VHit
41{
42  public:
43
44      ExN04CalorimeterHit();
45      ExN04CalorimeterHit(G4LogicalVolume* logVol,G4int z,G4int phi);
46      ~ExN04CalorimeterHit();
47      ExN04CalorimeterHit(const ExN04CalorimeterHit &right);
48      const ExN04CalorimeterHit& operator=(const ExN04CalorimeterHit &right);
49      G4int operator==(const ExN04CalorimeterHit &right) const;
50
51      inline void *operator new(size_t);
52      inline void operator delete(void *aHit);
53
54      void Draw();
55      const std::map<G4String,G4AttDef>* GetAttDefs() const;
56      std::vector<G4AttValue>* CreateAttValues() const;
57      void Print();
58
59  private:
60      G4int ZCellID;
61      G4int PhiCellID;
62      G4double edep;
63      G4ThreeVector pos;
64      G4RotationMatrix rot;
65      const G4LogicalVolume* pLogV;
66      static std::map<G4String,G4AttDef> fAttDefs;
67
68  public:
69      inline void SetCellID(G4int z,G4int phi)
70      {
71        ZCellID = z;
72        PhiCellID = phi;
73      }
74      inline G4int GetZ() { return ZCellID; }
75      inline G4int GetPhi() { return PhiCellID; }
76      inline void SetEdep(G4double de)
77      { edep = de; }
78      inline void AddEdep(G4double de)
79      { edep += de; }
80      inline G4double GetEdep()
81      { return edep; }
82      inline void SetPos(G4ThreeVector xyz)
83      { pos = xyz; }
84      inline G4ThreeVector GetPos()
85      { return pos; }
86      inline void SetRot(G4RotationMatrix rmat)
87      { rot = rmat; }
88      inline G4RotationMatrix GetRot()
89      { return rot; }
90      inline const G4LogicalVolume * GetLogV()
91      { return pLogV; }
92
93};
94
95typedef G4THitsCollection<ExN04CalorimeterHit> ExN04CalorimeterHitsCollection;
96
97extern G4Allocator<ExN04CalorimeterHit> ExN04CalorimeterHitAllocator;
98
99inline void* ExN04CalorimeterHit::operator new(size_t)
100{
101  void *aHit;
102  aHit = (void *) ExN04CalorimeterHitAllocator.MallocSingle();
103  return aHit;
104}
105
106inline void ExN04CalorimeterHit::operator delete(void *aHit)
107{
108  ExN04CalorimeterHitAllocator.FreeSingle((ExN04CalorimeterHit*) aHit);
109}
110
111#endif
112
113
Note: See TracBrowser for help on using the repository browser.