## Feature #253

closedTask #235: Miscellaneous version 1.6 issues & tasks

### VDC geometry parameters

**Description**

Support setting and using x/y position information of the VDC chambers

#### Updated by Ole Hansen almost 7 years ago

**Status**changed from*New*to*Closed***Start date**set to*01/23/2018***% Done**changed from*0*to*100*

Made the geometry of the VDC classes consistent. There are two main coordinate systems:

- VDC coordinates: The origin is the center of the lower VDC chamber, z points vertically up, x is horizontal along the long VDC side in the dispersive direction (pointing away from the target)
- Track coordinates (also called TRANSPORT coordinates, although that's misleading): The origin is the same as that of the VDC coordinate system. z points along the direction of the central ray, y is the same as the VDC system's y, and x forms a right-handed coordinate system with z and y. The direction of the central ray is the VDC z-axis tilted by a little over 45 toward the VDC x-axis. This angle is the (negative of the) "VDC angle", specified as the T000 focal plane matrix element in the database. Yes, I know, a complicated mess.

VDC track calculations are first done in the VDC systems. Track system coordinates are then calculated in `THaVDC::CalcFocalPlaneCoords`

. All detector `fOrigin`

and axes (`fXax`

etc.) are given relative to the track system. So the VDC axes are tilted by -45.1 or so degrees, while detectors usually aren't tilted (although they can be).

The center point of each VDC plane is now in a new `TVector3`

member variable `THaVDCPlane::fCenter`

, which is expressed in VDC coordinates. `THaVDCPlane::fOrigin`

is that same point, but in track coordinates. The `x`

and `y`

components of `fCenter`

are now calculated automatically from the wire start positions, except if non-zero values are given for `x`

and/or `y`

in the database, they override the calculated positions. In practice, `y`

is always zero by definition, and so is `x`

of the lower chamber.

To check if a point lies within a detector's active area, use `IsInactiveArea(x,y)`

, where `x`

and `y`

must be in local detector coordinates, except for `THaVDCPlane`

, where `x`

and `y`

are in VDC coordinates (i.e. not the `THaVDCPlane`

local system), i.e. relative to `fOrigin = (0,0,0)`

.

`THaVDCChamber::MatchUVClusters()`

now correctly checks if a cluster is inside the active VDC area. The VDC plane "size" is set to approximate, conservative values for the HRS VDCs in `THaVDCPlane::ReadGeometry`

so that this cut already works to some extent with old databases. To adjust the cut, specify "size" explicitly in the database.

Most of this is implemented with commit 7751e5f.