Message: Problem in Example N07 Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Problem in Example N07 

Keywords: N07, novice, example
Forum: Event and Track Management
Date: 25 Mar, 2004
From: Kanin <nin@astro.phys.sc.chula.ac.th>

Hi.

I try to learn the Example N07. In the file ExN07StackingAction.cc,
some lines of the codes are:

G4int ExN07StackingAction::nGamma[6] = {0,0,0,0,0,0};
G4int ExN07StackingAction::nElectron[6] = {0,0,0,0,0,0};
G4int ExN07StackingAction::nPositron[6] = {0,0,0,0,0,0};


   I don't understand what will store in the array size=6.
   What is "nGamma[6] = {0,0,0,0,0,0}; " means ?    
 

And in the file ExN07Runaction.cc

====================================================
void ExN07RunAction::EndOfRunAction(const G4Run* aRun)
{
static G4String regName[3] = {"Calor-A","Calor-B","Calor-C"};

const ExN07Run* theRun = (const ExN07Run*)aRun;

G4cout
<< " Run Summary - Number of events : " << theRun->GetNumberOfEvent()
<< G4endl;


G4double nEvt = (G4double)(theRun->GetNumberOfEvent());
for(size_t i=0;i<3;i++)
{
size_t ih1 = 2*i;
size_t ih2 = 2*i+1;


G4Region* region = G4RegionStore::GetInstance()->GetRegion(regName[i]);
G4ProductionCuts* cuts = region->GetProductionCuts();
G4cout << "Region : " << region->GetName() << G4endl;
G4cout << " Production thresholds :" << G4endl << " "
<< " gamma " << G4BestUnit(cuts->GetProductionCut("gamma"),"Length")
<< " e- " << G4BestUnit(cuts->GetProductionCut("e-"),"Length")
<< " e+ " << G4BestUnit(cuts->GetProductionCut("e+"),"Length")
<< G4endl;
G4cout << " Energy deposition in an event :" << G4endl << " "
<< " Absorber " << G4BestUnit((theRun->GetTotalE(ih1))/nEvt,"Energy")
<< " Gap " << G4BestUnit((theRun->GetTotalE(ih2))/nEvt,"Energy")
<< G4endl;
G4cout << " Number of secondaries in an event :" << G4endl << " "
<< " gamma in Absorber " << (theRun->GetNGamma(ih1))/nEvt
<< " in Gap " << (theRun->GetNGamma(ih2))/nEvt << G4endl << " "
<< " e- in Absorber " << (theRun->GetNElectron(ih1))/nEvt
<< " in Gap " << (theRun->GetNElectron(ih2))/nEvt << G4endl << " "
<< " e+ in Absorber " << (theRun->GetNPositron(ih1))/nEvt
<< " in Gap " << (theRun->GetNPositron(ih2))/nEvt << G4endl;

=============================================


  In the "for-loop", why "i" run from "0 to 2" ?
  Does the "ih1" means the primary events  and "ih2" means secondary events ?
 

Could anyone explain me ?
Thank you very much...

Kanin

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

 Add Message Add Message
to: "Problem in Example N07"

 Subscribe Subscribe

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


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]