Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21: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 eventgenerator/HepMC/HepMCEx01/include/ExN04CalorimeterHit.hh
0027 /// \brief Definition of the ExN04CalorimeterHit class
0028 //
0029 //
0030 
0031 #ifndef ExN04CalorimeterHit_h
0032 #define ExN04CalorimeterHit_h 1
0033 
0034 #include "G4Allocator.hh"
0035 #include "G4LogicalVolume.hh"
0036 #include "G4RotationMatrix.hh"
0037 #include "G4THitsCollection.hh"
0038 #include "G4ThreeVector.hh"
0039 #include "G4Transform3D.hh"
0040 #include "G4VHit.hh"
0041 
0042 class ExN04CalorimeterHit : public G4VHit
0043 {
0044   public:
0045     ExN04CalorimeterHit();
0046     ExN04CalorimeterHit(G4LogicalVolume* logVol, G4int z, G4int phi);
0047     ExN04CalorimeterHit(const ExN04CalorimeterHit& right);
0048 
0049     virtual ~ExN04CalorimeterHit();
0050 
0051     const ExN04CalorimeterHit& operator=(const ExN04CalorimeterHit& right);
0052     G4bool operator==(const ExN04CalorimeterHit& right) const;
0053 
0054     inline void* operator new(size_t);
0055     inline void operator delete(void* aHit);
0056 
0057     virtual void Draw();
0058     virtual void Print();
0059 
0060     void SetCellID(G4int z, G4int phi);
0061     G4int GetZ();
0062     G4int GetPhi();
0063     void SetEdep(G4double de);
0064     void AddEdep(G4double de);
0065     G4double GetEdep();
0066     void SetPos(G4ThreeVector xyz);
0067     G4ThreeVector GetPos();
0068     void SetRot(G4RotationMatrix rmat);
0069     G4RotationMatrix GetRot();
0070     const G4LogicalVolume* GetLogV();
0071 
0072   private:
0073     G4int fZCellID;
0074     G4int fPhiCellID;
0075     G4double fedep;
0076     G4ThreeVector fpos;
0077     G4RotationMatrix frot;
0078     const G4LogicalVolume* fpLogV;
0079 };
0080 
0081 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0082 inline void ExN04CalorimeterHit::SetCellID(G4int z, G4int phi)
0083 {
0084   fZCellID = z;
0085   fPhiCellID = phi;
0086 }
0087 
0088 inline G4int ExN04CalorimeterHit::GetZ()
0089 {
0090   return fZCellID;
0091 }
0092 
0093 inline G4int ExN04CalorimeterHit::GetPhi()
0094 {
0095   return fPhiCellID;
0096 }
0097 
0098 inline void ExN04CalorimeterHit::SetEdep(G4double de)
0099 {
0100   fedep = de;
0101 }
0102 
0103 inline void ExN04CalorimeterHit::AddEdep(G4double de)
0104 {
0105   fedep += de;
0106 }
0107 
0108 inline G4double ExN04CalorimeterHit::GetEdep()
0109 {
0110   return fedep;
0111 }
0112 
0113 inline void ExN04CalorimeterHit::SetPos(G4ThreeVector xyz)
0114 {
0115   fpos = xyz;
0116 }
0117 
0118 inline G4ThreeVector ExN04CalorimeterHit::GetPos()
0119 {
0120   return fpos;
0121 }
0122 
0123 inline void ExN04CalorimeterHit::SetRot(G4RotationMatrix rmat)
0124 {
0125   frot = rmat;
0126 }
0127 
0128 inline G4RotationMatrix ExN04CalorimeterHit::GetRot()
0129 {
0130   return frot;
0131 }
0132 
0133 inline const G4LogicalVolume* ExN04CalorimeterHit::GetLogV()
0134 {
0135   return fpLogV;
0136 }
0137 
0138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0139 typedef G4THitsCollection<ExN04CalorimeterHit> ExN04CalorimeterHitsCollection;
0140 
0141 extern G4Allocator<ExN04CalorimeterHit> ExN04CalorimeterHitAllocator;
0142 
0143 inline void* ExN04CalorimeterHit::operator new(size_t)
0144 {
0145   void* aHit;
0146   aHit = (void*)ExN04CalorimeterHitAllocator.MallocSingle();
0147   return aHit;
0148 }
0149 
0150 inline void ExN04CalorimeterHit::operator delete(void* aHit)
0151 {
0152   ExN04CalorimeterHitAllocator.FreeSingle((ExN04CalorimeterHit*)aHit);
0153 }
0154 
0155 #endif