Back to home page

EIC code displayed by LXR

 
 

    


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

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