Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-14 07:43:07

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