Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-04 08:06:39

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 F02CalorHit.hh
0027 /// \brief Definition of the F02CalorHit class
0028 
0029 #ifndef F02CalorHit_h
0030 #define F02CalorHit_h 1
0031 
0032 #include "G4Allocator.hh"
0033 #include "G4THitsCollection.hh"
0034 #include "G4VHit.hh"
0035 
0036 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0037 
0038 class F02CalorHit : public G4VHit
0039 {
0040   public:
0041     F02CalorHit() = default;
0042     F02CalorHit(const F02CalorHit&);
0043     ~F02CalorHit() override = default;
0044 
0045     const F02CalorHit& operator=(const F02CalorHit&);
0046     G4bool operator==(const F02CalorHit&) const;
0047 
0048     inline void* operator new(size_t);
0049     inline void operator delete(void*);
0050 
0051     void Print() override;
0052 
0053   public:
0054     void AddAbs(G4double de, G4double dl)
0055     {
0056       fEdepAbs += de;
0057       fTrackLengthAbs += dl;
0058     };
0059     void AddGap(G4double de, G4double dl)
0060     {
0061       fEdepGap += de;
0062       fTrackLengthGap += dl;
0063     };
0064 
0065     G4double GetEdepAbs() { return fEdepAbs; };
0066     G4double GetTrackAbs() { return fTrackLengthAbs; };
0067     G4double GetEdepGap() { return fEdepGap; };
0068     G4double GetTrackGap() { return fTrackLengthGap; };
0069 
0070   private:
0071     G4double fEdepAbs = 0.;
0072     G4double fTrackLengthAbs = 0.;
0073     G4double fEdepGap = 0.;
0074     G4double fTrackLengthGap = 0.;
0075 };
0076 
0077 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0078 
0079 using F02CalorHitsCollection = G4THitsCollection<F02CalorHit>;
0080 
0081 extern G4ThreadLocal G4Allocator<F02CalorHit>* F02CalorHitAllocator;
0082 
0083 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0084 
0085 inline void* F02CalorHit::operator new(size_t)
0086 {
0087   if (!F02CalorHitAllocator) F02CalorHitAllocator = new G4Allocator<F02CalorHit>;
0088   return (void*)F02CalorHitAllocator->MallocSingle();
0089 }
0090 
0091 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0092 
0093 inline void F02CalorHit::operator delete(void* aHit)
0094 {
0095   F02CalorHitAllocator->FreeSingle((F02CalorHit*)aHit);
0096 }
0097 
0098 #endif