source: trunk/examples/extended/analysis/A01/include/A01EmCalorimeterHit.hh@ 1036

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

update

File size: 3.9 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// $Id: A01EmCalorimeterHit.hh,v 1.5 2006/06/29 16:31:02 gunter Exp $
27// --------------------------------------------------------------
28//
29#ifndef A01EmCalorimeterHit_h
30#define A01EmCalorimeterHit_h 1
31
32#include "G4VHit.hh"
33#include "G4THitsCollection.hh"
34#include "G4Allocator.hh"
35#include "G4ThreeVector.hh"
36#include "G4LogicalVolume.hh"
37#include "G4Transform3D.hh"
38#include "G4RotationMatrix.hh"
39
40class G4AttDef;
41class G4AttValue;
42
43class A01EmCalorimeterHit : public G4VHit
44{
45 public:
46
47 A01EmCalorimeterHit();
48 A01EmCalorimeterHit(G4int z);
49 virtual ~A01EmCalorimeterHit();
50 A01EmCalorimeterHit(const A01EmCalorimeterHit &right);
51 const A01EmCalorimeterHit& operator=(const A01EmCalorimeterHit &right);
52 int operator==(const A01EmCalorimeterHit &right) const;
53
54 inline void *operator new(size_t);
55 inline void operator delete(void *aHit);
56
57 virtual void Draw();
58 virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
59 virtual std::vector<G4AttValue>* CreateAttValues() const;
60 virtual void Print();
61
62 private:
63 G4int cellID;
64 G4double edep;
65 G4ThreeVector pos;
66 G4RotationMatrix rot;
67 const G4LogicalVolume* pLogV;
68
69 public:
70 inline void SetCellID(G4int z) { cellID = z; }
71 inline G4int GetCellID() const { return cellID; }
72 inline void SetEdep(G4double de) { edep = de; }
73 inline void AddEdep(G4double de) { edep += de; }
74 inline G4double GetEdep() const { return edep; }
75 inline void SetPos(G4ThreeVector xyz) { pos = xyz; }
76 inline G4ThreeVector GetPos() const { return pos; }
77 inline void SetRot(G4RotationMatrix rmat) { rot = rmat; }
78 inline G4RotationMatrix GetRot() const { return rot; }
79 inline void SetLogV(G4LogicalVolume* val) { pLogV = val; }
80 inline const G4LogicalVolume* GetLogV() const { return pLogV; }
81};
82
83typedef G4THitsCollection<A01EmCalorimeterHit> A01EmCalorimeterHitsCollection;
84
85extern G4Allocator<A01EmCalorimeterHit> A01EmCalorimeterHitAllocator;
86
87inline void* A01EmCalorimeterHit::operator new(size_t)
88{
89 void* aHit;
90 aHit = (void*)A01EmCalorimeterHitAllocator.MallocSingle();
91 return aHit;
92}
93
94inline void A01EmCalorimeterHit::operator delete(void* aHit)
95{
96 A01EmCalorimeterHitAllocator.FreeSingle((A01EmCalorimeterHit*) aHit);
97}
98
99#endif
100
101
Note: See TracBrowser for help on using the repository browser.