Analysis Software
Documentation for sPHENIX simulation 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 
15 
16 #include <algorithm>
17 
20  const Acts::BoundVector& boundParams) {
21  // convert angles to global unit direction vector
22  Vector3 direction = makeDirectionFromPhiTheta(boundParams[eBoundPhi],
23  boundParams[eBoundTheta]);
24 
25  // convert local position to global position vector
26  Vector2 local(boundParams[eBoundLoc0], boundParams[eBoundLoc1]);
27  Vector3 position = surface.localToGlobal(geoCtx, local, direction);
28 
29  // construct full free-vector. time and q/p stay as-is.
30  FreeVector freeParams = FreeVector::Zero();
31  freeParams[eFreePos0] = position[ePos0];
32  freeParams[eFreePos1] = position[ePos1];
33  freeParams[eFreePos2] = position[ePos2];
34  freeParams[eFreeTime] = boundParams[eBoundTime];
35  freeParams[eFreeDir0] = direction[eMom0];
36  freeParams[eFreeDir1] = direction[eMom1];
37  freeParams[eFreeDir2] = direction[eMom2];
38  freeParams[eFreeQOverP] = boundParams[eBoundQOverP];
39  return freeParams;
40 }