Message: suggestions to G4PSNofSecondary.cc Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None suggestions to G4PSNofSecondary.cc 

Forum: Biasing and Scoring
Date: 08 Sep, 2011
From: Fada Guan <Fada Guan>

Dear Drs. Aso and Kimura:

I think the comments and some output information in G4PSNofSecondary.cc file (Geant4.9.4.p02) is not so clear.

1) the description part is: // (Description) // This is a primitive scorer class for scoring number of steps in the // Cell. // // Created: 2005-11-14 Tsukasa ASO, Akinori Kimura.

I think it should be “scoring number of secondaries in the cell.”

2)In ProcessHits function and PrintAll function,

G4bool G4PSNofSecondary::ProcessHits(G4Step* aStep,G4TouchableHistory*)
{
  //- check for newly produced particle. e.g. first step.
  if ( aStep->GetTrack()->GetCurrentStepNumber() != 1) return FALSE;
  //- check for this is not a primary particle. e.g. ParentID > 0 .
  if ( aStep->GetTrack()->GetParentID() == 0 ) return FALSE;
  //- check the particle if the partifle definition is given.
  if ( particleDef && particleDef != aStep->GetTrack()->GetDefinition() )
      return FALSE;
  //
  //- This is a newly produced secondary particle.
  G4int  index = GetIndex(aStep);
  G4double weight = 1.0;
  if ( weighted ) weight *= aStep->GetPreStepPoint()->GetWeight();
  EvtMap->add(index,weight);  
  return TRUE;
}
void G4PSNofSecondary::PrintAll()
{
  G4cout << " PrimitiveScorer " << GetName() << G4endl;
  G4cout << " Number of entries " << EvtMap->entries() << G4endl;
  std::map<G4int,G4double*>::iterator itr = EvtMap->GetMap()->begin();
  for(; itr != EvtMap->GetMap()->end(); itr++) {
    G4cout << "  copy no.: " << itr->first
	   << "  num of step: " << *(itr->second)/GetUnitValue()
	   << G4endl;
  }
}

I understand here if particleDef == 0, all types of secondaries will be counted.  If particleDef != 0, the desired type of secondary particles will be counted.  I think some comments should be added in ProcessHits function and the  PrintAll() function should provide more detailed information. In addition, the output should be number of “secondaries,” not “step.”
For example, it can be:
    If(particleDef==0)
    {G4cout << "  copy no.: " << itr->first
	   << "  number of all secondaries: " << *(itr->second)/GetUnitValue()
	   << G4endl;}
else{
G4cout << "  copy no.: " << itr->first
	   << " number of secondary "<<particleDef->GetParticleName <<": " << *(itr->second)/GetUnitValue()
	   << G4endl;}

Just some suggestions.

Thanks a lot.

Regards.

Fada

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: suggestions to G4PSNofSecondary.cc   (Fada Guan - 08 Sep, 2011)
(_ None: Re: suggestions to G4PSNofSecondary.cc   (Tsukasa Aso - 08 Sep, 2011)
 Add Message Add Message
to: "suggestions to G4PSNofSecondary.cc"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews