Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-11 08:31:02

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