Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:21:47

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 // ********************************************************************
0027 //
0028 //  CaTS (Calorimetry and Tracking Simulation)
0029 //
0030 //  Authors : Hans Wenzel
0031 //            Soon Yung Jun
0032 //            (Fermi National Accelerator Laboratory)
0033 //
0034 // History
0035 //   October 18th, 2021 : first implementation
0036 //
0037 // ********************************************************************
0038 //
0039 /// \file PhotonHit.cc
0040 /// \brief Implementation of the CaTS::PhotonHit class
0041 
0042 // Geant4 headers
0043 #include "PhotonHit.hh"
0044 #include "G4VVisManager.hh"
0045 #include "G4Circle.hh"
0046 #include "G4Colour.hh"
0047 #include "G4VisAttributes.hh"
0048 #include <G4Point3D.hh>
0049 #include <G4ThreeVector.hh>
0050 #include <G4VHit.hh>
0051 // project headers
0052 #include "PhotonHit.hh"
0053 
0054 template <class Type>
0055 class G4Allocator;
0056 G4ThreadLocal G4Allocator<PhotonHit>* PhotonHitAllocator = nullptr;
0057 
0058 PhotonHit::PhotonHit()
0059   : G4VHit()
0060 {}
0061 
0062 PhotonHit::PhotonHit(unsigned iid, unsigned ipid, G4double iwavelength,
0063                      G4double itime, G4ThreeVector iposition,
0064                      G4ThreeVector idirection, G4ThreeVector ipolarization)
0065   : G4VHit()
0066 {
0067   fid           = iid;
0068   fpid          = ipid;
0069   fwavelength   = iwavelength;
0070   ftime         = itime;
0071   fposition     = iposition;
0072   fdirection    = idirection;
0073   fpolarization = ipolarization;
0074 }
0075 
0076 PhotonHit::PhotonHit(const PhotonHit& right)
0077   : G4VHit()
0078 {
0079   fid           = right.fid;
0080   fpid          = right.fpid;
0081   fwavelength   = right.fwavelength;
0082   ftime         = right.ftime;
0083   fposition     = right.fposition;
0084   fdirection    = right.fdirection;
0085   fpolarization = right.fpolarization;
0086 }
0087 
0088 const PhotonHit& PhotonHit::operator=(const PhotonHit& right)
0089 {
0090   fid           = right.fid;
0091   fpid          = right.fpid;
0092   fwavelength   = right.fwavelength;
0093   ftime         = right.ftime;
0094   fposition     = right.fposition;
0095   fdirection    = right.fdirection;
0096   fpolarization = right.fpolarization;
0097   return *this;
0098 }
0099 
0100 G4bool PhotonHit::operator==(const PhotonHit& right) const
0101 {
0102   return (this == &right) ? true : false;
0103 }
0104 
0105 void PhotonHit::Draw()
0106 {
0107   G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
0108   if(pVVisManager)
0109   {
0110     G4Circle circle(fposition);
0111     circle.SetScreenSize(2.);
0112     circle.SetFillStyle(G4Circle::filled);
0113     G4Colour colour(1., 0., 0.);
0114     G4VisAttributes attribs(colour);
0115     circle.SetVisAttributes(attribs);
0116     pVVisManager->Draw(circle);
0117   }
0118 }