Specifying the test-beam sensor geometry with the DDD

Useful documentation to understand the CMS DDD can be found at http://cmsdoc.cern.ch/cms/software/ddd/www/draft1.3_cms_ddl.pdf).

All the Tracker beam/system-test geometry files are kept in the ORCA directory Data/TrackerTBGeometries/. (Get this by doing "cvs co Data/TrackerTBGeometries"). There is one subdirectory in there for each beam/system-test, with fairly obvious names. Often these contain a directory doc/ with explanations of what is there.

An example geometry specified with .xml files is in Data/TrackerTBGeometries/Examples/. It includes

configuration.xml
------------------------
This is the main .xml file, specified in your .orcarc cards. It includes all the other .xml files listed below.

cms.xml
--------------
Declares several objects, such as OCMS (=cms), TRAK (=tracker), the TOB and TIB, the required Tracker layers and the required sensors. It says what shape each one is and how large they are. The size of the wafers and their names are taken copied from the file /afs/cern.ch/cms/Releases/Geometry/Geometry_1_9_0/src/Tracker/TrackerGeometry/.

Note that the code which reads the xml (TkLayout/src/TopologyBuilder.cc) assumes that each wafer is inside at least 3 other objects - layer, TOB/TIB, TRAK. Furthermore, the OSCAR .xml files in its Data area rely on the top level object being called OCMS (for the magnetic field to work) and the tracker being called TRAK (for the GEANT4 tracking cuts to be applied to it).

tib.xml and tec.xml
----------------------
Declare the positions of the sensors relative to the layers, and of the layers relative to the TOB/TEC and of the TOB/TEC relative to CMS. If you want more than one sensor or layer, you can add several in this file. This information is used by the class TkDDDInterface/CmsTrackerBuilderFromDDD when constructing the geometry. Be careful that no object must go outside the boundaries of the object that contains it.

trackersens.xml
-----------------------
For each sensor, just notes that it is sensitive (i.e. gives a signal when hit). (e.g. <Parameter name="SensitiveDetector" value="TkAccumulatingSensitiveDetector"/>.)

It also gives a name to the SimHit ReadOutUnit that will contain its hits (e.g. <Parameter name="ReadOutName" value="TbTkHits"/>). The name can be anything, as long as you are consistent in OSCAR and ORCA.

specs.xml
--------------
The TOB/TEC/TIB container, and the layers and sensors they contain are all declared to have a "TkStructure" of TOB, TIB or TEC respectively. This information is required by CmsTrackerBuilderFromDDD. It also declares any sensors which are stereo.

napv.xml
-------------
Says how many APVs read out each module type (e.g. <Parameter name="NumberOfAPVs" value="4"/>). The number of strips will be 128 times this number. This is used by TopologyBuilderFromXml.

ProductionCuts/tracker.xml
-------------------------------------
This specifies the GEANT4 tracking cuts in the Tracker (volume TRAK), both for the sensitive and non-sensitive regions. It is in OSCAR's Data package and is only required when simulating events with OSCAR. Leaving it out seems to switch off the most common secondary interactions in the silicon..

PropagationInField/FieldParameters.xml
---------------------------------------------
This is necessary if your want to simulate the magnetic field. It is in OSCAR's Data package and is only required when simulating events with OSCAR.


.orcarc parameters required
--------------------------------
# Ask for DDD to be used.
TkDDDInterface:UseDDD = 1
# Directory and Name of test-beam geometry file.
Geometry_PATH = .:./../../../Data/TrackerTBGeometries/X5bMay2003:${Geometry_PATH}
DDDConfigFile = ./testbeamconfiguration.xml
# Relate ordering of detectors in .xml and input test-beam dataset.
ApvOrcaIdToDatasetId:FileName = DetMap.dat
 

DetMap.dat File
--------------------

The DetMap.dat file, is used by the ApvOrcaIdToDatasetId class to relate the order of detectors in the input test-beam dataset to in the .xml geometry file. It is only needed to run on real data, not simulated data.

The first column in DetMap.dat is the detector number. It is ordered according to the order in which a detector numbering factory (such as Tracker/TkLayout/interface/TBNumberingFactory.h or TkNumberingSchemeFactory.h) inserted the detector modules into the  DetUnitNumbering<TrackerSimHitTag>, which later can be used to remember this order for any given module). The NumberingFactory of your choice will have been called by your analysis code in the case of a non-COBRA driven event loop, or by ORCA for a COBRA driven event loop. Try running TkX5bMay2003/test/Geometry.cpp to find out the number of all modules.

The second and third columns in DetMap.dat give the APV numbers within that detector and the code number for each one. The latter should correspond to that in the input test-beam dataset, and is based the APV's CCU + I2C number. The first four hexadecimal digits must be those in the root Tree in the sir*.root test-beam dataset. The last four digits can be anything.