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

#include <G4PSCellCharge.hh>

Inheritance diagram for G4PSCellCharge:
G4VPrimitiveScorer G4PSCellCharge3D

Public Member Functions

 G4PSCellCharge (G4String name, G4int depth=0)
 
 G4PSCellCharge (G4String name, const G4String &unit, G4int depth=0)
 
virtual ~G4PSCellCharge ()
 
virtual void Initialize (G4HCofThisEvent *)
 
virtual void EndOfEvent (G4HCofThisEvent *)
 
virtual void clear ()
 
virtual void DrawAll ()
 
virtual void PrintAll ()
 
virtual void SetUnit (const G4String &unit)
 
- Public Member Functions inherited from G4VPrimitiveScorer
 G4VPrimitiveScorer (G4String name, G4int depth=0)
 
virtual ~G4VPrimitiveScorer ()
 
G4int GetCollectionID (G4int)
 
void SetUnit (const G4String &unit)
 
const G4String & GetUnit () const
 
G4double GetUnitValue () const
 
void SetMultiFunctionalDetector (G4MultiFunctionalDetector *d)
 
G4MultiFunctionalDetector * GetMultiFunctionalDetector () const
 
G4String GetName () const
 
void SetFilter (G4VSDFilter *f)
 
G4VSDFilter * GetFilter () const
 
void SetVerboseLevel (G4int vl)
 
G4int GetVerboseLevel () const
 
void SetNijk (G4int i, G4int j, G4int k)
 

Protected Member Functions

virtual G4bool ProcessHits (G4Step *, G4TouchableHistory *)
 
- Protected Member Functions inherited from G4VPrimitiveScorer
virtual G4int GetIndex (G4Step *)
 
void CheckAndSetUnit (const G4String &unit, const G4String &category)
 

Additional Inherited Members

- Protected Attributes inherited from G4VPrimitiveScorer
G4String primitiveName
 
G4MultiFunctionalDetector * detector
 
G4VSDFilter * filter
 
G4int verboseLevel
 
G4int indexDepth
 
G4String unitName
 
G4double unitValue
 
G4int fNi
 
G4int fNj
 
G4int fNk
 

Detailed Description

Definition at line 46 of file G4PSCellCharge.hh.

Constructor & Destructor Documentation

G4PSCellCharge::G4PSCellCharge ( G4String  name,
G4int  depth = 0 
)

Definition at line 43 of file G4PSCellCharge.cc.

References SetUnit().

44  :G4VPrimitiveScorer(name,depth),HCID(-1)
45 {
46  SetUnit("e+");
47 }
virtual void SetUnit(const G4String &unit)
G4VPrimitiveScorer(G4String name, G4int depth=0)
G4PSCellCharge::G4PSCellCharge ( G4String  name,
const G4String &  unit,
G4int  depth = 0 
)

Definition at line 49 of file G4PSCellCharge.cc.

References SetUnit().

51  :G4VPrimitiveScorer(name,depth),HCID(-1)
52 {
53  SetUnit(unit);
54 }
virtual void SetUnit(const G4String &unit)
G4VPrimitiveScorer(G4String name, G4int depth=0)
G4PSCellCharge::~G4PSCellCharge ( )
virtual

Definition at line 56 of file G4PSCellCharge.cc.

57 {;}

Member Function Documentation

void G4PSCellCharge::clear ( void  )
virtual

Reimplemented from G4VPrimitiveScorer.

Definition at line 95 of file G4PSCellCharge.cc.

References G4THitsMap< T >::clear().

95  {
96  EvtMap->clear();
97 }
void clear()
Definition: G4THitsMap.hh:209
void G4PSCellCharge::DrawAll ( void  )
virtual

Reimplemented from G4VPrimitiveScorer.

Definition at line 99 of file G4PSCellCharge.cc.

100 {;}
void G4PSCellCharge::EndOfEvent ( G4HCofThisEvent *  )
virtual

Reimplemented from G4VPrimitiveScorer.

Definition at line 92 of file G4PSCellCharge.cc.

93 {;}
void G4PSCellCharge::Initialize ( G4HCofThisEvent *  HCE)
virtual

Reimplemented from G4VPrimitiveScorer.

Definition at line 84 of file G4PSCellCharge.cc.

References G4HCofThisEvent::AddHitsCollection(), G4VPrimitiveScorer::detector, G4VPrimitiveScorer::GetCollectionID(), G4VPrimitiveScorer::GetName(), and G4VSensitiveDetector::GetName().

85 {
86  EvtMap = new G4THitsMap<G4double>(detector->GetName(),
87  GetName());
88  if ( HCID < 0 ) HCID = GetCollectionID(0);
89  HCE->AddHitsCollection(HCID,EvtMap);
90 }
G4String GetName() const
G4int GetCollectionID(G4int)
void AddHitsCollection(G4int HCID, G4VHitsCollection *aHC)
G4MultiFunctionalDetector * detector
void G4PSCellCharge::PrintAll ( void  )
virtual

Reimplemented from G4VPrimitiveScorer.

Definition at line 102 of file G4PSCellCharge.cc.

References G4VPrimitiveScorer::detector, G4THitsMap< T >::entries(), G4cout, G4endl, G4THitsMap< T >::GetMap(), G4VPrimitiveScorer::GetName(), G4VSensitiveDetector::GetName(), G4VPrimitiveScorer::GetUnit(), and G4VPrimitiveScorer::GetUnitValue().

103 {
104  G4cout << " MultiFunctionalDet " << detector->GetName() << G4endl;
105  G4cout << " PrimitiveScorer " << GetName() <<G4endl;
106  G4cout << " Number of entries " << EvtMap->entries() << G4endl;
107  std::map<G4int,G4double*>::iterator itr = EvtMap->GetMap()->begin();
108  for(; itr != EvtMap->GetMap()->end(); itr++) {
109  G4cout << " copy no.: " << itr->first
110  << " cell charge : " << *(itr->second)/GetUnitValue()
111  << " [" << GetUnit() << "]"
112  << G4endl;
113  }
114 }
G4String GetName() const
G4GLOB_DLL std::ostream G4cout
G4double GetUnitValue() const
G4int entries() const
Definition: G4THitsMap.hh:79
std::map< G4int, T * > * GetMap() const
Definition: G4THitsMap.hh:68
#define G4endl
Definition: G4ios.hh:61
G4MultiFunctionalDetector * detector
const G4String & GetUnit() const
G4bool G4PSCellCharge::ProcessHits ( G4Step *  aStep,
G4TouchableHistory *   
)
protectedvirtual

Implements G4VPrimitiveScorer.

Definition at line 59 of file G4PSCellCharge.cc.

References G4THitsMap< T >::add(), fGeomBoundary, G4StepPoint::GetCharge(), G4Track::GetCurrentStepNumber(), G4VPrimitiveScorer::GetIndex(), G4Track::GetParentID(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4StepPoint::GetStepStatus(), G4Step::GetTrack(), G4StepPoint::GetWeight(), and TRUE.

60 {
61 
62  // Enter or First step of primary.
63  if( aStep->GetPreStepPoint()->GetStepStatus() == fGeomBoundary
64  || ( aStep->GetTrack()->GetParentID() == 0 &&
65  aStep->GetTrack()->GetCurrentStepNumber() == 1 ) ){
66  G4double CellCharge = aStep->GetPreStepPoint()->GetCharge();
67  CellCharge *= aStep->GetPreStepPoint()->GetWeight();
68  G4int index = GetIndex(aStep);
69  EvtMap->add(index,CellCharge);
70  }
71 
72  // Exit
73  if( aStep->GetPostStepPoint()->GetStepStatus() == fGeomBoundary){
74  G4double CellCharge = aStep->GetPreStepPoint()->GetCharge();
75  CellCharge *= aStep->GetPreStepPoint()->GetWeight();
76  G4int index = GetIndex(aStep);
77  CellCharge *= -1.0;
78  EvtMap->add(index,CellCharge);
79  }
80 
81  return TRUE;
82 }
G4int GetParentID() const
G4double GetWeight() const
G4StepStatus GetStepStatus() const
int G4int
Definition: G4Types.hh:78
G4StepPoint * GetPreStepPoint() const
G4int GetCurrentStepNumber() const
G4int add(const G4int &key, T *&aHit) const
Definition: G4THitsMap.hh:138
G4double GetCharge() const
virtual G4int GetIndex(G4Step *)
#define TRUE
Definition: globals.hh:55
G4StepPoint * GetPostStepPoint() const
double G4double
Definition: G4Types.hh:76
G4Track * GetTrack() const
void G4PSCellCharge::SetUnit ( const G4String &  unit)
virtual

Definition at line 116 of file G4PSCellCharge.cc.

References G4VPrimitiveScorer::CheckAndSetUnit().

Referenced by G4PSCellCharge(), G4PSCellCharge3D::G4PSCellCharge3D(), and G4ScoreQuantityMessenger::SetNewValue().

117 {
118  CheckAndSetUnit(unit,"Electric charge");
119 }
void CheckAndSetUnit(const G4String &unit, const G4String &category)

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