Style.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file Style.cxx
3 //
4 /// \author messier@indiana.edu
5 ////////////////////////////////////////////////////////////////////////
7 #include "TLine.h"
8 
9 namespace evd{
10 
11  /// Convert PDG code to a latex string (root-style)
12  const char* Style::LatexName(int pdgcode)
13  {
14  switch (pdgcode) {
15  case 22: return "#gamma";
16  case -11: return "e^{+}";
17  case 11: return "e^{-}";
18  case 13: return "#mu";
19  case -15: return "#bar{#tau}";
20  case 15: return "#tau";
21  case -13: return "#bar{#mu}";
22  case 12: return "#nu_{e}";
23  case 14: return "#nu_{#mu}";
24  case 16: return "#nu_{#tau}";
25  case -12: return "#bar{#nu}_{e}";
26  case -14: return "#bar{#nu}_{#mu}";
27  case -16: return "#bar{#nu}_{#tau}";
28  case 111: return "#pi^{0}";
29  case 211: return "#pi^{+}";
30  case -211: return "#pi^{-}";
31  case 321: return "K^{+}";
32  case -321: return "K^{-}";
33  case 130: return "K^{0}_{L}";
34  case 310: return "K^{0}_{S}";
35  case 2112: return "n";
36  case 2212: return "p";
37  case -2112: return "#bar{n}";
38  case -2212: return "#bar{p}";
39  case 2224: return "#Delta^{++}";
40  case 1000060120: return "^{12}C";
41  case 1000170350: return "^{35}Cl";
42  case 1000260560: return "^{56}Fe";
43  case 1000220480: return "^{48}Ti";
44  case 1000080160: return "^{16}O";
45  case 1000070140: return "^{14}N";
46  case 1000110230: return "^{23}Na";
47  case 1000130270: return "^{27}Al";
48  case 1000140280: return "^{28}Si";
49  case 1000200400: return "^{40}Ca";
50  case 1000561370: return "^{137}Ba";
51  case 1000180400: return "^{40}Ar";
52  case 1000180390: return "^{39}Ar";
53  case 2000000001: return "GENIE_{1}";
54  case 2000000002: return "GENIE_{2}";
55  default:
56  static char buff[256];
57  sprintf(buff,"X_{%d}",pdgcode);
58  return buff;
59  }
60  return 0;
61  }
62 
63  //......................................................................
64 
66  switch (pdgcode) {
67  case 11:
68  case -11:
69  case 12:
70  case -12:
71  return kRed;
72  case 13:
73  case -13:
74  case 14:
75  case -14:
76  return kBlue;
77  case 15:
78  case -15:
79  case 16:
80  case -16:
81  return kGreen;
82  case 22:
83  return kYellow-1;
84  case 111:
85  case 211:
86  case -211:
87  case 321:
88  case -321:
89  case 130:
90  case 310:
91  return kMagenta-3;
92  case 2112:
93  case 2212:
94  return kMagenta+3;
95  default:
96  return kBlack;
97  }
98  }
99 
100  //............................................................
101 
103  if (pdgcode == 2112 || pdgcode == 2212) return 3;
104  return 2;
105  }
106 
107  //............................................................
108 
110  switch (pdgcode) {
111  case 11:
112  case -11:
113  return kDotted;
114  case 13:
115  case -13:
116  case 15:
117  case -15:
118  case 211:
119  case -211:
120  case 2212:
121  return kSolid;
122  case 12:
123  case -12:
124  case 14:
125  case -14:
126  case 16:
127  case -16:
128  case 22:
129  case 2112:
130  return kDotted;
131  case 111:
132  return kDashed;
133  }
134  return 0;
135  }
136 
137  //............................................................
138 
139  void Style::FromPDG(TLine& line, int pdgcode)
140  {
141  // Many cases handled here for most common particles. Extend list as
142  // needed
143  int kSolid=1, kDashed=2, kDotted=3 /* kDashDot=4 */;
144  int c = kGray;
145  int s = kDotted;
146  int w = 1;
147 
148  switch (pdgcode) {
149  case 11: c=kRed; s=kSolid; w=2; break; // e-
150  case -11: c=kRed; s=kSolid; w=2; break; // e+
151  case 12: c=kRed; s=kDotted; w=2; break; // nue
152  case -12: c=kRed; s=kDotted; w=2; break; // nue-bar
153  case 13: c=kBlue; s=kSolid; w=2; break; // mu+
154  case -13: c=kBlue; s=kSolid; w=2; break; // mu-
155  case 14: c=kBlue; s=kDotted; w=2; break; // numu
156  case -14: c=kBlue; s=kDotted; w=2; break; // numu-bar
157  case 15: c=kGreen; s=kSolid; w=2; break; // tau+
158  case -15: c=kGreen; s=kSolid; w=2; break; // tau-
159  case 16: c=kGreen; s=kDotted; w=2; break; // nutau
160  case -17: c=kGreen; s=kDotted; w=2; break; // nutau-bar
161  case 22: c=kYellow-1; s=kDotted; w=2; break; // gamma
162  case 111: c=kMagenta-3; s=kDashed; w=3; break; // pi0
163  case 211: c=kMagenta-3; s=kSolid; w=3; break; // pi+
164  case -211: c=kMagenta-3; s=kSolid; w=3; break; // pi-
165  case 2212: c=kMagenta+3; s=kSolid; w=4; break; // proton
166  case 2112: c=kMagenta+3; s=kDotted; w=4; break; // neutron
167  default: break;
168  };
169  line.SetLineColor(c);
170  line.SetLineStyle(s);
171  line.SetLineWidth(w);
172  }
173 }//namespace
174 ////////////////////////////////////////////////////////////////////////
static void FromPDG(TLine &line, int pdgcode)
Definition: Style.cxx:139
static int LineWidthFromPDG(int pdgcode)
Definition: Style.cxx:102
LArSoft includes.
Definition: InfoTransfer.h:33
static int ColorFromPDG(int pdgcode)
Definition: Style.cxx:65
static const char * LatexName(int pdgcode)
Convert PDG code to a latex string (root-style)
Definition: Style.cxx:12
void line(double t, double *p, double &x, double &y, double &z)
static int LineStyleFromPDG(int pdgcode)
Definition: Style.cxx:109
static QCString * s
Definition: config.cpp:1042