FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairEveTrack.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 /*
9  * FairEveTrack.cxx
10  *
11  * Created on: 23 kwi 2020
12  * Author: Daniel Wielanek
13  * E-mail: daniel.wielanek@gmail.com
14  * Warsaw University of Technology, Faculty of Physics
15  */
16  #include "FairEveTrack.h"
17  #include <TEvePathMark.h> // for TEvePathMark
18  #include <TEveVector.h> // for TEveVectorT, TEveVector
19  #include <TMath.h> // for IsNaN
20  #include <TMathBase.h> // for Abs
21  #include <TVector3.h> // for TVector3
22  #include "FairEventManager.h" // for FairEventManager
23 
25  : TEveTrack()
26 {}
27 
28 FairEveTrack::FairEveTrack(TParticle *t, Int_t label, TEveTrackPropagator *prop)
29  : TEveTrack(t, label, prop)
30 {}
31 
32 void FairEveTrack::SetFirstPoint(const TVector3 &mom, const TVector3 &pos)
33 {
34  TEveTrack::SetPoint(0, pos.X(), pos.Y(), pos.Z());
35  TEvePathMark path;
36  Float_t point[3] = {(Float_t)pos.X(), (Float_t)pos.Y(), (Float_t)pos.Z()};
37  path.fV = point;
38  path.fTime = 0;
39  TEveVector Mom(mom.Px(), mom.Py(), mom.Pz());
40  path.fP = Mom;
41  AddPathMark(path);
42 }
43 
44 void FairEveTrack::SetNextPoint(const TVector3 &point)
45 {
46  TVector3 world = FairEventManager::Instance()->GetWorldSize();
47  if (TMath::Abs(point.X()) > world.X())
48  return;
49  if (TMath::Abs(point.Y()) > world.Y())
50  return;
51  if (TMath::Abs(point.Z()) > world.Z())
52  return;
53  if (TMath::IsNaN(point.X()))
54  return;
55  TEveTrack::SetNextPoint(point.X(), point.Y(), point.Z());
56  TEvePathMark path;
57  Float_t hit[3] = {(Float_t)point.X(), (Float_t)point.Y(), (Float_t)point.Z()};
58  path.fV = hit;
59  path.fTime = 0;
60  AddPathMark(path);
61 }
62 
virtual ~FairEveTrack()
TVector3 GetWorldSize() const
static FairEventManager * Instance()
void SetNextPoint(const TVector3 &point)
void SetFirstPoint(const TVector3 &mom, const TVector3 &pos)