Back to home page

EIC code displayed by LXR

 
 

    


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

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/HepMCEx02/include/H02MuonHit.hh
0027 /// \brief Definition of the H02MuonHit class
0028 //
0029 //
0030 #ifndef H02_MUON_HIT_H
0031 #define H02_MUON_HIT_H
0032 
0033 #include "G4Allocator.hh"
0034 #include "G4THitsCollection.hh"
0035 #include "G4ThreeVector.hh"
0036 #include "G4VHit.hh"
0037 
0038 class H02MuonHit : public G4VHit
0039 {
0040   public:
0041     H02MuonHit();
0042     H02MuonHit(G4int imod, G4String aname, const G4ThreeVector& pxyz, const G4ThreeVector& xyz,
0043                G4double atof);
0044     ~H02MuonHit();
0045 
0046     H02MuonHit(const H02MuonHit& right);
0047     const H02MuonHit& operator=(const H02MuonHit& right);
0048     G4bool operator==(const H02MuonHit& right) const;
0049 
0050     void* operator new(size_t);
0051     void operator delete(void* aHit);
0052 
0053     // set/get functions...
0054     void SetModuleID(G4int i);
0055     G4int GetModuleID() const;
0056 
0057     void SetParticle(G4String aname);
0058     G4String GetParticle() const;
0059 
0060     void SetMomentum(const G4ThreeVector& pxyz);
0061     G4ThreeVector GetMomentum() const;
0062 
0063     void SetPosition(const G4ThreeVector& xyz);
0064     G4ThreeVector GetPosition() const;
0065 
0066     void SetTOF(G4double atof);
0067     G4double GetTOF() const;
0068 
0069     // methods...
0070     virtual void Draw();
0071     virtual void Print();
0072 
0073   private:
0074     G4int fModuleID;
0075     G4String fPname;
0076     G4ThreeVector fMomentum;
0077     G4ThreeVector fPosition;
0078     G4double fTof;
0079 };
0080 
0081 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0082 inline void H02MuonHit::SetModuleID(G4int i)
0083 {
0084   fModuleID = i;
0085 }
0086 inline G4int H02MuonHit::GetModuleID() const
0087 {
0088   return fModuleID;
0089 }
0090 
0091 inline void H02MuonHit::SetParticle(G4String aname)
0092 {
0093   fPname = aname;
0094 }
0095 inline G4String H02MuonHit::GetParticle() const
0096 {
0097   return fPname;
0098 }
0099 
0100 inline void H02MuonHit::SetMomentum(const G4ThreeVector& pxyz)
0101 {
0102   fMomentum = pxyz;
0103 }
0104 inline G4ThreeVector H02MuonHit::GetMomentum() const
0105 {
0106   return fMomentum;
0107 }
0108 
0109 inline void H02MuonHit::SetPosition(const G4ThreeVector& xyz)
0110 {
0111   fPosition = xyz;
0112 }
0113 inline G4ThreeVector H02MuonHit::GetPosition() const
0114 {
0115   return fPosition;
0116 }
0117 
0118 inline void H02MuonHit::SetTOF(G4double atof)
0119 {
0120   fTof = atof;
0121 }
0122 inline G4double H02MuonHit::GetTOF() const
0123 {
0124   return fTof;
0125 }
0126 
0127 typedef G4THitsCollection<H02MuonHit> H02MuonHitsCollection;
0128 extern G4Allocator<H02MuonHit> H02MuonHitAllocator;
0129 
0130 inline void* H02MuonHit::operator new(size_t)
0131 {
0132   void* aHit;
0133   aHit = (void*)H02MuonHitAllocator.MallocSingle();
0134   return aHit;
0135 }
0136 
0137 inline void H02MuonHit::operator delete(void* aHit)
0138 {
0139   H02MuonHitAllocator.FreeSingle((H02MuonHit*)aHit);
0140 }
0141 
0142 #endif