Message: Re: Recording energies of gammas passing through a volume Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Recording energies of gammas passing through a volume 

Forum: Biasing and Scoring
Re: Question Recording energies of gammas passing through a volume (Ben Ryan)
Date: 28 Jan, 2010
From: Tsukasa Aso <Tsukasa Aso>


With a primitive scorer, you can apply a SD filter 
to separate energy range of gammas in a scorer.

 i.e.  snippet code from examples/extended/runAndEvent/RE02
 Each scorer (in this case FlatSurfaceCurrent ) records the current 
btw kmin and kmax. By defining scorers corresponding to the number 
of energy bins (in this case 4), you can extract the current 
as a function of energy of gamma.

  for ( G4int i = 0; i < 4; i++){
      G4String psgName(name);
      G4double kmin = std::pow(10.,(G4double)i)*keV;
      G4double kmax = std::pow(10.,(G4double)(i+1))*keV;
      //-- Particle with kinetic energy filter.                                 
      G4SDParticleWithEnergyFilter* pkinEFilter =
	new G4SDParticleWithEnergyFilter(fltName="gammaE filter",kmin,kmax);
      pkinEFilter->add("gamma");  // Accept only gamma.                         
      pkinEFilter->show();        // Show accepting condition to stdout.        
      //-- Surface Current Scorer which scores  number of tracks in unit area.  
      G4PSFlatSurfaceCurrent* scorer =
          new RE02PSFlatSurfaceCurrent(psgName,fCurrent_InOut,fNx,fNy,fNz);
      scorer->SetFilter(pkinEFilter);    // Assign filter.                      
      MFDet->RegisterPrimitive(scorer);  // Register it to MultiFunctionalDetec\

Tsukasa Aso


 Add Message Add Message
to: "Re: Recording energies of gammas passing through a volume"

 Subscribe Subscribe

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