Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21:13

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 exoticphysics/phonon/include/XAluminumElectrodeHit.hh
0027 /// \brief Definition of the XAluminumElectrodeHit class
0028 //
0029 //
0030 // 20141008  Allocators must be thread-local, and must be pointers
0031 // 20150818  Make hit a simple container, with public data members
0032 
0033 #ifndef XAluminumElectrodeHit_h
0034 #define XAluminumElectrodeHit_h 1
0035 
0036 #include "G4Allocator.hh"
0037 #include "G4THitsCollection.hh"
0038 #include "G4ThreeVector.hh"
0039 #include "G4VHit.hh"
0040 
0041 class G4AttDef;
0042 class G4AttValue;
0043 
0044 class XAluminumElectrodeHit : public G4VHit
0045 {
0046   public:  // Treat hit as simple container class
0047     G4double fTime;
0048     G4double fEdep;
0049     G4ThreeVector fLocalPos;
0050     G4ThreeVector fWorldPos;
0051 
0052   public:
0053     XAluminumElectrodeHit();
0054     virtual ~XAluminumElectrodeHit();
0055     XAluminumElectrodeHit(const XAluminumElectrodeHit& right);
0056     const XAluminumElectrodeHit& operator=(const XAluminumElectrodeHit& right);
0057     G4bool operator==(const XAluminumElectrodeHit& right) const;
0058 
0059     inline void* operator new(size_t);
0060     inline void operator delete(void* aHit);
0061 
0062     virtual void Draw();
0063     virtual const std::map<G4String, G4AttDef>* GetAttDefs() const;
0064     virtual std::vector<G4AttValue>* CreateAttValues() const;
0065     virtual void Print();
0066 };
0067 
0068 typedef G4THitsCollection<XAluminumElectrodeHit> XAluminumElectrodeHitsCollection;
0069 
0070 extern G4ThreadLocal G4Allocator<XAluminumElectrodeHit>* XAluminumElectrodeHitAllocator;
0071 
0072 inline void* XAluminumElectrodeHit::operator new(size_t)
0073 {
0074   if (!XAluminumElectrodeHitAllocator)  // Singleton
0075     XAluminumElectrodeHitAllocator = new G4Allocator<XAluminumElectrodeHit>;
0076 
0077   return (void*)XAluminumElectrodeHitAllocator->MallocSingle();
0078 }
0079 
0080 inline void XAluminumElectrodeHit::operator delete(void* aHit)
0081 {
0082   XAluminumElectrodeHitAllocator->FreeSingle((XAluminumElectrodeHit*)aHit);
0083 }
0084 
0085 #endif