[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 | // $Id: BrachyPhantomHit.hh,v 1.3 2006/06/29 17:32:14 gunter Exp $ |
---|
| 28 | // GEANT4 tag $Name: $ |
---|
| 29 | // |
---|
| 30 | // |
---|
| 31 | // ******************************** |
---|
| 32 | // * * |
---|
| 33 | // * BrachyPhantomHit.hh * |
---|
| 34 | // * * |
---|
| 35 | // ******************************** |
---|
| 36 | // |
---|
| 37 | //Code developed by: S. Guatelli |
---|
| 38 | // |
---|
| 39 | // It manages the hits and the enrgy deposit in the phantom associated with |
---|
| 40 | // each hit ... |
---|
| 41 | |
---|
| 42 | #ifndef BrachyPhantomHit_h |
---|
| 43 | #define BrachyPhantomHit_h 1 |
---|
| 44 | |
---|
| 45 | #include "G4VHit.hh" |
---|
| 46 | #include "G4THitsCollection.hh" |
---|
| 47 | #include "G4Allocator.hh" |
---|
| 48 | #include "G4ThreeVector.hh" |
---|
| 49 | #include "G4LogicalVolume.hh" |
---|
| 50 | #include "G4Transform3D.hh" |
---|
| 51 | #include "G4RotationMatrix.hh" |
---|
| 52 | |
---|
| 53 | class BrachyPhantomHit : public G4VHit |
---|
| 54 | { |
---|
| 55 | public: |
---|
| 56 | BrachyPhantomHit(G4LogicalVolume* ,G4int ,G4int ,G4int ); |
---|
| 57 | ~BrachyPhantomHit(); |
---|
| 58 | BrachyPhantomHit(const BrachyPhantomHit &right); |
---|
| 59 | const BrachyPhantomHit& operator = (const BrachyPhantomHit &right); |
---|
| 60 | int operator == (const BrachyPhantomHit &right) const; |
---|
| 61 | |
---|
| 62 | inline void *operator new(size_t); |
---|
| 63 | inline void operator delete(void *aHit); |
---|
| 64 | |
---|
| 65 | void Draw(); |
---|
| 66 | void Print(); |
---|
| 67 | |
---|
| 68 | private: |
---|
| 69 | const G4LogicalVolume* logicalVolume;// Logical volume where the hit happened |
---|
| 70 | G4int xHitPosition; // Hit x coordinate |
---|
| 71 | G4int zHitPosition; // Hit z coordinate |
---|
| 72 | G4int yHitPosition; // Hit y coordinate |
---|
| 73 | G4ThreeVector hitPosition; //position of the hit |
---|
| 74 | G4RotationMatrix rotation; // rotation of the logical volume |
---|
| 75 | G4double energyDeposit; // energy deposit associated with the hit |
---|
| 76 | |
---|
| 77 | public: |
---|
| 78 | //... |
---|
| 79 | // Set Hit position |
---|
| 80 | inline void SetCellID(G4int XID,G4int YID,G4int ZID) |
---|
| 81 | {xHitPosition = XID; zHitPosition = ZID; yHitPosition = YID; } |
---|
| 82 | |
---|
| 83 | inline G4int GetXID() // Get hit x coordinate |
---|
| 84 | {return xHitPosition;} |
---|
| 85 | |
---|
| 86 | inline G4int GetZID() // Get hit z coordinate |
---|
| 87 | {return zHitPosition;} |
---|
| 88 | |
---|
| 89 | inline G4int GetYID() // Get hit y coordinate |
---|
| 90 | {return yHitPosition;} |
---|
| 91 | |
---|
| 92 | inline void SetEdep(G4double edep) //Set hit energy deposit |
---|
| 93 | {energyDeposit = edep;} |
---|
| 94 | |
---|
| 95 | inline void AddEdep(G4double edep) // Add energy deposit |
---|
| 96 | {energyDeposit += edep;} |
---|
| 97 | |
---|
| 98 | inline G4double GetEdep() // Get energy deposit |
---|
| 99 | {return energyDeposit;} |
---|
| 100 | |
---|
| 101 | inline void SetPos(G4ThreeVector xyz) // Set hit position |
---|
| 102 | {hitPosition = xyz;} |
---|
| 103 | |
---|
| 104 | inline G4ThreeVector GetPos() // Get hit position |
---|
| 105 | {return hitPosition;} |
---|
| 106 | |
---|
| 107 | inline void SetRot(G4RotationMatrix rmat) //set rotation |
---|
| 108 | {rotation = rmat;} |
---|
| 109 | |
---|
| 110 | inline G4RotationMatrix GetRot() //get rotation |
---|
| 111 | {return rotation;} |
---|
| 112 | |
---|
| 113 | //... |
---|
| 114 | // It returns the logical volume where the hit happened |
---|
| 115 | inline const G4LogicalVolume * GetLogicalVolume() |
---|
| 116 | {return logicalVolume;} |
---|
| 117 | }; |
---|
| 118 | |
---|
| 119 | typedef G4THitsCollection<BrachyPhantomHit> BrachyPhantomHitsCollection; |
---|
| 120 | extern G4Allocator<BrachyPhantomHit> BrachyPhantomHitAllocator; |
---|
| 121 | |
---|
| 122 | inline void* BrachyPhantomHit::operator new(size_t) |
---|
| 123 | { |
---|
| 124 | void *aHit; |
---|
| 125 | aHit = (void *) BrachyPhantomHitAllocator.MallocSingle(); |
---|
| 126 | return aHit; |
---|
| 127 | } |
---|
| 128 | |
---|
| 129 | inline void BrachyPhantomHit::operator delete(void *aHit) |
---|
| 130 | { |
---|
| 131 | BrachyPhantomHitAllocator.FreeSingle((BrachyPhantomHit*) aHit); |
---|
| 132 | } |
---|
| 133 | #endif |
---|
| 134 | |
---|
| 135 | |
---|