er  dev
ERTelescopeTrack.cxx
1 /********************************************************************************
2  * Copyright (C) Joint Institute for Nuclear Research *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence version 3 (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 #include "ERTelescopeTrack.h"
9 //--------------------------------------------------------------------------------------------------
10 ERTelescopeTrack::ERTelescopeTrack(const TVector3& targetVertex, const TVector3& xStationVertex,
11  const TVector3& yStationVertex, const TVector3& xStationLocalVertex,
12  const TVector3& yStationLocalVertex, const Int_t xChannel, const Int_t yChannel,
13  const Double_t xEdep, const Double_t yEdep)
14 : fTargetVertex(targetVertex), fXStationVertex(xStationVertex), fYStationVertex(yStationVertex),
15  fXStationLocalVertex(xStationLocalVertex), fYStationLocalVertex(yStationLocalVertex),
16  fXChannel(xChannel), fYChannel(yChannel), fXEdep(xEdep), fYEdep(yEdep)
17 {
18 }
19 //--------------------------------------------------------------------------------------------------
20 TVector3 ERTelescopeTrack::GetDirection() const {
21  auto direction = fXStationVertex - fTargetVertex;
22  direction.SetMag(1.);
23  return direction;
24 }
25 //--------------------------------------------------------------------------------------------------
26 TVector3 ERTelescopeTrack::GetVertexInZPlane(const Double_t z) const {
27  const auto direction = fXStationVertex - fTargetVertex;
28  return fTargetVertex + direction * ((z - fTargetVertex.Z()) / (direction.Z()));
29 }
30 //--------------------------------------------------------------------------------------------------
31 Double_t ERTelescopeTrack::GetXInZPlane(Double_t z) const {
32  return GetVertexInZPlane(z).X();
33 }
34 //--------------------------------------------------------------------------------------------------
35 Double_t ERTelescopeTrack::GetYInZPlane(Double_t z) const {
36  return GetVertexInZPlane(z).Y();
37 }
38 //--------------------------------------------------------------------------------------------------
39 ClassImp(ERTelescopeTrack)
ERTelescopeTrack()=default
Default constructor.