EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TransformationBoundToFree.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TransformationBoundToFree.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
10 
13 
16  const Acts::BoundVector& boundParams) {
17  // convert angles to global unit direction vector
18  Vector3D direction = makeDirectionUnitFromPhiTheta(boundParams[eBoundPhi],
19  boundParams[eBoundTheta]);
20 
21  // convert local position to global position vector
22  Vector2D local(boundParams[eBoundLoc0], boundParams[eBoundLoc1]);
23  Vector3D position = surface.localToGlobal(geoCtx, local, direction);
24 
25  // construct full free-vector. time and q/p stay as-is.
26  FreeVector freeParams = FreeVector::Zero();
27  freeParams[eFreePos0] = position[ePos0];
28  freeParams[eFreePos1] = position[ePos1];
29  freeParams[eFreePos2] = position[ePos2];
30  freeParams[eFreeTime] = boundParams[eBoundTime];
31  freeParams[eFreeDir0] = direction[eMom0];
32  freeParams[eFreeDir1] = direction[eMom1];
33  freeParams[eFreeDir2] = direction[eMom2];
34  freeParams[eFreeQOverP] = boundParams[eBoundQOverP];
35  return freeParams;
36 }