Public Member Functions | Static Public Member Functions | List of all members
evd::Style Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N19-11-12/EventDisplay/Style.h"

Public Member Functions

void FromPDG (TAttLine *line, int pdgcode)
 
int ColorFromPDG (int pdgcode)
 
int LineStyleFromPDG (int pdgcode)
 
int LineWidthFromPDG (int pdgcode)
 

Static Public Member Functions

static const char * LatexName (int pdgcode)
 Convert PDG code to a latex string (root-style) More...
 

Detailed Description

Parameters for drawing options. Allow a consistent style for drawing particle tracks

Definition at line 14 of file Style.h.

Member Function Documentation

int evd::Style::ColorFromPDG ( int  pdgcode)

Definition at line 98 of file Style.cxx.

References FromPDG().

Referenced by evd::MCTrueView::Draw(), evd::SimulationDrawer::FLSHit2D(), evd::SimulationDrawer::FLSHit3D(), evd::SimulationDrawer::MCTruthTrajectoriesAnyD(), and evd::SimulationDrawer::MCTruthVectors3D().

98  {
99  // This object just holds the style from the function bellow
100  TAttLine* style = new TLine(0,0,1,1);
101 
102  this->FromPDG(style,pdgcode);
103 
104  return style->GetLineColor();
105  }
void FromPDG(TAttLine *line, int pdgcode)
Definition: Style.cxx:127
void evd::Style::FromPDG ( TAttLine *  line,
int  pdgcode 
)

Definition at line 127 of file Style.cxx.

References plot_validation_datamc::c, colors, evdb::Colors::Foreground(), and w.

Referenced by ColorFromPDG(), evd::SimulationDrawer::FLSHit2D(), LineStyleFromPDG(), and evd::SimulationDrawer::MCTruthVectors2D().

128  {
129  // Many cases handled here for most common particles. Extend list as
130  // needed
131  int kSolid=1, kDashed=2, kDotted=3 /* kDashDot=4 */;
132  int c = kGray;
133  int s = kSolid;
134  int w = 1;
135 
137  bool isBonW = (colors->Foreground(0) == kBlack) ? 1 : 0;
138 
139  // The convention here is actually important elsewhere to hide
140  // the mess that is displaying gammas without removing all neutrals.
141  // Charged: ---- Gamma: - - Other neutrals: . .
142  //
143  switch (pdgcode) {
144  case 11: c=(isBonW) ? kRed : kRed-4; s=kSolid; w=1; break; // e-
145  case -11: c=(isBonW) ? kRed : kRed-4; s=kSolid; w=1; break; // e+
146  case 12: c=(isBonW) ? kRed : kRed-4; s=kDotted; w=1; break; // nue
147  case -12: c=(isBonW) ? kRed : kRed-4; s=kDotted; w=1; break; // nue-bar
148  case 13: c=(isBonW) ? kAzure : kAzure+1; s=kSolid; w=1; break; // mu+
149  case -13: c=(isBonW) ? kAzure : kAzure+1; s=kSolid; w=1; break; // mu-
150  case 14: c=(isBonW) ? kAzure : kAzure+1; s=kDotted; w=1; break; // numu
151  case -14: c=(isBonW) ? kAzure : kAzure+1; s=kDotted; w=1; break; // numu-bar
152  case 22: c=(isBonW) ? kYellow-1 : kYellow-9; s=kDashed; w=1; break; // gamma
153  case 111: c=(isBonW) ? kOrange+7 : kOrange-3; s=kDotted; w=1; break; // pi0
154  case 211: c=(isBonW) ? kMagenta-3 : kPink+6; s=kSolid; w=1; break; // pi+
155  case -211: c=(isBonW) ? kMagenta-3 : kPink+6; s=kSolid; w=1; break; // pi-
156  case 2212: c=(isBonW) ? kViolet-6 : kViolet; s=kSolid; w=1; break; // proton
157  case 2112: c=(isBonW) ? kTeal+9 : kTeal-3; s=kDotted; w=1; break; // neutron
158  default: break;
159  };
160  line->SetLineColor(c);
161  line->SetLineStyle(s);
162  line->SetLineWidth(w);
163  }
const XML_Char * s
Definition: expat.h:262
int colors[6]
Definition: tools.h:1
int Foreground(int i=0)
Float_t w
Definition: plot.C:20
const char * evd::Style::LatexName ( int  pdgcode)
static

Convert PDG code to a latex string (root-style)

Definition at line 16 of file Style.cxx.

Referenced by evd::MCTrueView::Draw(), and evd::SimulationDrawer::MCTruthShortText().

17  {
18  switch (pdgcode) {
19  case 22: return "#gamma";
20  case -11: return "e^{+}";
21  case 11: return "e^{-}";
22  case 13: return "#mu";
23  case -15: return "#bar{#tau}";
24  case 15: return "#tau";
25  case -13: return "#bar{#mu}";
26  case 12: return "#nu_{e}";
27  case 14: return "#nu_{#mu}";
28  case 16: return "#nu_{#tau}";
29  case -12: return "#bar{#nu}_{e}";
30  case -14: return "#bar{#nu}_{#mu}";
31  case -16: return "#bar{#nu}_{#tau}";
32  case 111: return "#pi^{0}";
33  case 211: return "#pi^{+}";
34  case -211: return "#pi^{-}";;
35  case 221: return "#eta";
36  case 331: return "#eta'";
37  case 130: return "K^{0}_{L}";
38  case 310: return "K^{0}_{S}";
39  case 311: return "K^{0}";
40  case -311: return "#bar{K}^{0}";
41  case 321: return "K^{+}";
42  case -321: return "K^{-}";
43  case 2112: return "n";
44  case 2212: return "p";
45  case -2112: return "#bar{n}";
46  case -2212: return "#bar{p}";
47  case 2224: return "#Delta^{++}";
48  case 3122: return "#Lambda^{0}";
49  case 3222: return "#Sigma^{+}";
50  case -3222: return "#Sigma^{-}";
51 
52  case 1000010020: return "^{2}H";
53  case 1000010030: return "^{3}H";
54  case 1000020030: return "^{3}He";
55  case 1000020040: return "^{4}He";
56  case 1000040070: return "^{7}Be";
57  case 1000040080: return "^{8}Be";
58  case 1000040100: return "^{10}Be";
59  case 1000050090: return "^{9}B";
60  case 1000050100: return "^{10}B";
61  case 1000050110: return "^{11}B";
62  case 1000060100: return "^{10}C";
63  case 1000060110: return "^{11}C";
64  case 1000060120: return "^{12}C";
65  case 1000060130: return "^{13}C";
66  case 1000060140: return "^{14}C";
67  case 1000070150: return "^{15}N";
68  case 1000100220: return "^{22}Ne";
69  case 1000140300: return "^{30}Si";
70  case 1000150330: return "^{33}P";
71  case 1000160340: return "^{34}S";
72  case 1000160350: return "^{35}S";
73  case 1000160360: return "^{36}S";
74  case 1000170350: return "^{35}Cl";
75  case 1000170360: return "^{36}Cl";
76  case 1000170370: return "^{37}Cl";
77  case 1000180380: return "^{38}Ar";
78  case 1000210480: return "^{48}Sc";
79  case 1000260560: return "^{56}Fe";
80  case 1000220480: return "^{48}Ti";
81  case 1000080160: return "^{16}O";
82  case 1000070140: return "^{14}N";
83  case 1000110230: return "^{23}Na";
84  case 1000130270: return "^{27}Al";
85  case 1000140280: return "^{28}Si";
86  case 1000200400: return "^{40}Ca";
87  case 1000561370: return "^{137}Ba";
88  default:
89  static char buff[256];
90  sprintf(buff,"X_{%d}",pdgcode);
91  return buff;
92  }
93  return 0;
94  }
int evd::Style::LineStyleFromPDG ( int  pdgcode)

Definition at line 116 of file Style.cxx.

References FromPDG().

Referenced by evd::SimulationDrawer::MCTruthTrajectoriesAnyD(), and evd::SimulationDrawer::MCTruthVectors3D().

116  {
117  // This object just holds the style from the function bellow
118  TAttLine* style = new TLine(0,0,1,1);
119 
120  this->FromPDG(style,pdgcode);
121 
122  return style->GetLineStyle();
123  }
void FromPDG(TAttLine *line, int pdgcode)
Definition: Style.cxx:127
int evd::Style::LineWidthFromPDG ( int  pdgcode)

Definition at line 109 of file Style.cxx.

Referenced by evd::SimulationDrawer::MCTruthTrajectoriesAnyD(), and evd::SimulationDrawer::MCTruthVectors3D().

109  {
110  if (pdgcode == 2112 || pdgcode == 2212) return 2;
111  return 2;
112  }

The documentation for this class was generated from the following files: