ROOTPWA
rootpalettes.C
Go to the documentation of this file.
1 // workaround for Kpipi script production to be loaded by root
2 
3 #include "TROOT.h"
4 #include "TStyle.h"
5 #include "TColor.h"
6 #include <iostream>
7 
8 void setDiffColorStyle(const unsigned int NCont) {
9  static Int_t *colors =0;
10  static Bool_t initialized = kFALSE;
11 
12  Double_t Red[3] = { 0.0, 1.0, 1.0 };
13  Double_t Green[3] = { 0.0, 1.0, 0.0 };
14  Double_t Blue[3] = { 1.0, 1.0, 0.0 };
15  Double_t Length[3] = { 0.0, 0.50, 1.0 };
16 
17  if(!initialized){
18  colors = new Int_t[NCont];
19  Int_t FI = TColor::CreateGradientColorTable(3,Length,Red,Green,Blue,NCont);
20  for (unsigned int i=0; i<NCont; i++) colors[i] = FI+i;
21  initialized = kTRUE;
22  return;
23  }
24  gStyle->SetPalette(NCont,colors);
25 }
26 
27 
28 void setNormalColorStyle(const unsigned int NCont) {
29  static Int_t *colors =0;
30  static Bool_t initialized = kFALSE;
31 
32  Double_t Red[3] = { 0.0, 0.0, 1.0 };
33  Double_t Green[3] = { 0.0, 1.0, 0.0 };
34  Double_t Blue[3] = { 1.0, 0.0, 0.0 };
35  Double_t Length[3] = { 0.0, 0.50, 1.0 };
36 
37  if(!initialized){
38  colors = new Int_t[NCont];
39  Int_t FI = TColor::CreateGradientColorTable(3,Length,Red,Green,Blue,NCont);
40  for (unsigned int i=0; i<NCont; i++) colors[i] = FI+i;
41  initialized = kTRUE;
42  return;
43  }
44  gStyle->SetPalette(NCont,colors);
45 }
46 
47 /*
48 void setNormalColorStyle() {
49  static Int_t colors2[NCont];
50  static Bool_t initialized2 = kFALSE;
51 
52  Double_t Red[5] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
53  Double_t Green[5] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
54  Double_t Blue[5] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
55  Double_t Length[5] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
56 
57 
58  if(!initialized2){
59  Int_t FI = TColor::CreateGradientColorTable(5,Length,Red,Green,Blue,NCont);
60  for (int i=0; i<NCont; i++) colors2[i] = FI+i;
61  initialized2 = kTRUE;
62  return;
63  }
64  gStyle->SetPalette(NCont,colors2);
65 }
66 
67 void setNormalColorStyle2() {
68  static Int_t colors2[NCont];
69  static Bool_t initialized2 = kFALSE;
70 
71  Double_t Red[5] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
72  Double_t Green[5] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
73  Double_t Blue[5] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
74  Double_t Length[5] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
75 
76 
77  if(!initialized2){
78  Int_t FI = TColor::CreateGradientColorTable(5,Length,Red,Green,Blue,NCont);
79  for (int i=0; i<NCont; i++) colors2[i] = FI+i;
80  initialized2 = kTRUE;
81  return;
82  }
83  gStyle->SetPalette(NCont,colors2);
84 }*/
85 
86 void rootpalettes() {
87 }