Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-06 16:42:35

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /// \file RMC01DoubleWithWeightHit.hh
0027 /// \brief Definition of the RMC01DoubleWithWeightHit class
0028 
0029 //  Class Name:           RMC01DoubleWithWeightHit
0030 //        Author:               L. Desorgher
0031 //        Organisation:         SpaceIT GmbH
0032 //        Contract:        ESA contract 21435/08/NL/AT
0033 //        Customer:             ESA/ESTEC
0034 //////////////////////////////////////////////////////////////
0035 // CHANGE HISTORY
0036 //--------------
0037 //      ChangeHistory:
0038 //                 17-11-2009 creation by L. Desorgher
0039 //
0040 //-------------------------------------------------------------
0041 
0042 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0043 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0044 
0045 #ifndef RMC01DoubleWithWeightHit_h
0046 #define RMC01DoubleWithWeightHit_h
0047 
0048 #include "G4VHit.hh"
0049 #include "G4THitsCollection.hh"
0050 #include "G4Allocator.hh"
0051 
0052 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0053 
0054 class RMC01DoubleWithWeightHit : public G4VHit
0055 {
0056   public:
0057     RMC01DoubleWithWeightHit(G4double value, G4double weight);
0058     virtual ~RMC01DoubleWithWeightHit();
0059  
0060     RMC01DoubleWithWeightHit(const RMC01DoubleWithWeightHit&);
0061  
0062     const RMC01DoubleWithWeightHit& operator = (const RMC01DoubleWithWeightHit&);
0063  
0064     G4bool operator == (const RMC01DoubleWithWeightHit& right) const;
0065 
0066     inline void* operator new(size_t);
0067     inline void operator delete(void* aHit);
0068 
0069     // Methods to get the information - energy deposit and associated
0070     // position in the phantom - of the hits stored in the hits collection  
0071  
0072     inline G4double GetValue() {return fValue;}
0073 
0074     inline G4double GetWeight() {return fWeight;}
0075 
0076   private:
0077  
0078     G4double fValue; // It can be anything
0079     G4double fWeight; 
0080 };
0081 
0082 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0083 
0084 using RMC01DoubleWithWeightHitsCollection
0085       = G4THitsCollection<RMC01DoubleWithWeightHit>;
0086 
0087 extern G4ThreadLocal
0088        G4Allocator<RMC01DoubleWithWeightHit>* RMC01DoubleWithWeightHitAllocator;
0089 
0090 inline void* RMC01DoubleWithWeightHit::operator new(size_t)
0091 {
0092   if (!RMC01DoubleWithWeightHitAllocator)
0093     RMC01DoubleWithWeightHitAllocator = new G4Allocator<RMC01DoubleWithWeightHit>;
0094   return (void *)RMC01DoubleWithWeightHitAllocator->MallocSingle();
0095 }
0096 
0097 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0098 
0099 inline void RMC01DoubleWithWeightHit::operator delete(void *aHit)
0100 {
0101   if (RMC01DoubleWithWeightHitAllocator)
0102     RMC01DoubleWithWeightHitAllocator
0103     ->FreeSingle((RMC01DoubleWithWeightHit*) aHit);
0104 }
0105 
0106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0107 
0108 #endif
0109