# Difference: SimplifiedTrackfitGeometry (1 vs. 4)

#### Revision 42016-08-24 - GeorgeRufusCoombs

Line: 1 to 1

 META TOPICPARENT name="LHCbTracking"

# A simplified geometry for track fitting

Line: 21 to 21
Here are a few schematic pictures of how the volumes are chosen:
Changed:
<
<
>
>
To get access to the top-level element of the simplified geometry in C++ you can do

#### Revision 32009-07-14 - WouterHulsbergen

Line: 1 to 1

 META TOPICPARENT name="LHCbTracking"

# A simplified geometry for track fitting

Line: 8 to 8
A solution to this problem is to use a 'simplified' tracking geometry. In LHCb we have for now chosen a very simplistic solution: the detector geometry is 'summarized' in O(20) volumes, most of which are in the velo region. These volumes get material properties such that they more or less represent the average material that you would find in the full geometry in that volume.
>
>
Here you can find a few presentations in which the simplified geometry is discussed

## Volumes in the simplified geometry

>
>
The tracking geometry contains about 30 volumes. The xml for the geometry resides in the database in DDDB/TrackfitGeometry/. It is a normal geometry, just like the default LHCb geometry. You can for example visualize it in Panoramix.

Here are a few schematic pictures of how the volumes are chosen:

To get access to the top-level element of the simplified geometry in C++ you can do IDetectorElement* simplifiedgeometry = getDet("/dd/TrackfitGeometry/Structure/LHCb" ) ;

Each volume in the trackfit geometry is either a box, a cylinder or a cone. Being a single volume, it has a homogeneous material distribution. The volumes in the track fit geometry have been defined by carefully looking at how material was distributed. The aim was to obtain pull distributions for the parameters of long tracks that at the vertex look more or less identical to those that are obtained with the nominal geometry. The particular complication is the RF foil: the simplified geometry is not phi symmetric, just like the full LHCb geometry is not phi symmetric.

The material properties of the volumes in the trackfit geometry are obtained by averaging the true distribution of materials inside the volume. This procedure is described below.

## Use of the tracking geometry in the trackfit

The track fit uses a tool of type `IMaterialLocator` to interact with the geometry. There are two ways to use the simplified geometry in the track fit. First, you can tell the `DetailedMaterialLocator` to use a different geometry to search for volumes, e.g. schematically

```    Fitter.addTool( DetailedMaterialLocator , "MaterialLocator" )
Fitter.MaterialLocator.Geometry = '/dd/TrackfitGeometry/Structure/LHCb'
```

Alternatively, you can use another implementation of the `!IMaterialLocator` tool:

```    Fitter.addTool( SimplifiedMaterialLocator , "MaterialLocator" )
```

The latter is a bit faster because the `SimplifiedMaterialLocator` exploits a particular feature of the simplified geometry: None of the volumes in the simplified geometry are rotated. Therefore, the global-to-local transformations are much simpler than for the generic case.

## Procedure to generate the material properties of the volumes

>
>
The package `Det/TrackfitGeometry` contains an algorithm to generate the material properties of the algorithms in the simplified geometry. The procedure can be sketched as follows:
• take a DST with simulated data that contains both `MCParticles` and =MCHits=. (For `MC09` this is an '=.xdst=' file.)
• for each event, select `MCParticles` that traverse both VELO and T-stations.
• make straight-line segments between any two `MCHits` and between the first `MCHit` and the vertex
• for each segment use TransportSvc to compute the intersections with the full geometry. An `intersection` is a special term int he transport service: it is basically the segment through as single-material volume. So, you have a begin-point, an end-point and a pointer to a particular material in the material database
• for each of these intersections, use the 'simplified' TransportSvc (which is a transport svc using the simplified geometry) to compute the corresponding volumes in the implified geometry. this allows to divide the original intersection precisely over the volumes in the simplified geometry.
• in this fashion, accumulate for each volume a list of 'Materials' that have been seen. Keep for each material the 'total segment length'. The latter represents the volume fraction of that material in the volume of the simplified material.
• when all events have been processed, the materials for each volume are combined in a `Mixture` (which is an implementation of a `Material`). To do this the original `Materials` are decomposed in so called `Elements` (which is another implementation of a `Material`). Each element appears in the final mixture as a certain fraction of the mass. This allows to get proper values for the effective A and Z for the mixture. The density and radiation length of the material follow their own averaging:
• the density is the volume weighted density of all materials
• the inverse radiation length is the volume weighted inverse radiation length. This assures that the average is consistent with the way it is used in the computation of the multiple scattering contribution used in the track fit

To run the algorithm, check-out the package, compile the algorithm and run the example script:

```   shell> SetupProject Brunel
shell> getpack Det/TrackfitGeometry
shell> cd Det/TrackfitGeometry/cmt
shell> gmake
shell> gaudirun.py ../options/GenerateMaterial.py
```
This will produce a file `materials.xml` as well as a root file with histograms.

To test your new `material.xml` file, you can create a database layer as follows:

```   shell> mkdirhier DDDB/TrackingGeometry
shell> mv materials.xml DDDB/TrackingGeometry
shell> SetupProject LHCb
shell> copy_files_to_db.py -c sqlite_file:SimplifiedMaterials.db/DDDB -s DDDB
```
You can load this database layer in your standard brunel job by copying these lines into your main option file
```   shell> from Configurables import ( CondDB, CondDBAccessSvc )
shell> simplifiedmaterialCond = CondDBAccessSvc( 'SimplifiedMaterialCond' )
shell> simplifiedmaterialCond.ConnectionString = 'sqlite_file:SimplifiedMaterials.db/DDDB'
```

-- WouterHulsbergen - 14 Jul 2009 \ No newline at end of file
>
>
 META FILEATTACHMENT attachment="simplelhcb.png" attr="" comment="all of LHCb" date="1247579575" name="simplelhcb.png" path="simplelhcb.png" size="6695" stream="simplelhcb.png" user="Main.WouterHulsbergen" version="1" attachment="veloregion.png" attr="" comment="velo region" date="1247579616" name="veloregion.png" path="veloregion.png" size="7456" stream="veloregion.png" user="Main.WouterHulsbergen" version="1" attachment="rffoil.png" attr="" comment="xy view of velo with RF foil in red" date="1247579653" name="rffoil.png" path="rffoil.png" size="39513" stream="rffoil.png" user="Main.WouterHulsbergen" version="1"

#### Revision 22009-07-14 - WouterHulsbergen

Line: 1 to 1

 META TOPICPARENT name="LHCbTracking"

# A simplified geometry for track fitting

## Introduction

Changed:
<
<
To correct for energy loss and multiple scattering on a charged particle trajectory, the LHCb track fit talks to the transport service to locate intersections with detector material on the track.
>
>
To correct for energy loss and multiple scattering on a charged particle trajectory, the LHCb track fit talks to the transport service to locate intersections with detector material. Since the number of volumes in the LHCb geometry is large (about 10 million), searching for intersections is expensive. For single iteration fits, it dominates the track fit time consumption.

A solution to this problem is to use a 'simplified' tracking geometry. In LHCb we have for now chosen a very simplistic solution: the detector geometry is 'summarized' in O(20) volumes, most of which are in the velo region. These volumes get material properties such that they more or less represent the average material that you would find in the full geometry in that volume.

## Volumes in the simplified geometry

#### Revision 12009-07-14 - WouterHulsbergen

Line: 1 to 1
>
>
 META TOPICPARENT name="LHCbTracking"

# A simplified geometry for track fitting

## Introduction

To correct for energy loss and multiple scattering on a charged particle trajectory, the LHCb track fit talks to the transport service to locate intersections with detector material on the track.

## Procedure to generate the material properties of the volumes

-- WouterHulsbergen - 14 Jul 2009

Copyright &© 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback