Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
CexmcEnergyDepositInLeftRightSet Class Reference

#include <CexmcEnergyDepositInLeftRightSet.hh>

Inheritance diagram for CexmcEnergyDepositInLeftRightSet:
CexmcSimpleEnergyDeposit CexmcPrimitiveScorer G4VPrimitiveScorer CexmcEnergyDepositInCalorimeter

Public Member Functions

 CexmcEnergyDepositInLeftRightSet (const G4String &name, const CexmcSetup *setup)
 
void PrintAll (void)
 
- Public Member Functions inherited from CexmcSimpleEnergyDeposit
 CexmcSimpleEnergyDeposit (const G4String &name)
 
void Initialize (G4HCofThisEvent *hcOfThisEvent)
 
void EndOfEvent (G4HCofThisEvent *hcOfThisEvent)
 
void DrawAll (void)
 
void PrintAll (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 CexmcSimpleEnergyDeposit
G4int GetIndex (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 CexmcSimpleEnergyDeposit
CexmcEnergyDepositCollectioneventMap
 
- 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 = 16
 

Detailed Description

Definition at line 54 of file CexmcEnergyDepositInLeftRightSet.hh.

Constructor & Destructor Documentation

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

Definition at line 54 of file CexmcEnergyDepositInLeftRightSet.cc.

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

Member Function Documentation

G4int CexmcEnergyDepositInLeftRightSet::GetIndex ( G4Step step)
protectedvirtual

Reimplemented from G4VPrimitiveScorer.

Definition at line 61 of file CexmcEnergyDepositInLeftRightSet.cc.

References G4Step::GetPreStepPoint(), CexmcSetup::IsRightDetector(), leftRightBitsOffset, and setup.

62 {
63  G4int ret( 0 );
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 }
int G4int
Definition: G4Types.hh:78
G4StepPoint * GetPreStepPoint() const
G4bool IsRightDetector(const G4VPhysicalVolume *pVolume) const
Definition: CexmcSetup.hh:207
G4int CexmcEnergyDepositInLeftRightSet::GetLeftRightBitsOffset ( void  )
inlinestatic

Definition at line 88 of file CexmcEnergyDepositInLeftRightSet.hh.

References leftRightBitsOffset.

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

Definition at line 79 of file CexmcEnergyDepositInLeftRightSet.hh.

References CexmcLeft, CexmcRight, and leftRightBitsOffset.

Referenced by CexmcEnergyDepositDigitizer::Digitize().

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

Reimplemented from G4VPrimitiveScorer.

Definition at line 74 of file CexmcEnergyDepositInLeftRightSet.cc.

References G4THitsMap< T >::entries(), CexmcSimpleEnergyDeposit::eventMap, G4BestUnit, G4cout, G4endl, G4THitsMap< T >::GetMap(), leftRightBitsOffset, and CexmcPrimitiveScorer::PrintHeader().

75 {
76  G4int nmbOfEntries( eventMap->entries() );
77 
78  if ( nmbOfEntries == 0 )
79  return;
80 
81  PrintHeader( nmbOfEntries );
82 
83  for ( CexmcEnergyDepositCollectionData::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  G4cout << " " << detectorSide << " detector" << G4endl;
90  G4cout << " , energy deposit " <<
91  G4BestUnit( *( itr->second ), "Energy" ) << G4endl;
92  }
93 }
#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:79
std::map< G4int, T * > * GetMap() const
Definition: G4THitsMap.hh:68
void PrintHeader(G4int nmbOfEntries) const
#define G4endl
Definition: G4ios.hh:61
CexmcEnergyDepositCollection * eventMap

Field Documentation

const G4int CexmcEnergyDepositInLeftRightSet::leftRightBitsOffset = 16
staticprotected
const CexmcSetup* CexmcEnergyDepositInLeftRightSet::setup
protected

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