Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TrackDCAPipeCut.cxx
1/*
2 * TrackDCAPipeCut.cxx
3 *
4 * Created on: 4 cze 2018
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "TrackDCAPipeCut.h"
11
12#include "DataFormatManager.h"
13#include "Event.h"
14#include "ExpTrack.h"
15#include "Helix.h"
16
17namespace Hal {
18 TrackDCAPipeCut::TrackDCAPipeCut() : TrackExpCut(3) {
19 SetUnitName("DCA_{abs} [cm]", DCA());
20 SetUnitName("DCA XY_{abs}[cm]", DCAxy());
21 SetUnitName("DCA Z_{abs}[cm]", DCAz());
22 }
23
24 Bool_t TrackDCAPipeCut::Pass(Track* track) {
25 const Helix& helix = ((ExpTrackHelix*) track)->GetHelix();
26 Double_t s = helix.PathLength(TVector3(0, 0, 0), kFALSE);
27 const TVector3 dca = helix.EvalPos(s);
28 SetValue(dca.Mag(), DCA());
29 SetValue(dca.Pt(), DCAxy());
30 SetValue(dca.Z(), DCAz());
31 return Validate();
32 }
33
34 Bool_t TrackDCAPipeCut::Init(Int_t id_format) {
35 if (TrackExpCut::Init() == kFALSE) return kFALSE;
36 const Event* ev = DataFormatManager::Instance()->GetFormat(id_format);
37 if (ev->InheritsFrom("Hal::ExpEventHelix")) {
38 return kTRUE;
39 } else {
40 return kFALSE;
41 }
42 }
43
44 TrackDCAPipeCut::~TrackDCAPipeCut() {}
45} // namespace Hal
void PathLength(Double_t r, Double_t &s1, Double_t &s2) const
Definition Helix.h:40
TVector3 EvalPos(Double_t s) const
Definition Helix.h:121