Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
PdgBinPairCut.cxx
1/*
2 * PdgBinPairCut.cxx
3 *
4 * Created on: 2 sie 2018
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "PdgBinPairCut.h"
11
12#include "Cut.h"
13#include "Track.h"
14#include "TwoTrack.h"
15
16#include <utility>
17#include <vector>
18
19#include <RtypesCore.h>
20#include <TString.h>
21namespace Hal {
22 PdgBinPairCut::PdgBinPairCut() : TwoTrackCut(2) {
23 SetUnitName("First paritcle [AU]", 0);
24 SetUnitName("Second paritcle [AU]", 1);
25 }
26
27 Bool_t PdgBinPairCut::Pass(TwoTrack* pair) {
28 McTrack* track1 = (McTrack*) pair->GetTrack1();
29 McTrack* track2 = (McTrack*) pair->GetTrack2();
30 SetValue(PidToID(track1), 0);
31 SetValue(PidToID(track2), 1);
32 return Validate();
33 }
34
35 Int_t PdgBinPairCut::PidToID(McTrack* track) const {
36 Int_t val = 0;
37 Int_t pdg = track->GetPdg();
38 switch (pdg) {
39 case -11: val = 2; break;
40 case 211: val = 3; break;
41 case 321: val = 4; break;
42 case 2212: val = 5; break;
43 case 11: val = -2; break;
44 case -211: val = -3; break;
45 case -321: val = -4; break;
46 case -2212: val = -5; break;
47 case 13: val = -6; break;
48 case -13: val = 6; break;
49 default: {
50 Int_t charge = track->GetCharge();
51 switch (charge) {
52 case 0: val = 0; break;
53 case 1: val = 1; break;
54 case -1: val = -1; break;
55 default: val = 7; break;
56 }
57 } break;
58 };
59 return val;
60 }
61
62 PdgBinPairCut::~PdgBinPairCut() {
63 // TODO Auto-generated destructor stub
64 }
65
66 std::vector<std::pair<TString, Double_t>> PdgBinPairCut::GetBinLabels(Int_t /*int1*/) const {
67 std::vector<std::pair<TString, Double_t>> res;
68 res.push_back(std::pair<TString, Double_t>("0", 0));
69 res.push_back(std::pair<TString, Double_t>("+", 1));
70 res.push_back(std::pair<TString, Double_t>("-", -1));
71 res.push_back(std::pair<TString, Double_t>("unknown", 7));
72 res.push_back(std::pair<TString, Double_t>("e^{+}", 2));
73 res.push_back(std::pair<TString, Double_t>("#pi^{+}", 3));
74 res.push_back(std::pair<TString, Double_t>("K^{+}", 4));
75 res.push_back(std::pair<TString, Double_t>("p", 5));
76 res.push_back(std::pair<TString, Double_t>("#mu^{+}", 6));
77 res.push_back(std::pair<TString, Double_t>("e^{-}", -2));
78 res.push_back(std::pair<TString, Double_t>("#pi^{-}", -3));
79 res.push_back(std::pair<TString, Double_t>("K^{-}", -4));
80 res.push_back(std::pair<TString, Double_t>("#bar{p}", -5));
81 res.push_back(std::pair<TString, Double_t>("#mu^{-}", -6));
82 return res;
83 }
84} // namespace Hal
virtual Int_t GetPdg() const
Definition McTrack.h:31
Double_t GetCharge() const
Definition Track.h:184
Track * GetTrack1() const
Definition TwoTrack.h:75
Track * GetTrack2() const
Definition TwoTrack.h:80