Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:32

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 Par01/include/Par01CalorimeterHit.hh
0027 /// \brief Definition of the Par01CalorimeterHit class
0028 //
0029 //
0030 //
0031 
0032 #ifndef Par01CalorimeterHit_h
0033 #define Par01CalorimeterHit_h 1
0034 
0035 #include "G4Allocator.hh"
0036 #include "G4LogicalVolume.hh"
0037 #include "G4RotationMatrix.hh"
0038 #include "G4THitsCollection.hh"
0039 #include "G4ThreeVector.hh"
0040 #include "G4Transform3D.hh"
0041 #include "G4VHit.hh"
0042 
0043 class Par01CalorimeterHit : public G4VHit
0044 {
0045   public:
0046     Par01CalorimeterHit();
0047     Par01CalorimeterHit(G4LogicalVolume* logVol);
0048     ~Par01CalorimeterHit();
0049     Par01CalorimeterHit(const Par01CalorimeterHit& right);
0050     const Par01CalorimeterHit& operator=(const Par01CalorimeterHit& right);
0051     G4bool operator==(const Par01CalorimeterHit& right) const;
0052 
0053     inline void* operator new(size_t);
0054     inline void operator delete(void* aHit);
0055     void* operator new(size_t, void* p) { return p; }
0056 #ifndef G4NOT_ISO_DELETES
0057     void operator delete(void*, void*) {}
0058 #endif
0059 
0060     // methods from base class
0061     virtual void Draw();
0062     virtual void Print();
0063 
0064   private:
0065     G4double fEdep;
0066     G4ThreeVector fPosition;
0067     G4RotationMatrix fRot;
0068     const G4LogicalVolume* fLogV;
0069 
0070   public:
0071     inline void SetEdep(G4double de) { fEdep = de; };
0072     inline void AddEdep(G4double de) { fEdep += de; };
0073     inline G4double GetEdep() { return fEdep; };
0074     inline void SetPos(G4ThreeVector xyz) { fPosition = xyz; };
0075     inline G4ThreeVector GetPos() { return fPosition; };
0076     inline void SetRot(G4RotationMatrix rmat) { fRot = rmat; };
0077     inline G4RotationMatrix GetRot() { return fRot; };
0078     inline const G4LogicalVolume* GetLogV() { return fLogV; };
0079 };
0080 
0081 typedef G4THitsCollection<Par01CalorimeterHit> Par01CalorimeterHitsCollection;
0082 
0083 extern G4ThreadLocal G4Allocator<Par01CalorimeterHit>* Par01CalorimeterHitAllocator;
0084 
0085 inline void* Par01CalorimeterHit::operator new(size_t)
0086 {
0087   if (!Par01CalorimeterHitAllocator)
0088     Par01CalorimeterHitAllocator = new G4Allocator<Par01CalorimeterHit>;
0089   return (void*)Par01CalorimeterHitAllocator->MallocSingle();
0090 }
0091 
0092 inline void Par01CalorimeterHit::operator delete(void* aHit)
0093 {
0094   Par01CalorimeterHitAllocator->FreeSingle((Par01CalorimeterHit*)aHit);
0095 }
0096 
0097 #endif