Message: Re: Wich dimension for slices of sensitive detector? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Wich dimension for slices of sensitive detector? 

Forum: Geometry
Re: Question Wich dimension for slices of sensitive detector? (Diana Massai)
Date: 09 Aug, 2006
From: Vladimir IVANTCHENKO <vnivanch@mail.cern.ch>

On Wed, 9 Aug 2006, Diana Massai wrote:

> *** Discussion title: Geometry
> Email replies to PublicHyperNews@slac.stanford.edu must include:
>   In-Reply-To: <"/geometry/590"@geant4-hn.slac.stanford.edu>
>   Subject: ...change this to be about your reply.
> 
> Hi, I have a problem on the setting of the dimension of slices. I run 
> a proton beam at 120 MeV with 20000 events and I built a water phantom
> (Sensitive Detector) with slices of 0.01 mm, and doing it, the total 
> energy deposited in water seems to be OK. But when I increase 
> the thickness at 0.1 or 1 mm, it is impossible to follow the right 
> deposition. 
> In the D1DetectorConstruction.cc, inside the definition of function 
> D1DetectorConstruction.cc() I inserted the code: 
>   
>  //Slice (200x200x0.01 mm)
>   S_x = 200*mm;
>   S_y = 200*mm;
>   S_z = 0.01*mm;   
> 
> Then, inside the definition of function Construct(), I inserted 
> the code: 
> 
>  S_box = new G4Box("Slice",S_x/2,S_y/2,S_z/2);  
>  S_log = new G4LogicalVolume(S_box,Acqua,"Slicelog",0,0,0);  
>  Spost = Spostf + S_z/2;
> 
>  for (int i = 0; i < 30000; i++)
>  {   
>    S_phys = new G4PVPlacement(0,
>                               G4ThreeVector(0,0,Spost),
>                               S_log,
>                               "Slicephys",
>                               W_log,
>                               false,
>                               i+1); 
>    Spost += S_z;
> }
>   
> //Set sensitive detector to be slice
>   if(!sliceSD)
>  {
>     G4SDManager* SDman = G4SDManager::GetSDMpointer();
>     G4String sliceSDname = "/mydet/slice";
>     sliceSD = new D1SliceSD(sliceSDname);
>     SDman->AddNewDetector(sliceSD);
>  }
>                                                                                  
> //Set sensitive detector to logic Chamber class
>   S_log->SetSensitiveDetector(sliceSD);
> 
> Then I defined the class called D1SliceSD, introducing this code:
>  
> D1SliceSD::D1SliceSD(G4String name):G4VSensitiveDetector(name)
> {
> //Intialise pointer to zero or owned memory
>   sliceCollection = 0;  
>   G4String HCname;
>   collectionName.insert(HCname = "sliceCollection");
> }
> 
> D1SliceSD::~D1SliceSD(){;}
> 
> void D1SliceSD::Initialize(G4HCofThisEvent* HCE)
> {
>   static int HCID = -1;  
>   sliceCollection = new
>   D1SliceHitsCollection(SensitiveDetectorName,collectionName[0]);  
> 
> if(HCID < 0)
>     HCID = GetCollectionID(0); 
>   
>   HCE->AddHitsCollection(HCID,sliceCollection);
> }
> 
> After that I created the class D1SliceHit. At the end I put in 
> D1EventAction.cc:
> 
> D1EventAction::D1EventAction(D1RunAction*D1RA,D1DetectorConstruction*D1DC):
> runaction(D1RA)
> {
>   DC = D1DC;
>   sliceID = -1;
> }
> 
> D1EventAction::~D1EventAction(){;}
> 
> void D1EventAction::BeginOfEventAction(const G4Event* evt)
> {
>   eventNumber = evt->GetEventID();
>   
>   if (eventNumber % 1 == 0) 
>     G4cout << "Begin of Event " << eventNumber << G4endl;
>     
>   G4SDManager* sensitiveSliceManager = G4SDManager::GetSDMpointer();
>   
>   if (sliceID == -1) 
>     sliceID = sensitiveSliceManager->GetCollectionID("sliceCollection");
> }
> 
> Why the thickness of every slice must be less or equal to 0.01 mm to 
> control the energy deposition in the water phantom? 
> Could anybody help me about this?
> 
> Thanks, Diana Massai
> 
> 

Your problem likely come from the fact that you change the slice size in 
one part of the application and forget to do so in another.

When one have sliced detector it is is optimal to define parameters in 
one place (thickness of one slice/ number of slices...). From these set of 
parameters in each corner of the code it is possible to recalculate 
geometry and other things.  

VI

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

 Add Message Add Message
to: "Re: Wich dimension for slices of sensitive detector?"

 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 ]