Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CexmcTrackPointsInLeftRightSet Class Reference

#include <CexmcTrackPointsInLeftRightSet.hh>

Inheritance diagram for CexmcTrackPointsInLeftRightSet:
Collaboration diagram for CexmcTrackPointsInLeftRightSet:

Public Member Functions

 CexmcTrackPointsInLeftRightSet (const G4String &name, const CexmcSetup *setup)
 
void PrintAll (void)
 
- Public Member Functions inherited from CexmcTrackPoints
 CexmcTrackPoints (const G4String &name)
 
void Initialize (G4HCofThisEvent *hcOfThisEvent)
 
void EndOfEvent (G4HCofThisEvent *hcOfThisEvent)
 
void DrawAll (void)
 
void clear (void)
 
- Public Member Functions inherited from CexmcPrimitiveScorer
 CexmcPrimitiveScorer (const G4String &name)
 
virtual ~CexmcPrimitiveScorer ()
 
void InitializeMessenger (void)
 
- Public Member Functions inherited from G4VPrimitiveScorer
 G4VPrimitiveScorer (G4String name, G4int depth=0)
 
virtual ~G4VPrimitiveScorer ()
 
G4int GetCollectionID (G4int)
 
void SetUnit (const G4String &unit)
 
const G4StringGetUnit () const
 
G4double GetUnitValue () const
 
void SetMultiFunctionalDetector (G4MultiFunctionalDetector *d)
 
G4MultiFunctionalDetectorGetMultiFunctionalDetector () const
 
G4String GetName () const
 
void SetFilter (G4VSDFilter *f)
 
G4VSDFilterGetFilter () const
 
void SetVerboseLevel (G4int vl)
 
G4int GetVerboseLevel () const
 
void SetNijk (G4int i, G4int j, G4int k)
 

Static Public Member Functions

static CexmcSide GetSide (G4int index)
 
static G4int GetLeftRightBitsOffset (void)
 

Protected Member Functions

G4int GetIndex (G4Step *step)
 
- Protected Member Functions inherited from CexmcTrackPoints
G4int GetTrackId (G4Step *step)
 
G4bool ProcessHits (G4Step *step, G4TouchableHistory *tHistory)
 
- Protected Member Functions inherited from CexmcPrimitiveScorer
void PrintHeader (G4int nmbOfEntries) const
 
- Protected Member Functions inherited from G4VPrimitiveScorer
void CheckAndSetUnit (const G4String &unit, const G4String &category)
 

Protected Attributes

const CexmcSetupsetup
 
- Protected Attributes inherited from CexmcTrackPoints
CexmcTrackPointsCollectioneventMap
 
- Protected Attributes inherited from G4VPrimitiveScorer
G4String primitiveName
 
G4MultiFunctionalDetectordetector
 
G4VSDFilterfilter
 
G4int verboseLevel
 
G4int indexDepth
 
G4String unitName
 
G4double unitValue
 
G4int fNi
 
G4int fNj
 
G4int fNk
 

Static Protected Attributes

static const G4int leftRightBitsOffset = 24
 

Detailed Description

Definition at line 54 of file CexmcTrackPointsInLeftRightSet.hh.

Constructor & Destructor Documentation

CexmcTrackPointsInLeftRightSet::CexmcTrackPointsInLeftRightSet ( const G4String name,
const CexmcSetup setup 
)

Definition at line 54 of file CexmcTrackPointsInLeftRightSet.cc.

55  :
56  CexmcTrackPoints( name ), setup( setup )
57 {
58 }
CexmcTrackPoints(const G4String &name)

Member Function Documentation

G4int CexmcTrackPointsInLeftRightSet::GetIndex ( G4Step step)
protectedvirtual

Reimplemented from CexmcTrackPoints.

Definition at line 61 of file CexmcTrackPointsInLeftRightSet.cc.

62 {
63  G4int ret( GetTrackId( step ) );
64  G4StepPoint * preStep( step->GetPreStepPoint() );
65  G4VPhysicalVolume * pVolume( preStep->GetPhysicalVolume() );
66 
67  if ( setup->IsRightDetector( pVolume ) )
68  ret |= 1 << leftRightBitsOffset;
69 
70  return ret;
71 }
G4int GetTrackId(G4Step *step)
int G4int
Definition: G4Types.hh:78
G4StepPoint * GetPreStepPoint() const
G4bool IsRightDetector(const G4VPhysicalVolume *pVolume) const
Definition: CexmcSetup.hh:207

Here is the call graph for this function:

G4int CexmcTrackPointsInLeftRightSet::GetLeftRightBitsOffset ( void  )
inlinestatic

Definition at line 88 of file CexmcTrackPointsInLeftRightSet.hh.

89 {
90  return leftRightBitsOffset;
91 }
CexmcSide CexmcTrackPointsInLeftRightSet::GetSide ( G4int  index)
inlinestatic

Definition at line 79 of file CexmcTrackPointsInLeftRightSet.hh.

80 {
81  if ( index >> leftRightBitsOffset == 1 )
82  return CexmcRight;
83 
84  return CexmcLeft;
85 }

Here is the caller graph for this function:

void CexmcTrackPointsInLeftRightSet::PrintAll ( void  )
virtual

Reimplemented from CexmcTrackPoints.

Definition at line 74 of file CexmcTrackPointsInLeftRightSet.cc.

75 {
76  G4int nmbOfEntries( eventMap->entries() );
77 
78  if ( nmbOfEntries == 0 )
79  return;
80 
81  PrintHeader( nmbOfEntries );
82 
83  for ( CexmcTrackPointsCollectionData::iterator
84  itr( eventMap->GetMap()->begin() );
85  itr != eventMap->GetMap()->end(); ++itr )
86  {
87  G4bool isRightDetector( itr->first >> leftRightBitsOffset );
88  const G4String detectorSide( isRightDetector ? "right" : "left" );
89  G4int trackId( itr->first &
90  ( ( 1 << ( leftRightBitsOffset - 1 ) ) |
91  ( ( 1 << ( leftRightBitsOffset - 1 ) ) - 1 ) ) );
92  G4cout << " " << detectorSide << " detector" << G4endl;
93  G4cout << " , track id " << trackId << G4endl;
94  G4cout << " , position: " <<
95  G4BestUnit( itr->second->positionLocal, "Length" ) << G4endl;
96  G4cout << " , direction: " <<
97  itr->second->directionLocal << G4endl;
98  G4cout << " , momentum: " <<
99  G4BestUnit( itr->second->momentumAmp, "Energy" ) << G4endl;
100  G4cout << " , particle: " <<
101  itr->second->particle->GetParticleName() << G4endl;
102  }
103 }
CexmcTrackPointsCollection * eventMap
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
G4int entries() const
Definition: G4THitsMap.hh:200
std::map< G4int, T * > * GetMap() const
Definition: G4THitsMap.hh:99
void PrintHeader(G4int nmbOfEntries) const
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Member Data Documentation

const G4int CexmcTrackPointsInLeftRightSet::leftRightBitsOffset = 24
staticprotected

Definition at line 75 of file CexmcTrackPointsInLeftRightSet.hh.

const CexmcSetup* CexmcTrackPointsInLeftRightSet::setup
protected

Definition at line 67 of file CexmcTrackPointsInLeftRightSet.hh.


The documentation for this class was generated from the following files: