Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:32:04

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 runAndEvent/RE04/src/RE04TrajectoryPoint.cc
0027 /// \brief Implementation of the RE04TrajectoryPoint class
0028 //
0029 //
0030 #include "RE04TrajectoryPoint.hh"
0031 
0032 #include "G4AttDef.hh"
0033 #include "G4AttDefStore.hh"
0034 #include "G4AttValue.hh"
0035 #include "G4Material.hh"
0036 #include "G4UnitsTable.hh"
0037 
0038 // #define G4ATTDEBUG
0039 #ifdef G4ATTDEBUG
0040 #  include "G4AttCheck.hh"
0041 #endif
0042 
0043 G4ThreadLocal G4Allocator<RE04TrajectoryPoint>* faTrajPointAllocator = 0;
0044 
0045 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0046 RE04TrajectoryPoint::RE04TrajectoryPoint()
0047   : G4VTrajectoryPoint(), fPosition(G4ThreeVector(0., 0., 0.)), fpMaterial(0)
0048 {}
0049 
0050 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0051 RE04TrajectoryPoint::RE04TrajectoryPoint(G4ThreeVector pos, const G4Material* mat)
0052   : G4VTrajectoryPoint(), fPosition(pos), fpMaterial(mat)
0053 {}
0054 
0055 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0056 RE04TrajectoryPoint::RE04TrajectoryPoint(const RE04TrajectoryPoint& right)
0057   : G4VTrajectoryPoint(), fPosition(right.fPosition), fpMaterial(right.fpMaterial)
0058 {}
0059 
0060 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0061 RE04TrajectoryPoint::~RE04TrajectoryPoint() {}
0062 
0063 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0064 const std::map<G4String, G4AttDef>* RE04TrajectoryPoint::GetAttDefs() const
0065 {
0066   G4bool isNew;
0067   std::map<G4String, G4AttDef>* store = G4AttDefStore::GetInstance("RE04TrajectoryPoint", isNew);
0068   if (isNew) {
0069     G4String pos("Pos");
0070     (*store)[pos] = G4AttDef(pos, "Position", "Physics", "G4BestUnit", "G4ThreeVector");
0071     G4String mat("Mat");
0072     (*store)[mat] = G4AttDef(mat, "Mat", "Physics", "Name", "G4String");
0073   }
0074   return store;
0075 }
0076 
0077 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0078 std::vector<G4AttValue>* RE04TrajectoryPoint::CreateAttValues() const
0079 {
0080   std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
0081 
0082   values->push_back(G4AttValue("Pos", G4BestUnit(fPosition, "Length"), ""));
0083   values->push_back(G4AttValue("Mat", fpMaterial->GetName(), ""));
0084 
0085 #ifdef G4ATTDEBUG
0086   G4cout << G4AttCheck(values, GetAttDefs());
0087 #endif
0088 
0089   return values;
0090 }