Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-22 08:08:44

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 SAXSSensitiveDetectorHit.cc
0027 /// \brief Implementation of the SAXSSensitiveDetectorHit class
0028 
0029 #include "SAXSSensitiveDetectorHit.hh"
0030 
0031 #include "G4AttDef.hh"
0032 #include "G4AttDefStore.hh"
0033 #include "G4AttValue.hh"
0034 #include "G4Circle.hh"
0035 #include "G4Colour.hh"
0036 #include "G4LogicalVolume.hh"
0037 #include "G4SystemOfUnits.hh"
0038 #include "G4UIcommand.hh"
0039 #include "G4UnitsTable.hh"
0040 #include "G4VVisManager.hh"
0041 #include "G4VisAttributes.hh"
0042 #include "G4ios.hh"
0043 
0044 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0045 
0046 G4ThreadLocal G4Allocator<SAXSSensitiveDetectorHit>* hitAllocator = nullptr;
0047 
0048 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0049 
0050 SAXSSensitiveDetectorHit::SAXSSensitiveDetectorHit() : G4VHit()
0051 {
0052   fTime = 0.;
0053   fPos = G4ThreeVector(0., 0., 0.);
0054   fMom = G4ThreeVector(0., 0., 0.);
0055   fEnergy = 0.;
0056   fType = -1;
0057   fTrackID = -1;
0058   fWeight = -1;
0059 }
0060 
0061 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0062 
0063 SAXSSensitiveDetectorHit::SAXSSensitiveDetectorHit(const SAXSSensitiveDetectorHit& right) : G4VHit()
0064 {
0065   fTrackID = right.fTrackID;
0066   fTrackIDP = right.fTrackIDP;
0067   fPos = right.fPos;
0068   fMom = right.fMom;
0069   fTime = right.fTime;
0070   fEnergy = right.fEnergy;
0071   fType = right.fType;
0072   fWeight = right.fWeight;
0073 }
0074 
0075 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0076 
0077 const SAXSSensitiveDetectorHit&
0078 SAXSSensitiveDetectorHit::operator=(const SAXSSensitiveDetectorHit& right)
0079 {
0080   fTrackID = right.fTrackID;
0081   fTrackIDP = right.fTrackIDP;
0082   fPos = right.fPos;
0083   fMom = right.fMom;
0084   fTime = right.fTime;
0085   fEnergy = right.fEnergy;
0086   fType = right.fType;
0087   fWeight = right.fWeight;
0088 
0089   return *this;
0090 }
0091 
0092 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0093 
0094 int SAXSSensitiveDetectorHit::operator==(const SAXSSensitiveDetectorHit&) const
0095 {
0096   return 0;
0097 }
0098 
0099 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0100 
0101 void SAXSSensitiveDetectorHit::Draw()
0102 {
0103   G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
0104   if (pVVisManager) {
0105     G4Circle circle(fPos);
0106     circle.SetScreenSize(2);
0107     circle.SetFillStyle(G4Circle::filled);
0108     G4Colour colour(1., 1., 0.);
0109     G4VisAttributes attribs(colour);
0110     circle.SetVisAttributes(attribs);
0111     pVVisManager->Draw(circle);
0112   }
0113 }
0114 
0115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0116 
0117 void SAXSSensitiveDetectorHit::Print()
0118 {
0119   G4cout << " Hit at time " << fTime / ns << " (nsec) - pos(x,y,z) " << fPos / mm
0120          << " (mm) - mom(x,y,z) " << fMom / eV << " eV" << G4endl;
0121 }
0122 
0123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....