7 #include "G4ParticleTable.hh" 8 #include "G4ParticleTypes.hh" 9 #include "G4ParticleDefinition.hh" 10 #include "G4Polyline.hh" 11 #include "G4Circle.hh" 12 #include "G4Colour.hh" 13 #include "G4VisAttributes.hh" 14 #include "G4AttDefStore.hh" 15 #include "G4AttDef.hh" 16 #include "G4AttValue.hh" 17 #include "G4UIcommand.hh" 18 #include "G4VisAttributes.hh" 19 #include "G4VVisManager.hh" 20 #include "G4UnitsTable.hh" 21 #include "G4VProcess.hh" 22 #include "G4ProcessType.hh" 23 #include "G4HadronicProcess.hh" 69 fPositionRecord -> push_back(
new G4TrajectoryPoint(aTrack->GetPosition()));
73 fPreStepVolume -> push_back(aTrack->GetVolume()->GetName());
75 fMaterialName -> push_back(aTrack->GetVolume()->GetLogicalVolume()->GetMaterial()->GetName());
77 fStepLength -> push_back(aTrack->GetStepLength());
81 if (!aTrack->GetLogicalVolumeAtVertex()) {
89 fVolName1rst = aTrack->GetLogicalVolumeAtVertex()->GetName();
111 if (aTrack->GetCreatorProcess() != 0)
112 fProcessName = aTrack->GetCreatorProcess()->GetProcessName();
161 G4TrajectoryPoint* rightPoint = (G4TrajectoryPoint*)((*(right.
fPositionRecord))[
i]);
166 G4ThreeVector rightMomentum = (G4ThreeVector)((*(right.
fMomentumRecord))[
i]);
176 G4double rightsteplength =(G4double)((*(right.
fStepLength))[
i]);
181 G4String rightMaterialName = (G4String)((*(right.
fMaterialName))[
i]);
220 G4TrajectoryPoint* rightPoint = (G4TrajectoryPoint*)((*(right->
fPositionRecord))[
i]);
227 G4ThreeVector rightMomentum = (G4ThreeVector)((*(right->
fMomentumRecord))[
i]);
234 G4String rightPreStepVolume =(G4String)((*(right->
fPreStepVolume))[
i]);
241 G4double rightsteplength =(G4double)((*(right->
fStepLength))[
i]);
246 G4String rightMaterialName = (G4String)((*(right->
fMaterialName))[
i]);
269 delete (*fPositionRecord)[
i];
292 G4cout << G4endl <<
"TrackID =" <<
fTrackID 293 <<
" : ParentID=" <<
fParentID << G4endl;
296 G4cout <<
"Original momentum : " <<
297 G4BestUnit(
fMomentum,
"Energy") << G4endl;
298 G4cout <<
"Vertex : " << G4BestUnit(
fVertexPosition,
"Length") << G4endl;
300 <<
" points." << G4endl;
303 G4TrajectoryPoint* aTrajectoryPoint = (G4TrajectoryPoint*)((*
fPositionRecord)[
i]);
304 G4cout <<
"Point[" <<
i <<
"]" 305 <<
" Position= " << aTrajectoryPoint->GetPosition() << G4endl;
311 G4VTrajectory::ShowTrajectory(o);
316 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
319 G4Polyline pPolyline;
321 G4TrajectoryPoint* aTrajectoryPoint = (G4TrajectoryPoint*)((*
fPositionRecord)[
i]);
322 pos = aTrajectoryPoint->GetPosition();
323 pPolyline.push_back( pos );
326 G4Colour
color(1.0,1.0,1.0);
328 if(
fPDGCharge == 0.) color = G4Colour::White();
329 if(
fPDGCharge == 1.0) color = G4Colour(1.0, 0.5, 0.0);
330 if(
fPDGCharge == -1.0) color = G4Colour(0.5, 0.0, 0.5);
348 color = G4Color::Magenta();
356 G4VisAttributes attribs(color);
357 pPolyline.SetVisAttributes(attribs);
358 if(pVVisManager) pVVisManager->Draw(pPolyline);
416 std::map<G4String,G4AttDef>* store
417 = G4AttDefStore::GetInstance(
"LBNETrajectory",isNew);
421 G4String
ID(
"TrkID");
422 (*store)[
ID] = G4AttDef(ID,
"Track ID",
"Physics",
"",
"G4int");
424 G4String PID(
"ParTrkID");
425 (*store)[PID] = G4AttDef(PID,
"Parent ID",
"Physics",
"",
"G4int");
428 (*store)[PN] = G4AttDef(PN,
"Particle Name",
"Physics",
"",
"G4String");
431 (*store)[Ch] = G4AttDef(Ch,
"Charge",
"Physics",
"e+",
"G4double");
434 (*store)[
PDG] = G4AttDef(PDG,
"PDG Encoding",
"Physics",
"",
"G4int");
436 G4String IMom(
"IMom");
437 (*store)[IMom] = G4AttDef(IMom,
"Momentum at start of trajectory",
438 "Physics",
"G4BestUnit",
"G4ThreeVector");
440 G4String IMag(
"IMomMag");
442 G4AttDef(IMag,
"Magnitude of momentum at start of trajectory",
443 "Physics",
"G4BestUnit",
"G4double");
445 G4String NTP(
"NPts");
446 (*store)[NTP] = G4AttDef(NTP,
"No. of points",
"Physics",
"",
"G4int");
454 std::vector<G4AttValue>*
values =
new std::vector<G4AttValue>;
457 (G4AttValue(
"TrkID",G4UIcommand::ConvertToString(
fTrackID),
""));
460 (G4AttValue(
"ParTrkID",G4UIcommand::ConvertToString(
fParentID),
""));
465 (G4AttValue(
"Q",G4UIcommand::ConvertToString(
fPDGCharge),
""));
468 (G4AttValue(
"PDG",G4UIcommand::ConvertToString(
fPDGEncoding),
""));
477 (G4AttValue(
"NPts",G4UIcommand::ConvertToString(
GetPointEntries()),
""));
487 ->push_back(
new G4TrajectoryPoint(aStep->GetPostStepPoint()
491 G4Track* aTrack=aStep->GetTrack();
500 G4StepPoint * steppoint=aStep->GetPreStepPoint();
501 G4String PreVolumeName=steppoint->GetPhysicalVolume()->GetName();
502 G4String MaterialName =
503 steppoint->GetPhysicalVolume()->GetLogicalVolume()->GetMaterial()->GetName();
511 return (G4ParticleTable::GetParticleTable()->FindParticle(
fParticleName));
516 if(!secondTrajectory)
return;
520 for(
int i=1;
i<ent;
i++)
G4Allocator< LBNETrajectory > myTrajectoryAllocator
std::vector< G4double > DVec
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
virtual std::vector< G4AttValue > * CreateAttValues() const
virtual void MergeTrajectory(G4VTrajectory *secondTrajectory)
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
G4int fMaterialNumber1rst
G4ParticleDefinition * GetParticleDefinition()
LBNETrajectoryVolumeName * fPreStepVolume
virtual ~LBNETrajectory()
std::vector< G4VTrajectoryPoint * > LBNETrajectoryPointContainer
G4ParticleDefinition * fParticleDefinition
virtual void ShowTrajectory() const
virtual void DrawTrajectory() const
G4int fMaterialNumberLast
LBNETrajectoryMaterialName * fMaterialName
LBNETrajectoryMomentumContainer * fMomentumRecord
G4ThreeVector GetInitialMomentum() const
G4String fMaterialName1rst
G4ThreeVector fVertexPosition
std::size_t color(std::string const &procname)
G4ThreeVector fPolarization
std::vector< G4String > LBNETrajectoryVolumeName
std::vector< G4String > LBNETrajectoryMaterialName
virtual void AppendStep(const G4Step *aStep)
LBNETrajectoryPointContainer * fPositionRecord
G4ThreeVector fParentMomentumAtThisProduction
virtual int GetPointEntries() const
std::vector< G4ThreeVector > LBNETrajectoryMomentumContainer