G4PSNofStep Class Reference

#include <G4PSNofStep.hh>

Inheritance diagram for G4PSNofStep:

G4VPrimitiveScorer G4PSNofStep3D

Public Member Functions

 G4PSNofStep (G4String name, G4int depth=0)
virtual ~G4PSNofStep ()
virtual void Initialize (G4HCofThisEvent *)
virtual void EndOfEvent (G4HCofThisEvent *)
virtual void clear ()
virtual void DrawAll ()
virtual void PrintAll ()
virtual void SetUnit (const G4String &unit)
void SetBoundaryFlag (G4bool flg=true)

Protected Member Functions

virtual G4bool ProcessHits (G4Step *, G4TouchableHistory *)

Detailed Description

Definition at line 46 of file G4PSNofStep.hh.


Constructor & Destructor Documentation

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

Definition at line 41 of file G4PSNofStep.cc.

References SetUnit().

00042     :G4VPrimitiveScorer(name,depth),HCID(-1),boundaryFlag(false)
00043 {
00044     SetUnit("");
00045 }

G4PSNofStep::~G4PSNofStep (  )  [virtual]

Definition at line 47 of file G4PSNofStep.cc.

00048 {;}


Member Function Documentation

void G4PSNofStep::clear (  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 71 of file G4PSNofStep.cc.

00071                        {
00072   EvtMap->clear();
00073 }

void G4PSNofStep::DrawAll (  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 75 of file G4PSNofStep.cc.

00076 {;}

void G4PSNofStep::EndOfEvent ( G4HCofThisEvent  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 68 of file G4PSNofStep.cc.

00069 {;}

void G4PSNofStep::Initialize ( G4HCofThisEvent  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 61 of file G4PSNofStep.cc.

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

00062 {
00063   EvtMap = new G4THitsMap<G4double>(detector->GetName(),GetName());
00064   if(HCID < 0) {HCID = GetCollectionID(0);}
00065   HCE->AddHitsCollection(HCID, (G4VHitsCollection*)EvtMap);
00066 }

void G4PSNofStep::PrintAll (  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 78 of file G4PSNofStep.cc.

References G4VPrimitiveScorer::detector, G4cout, G4endl, G4VPrimitiveScorer::GetName(), and G4VSensitiveDetector::GetName().

00079 {
00080   G4cout << " MultiFunctionalDet  " << detector->GetName() << G4endl;
00081   G4cout << " PrimitiveScorer " << GetName() << G4endl;
00082   G4cout << " Number of entries " << EvtMap->entries() << G4endl;
00083   std::map<G4int,G4double*>::iterator itr = EvtMap->GetMap()->begin();
00084   for(; itr != EvtMap->GetMap()->end(); itr++) {
00085     G4cout << "  copy no.: " << itr->first
00086            << "  num of step: " << *(itr->second)
00087            << " [steps] "
00088            << G4endl;
00089   }
00090 }

G4bool G4PSNofStep::ProcessHits ( G4Step ,
G4TouchableHistory  
) [protected, virtual]

Implements G4VPrimitiveScorer.

Definition at line 50 of file G4PSNofStep.cc.

References FALSE, G4VPrimitiveScorer::GetIndex(), G4Step::GetStepLength(), and TRUE.

00051 {
00052   if ( boundaryFlag ) {
00053       if ( aStep->GetStepLength() == 0. ) return FALSE;
00054   }
00055   G4int  index = GetIndex(aStep);
00056   G4double val = 1.0;
00057   EvtMap->add(index,val);  
00058   return TRUE;
00059 }

void G4PSNofStep::SetBoundaryFlag ( G4bool  flg = true  )  [inline]

Definition at line 70 of file G4PSNofStep.hh.

00071         {boundaryFlag = flg;}

void G4PSNofStep::SetUnit ( const G4String unit  )  [virtual]

Reimplemented from G4VPrimitiveScorer.

Definition at line 92 of file G4PSNofStep.cc.

References G4Exception(), G4VPrimitiveScorer::GetName(), G4VPrimitiveScorer::GetUnit(), JustWarning, G4VPrimitiveScorer::unitName, and G4VPrimitiveScorer::unitValue.

Referenced by G4PSNofStep().

00093 {
00094   if (unit == "" ){
00095     unitName = unit;
00096     unitValue = 1.0;
00097   }else{
00098       G4String msg = "Invalid unit ["+unit+"] (Current  unit is [" +GetUnit()+"] ) for " + GetName();
00099       G4Exception("G4PSNofStep::SetUnit","DetPS0011",JustWarning,msg);
00100   }
00101 
00102 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:03 2013 for Geant4 by  doxygen 1.4.7