Back to home page

EIC code displayed by LXR

 
 

    


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

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 exoticphysics/phonon/src/XAluminumElectrodeHit.cc
0027 /// \brief Implementation of the XAluminumElectrodeHit class
0028 //
0029 //
0030 // 20141008  Allocators must be thread-local, and must be pointers
0031 
0032 #include "XAluminumElectrodeHit.hh"
0033 
0034 #include "G4AttDef.hh"
0035 #include "G4AttDefStore.hh"
0036 #include "G4AttValue.hh"
0037 #include "G4Circle.hh"
0038 #include "G4Colour.hh"
0039 #include "G4LogicalVolume.hh"
0040 #include "G4RotationMatrix.hh"
0041 #include "G4SystemOfUnits.hh"
0042 #include "G4Transform3D.hh"
0043 #include "G4UnitsTable.hh"
0044 #include "G4VVisManager.hh"
0045 #include "G4VisAttributes.hh"
0046 #include "G4ios.hh"
0047 
0048 G4ThreadLocal G4Allocator<XAluminumElectrodeHit>* XAluminumElectrodeHitAllocator = 0;
0049 
0050 XAluminumElectrodeHit::XAluminumElectrodeHit()
0051 {
0052   fTime = 0.;
0053   fEdep = 0.;
0054 }
0055 
0056 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0057 
0058 XAluminumElectrodeHit::~XAluminumElectrodeHit()
0059 {
0060   ;
0061 }
0062 
0063 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0064 
0065 XAluminumElectrodeHit::XAluminumElectrodeHit(const XAluminumElectrodeHit& right) : G4VHit()
0066 {
0067   fTime = right.fTime;
0068   fEdep = right.fEdep;
0069   fWorldPos = right.fWorldPos;
0070   fLocalPos = right.fLocalPos;
0071 }
0072 
0073 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0074 
0075 const XAluminumElectrodeHit& XAluminumElectrodeHit::operator=(const XAluminumElectrodeHit& right)
0076 {
0077   fTime = right.fTime;
0078   fEdep = right.fEdep;
0079   fWorldPos = right.fWorldPos;
0080   fLocalPos = right.fLocalPos;
0081   return *this;
0082 }
0083 
0084 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0085 
0086 G4bool XAluminumElectrodeHit::operator==(const XAluminumElectrodeHit& /*right*/) const
0087 {
0088   return false;
0089 }
0090 
0091 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0092 
0093 void XAluminumElectrodeHit::Draw()
0094 {
0095   G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
0096   if (pVVisManager) {
0097     G4Circle circle(fWorldPos);
0098     circle.SetScreenSize(15);
0099     circle.SetFillStyle(G4Circle::filled);
0100     G4Colour colour(0.65, 0.65, 0.);
0101     G4VisAttributes attribs(colour);
0102     attribs.SetStartTime(fTime);
0103     attribs.SetEndTime(fTime + 1 * ms);
0104     circle.SetVisAttributes(attribs);
0105     pVVisManager->Draw(circle);
0106   }
0107 }
0108 
0109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0110 
0111 const std::map<G4String, G4AttDef>* XAluminumElectrodeHit::GetAttDefs() const
0112 {
0113   G4bool isNew;
0114   std::map<G4String, G4AttDef>* store = G4AttDefStore::GetInstance("XAluminumElectrodeHit", isNew);
0115   if (isNew) {
0116     G4String HitType("HitType");
0117     (*store)[HitType] = G4AttDef(HitType, "Hit Type", "Physics", "", "G4String");
0118 
0119     G4String Time("Time");
0120     (*store)[Time] = G4AttDef(Time, "Time", "Physics", "G4BestUnit", "G4double");
0121 
0122     G4String EDep("EDep");
0123     (*store)[EDep] = G4AttDef(Time, "EDep", "Physics", "G4BestUnit", "G4double");
0124 
0125     G4String Pos("Pos");
0126     (*store)[Pos] = G4AttDef(Pos, "Position", "Physics", "G4BestUnit", "G4ThreeVector");
0127   }
0128   return store;
0129 }
0130 
0131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0132 
0133 std::vector<G4AttValue>* XAluminumElectrodeHit::CreateAttValues() const
0134 {
0135   std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
0136 
0137   values->push_back(G4AttValue("HitType", "XAluminumElectrodeHit", ""));
0138 
0139   values->push_back(G4AttValue("Time", G4BestUnit(fTime, "Time"), ""));
0140 
0141   values->push_back(G4AttValue("EDep", G4BestUnit(fEdep, "Energy"), ""));
0142 
0143   values->push_back(G4AttValue("Pos", G4BestUnit(fWorldPos, "Length"), ""));
0144 
0145   return values;
0146 }
0147 
0148 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0149 
0150 void XAluminumElectrodeHit::Print()
0151 {
0152   G4cout << "  time " << fTime / ns << " (nsec) : at " << fLocalPos << "  -- fEdep = " << fEdep / eV
0153          << " [eV]" << G4endl;
0154 }