Message: Computation of kinetic energy released by primary photons per voxel Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Computation of kinetic energy released by primary photons per voxel 

Forum: Event and Track Management
Date: 01 Feb, 2010
From: Francisco <Francisco>

Hi

I want to calculate the kinetic energy released by primary photons per voxel of my detector (silicon array). The code below allows me to compute the energy deposited per voxel (taken from a geant4 example), but I am struggling to calculate, instead of Edep per voxel, the initial kinetic energy of those electrons set in motion by photons (primay) in the voxel. By using the ID I can isolate those electrons, but I don't have any way to do (for instance):

  KineticEnergy = (*CHC)[i]->GetVertexKineticEnergy(); 

1. How can I do modify the code below to get the initial kinetic energy of electrons released by photons per voxel?

2. If the scattered photons have the same ID (than primary photons), how can I get information of those electrons released only by primary photons?

Thank you very much in advance. Francisco

EventAction::EventAction(DetectorConstruction* det)
  :detector(det), printModulo(10000),eventMessenger(0)
{
  epitaxialCollID = -1;
  eventMessenger = new EventActionMessenger(this);  
}

EventAction::~EventAction() {delete eventMessenger;} //{;}

void EventAction::BeginOfEventAction(const G4Event* evt)
{
 G4int evtNb = evt->GetEventID();

 //printing survey
 if (evtNb%printModulo == 0) 
    G4cout << "\n---> Begin of Event: " << evtNb << G4endl;  

  G4SDManager * SDman = G4SDManager::GetSDMpointer();
  if(epitaxialCollID<0)
  {
    G4String colNam;
    epitaxialCollID = SDman->GetCollectionID(colNam="epiCollection");  
  }
  TotalEnergyDeposit = 0.;

}

void EventAction::EndOfEventAction(const G4Event* evt)
{  
  if(epitaxialCollID<0) return;
  G4HCofThisEvent * HCE = evt->GetHCofThisEvent();
  EpitaxialHitsCollection* CHC = 0;
  if(HCE)
  {
    CHC = (EpitaxialHitsCollection*)(HCE->GetHC(epitaxialCollID));
  }

  if(CHC)
  {
    int n_hit = CHC->entries();

    for(int i=0;i<n_hit;i++){

      G4int copyIDinX,copyIDinZ;
      G4int NbOfPixelsAlongX = 520;
      G4int NbOfPixelsAlongZ = 520;

      G4double density = 2.33*g/cm3;
      G4double volume  = 8.75E-9*cm3;
      G4double Pixellmass = density*volume;   //Pixell  mass

      G4double x,z;
      totE = (*CHC)[i]->GetEdep();
      G4double Dose = totE/Pixellmass;

      copyIDinX = (*CHC)[i]->GetX();
      copyIDinZ = (*CHC)[i]->GetZ();
      G4double pixelWidth = 25.0E-04*cm;
      x = ( - NbOfPixelsAlongX + 1+ 2*copyIDinX )* pixelWidth/2; 
      z = ( - NbOfPixelsAlongZ + 1+ 2*copyIDinZ )* pixelWidth/2;

      FILE *pFile1 = NULL;
      pFile1 = fopen("2DDoseArray.dat", "a");
      fprintf (pFile1, "%d\t%d\t%.3E\n", copyIDinX, copyIDinZ, Dose/(joule/kg));
      fclose(pFile1);

    }

  }    

  FILE *pFile2 = NULL;
  pFile2 = fopen("EnergyDeposited.dat", "a");
  fprintf (pFile2, "%.3f\n", TotalEnergyDeposit/keV);
  fclose(pFile2);
}

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

1 Feedback: Re: Computation of kinetic energy released by primary photons per voxel   (Gumplinger Peter - 01 Feb, 2010)
(_ None: Re: Computation of kinetic energy released by primary photons per voxel   (Francisco - 03 Feb, 2010)
 Add Message Add Message
to: "Computation of kinetic energy released by primary photons per voxel"

 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 ]