ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
VTrackInformation Class Referenceabstract

Instances of classes derived from this class are attached as UserInformation to G4Tracks. It extends G4VUserTrackInformation. The GenParticlePtr held by the VTrackInformation object can change during simulation (i.e. each time the track undergoes a non-destructive interaction). The member variables are m_classify: a classification of the current G4Track (Primary, Regenerated Primary, Registered Secondary, Secondary) and m_primaryGenParticle: a pointer to the GenParticle used to create the initial G4PrimaryParticle from which the current G4Track decends. More...

#include <VTrackInformation.h>

Inheritance diagram for VTrackInformation:
Collaboration diagram for VTrackInformation:

Public Types

enum  TrackClassification {
  Primary, RegeneratedPrimary, RegisteredSecondary, Secondary,
  BarcodeOnly
}
 

Public Member Functions

 VTrackInformation (TrackClassification tc=Primary)
 
TrackClassification GetClassification () const
 return the classification of the current G4Ttrack (Primary, Regenerated Primary, Registered Secondary, Secondary) More...
 
void SetClassification (TrackClassification tc)
 update the classification of the currently tracked particle, usually called when a new G4Track is created or after it survives an interaction. More...
 
HepMC::ConstGenParticlePtr GetPrimaryGenParticle () const
 return a pointer to the GenParticle used to create the initial G4PrimaryParticle from which the current G4Track decends. More...
 
HepMC::GenParticlePtr GetPrimaryGenParticle ()
 
void SetPrimaryGenParticle (HepMC::GenParticlePtr)
 set the pointer to the GenParticle used to create the initial G4PrimaryParticle from which the current G4Track decends. More...
 
virtual HepMC::ConstGenParticlePtr GetCurrentGenParticle () const
 return a pointer to the GenParticle corresponding to the current G4Track (if there is one). More...
 
virtual HepMC::GenParticlePtr GetCurrentGenParticle ()
 
virtual void SetCurrentGenParticle (HepMC::GenParticlePtr)
 set the pointer to the GenParticle corresponding to the current G4Track. More...
 
virtual const ISF::ISFParticleGetBaseISFParticle () const
 return a pointer to the ISFParticle corresponding to the current G4Track. More...
 
virtual ISF::ISFParticleGetBaseISFParticle ()
 
virtual void SetBaseISFParticle (ISF::ISFParticle *)
 set the pointer to the ISFParticle corresponding to the current G4Track. More...
 
virtual bool GetReturnedToISF () const
 Is the ISFParticle corresponding to the current G4Track scheduled to be returned to the ISF? More...
 
virtual void SetReturnedToISF (bool)
 Flag whether the ISFParticle corresponding to the current G4Track scheduled to be returned to the ISF. More...
 
virtual int GetParticleBarcode () const =0
 
virtual int GetParticleUniqueID () const =0
 
virtual int GetParticleStatus () const =0
 
virtual void Print () const
 

Private Attributes

TrackClassification m_classify
 
HepMC::GenParticlePtr m_primaryGenParticle {}
 

Detailed Description

Instances of classes derived from this class are attached as UserInformation to G4Tracks. It extends G4VUserTrackInformation. The GenParticlePtr held by the VTrackInformation object can change during simulation (i.e. each time the track undergoes a non-destructive interaction). The member variables are m_classify: a classification of the current G4Track (Primary, Regenerated Primary, Registered Secondary, Secondary) and m_primaryGenParticle: a pointer to the GenParticle used to create the initial G4PrimaryParticle from which the current G4Track decends.

Dervived classes also provide access to the GenParticle corresponding to the current G4Track (if one exists)

Definition at line 30 of file VTrackInformation.h.

Member Enumeration Documentation

◆ TrackClassification

Enumerator
Primary 
RegeneratedPrimary 
RegisteredSecondary 
Secondary 
BarcodeOnly 

Definition at line 32 of file VTrackInformation.h.

Constructor & Destructor Documentation

◆ VTrackInformation()

VTrackInformation::VTrackInformation ( TrackClassification  tc = Primary)

Definition at line 7 of file VTrackInformation.cxx.

8  : m_classify(tc)
9 {
10 }

Member Function Documentation

◆ GetBaseISFParticle() [1/2]

virtual ISF::ISFParticle* VTrackInformation::GetBaseISFParticle ( )
inlinevirtual

Reimplemented in TrackInformation, and TrackBarcodeInfo.

Definition at line 81 of file VTrackInformation.h.

81 {return nullptr;}

◆ GetBaseISFParticle() [2/2]

virtual const ISF::ISFParticle* VTrackInformation::GetBaseISFParticle ( ) const
inlinevirtual

return a pointer to the ISFParticle corresponding to the current G4Track.

Reimplemented in TrackInformation, and TrackBarcodeInfo.

Definition at line 80 of file VTrackInformation.h.

80 {return nullptr;}

◆ GetClassification()

TrackClassification VTrackInformation::GetClassification ( ) const
inline

return the classification of the current G4Ttrack (Primary, Regenerated Primary, Registered Secondary, Secondary)

Definition at line 39 of file VTrackInformation.h.

39 {return m_classify;}

◆ GetCurrentGenParticle() [1/2]

virtual HepMC::GenParticlePtr VTrackInformation::GetCurrentGenParticle ( )
inlinevirtual

Reimplemented in TrackInformation.

Definition at line 68 of file VTrackInformation.h.

68 {return nullptr;}

◆ GetCurrentGenParticle() [2/2]

virtual HepMC::ConstGenParticlePtr VTrackInformation::GetCurrentGenParticle ( ) const
inlinevirtual

return a pointer to the GenParticle corresponding to the current G4Track (if there is one).

Reimplemented in TrackInformation.

Definition at line 67 of file VTrackInformation.h.

67 {return nullptr;}

◆ GetParticleBarcode()

virtual int VTrackInformation::GetParticleBarcode ( ) const
pure virtual

Implemented in TrackInformation, and TrackBarcodeInfo.

◆ GetParticleStatus()

virtual int VTrackInformation::GetParticleStatus ( ) const
pure virtual

Implemented in TrackInformation, and TrackBarcodeInfo.

◆ GetParticleUniqueID()

virtual int VTrackInformation::GetParticleUniqueID ( ) const
pure virtual

Implemented in TrackInformation, and TrackBarcodeInfo.

◆ GetPrimaryGenParticle() [1/2]

HepMC::GenParticlePtr VTrackInformation::GetPrimaryGenParticle ( )
inline

Definition at line 55 of file VTrackInformation.h.

55 {return m_primaryGenParticle;}

◆ GetPrimaryGenParticle() [2/2]

HepMC::ConstGenParticlePtr VTrackInformation::GetPrimaryGenParticle ( ) const
inline

return a pointer to the GenParticle used to create the initial G4PrimaryParticle from which the current G4Track decends.

Should match the return value of ISF::TruthBinding::getPrimaryGenParticle(). TODO Check that this is required.

Definition at line 54 of file VTrackInformation.h.

54 {return m_primaryGenParticle;}

◆ GetReturnedToISF()

bool VTrackInformation::GetReturnedToISF ( ) const
virtual

Is the ISFParticle corresponding to the current G4Track scheduled to be returned to the ISF?

Reimplemented in TrackInformation, and TrackBarcodeInfo.

Definition at line 17 of file VTrackInformation.cxx.

18 {
19  return false;
20 }

◆ Print()

virtual void VTrackInformation::Print ( ) const
inlinevirtual

Definition at line 105 of file VTrackInformation.h.

105 {}

◆ SetBaseISFParticle()

void VTrackInformation::SetBaseISFParticle ( ISF::ISFParticle )
virtual

set the pointer to the ISFParticle corresponding to the current G4Track.

(Only used to replace the ISFParticle by a copy of itself when the G4Track is killed and the copy is scheduled to be returned to the ISF.)

Reimplemented in TrackInformation, and TrackBarcodeInfo.

Definition at line 28 of file VTrackInformation.cxx.

29 {
30  // you should not call this, perhaps throw an exception?
31  std::cerr<<"ERROR VTrackInformation::SetBaseISFParticle() not supported "<<std::endl;
32 }

◆ SetClassification()

void VTrackInformation::SetClassification ( TrackClassification  tc)
inline

update the classification of the currently tracked particle, usually called when a new G4Track is created or after it survives an interaction.

Definition at line 45 of file VTrackInformation.h.

45 {m_classify=tc;}

◆ SetCurrentGenParticle()

void VTrackInformation::SetCurrentGenParticle ( HepMC::GenParticlePtr  )
virtual

set the pointer to the GenParticle corresponding to the current G4Track.

This will be updated each time an interaction of the G4Track is recorded to the HepMC::GenEvent.

Reimplemented in TrackInformation.

Definition at line 22 of file VTrackInformation.cxx.

23 {
24  // you should not call this, perhaps throw an exception?
25  std::cerr<<"ERROR VTrackInformation::SetCurrentGenParticle() not supported "<<std::endl;
26 }

◆ SetPrimaryGenParticle()

void VTrackInformation::SetPrimaryGenParticle ( HepMC::GenParticlePtr  p)

set the pointer to the GenParticle used to create the initial G4PrimaryParticle from which the current G4Track decends.

TODO Check that this is required - if so, ensure it is set consistently.

Definition at line 12 of file VTrackInformation.cxx.

13 {
14  m_primaryGenParticle = std::move(p);
15 }

◆ SetReturnedToISF()

void VTrackInformation::SetReturnedToISF ( bool  )
virtual

Flag whether the ISFParticle corresponding to the current G4Track scheduled to be returned to the ISF.

Only called in TrackProcessorUserActionPassBack::returnParticleToISF

Reimplemented in TrackInformation, and TrackBarcodeInfo.

Definition at line 34 of file VTrackInformation.cxx.

35 {
36  std::cerr<<"ERROR VTrackInformation::SetReturnedToISF() not supported "<<std::endl;
37 }

Member Data Documentation

◆ m_classify

TrackClassification VTrackInformation::m_classify
private

Definition at line 107 of file VTrackInformation.h.

◆ m_primaryGenParticle

HepMC::GenParticlePtr VTrackInformation::m_primaryGenParticle {}
private

Definition at line 108 of file VTrackInformation.h.


The documentation for this class was generated from the following files:
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
VTrackInformation::m_primaryGenParticle
HepMC::GenParticlePtr m_primaryGenParticle
Definition: VTrackInformation.h:108
VTrackInformation::m_classify
TrackClassification m_classify
Definition: VTrackInformation.h:107
VTrackInformation::Primary
@ Primary
Definition: VTrackInformation.h:32
VTrackInformation::Secondary
@ Secondary
Definition: VTrackInformation.h:32
VTrackInformation::BarcodeOnly
@ BarcodeOnly
Definition: VTrackInformation.h:32
VTrackInformation::RegisteredSecondary
@ RegisteredSecondary
Definition: VTrackInformation.h:32
VTrackInformation::RegeneratedPrimary
@ RegeneratedPrimary
Definition: VTrackInformation.h:32