Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TrackBasicMCCut.cxx
1/*
2 * TrackBasicMCCut.cxx
3 *
4 * Created on: 19 maj 2016
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "TrackBasicMCCut.h"
10
11#include "McTrack.h"
12#include "DataFormatManager.h"
13
14namespace Hal{
15
16const Int_t TrackBasicMCCut::fgStatusId = 0;
17const Int_t TrackBasicMCCut::fgPdgId = 1;
18const Int_t TrackBasicMCCut::fgPtId = 2;
19const Int_t TrackBasicMCCut::fgEtaId = 3;
21 SetUnitName("status", Status());
22 SetUnitName("pdg", Pdg());
23 SetUnitName("p_{T} [GeV/c]", Pt());
24 SetUnitName("#eta", Eta());
25 SetMinMax(0, 1000, Status());
26 SetMinMax(211, 211, Pdg());
27 SetMinMax(0, 1, Pt());
28 SetMinMax(-1, 1, Eta());
29}
30
32 McTrack* mc_track = (McTrack*) track;
33 SetValue(mc_track->GetStatus(), Status());
34 SetValue(mc_track->GetPdg(), Pdg());
35 SetValue(mc_track->GetMomentum().Pt(), Pt());
36 Double_t p = mc_track->GetMomentum().P();
37 Double_t pz = mc_track->GetMomentum().Pz();
38 if (p == pz) {
39 if (p >= 0)
40 SetValue(kMaxInt, Eta());
41 else
42 SetValue(-kMaxInt, Eta());
43 } else {
44 SetValue(mc_track->GetMomentum().Eta(), Eta());
45 }
46 return Validate();
47}
48
50
51void TrackBasicMCCut::SetPdgCut(Int_t pdg) { SetMinAndMax(pdg, Pdg()); }
52
53void TrackBasicMCCut::SetPtCut(Double_t min, Double_t max) { SetMinMax(min, max, Pt()); }
54
55void TrackBasicMCCut::SetEtaCut(Double_t min, Double_t max) { SetMinMax(min, max, Eta()); }
56
57TrackBasicMCCut::~TrackBasicMCCut() {}
58}
void SetMinAndMax(Double_t val, Int_t i=0)
Definition Cut.cxx:91
void SetMinMax(Double_t min, Double_t max, Int_t i=0)
Definition Cut.cxx:93
void SetValue(Double_t val, Int_t i=0)
Definition Cut.h:235
Bool_t Validate()
Definition Cut.cxx:43
void SetUnitName(TString name, Int_t i=0)
Definition Cut.h:241
virtual Int_t GetPdg() const
Definition McTrack.h:31
static Int_t Status()
void SetPdgCut(Int_t pdg)
Bool_t Pass(Track *track)
void SetEtaCut(Double_t min, Double_t max)
void SetStatusCut(Int_t stat)
void SetPtCut(Double_t min, Double_t max)
Int_t GetStatus() const
Definition Track.h:199
const TLorentzVector & GetMomentum() const
Definition Track.h:118