[Gate-users] Bug in GateDeadTime.cc

Sebastien JAN jan at shfj.cea.fr
Wed Jun 7 17:37:12 CEST 2006


Hi Spencer,

I did some tests to check this potential bug with the following 
configuration :

System:
  cylindricalPET
    rsector (40 volumes)
     crystal (100 volumes / rsector)


1/ First test : Dead Time applied on the rsector :

## Initialization :
m_generalDetId = aVolumeID->GetCopyNo(m_depth);

---In this case, m_generalDetId go from 0 to 39 (we defined 40 rsectors)
And m_depth = 2 with our geometrical description
---Now the loop

for(G4int i = 1 ; i < numberOfHigherLevels + 1; i++)
     {m_generalDetId += aVolumeID->GetCopyNo(m_depth-i) * 
numberOfComponentForLevel[i-1];}

---In this case, for every i values, aVolumeID->GetCopyNo(m_depth-i) 
will be always NULL
and m_generalDetId will go from 0 to 39


2/ Second test : Dead Tile applied on the crystal

## Initialization :
m_generalDetId = aVolumeID->GetCopyNo(m_depth);

---In this case, m_generalDetId go from 0 to 99 (we defined 100 crystals 
PER rsector)
And m_depth = 3 with our geometrical description
---Now the loop

for(G4int i = 1 ; i < numberOfHigherLevels + 1; i++)
     {m_generalDetId += aVolumeID->GetCopyNo(m_depth-i) * 
numberOfComponentForLevel[i-1];}

---In this case for i = 1 aVolumeID->GetCopyNo(m_depth-i) will go from 0 
to 39 AND numberOfComponentForLevel[i-1] = 100
For every other i values, aVolumeID->GetCopyNo(m_depth-i) is null.
Finally m_generalDetId will go from 0 to 3900 + 99 (which is expected)


This is of course tested with some G4cout lines.

Hope this mail is quite clear and could help you.
In my opinion and if my small tests are ok, there is no bug in the 
single dead time class.


Cheers
Sebastien



Spencer Bowen wrote:
>     I'm writing to report a potential bug for the singles dead time 
> implementation in Gate versions 2.1.0 and 2.2.0 found in the source file 
> GateDeadTime.cc.  In the for-loop at lines 134-137 it appears as though 
> a unique ID for each component is not assigned to m_generalDetId.  For 
> instance, for a cyldricalPET system I have been simulating that contains 
> 6 modules per an rsector (total of 22 rsectors), with the deadtime 
> attached to the module volume, the variable m_generalDetId goes from 0 
> to 26, when it should go from 0 to 131.  Indeed the array 
> m_deadTimeTable is declared with length numberTotalOfComponentInSystem = 
> 132, in this instance (line 286).  Consequently, with duplicate 
> m_generalDetId values the dead time experienced for each module can be 
> significantly greater than if unique IDs were issued.  Below I have 
> posted a simple fix to this potential bug:
> 
> 
>      G4int multFactor = 1;
>      for(G4int i = 1 ; i < numberOfHigherLevels + 1; i++)
>     {
>            multFactor *= numberOfComponentForLevel[i-1];
>           m_generalDetId += aVolumeID->GetCopyNo(m_depth-i)*multFactor;
>     }
> 
> I'm interested to know if others have noticed this error in their own 
> simulation results?
>      Spencer
>   



More information about the Gate-users mailing list