EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EtmPalette.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EtmPalette.cc
1 
2 #include <TStyle.h>
3 
4 #include <EtmPalette.h>
5 
6 // ---------------------------------------------------------------------------------------
7 // ---------------------------------------------------------------------------------------
8 
10 {
11  // Help transparency to work; do not rely on a fact that
12  // OpenGL.CanvasPreferGL is set to 1 in $ROOTSYS/etc/system.rootrc ;
13  gStyle->SetCanvasPreferGL(kTRUE);
14 
15  // Pre-defined "regular" detector colors; would be best to never change them;
16  AddEntry("", _GAP_COLOR_);
17  AddEntry("TRD", kGray);
18  AddEntry("TPC", kCyan);
19  //AddEntry("TOF", kBlack);
20  //AddEntry("Preshower", kOrange-3);
21  AddEntry("TOF", kOrange-3);
22  AddEntry("Preshower", kBlack);
23  AddEntry("Si Tracker", kYellow);
24  AddEntry("Cherenkov", kAzure+6);
25  //AddEntry("DIRC", kAzure+7);
26  AddEntry("Mu Tagger", kViolet);
27  //AddEntry("LM PID", kViolet+1);
28  AddEntry("MPGD", kGreen+2);
29 
30  // Keep both for backward compatibility;
31  AddEntry("HM RICH", kMagenta+1);
32  AddEntry("Fwd RICH", kMagenta);
33 
34  AddEntry("EmCal", kGreen);
35 
36  AddEntry("sTGC", kViolet+2);
37  AddEntry("DIRC", kViolet+1);
38 
39  // Will not be visible anyway;
40  AddEntry(_MARKER_, kPink-8);
41 
42  AddEntry("PID", kPink-9);
43  AddEntry("TRACKER", kCyan-10);
44 
45 
46  // This stuff has to do with the "magnet element" look -> don't touch;
47  //AddEntry("Cryostat", kYellow-10);//White);
48  //AddEntry("Cryostat", kCyan+2);//White);
49  AddEntry("Cryostat", kYellow-8);
50  AddEntry("M.Coil +", kRed);
51  AddEntry("M.Coil -", kAzure+4);
52  AddEntry("HCal", kBlue+1);
53 } // EtmPalette::EtmPalette()
54 
55 // ---------------------------------------------------------------------------------------
56 // ---------------------------------------------------------------------------------------
57 
58 bool EtmPalette::AddEntry(const char *tag, int color)
59 {
60  if (mColors.find(tag) != mColors.end() || mTags.find(color) != mTags.end()) {
61  printf("Either '%s' tag or '%d' color exist already!\n", tag, color);
62  return false;
63  } //if
64 
65  mColors[tag] = color;
66  mTags[color] = tag;
67 
68  return true;
69 } // EtmPalette::AddEntry()
70 
71 // ---------------------------------------------------------------------------------------
72 // ---------------------------------------------------------------------------------------
73