CbmRoot
Loading...
Searching...
No Matches
HalCbmTofCut.cxx
Go to the documentation of this file.
1/* Copyright (C) 2023-2023 Warsaw University of Technology, Warsaw
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Daniel Wielanek [committer] */
4#include "HalCbmTofCut.h"
5
6#include "Hal/Std.h"
7#include "HalCbmTrack.h"
8
9HalCbmTofCut::HalCbmTofCut() : Hal::TrackToFMass2Cut(2) { SetUnitName("Flag [AU]", 1); }
10
11Bool_t HalCbmTofCut::Init(Int_t task_id)
12{
13 if (FormatInhertis("HalCbmEvent", task_id, Hal::EFormatDepth::kNonBuffered)) return kTRUE;
14 return kFALSE;
15}
16
17Bool_t HalCbmTofCut::Pass(Hal::Track* track)
18{
19 HalCbmTrack* reco = (HalCbmTrack*) track;
20 Hal::ToFTrack* tof = reco->GetTofTrack();
21 SetValue(tof->GetFlag(), Flag());
22 SetValue(tof->GetMass2(), M2());
23 Double_t m2 = tof->GetMass2();
24 Double_t p = reco->GetMomentum().P();
25 SetValue(m2, 0);
26 SetValue(tof->GetFlag(), 1);
27 Double_t min = fLowLine[0] + fLowLine[1] * p + fLowLine[2] * p * p;
28 Double_t max = fHighLine[0] + fHighLine[1] * p + fHighLine[2] * p * p;
29 if (m2 > max || m2 < min) {
30 return ForcedUpdate(kFALSE);
31 }
32 return Validate();
33}
34
virtual ~HalCbmTofCut()
virtual Bool_t Pass(Hal::Track *track)
static Int_t Flag()
virtual Bool_t Init(Int_t task_id)
static Int_t M2()
Hal::ToFTrack * GetTofTrack()
Definition HalCbmTrack.h:37