Import Geant4 6.2.0 source tree
This commit is contained in:
@@ -0,0 +1,174 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//// $Id: MedLinacPhantomSD.cc,v 1.3 2004/05/14 18:25:40 mpiergen Exp $
|
||||
//
|
||||
//
|
||||
// Code developed by: M. Piergentili
|
||||
|
||||
//
|
||||
//
|
||||
#include "MedLinacPhantomSD.hh"
|
||||
#include "MedLinacPhantomHit.hh"
|
||||
#include "MedLinacAnalysisManager.hh"
|
||||
#include "MedLinacDetectorConstruction.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4VTouchable.hh"
|
||||
#include "G4TouchableHistory.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
|
||||
//....
|
||||
|
||||
MedLinacPhantomSD::MedLinacPhantomSD(G4String name):G4VSensitiveDetector(name)
|
||||
{
|
||||
}
|
||||
|
||||
MedLinacPhantomSD::~MedLinacPhantomSD()
|
||||
{
|
||||
}
|
||||
|
||||
void MedLinacPhantomSD::Initialize(G4HCofThisEvent*)
|
||||
{
|
||||
}
|
||||
|
||||
G4bool MedLinacPhantomSD::ProcessHits(G4Step* aStep, G4TouchableHistory* ROhist)
|
||||
{
|
||||
if(!ROhist)
|
||||
return false;
|
||||
|
||||
if(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() != "Phantom_phys")
|
||||
return false;
|
||||
|
||||
G4double energyDep = aStep->GetTotalEnergyDeposit();
|
||||
if(energyDep == 0.)
|
||||
return false;
|
||||
|
||||
// Read Voxel indexes: i is the x index, k is the z index
|
||||
G4int k = ROhist->GetReplicaNumber(1);
|
||||
G4int i = ROhist->GetReplicaNumber(2);
|
||||
G4int j = ROhist->GetReplicaNumber();
|
||||
|
||||
|
||||
G4int numberOfVoxelZ = 300;
|
||||
G4double voxelWidthZ = 1. *mm;
|
||||
|
||||
G4double x;
|
||||
G4double y;
|
||||
G4double z;
|
||||
x = (-numberOfVoxelZ+1+2*i)*voxelWidthZ/2;
|
||||
y = (- numberOfVoxelZ+1+2*j)*voxelWidthZ/2;
|
||||
z = (- numberOfVoxelZ+1+2*k)*voxelWidthZ/2;
|
||||
|
||||
if(energyDep != 0)
|
||||
{
|
||||
#ifdef G4ANALYSIS_USE
|
||||
MedLinacAnalysisManager* analysis =
|
||||
MedLinacAnalysisManager::getInstance();
|
||||
//2Dhistogram with the distribution of energy at depth=15 mm in the phantom
|
||||
//(x,y,energy) (YThickness = 1. cm)
|
||||
if(energyDep != 0)
|
||||
{
|
||||
if (z<140.*mm){if (z> 130.*mm)
|
||||
{analysis->FillHistogram3WithEnergy(x,y,energyDep/MeV);}
|
||||
}
|
||||
}
|
||||
if(energyDep != 0)
|
||||
{
|
||||
analysis->FillHistogram1WithEnergy(x,z,energyDep/MeV);
|
||||
}
|
||||
//**** PDD in isocenter (Y and X Thickness = 5. mm) **********************
|
||||
if(energyDep != 0)
|
||||
{
|
||||
if (y<2.5*mm){if (y> -2.5*mm)
|
||||
{
|
||||
if(x<2.5*mm){if (x> -2.5*mm)
|
||||
{analysis->FillHistogram4WithEnergy(z,energyDep/MeV);}
|
||||
}}}}
|
||||
//***** flatness along x ***** Depth=build-up for 6MV photon beam (15 mm)*
|
||||
if(energyDep != 0)
|
||||
{
|
||||
if (z<137.5*mm){if (z> 132.5*mm)
|
||||
{ if (y<2.5*mm){if (y> -2.5*mm)
|
||||
{analysis->FillHistogram5WithEnergy(x,energyDep/MeV);}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//***** flatness along x ***** Depth=50mm*********************************
|
||||
if(energyDep != 0)
|
||||
{
|
||||
if (z<102.5*mm){if (z> 97.5*mm)
|
||||
{ if (y<2.5*mm){if (y> -2.5*mm)
|
||||
{analysis->FillHistogram6WithEnergy(x,energyDep/MeV);}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//***** flatness along x ***** Depth=100 mm********************************
|
||||
if(energyDep != 0)
|
||||
{
|
||||
if (z<52.5*mm){if (z> 47.5*mm)
|
||||
{ if (y<2.5*mm){if (y> -2.5*mm)
|
||||
{analysis->FillHistogram7WithEnergy(x,energyDep/MeV);}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//***** flatness along x ***** Depth=200 mm********************************
|
||||
if(energyDep != 0)
|
||||
{
|
||||
if (z<-47.5*mm){if (z> -52.5*mm)
|
||||
{ if (y<2.5*mm){if (y> -2.5*mm)
|
||||
{analysis->FillHistogram8WithEnergy(x,energyDep/MeV);}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//**************************************************************************
|
||||
#endif
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void MedLinacPhantomSD::EndOfEvent(G4HCofThisEvent*)
|
||||
{
|
||||
}
|
||||
|
||||
void MedLinacPhantomSD::clear()
|
||||
{
|
||||
}
|
||||
|
||||
void MedLinacPhantomSD::DrawAll()
|
||||
{
|
||||
}
|
||||
|
||||
void MedLinacPhantomSD::PrintAll()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user