Format of the Detector file
by Daniel Drijard
<CERN>
October 1998
The following describes the format of the detector file. This file
(and its corresponding format) are temporary. Some proper database
will be devised at a later stage but we need something else before.
The file is in ASCII format and is assembled in specialised blocks and
sub-blocks.
Blocks description
- blocks of information start with a header-line which consists of:
2 labels, then the number of lines FOLLOWING, then a run range and
finally a date range which are read with the format
"(1x,a10,5x,a10,5x,i3,2(1x,i7),2(1x,i9))"
such as (the 3 lines following indicate the columns):
dEdX Geometry nnn 000001 999999 19970101 20101231 !Label[2],NbLines,Run-range[2],Date-range[2]
1111111111
00000000011111111112222222222333333333344444444445555555555666666666677777777778888888888899999999990000000000
12345678901234567890123456789012345678901234567890123456789012345678901234567890012345678901234567890123456789
-
the 2 labels define the type of information given in the lines which follow
-
the number of lines 'nnn' is needed to skip rapidly unwanted blocks (important because
this file is sequential ! )
-
the Run-range in this example extends to infinity
-
the Date-range in this example starts at a "time-origin for DIRAC" and
extends far enough in the future to satisfy optimistic people
sub-blocks constitute further lines described below
Sub-Blocks description
- header line consists of
a label, a count of words following, a count of lines following and a format which are read
with the format:
"(1x,a10,2i5,a)"
such as (the 2 lines following indicate the columns):
Position WW L (1x,3i3,i5,i3,11f8.3) ! Label,NbWords,NbLines
00000000011111111112222222222333333333344444444445555555555666666666677777777778888888888899999999990000000000
12345678901234567890123456789012345678901234567890123456789012345678901234567890012345678901234567890123456789
- the label defines the type of information given in the
following lines
- the number of words 'WW' to be read in the following lines
(sub-block dependent, it could in fact be anything)
- the number of lines 'L' is needed to skip unwanted lines
- the format is used to read the following lines
- there is a particular line to mark the end of the Detector file
(i.e. further lines will be ignored) which is:
FIN
12345678901234567890123456789012345678901234567890123456789012345678901234567890012345678901234567890123456789
The rules are the following:
- lines between blocks or sub-blocks with any non-blank character in
column 1 are ignored, but NOT lines inside a sub-block
- anything after (and including) the character "!" in a line is
ignored (comments follow the character "!")
- the order of blocks is arbitrary
- the order of sub-blocks, within a block, is arbitrary
- the format of the header-line is fixed for blocks
(there is ONE read statement common to all blocks)
- the format of the header-line for sub-blocks is NOT fixed because
this line is read by a block-dependent routine;
however, the format indicated above, "(1x,a10,2i5,a)" , should
be preferred
- the format of the lines inside of a sub-block is not formalised
(i.e. it is totally free)
One expects the program to operate in the following way:
- at initialisation
- have the list of blocks WANTED (i.e. needed for the current
processing). This should be defined at execution time (i.e. depending
on user requests)
- for each of these blocks, define a "run range"
RunRange={StartRun,EndRun} preset for example to {2,1} to mean empty
- for every input event, compare its run number to that of the previous
event and in case they are different:
- construct the list of blocks for which the new Run-number
is not included in RunRange
- if that list is not empty READ the Detector file to get the
proper new parameters.
This should be rare for standard processing but will become
more frequent later, after event selection
- here only RunRange is considered, DateRange could be
considered (in place or in addition, this is so far unimportant)
- if the Detector file needs to be read for new parameters:
- successive lines are read:
- each line must be a block header-line
- check if the block indicated is requested and if the
RunRange is appropriate;
if not, skip the number of lines indicated for this block
- call the routine corresponding to this block
- all lines of this block will be either read and used, or skipped
- this is evidently fully under the control of this routine
- consistency between equivalent routines is however much wanted
This concerns ONLY the format of the sub-block header-lines
- the processing of this file may be ended by either of:
- the mark of the end of the Detector file ("FIN" see above)
- exhausting the requests for updates
- for this, one must make sure (ENFORCE) that the different
RunRange (and DateRange) defined in the Detector File ARE
NOT overlapping.
This will allow to stop scanning the Detector file when a
RunRange (or DateRange) is satisfied
Blocks lists:
The list of blocks so far recognised by (decoded by) the software is:
- Axes Geometry
- Target Geometry
- MSGC Geometry
- SciFi Geometry
- dEdX Geometry
- DriftChamb Geometry
- HodVer Geometry
- HodHor Geometry
- Cherenkov Geometry
- Muon Geometry
- PreShower Geometry
- SciFi Calibration
- dEdX Calibration
- HodVer Calibration
Additional blocks (now unused but will later be needed...in some way):
- dEdX Matter
- HodVer Matter
- HodHor Matter
Additional Sub-blocks information:
Used in the Axes block :
Euler 14 1 (1x,7(i2,1x,a3)) ! NbCodes,[Euler code, 'abc'=successive axes] NbCodes/2 times
This is meant to define orientations between various systems of
co-ordinates (displacements are not considered because all systems
have the same origin of axes).
- NbCodes: defines the number of couples of parameters following
- Euler code: is a number used to reference
(throughout the programme) an "Euler" transformation
- abc: is a 3-letter string -built out of the letters X,Y,Z-
defining the order of the successive axes of rotation.
Normally 'XYZ' is used (rotations around X then Y then Z) but other
combinations are available.
xxxxxxxxxx 8 1 (1x,2i3,6f8.0) ! Name,Euler code,3 angles,Xorigin,Yorigin,Zorigin
defines a system of co-ordinates relative to the main system, SecondaryH (see #####).
- Name=xxxx...: maybe either of 8 principal systems
Primary, SecondaryH, SecondaryV, SecondaryW, RightH, RightV, LeftH, LeftV;
Other systems may be defined if needed
- Euler code: is a reference to the sub-block Euler
- 3 angles: are the rotation angles (in degrees)
- X- Y- Zorigin: is the origin of co-ordinates
Used in the Target block :
Position 12 0 (1x,3i3,9f8.0) ! Name,"closest Axes",Euler code,3 angles,Width,Height,Thickness
x Xcenter,Ycenter,Zcenter
This defines a target
- Name: is a reference (an integer) to the set of targets
which may be used
- closest axes: is the Euler code of the system of axes
in the set of the 8 principal systems closest to the system defined
by the '3 angles' which follow
- Euler code: the Euler code of the system defined by
the '3 angles'if defined in the Axes block.
This block has AT LEAST 8 principal systems.
In case the '3 angles' are not expressly defined in this block, the
Euler code should be set to 0 (a code will be generated in the programme)
- 3 angles: are the rotation angles (in degrees)
SPECIFICALLY for the Target block, the codes are both =1 and the
angles {5.7,0,0} (the Primary system)
- Width,Height,Thickness: are sizes (of a "parallelepipede")
along X,Y and Z
- Xcenter,Ycenter,Zcenter: define the co-ordinates of the
center
Used in the detector blocks:
Position 15 2 (1x,3i3,i5,i3,10f8.0) ! Name,"closest Axes",Euler code,NbWires,Direction
x 3 angles,Width,Height,Thickness,Xcenter,Ycenter,Zcenter,Xwire1,Pitch
defines a detector plane
-
Name: is a name (an integer) defining the plane
- closest axes: is the Euler code of the system of axes
in the set of the 8 principal systems closest to the system defined
by the '3 angles' which follow
- Euler code: the Euler code of the system defined by
the '3 angles' IF defined in the Axes block.
This block has AT LEAST 8 principal systems.
In case the '3 angles' are not expressly defined in this block,
the Euler code should be set to 0 (a code will be generated in the
programme)
- NbWires: number of detector elements in this plane
- Direction: "names" (numeros) of detector elements
increase/decrease along Y-axis for Direction=+1/-1
- 3 angles: are the rotation angles (in degrees)
- Width,Height,Thickness: are sizes along X,Y and Z
- Xcenter,Ycenter,Zcenter: define the co-ordinates of
the center
- Xwire1: is the X co-ordinate of the first wire or
scintillator (used in data decoding)
- Pitch: distance between successive elements
Used in the 'Calibration' detector blocks:
progressively building up
Pedestals 3 2 (1x,2i3,10f5.1) ! Name of plane,number of channels,pedestals
Gain 3 2 (1x,2i3,10f6.1) ! Name of plane,number of channels,gains
for scintillating fibres
Timing 3 2 (1x,2i3,10f6.1) ! Name of plane,number of channels,timing
for scintillating fibres
Delay 3 2 (1x,2i3,10f5.1) ! Name of plane,number of channels,delays
for vertical Hodoscopes
HVoltage 3 2 (1x,2i3,10f5.1) ! Name of plane,number of channels,voltages
for vertical Hodoscopes
CFD 3 2 (1x,2i3,10f5.1) ! Name of plane,number of channels,constant
x fraction discriminators
for vertical Hodoscopes
Used in the 'Matter' detector blocks:
Matter 3 2 (1x,3f8.0) ! Density,Radiation length,Interaction length
defines the material characteristics of a detector plane.
Density,Radiation length,Interaction length: have their standard
meaning.