// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // // -------------------------------------------------------------- // GEANT 4 for Solid // -------------------------------------------------------------- // Comments // by M. Settimo - Subatech // (14 April 2017) // // -------------------------------------------------------------- #ifndef SolidPVTHit_h #define SolidPVTHit_h 1 #include "G4VHit.hh" #include "G4THitsCollection.hh" #include "G4Allocator.hh" #include "G4ThreeVector.hh" #include "G4ProcessType.hh" #include "G4ParticleDefinition.hh" //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... class SolidPVTHit : public G4VHit { public: SolidPVTHit(); ~SolidPVTHit(); SolidPVTHit(const SolidPVTHit&); const SolidPVTHit& operator=(const SolidPVTHit&); int operator==(const SolidPVTHit&) const; inline void* operator new(size_t); inline void operator delete(void*); void Draw(); void Print(); public: void SetTrackID (G4int val) { trackID = val; }; void SetEdep (G4double val) { edep = val; }; void SetParticlePDG (G4int val) { particlePDG = val; }; void SetTime (G4double val) { time = val; }; void SetLayerName (G4String val) { layerName = val; }; void SetTrackLength (G4double val) {trackLength = val;}; void SetMotherID (G4int val) {motherID = val;}; void SetCubeID (G4int val) {cubeID = val;}; G4int GetTrackID() { return trackID; }; G4double GetEdep() { return edep; }; G4int GetParticlePDG() { return particlePDG;}; G4double GetTime() { return time; }; G4String GetLayerName() { return layerName; }; G4double GetTrackLength() { return trackLength; }; G4int GetMotherID() { return motherID; }; G4int GetCubeID() { return cubeID; }; private: G4int trackID; G4double edep; G4double time; G4int motherID; G4int particlePDG; G4double trackLength; G4int cubeID; G4String layerName; }; //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... typedef G4THitsCollection SolidPVTHitsCollection; extern G4ThreadLocal G4Allocator *SolidPVTHitAllocator; //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... inline void* SolidPVTHit::operator new(size_t) { if (!SolidPVTHitAllocator) SolidPVTHitAllocator = new G4Allocator; return (void*) SolidPVTHitAllocator->MallocSingle(); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... inline void SolidPVTHit::operator delete(void* aHit) { SolidPVTHitAllocator->FreeSingle((SolidPVTHit*) aHit); } #endif