Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TrackPdgBinCut.cxx
1/*
2 * TrackPdgBinCut.cxx
3 *
4 * Created on: 27 gru 2017
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "TrackPdgBinCut.h"
10
11#include "McTrack.h"
12
13namespace Hal {
14
15 TrackPdgBinCut::TrackPdgBinCut() : TrackCut(1) { SetUnitName("Pdg type [int["); }
16
17 Bool_t TrackPdgBinCut::Pass(Track* track) {
18 McTrack* tr = (McTrack*) track;
19 Int_t val = 0;
20 Int_t pdg = tr->GetPdg();
21 switch (pdg) {
22 case -11: val = 2; break;
23 case 211: val = 3; break;
24 case 321: val = 4; break;
25 case 2212: val = 5; break;
26 case 11: val = -2; break;
27 case -211: val = -3; break;
28 case -321: val = -4; break;
29 case -2212: val = -5; break;
30 case 13: val = -6; break;
31 case -13: val = 6; break;
32 default: {
33 Int_t charge = track->GetCharge();
34 switch (charge) {
35 case 0: val = 0; break;
36 case 1: val = 1; break;
37 case -1: val = -1; break;
38 default: val = 7; break;
39 }
40 } break;
41 };
42 SetValue(val);
43 return Validate();
44 }
45
46 TrackPdgBinCut::~TrackPdgBinCut() {
47 // TODO Auto-generated destructor stub
48 }
49
50 std::vector<std::pair<TString, Double_t>> TrackPdgBinCut::GetBinLabels() const {
51 std::vector<std::pair<TString, Double_t>> res;
52 res.push_back(std::pair<TString, Double_t>("neutral", 0));
53 res.push_back(std::pair<TString, Double_t>("pos", 1));
54 res.push_back(std::pair<TString, Double_t>("e^{+}", 2));
55 res.push_back(std::pair<TString, Double_t>("#pi^{+}", 3));
56 res.push_back(std::pair<TString, Double_t>("K^{+}", 4));
57 res.push_back(std::pair<TString, Double_t>("p", 5));
58 res.push_back(std::pair<TString, Double_t>("#mu^{+}", 6));
59 res.push_back(std::pair<TString, Double_t>("unknown", 7));
60 res.push_back(std::pair<TString, Double_t>("neg", -1));
61 res.push_back(std::pair<TString, Double_t>("e^{-}", -2));
62 res.push_back(std::pair<TString, Double_t>("#pi^{-}", -3));
63 res.push_back(std::pair<TString, Double_t>("K^{-}", -4));
64 res.push_back(std::pair<TString, Double_t>("#bar{p}", -5));
65 res.push_back(std::pair<TString, Double_t>("#mu^{-}", -6));
66
67 return res;
68 }
69} // namespace Hal
virtual Int_t GetPdg() const
Definition McTrack.h:31
Double_t GetCharge() const
Definition Track.h:184