Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TrackPCut.cxx
1/*
2 * TrackPCut.cxx
3 *
4 * Created on: 28 mar 2017
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "TrackPCut.h"
10
11#include "Track.h"
12
13namespace Hal {
14
15 TrackPCut::TrackPCut() : TrackCut(1) { SetUnitName("p [GeV/c]"); }
16
17 Bool_t TrackPCut::Pass(Track* track) {
18 SetValue(track->GetMomentum().P());
19 return Validate();
20 }
21
22 TrackPCut::~TrackPCut() {}
23
24 TrackPSignedCut::TrackPSignedCut() { SetUnitName("p_{signed} [GeV/c]"); }
25
26 Bool_t TrackPSignedCut::Pass(Track* track) {
27 if (track->GetCharge() >= 0)
28 SetValue(track->GetMomentum().P());
29 else
30 SetValue(-track->GetMomentum().P());
31 return Validate();
32 }
33
34 TrackPSignedCut::~TrackPSignedCut() {}
35} // namespace Hal
const TLorentzVector & GetMomentum() const
Definition Track.h:118
Double_t GetCharge() const
Definition Track.h:184