Ignore:
Timestamp:
Sep 25, 2007, 12:24:08 PM (17 years ago)
Author:
barrand
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • snovis/trunk/source/G4Lab/cxx/Trajectory.cxx

    r233 r288  
    88// Geant4 :
    99#include <G4Track.hh>
     10#include <G4VProcess.hh>
    1011
    1112static G4Allocator<G4Lab::Trajectory> sTrajectoryAllocator; // Beurk.
     
    3132)
    3233:G4Trajectory(aTrack)
     34,fProcess(0)
     35,fSave(false)
     36,fStoppingVolume(0)
    3337//////////////////////////////////////////////////////////////////////////////
    3438//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
     
    3741  fTotalEnergy = aTrack->GetTotalEnergy();
    3842  fGlobalTime = aTrack->GetGlobalTime();
     43  fProcess = aTrack->GetCreatorProcess();
     44
     45  fStoppingPoint  = aTrack->GetPosition();
     46  fStoppingVolume = aTrack->GetVolume();
     47
    3948  /*
    4049  printf("debug : G4Lab::Trajectory : \"%s\", kineticEnergy : %g, totalEnergy : %g, globalTime : %g\n",
     
    4756     aTrack->GetGlobalTime());
    4857  fPoints.push_back(tp);
     58
    4959}
    5060//////////////////////////////////////////////////////////////////////////////
    5161G4Lab::Trajectory::Trajectory(
    52  Trajectory& aRight
    53 )
    54 :G4Trajectory(aRight)
    55 //////////////////////////////////////////////////////////////////////////////
    56 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
    57 {
    58   fKineticEnergy = aRight.fKineticEnergy;
    59   fTotalEnergy = aRight.fTotalEnergy;
    60   fGlobalTime = aRight.fGlobalTime;
    61 
    62   size_t number = aRight.fPoints.size();
     62 Trajectory& aFrom
     63)
     64:G4Trajectory(aFrom)
     65//,IGeant4Trajectory(aFrom)
     66//////////////////////////////////////////////////////////////////////////////
     67//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
     68{
     69  fKineticEnergy = aFrom.fKineticEnergy;
     70  fTotalEnergy = aFrom.fTotalEnergy;
     71  fGlobalTime = aFrom.fGlobalTime;
     72  fProcess = aFrom.fProcess;
     73  fSave = aFrom.fSave;
     74
     75  size_t number = aFrom.fPoints.size();
    6376  for(size_t index=0;index<number;index++) {
    64     G4TrajectoryPoint* point = aRight.fPoints[index]->point();
     77    G4TrajectoryPoint* point = aFrom.fPoints[index]->point();
    6578    TrajectoryPoint* tp =
    66       new TrajectoryPoint(new G4TrajectoryPoint(*point),aRight.fGlobalTime);
     79      new TrajectoryPoint(new G4TrajectoryPoint(*point),aFrom.fGlobalTime);
    6780    fPoints.push_back(tp);
    6881  }
     
    8295}
    8396//////////////////////////////////////////////////////////////////////////////
    84 G4double G4Lab::Trajectory::GetKineticEnergy(
     97//////////////////////////////////////////////////////////////////////////////
     98//////////////////////////////////////////////////////////////////////////////
     99//////////////////////////////////////////////////////////////////////////////
     100double G4Lab::Trajectory::kineticEnergy(
    85101) const
    86102//////////////////////////////////////////////////////////////////////////////
     
    90106}
    91107//////////////////////////////////////////////////////////////////////////////
    92 G4double G4Lab::Trajectory::GetTotalEnergy(
     108double G4Lab::Trajectory::totalEnergy(
    93109) const
    94110//////////////////////////////////////////////////////////////////////////////
     
    98114}
    99115//////////////////////////////////////////////////////////////////////////////
    100 G4double G4Lab::Trajectory::GetGlobalTime(
     116double G4Lab::Trajectory::globalTime(
    101117) const
    102118//////////////////////////////////////////////////////////////////////////////
     
    106122}
    107123//////////////////////////////////////////////////////////////////////////////
    108 /*inline*/ void* G4Lab::Trajectory::operator new(
     124unsigned int G4Lab::Trajectory::pointEntries(
     125) const
     126//////////////////////////////////////////////////////////////////////////////
     127//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
     128{
     129  return fPoints.size();
     130}
     131//////////////////////////////////////////////////////////////////////////////
     132double G4Lab::Trajectory::pointGlobalTime(
     133 unsigned int aIndex
     134) const
     135//////////////////////////////////////////////////////////////////////////////
     136//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
     137{
     138  return fPoints[aIndex]->globalTime();
     139}
     140//////////////////////////////////////////////////////////////////////////////
     141std::string G4Lab::Trajectory::creatorProcessName(
     142) const
     143//////////////////////////////////////////////////////////////////////////////
     144//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
     145{
     146  if(!fProcess) return "";
     147  return fProcess->GetProcessName();
     148}
     149//////////////////////////////////////////////////////////////////////////////
     150std::string G4Lab::Trajectory::creatorProcessType(
     151) const
     152//////////////////////////////////////////////////////////////////////////////
     153//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
     154{
     155  if(!fProcess) return "NotDefined";
     156  switch(fProcess->GetProcessType()){
     157  case fNotDefined: return "NotDefined";
     158  case fTransportation: return "Transportation";
     159  case fElectromagnetic: return "Electromagnetic";
     160  case fOptical: return "Optical";
     161  case fHadronic: return "Hadronic";
     162  case fPhotolepton_hadron: return "Photolepton_hadron";
     163  case fDecay: return "Decay";
     164  case fGeneral: return "General";
     165  case fParameterisation: return "Parameterisation";
     166  case fUserDefined: return "UserDefined";
     167  };
     168  return "NotDefined";
     169}
     170//////////////////////////////////////////////////////////////////////////////
     171void G4Lab::Trajectory::setSave(
     172 bool aFlag
     173)
     174//////////////////////////////////////////////////////////////////////////////
     175//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
     176{
     177  fSave = aFlag;
     178}
     179//////////////////////////////////////////////////////////////////////////////
     180bool G4Lab::Trajectory::save(
     181) const
     182//////////////////////////////////////////////////////////////////////////////
     183//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
     184{
     185  return fSave;
     186}
     187//////////////////////////////////////////////////////////////////////////////
     188std::vector<double> G4Lab::Trajectory::stoppingPoint(
     189) const
     190//////////////////////////////////////////////////////////////////////////////
     191//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
     192{
     193  std::vector<double> v(3);
     194  v[0] = fStoppingPoint.x();
     195  v[1] = fStoppingPoint.y();
     196  v[2] = fStoppingPoint.z();
     197  return v;
     198}
     199//////////////////////////////////////////////////////////////////////////////
     200G4VPhysicalVolume* G4Lab::Trajectory::stoppingPhysicalVolume(
     201) const
     202//////////////////////////////////////////////////////////////////////////////
     203//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
     204{
     205  return fStoppingVolume;
     206}
     207//////////////////////////////////////////////////////////////////////////////
     208//////////////////////////////////////////////////////////////////////////////
     209//////////////////////////////////////////////////////////////////////////////
     210void* G4Lab::Trajectory::operator new(
    109211 size_t
    110212
     
    115217}
    116218//////////////////////////////////////////////////////////////////////////////
    117 /*inline*/ void G4Lab::Trajectory::operator delete(
     219void G4Lab::Trajectory::operator delete(
    118220 void* aTrajectory
    119221)
     
    124226}
    125227//////////////////////////////////////////////////////////////////////////////
    126 /*inline*/ int G4Lab::Trajectory::operator == (
     228int G4Lab::Trajectory::operator == (
    127229 const G4Lab::Trajectory& aRight
    128230) const
     
    177279{
    178280  return fPoints[aIndex]->point();
    179 }
    180 //////////////////////////////////////////////////////////////////////////////
    181 G4double G4Lab::Trajectory::GetPointGlobalTime(
    182  G4int aIndex
    183 ) const
    184 //////////////////////////////////////////////////////////////////////////////
    185 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
    186 {
    187   return fPoints[aIndex]->globalTime();
    188281}
    189282//////////////////////////////////////////////////////////////////////////////
     
    205298  tj->fPoints.clear();
    206299}
     300//////////////////////////////////////////////////////////////////////////////
     301const std::map<G4String,G4AttDef>* G4Lab::Trajectory::GetAttDefs() const
     302//////////////////////////////////////////////////////////////////////////////
     303//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
     304{
     305  //return G4Trajectory::GetAttDefs();
     306  return 0;
     307}
     308//////////////////////////////////////////////////////////////////////////////
     309std::vector<G4AttValue>* G4Lab::Trajectory::CreateAttValues() const
     310//////////////////////////////////////////////////////////////////////////////
     311//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
     312{
     313  //return G4Trajectory::CreateAttValues();
     314  return 0;
     315}
     316
Note: See TracChangeset for help on using the changeset viewer.