Back to home page

EIC code displayed by LXR

 
 

    


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

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 // This example is provided by the Geant4-DNA collaboration
0027 // Any report or published results obtained using the Geant4-DNA software
0028 // shall cite the following Geant4-DNA collaboration publications:
0029 // Med. Phys. 45 (2018) e722-e739
0030 // Phys. Med. 31 (2015) 861-874
0031 // Med. Phys. 37 (2010) 4692-4708
0032 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
0033 // The Geant4-DNA web site is available at http://geant4-dna.org
0034 //
0035 /// \file TrackerHit.cc
0036 /// \brief Implementation of the TrackerHit class
0037 
0038 #include "TrackerHit.hh"
0039 
0040 #include "G4Circle.hh"
0041 #include "G4UnitsTable.hh"
0042 #include "G4VVisManager.hh"
0043 #include "G4VisAttributes.hh"
0044 
0045 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0046 
0047 G4ThreadLocal G4Allocator<TrackerHit>* TrackerHitAllocator = nullptr;
0048 
0049 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0050 
0051 TrackerHit::TrackerHit() : G4VHit() {}
0052 
0053 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0054 
0055 TrackerHit::~TrackerHit() = default;
0056 
0057 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0058 
0059 TrackerHit::TrackerHit(const TrackerHit& right) : G4VHit()
0060 {
0061   fTrackID = right.fTrackID;
0062   fEdep = right.fEdep;
0063   fPos = right.fPos;
0064   fIncidentEnergy = right.fIncidentEnergy;
0065 }
0066 
0067 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0068 
0069 const TrackerHit& TrackerHit::operator=(const TrackerHit& right)
0070 {
0071   fTrackID = right.fTrackID;
0072   fEdep = right.fEdep;
0073   fPos = right.fPos;
0074   fIncidentEnergy = right.fIncidentEnergy;
0075 
0076   return *this;
0077 }
0078 
0079 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0080 
0081 G4bool TrackerHit::operator==(const TrackerHit& right) const
0082 {
0083   return this == &right;
0084 }
0085 
0086 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0087 
0088 void TrackerHit::Draw()
0089 {
0090   G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
0091   if (pVVisManager) {
0092     G4Circle circle(fPos);
0093     circle.SetScreenSize(4.);
0094     circle.SetFillStyle(G4Circle::filled);
0095     G4Colour colour(1., 0., 0.);
0096     G4VisAttributes attribs(colour);
0097     circle.SetVisAttributes(attribs);
0098     pVVisManager->Draw(circle);
0099   }
0100 }
0101 
0102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0103 
0104 void TrackerHit::Print()
0105 {
0106   G4cout << "  trackID: " << fTrackID << "Edep: " << std::setw(7) << G4BestUnit(fEdep, "Energy")
0107          << " Position: " << std::setw(7) << G4BestUnit(fPos, "Length")
0108          << "IncidentEnergy: " << std::setw(7) << G4BestUnit(fIncidentEnergy, "Energy") << G4endl;
0109 }
0110 
0111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......