Geometry data movement to C++: Geometry database
Changes made to implement moving of geometry (.db file) data to XDR output:
- dbio extended to support 'database mode', currently done by dbin, so dbio's I/O facilities are available for the geometry data.
- geometry data block defined for the XDR output file header, ready to test when geometry is read via dbio. OR simultaneously read geometry with both dbin and dbio (data spaces are different).
- BBSIM code using the geometry database has to be modified for dbio-style references. Extensive Fortran changes required. UNLESS dbin/dbio used simultaneously.
Geometry data movement to C++: Derived data
Implementation of moving derived data to C++ via the XDR event file (header):
- Data structure definition mechanism of dbio extended to support versioned derived data structures
- working example provided for defining data structures to transfer derived geometry constants from the simulation to reconstruction and other C++ codes.
- XDR file I/O code and versioning mechanism extended to support I/O of a version-protected set of derived data structures in the run header.
Example of use of derived data structures:
!
! ******* Structures to save derived data
!
! Derived data version number used to support versioning. Must be
! incremented when the derived data structures change, and the
! data handling code in derived_data.c and data_to_xdr.c modified
! accordingly to support the new ID.
!
incprefix DbiEvent
incname DerivedData
parameter DerivedDataVsn 1 ! Derived data version number.
include TestData.ds
TestData.ds
incname TestData
!
! Data structure definition for derived data. The 'nocode' directive
! specifies that the C++ code to create a class corresponding to this
! template is not needed.
template TestData nocode
int indx
real x
real y
real z
end template
dimension TestDataMax 500
record TestData(TestDataMax)
DataToDs.F
subroutine DataToDs
implicit none
print *,'Writing derived data block to XDR file'
call TestDataToDs
end
TestDataToDs.F
subroutine TestDataToDs
************************************************************************
*
* Move derived data to the I/O data structures
*
************************************************************************
implicit none
#include "gnbase/run_db.inc"
#include "DbiEvent/TestData.inc"
*
integer i
*
n_obj_TestData = 100
do i=1,100
TestData(i).indx = 1
TestData(i).x = i*10.
TestData(i).y = i*100.
TestData(i).z = i*200.
enddo
end
|