Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:32:04

0001 #ifndef PLOT_H
0002 #define PLOT_H
0003 
0004 #include <TCanvas.h>
0005 #include <TColor.h>
0006 #include <TPad.h>
0007 #include <TPaveText.h>
0008 #include <TStyle.h>
0009 #include <fmt/core.h>
0010 #include <string_view>
0011 #include <vector>
0012 
0013 namespace common_bench {
0014 namespace plot {
0015 
0016 inline const int kArgonneBlue = TColor::GetColor(0x1f, 0x77, 0xb4); // not really
0017 
0018 inline const int kMpBlue = TColor::GetColor(0x1f, 0x77, 0xb4);
0019 inline const int kMpOrange = TColor::GetColor(0xff, 0x7f, 0x0e);
0020 inline const int kMpGreen = TColor::GetColor(0x2c, 0xa0, 0x2c);
0021 inline const int kMpRed = TColor::GetColor(0xd6, 0x27, 0x28);
0022 inline const int kMpPurple = TColor::GetColor(0x94, 0x67, 0xbd);
0023 inline const int kMpBrown = TColor::GetColor(0x8c, 0x56, 0x4b);
0024 inline const int kMpPink = TColor::GetColor(0xe3, 0x77, 0xc2);
0025 inline const int kMpGrey = TColor::GetColor(0x7f, 0x7f, 0x7f);
0026 inline const int kMpMoss = TColor::GetColor(0xbc, 0xbd, 0x22);
0027 inline const int kMpCyan = TColor::GetColor(0x17, 0xbe, 0xcf);
0028 
0029 inline const std::vector<int> kPalette = {kMpBlue,   kMpOrange, kMpGreen, kMpRed,
0030                                           kMpPurple, kMpBrown,  kMpPink,  kMpGrey,
0031                                           kMpMoss,   kMpCyan};
0032 
0033 inline void draw_label(int ebeam, int pbeam, const std::string_view detector) {
0034   auto t = new TPaveText(.15, 0.800, .7, .925, "NB NDC");
0035   t->SetFillColorAlpha(kWhite, 0.4);
0036   t->SetTextFont(43);
0037   t->SetTextSize(25);
0038   t->AddText(fmt::format("#bf{{{} }}SIMULATION", detector).c_str());
0039   t->AddText(fmt::format("{} GeV on {} GeV", ebeam, pbeam).c_str());
0040   t->SetTextAlign(12);
0041   t->Draw();
0042 }
0043 
0044 } // namespace common_bench::plot
0045 
0046 } // namespace common_bench
0047 
0048 #endif