Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-17 07:51:43

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 MicroElecHitSey.cc
0027 /// \brief Implementation of the MicroElecHitSey class
0028 //
0029 //-
0030 
0031 
0032 #include "MicroElecHitSey.hh"
0033 #include "G4UnitsTable.hh"
0034 #ifdef  _G4CNF_USE_VIS_
0035     #include "G4VVisManager.hh"
0036 #endif  // _G4CNF_USE_VIS_
0037 #include "G4Circle.hh"
0038 #include "G4Colour.hh"
0039 #include "G4VisAttributes.hh"
0040 #include "G4ThreeVector.hh"
0041 
0042 G4ThreadLocal G4Allocator<MicroElecHitSey>* MicroElecHitSeyAllocator=0;
0043 
0044 MicroElecHitSey::MicroElecHitSey(){
0045     NbPrim = 999;
0046     NbSec = 999;
0047     NbSup50 = 999;
0048     trackID = 999;
0049     ParentID = 999;
0050     ParticleType = "initialization";
0051     ParticleName = "initialization";
0052     VolumeName = "initialization";
0053     Z = 999;
0054     A = 999;
0055     VertexKineticEnergy = 999.;
0056     PreStepKineticEnergy = 999.;
0057     PostStepKineticEnergy = 999.;
0058     Edep = 999.;
0059     Ni_Edep = 999.;
0060     PrePos = G4ThreeVector(0.0,0.0,0.0);
0061     PostPos = G4ThreeVector(0.0, 0.0, 0.0);
0062     PreStepMomentum = G4ThreeVector(0.0, 0.0, 0.0);
0063     PostStepMomentum = G4ThreeVector(0.0, 0.0, 0.0);
0064     StepLength = 999.;
0065 }
0066 
0067 MicroElecHitSey::~MicroElecHitSey(){
0068 }
0069 
0070 MicroElecHitSey::MicroElecHitSey(const MicroElecHitSey& right):G4VHit(){    
0071     NbPrim          = right.NbPrim;
0072     NbSec           = right.NbSec;
0073     NbSup50         = right.NbSup50;
0074     trackID         = right.trackID;
0075     ParentID        = right.ParentID;
0076     ParticleType    = right.ParticleType;
0077     ParticleName    = right.ParticleName;
0078     VolumeName      = right.VolumeName;
0079     Z               = right.Z;
0080     A               = right.A;
0081     VertexKineticEnergy = right.VertexKineticEnergy;
0082     PreStepKineticEnergy = right.PreStepKineticEnergy;
0083     PostStepKineticEnergy = right.PostStepKineticEnergy;
0084     Edep            = right.Edep;
0085     Ni_Edep         = right.Ni_Edep;
0086     PrePos          = right.PrePos;
0087     PostPos         = right.PostPos;
0088     PreStepMomentum = right.PreStepMomentum;
0089     PostStepMomentum = right.PostStepMomentum;
0090     StepLength      = right.StepLength;
0091 
0092 //-------------------
0093 //New due to the use of touchables to identify the different sensitive detectors
0094     VolumeCopyNumber = right.VolumeCopyNumber;
0095 }
0096 
0097 const MicroElecHitSey& MicroElecHitSey::operator=(const MicroElecHitSey& right){
0098     NbPrim          = right.NbPrim;
0099     NbSec           = right.NbSec;
0100     NbSup50         = right.NbSup50;
0101     trackID         = right.trackID;
0102     ParentID        = right.ParentID;
0103     ParticleType    = right.ParticleType;
0104     ParticleName    = right.ParticleName;
0105     VolumeName      = right.VolumeName;
0106     Z               = right.Z;
0107     A               = right.A;
0108     VertexKineticEnergy = right.VertexKineticEnergy;
0109     PreStepKineticEnergy = right.PreStepKineticEnergy;
0110     PostStepKineticEnergy = right.PostStepKineticEnergy;
0111     Edep            = right.Edep;
0112     Ni_Edep         = right.Ni_Edep;
0113     PrePos          = right.PrePos;
0114     PostPos         = right.PostPos;
0115     PreStepMomentum = right.PreStepMomentum;
0116     PostStepMomentum = right.PostStepMomentum;
0117     StepLength      = right.StepLength;
0118 
0119     VolumeCopyNumber = right.VolumeCopyNumber;
0120 
0121     return *this;
0122 }
0123 
0124 int MicroElecHitSey::operator==(const MicroElecHitSey& ) const{
0125     return 0; 
0126 }
0127 
0128 
0129 
0130 void MicroElecHitSey::Print(){
0131     
0132     G4cout << "  [trackID, Parent ID]: [" << trackID << ", " << ParentID << "],  ParticleName :" << ParticleName<<", [PrimID, SecID]=["<<NbPrim<<", "<<NbSec << "]"<<G4endl;
0133     G4cout << "   Kinetic energy : " << G4BestUnit(PreStepKineticEnergy, "Energy") << ", position : " << G4BestUnit(PrePos, "Length") << G4endl;
0134 
0135 }