12 #ifndef RestCore_TRestAnalysisPlot
13 #define RestCore_TRestAnalysisPlot
20 #include "TRestAnalysisTree.h"
22 const int REST_MAX_TAGS = 15;
27 const std::map<std::string, int> ColorIdMap{
28 {
"white", kWhite}, {
"black", kBlack}, {
"gray", kGray}, {
"red", kRed}, {
"green", kGreen},
29 {
"blue", kBlue}, {
"yellow", kYellow}, {
"magenta", kMagenta}, {
"cyan", kCyan}, {
"orange", kOrange},
30 {
"spring", kSpring}, {
"teal", kTeal}, {
"azure", kAzure}, {
"violet", kViolet}, {
"pink", kPink}};
31 const std::map<std::string, int> LineStyleMap{
32 {
"solid", kSolid}, {
"dashed", kDashed}, {
"dotted", kDotted}, {
"dashDotted", kDashDotted}};
33 const std::map<std::string, int> FillStyleMap{
34 {
"dotted", kFDotted1}, {
"dashed", kFDashed1}, {
"dotted1", kFDotted1},
35 {
"dotted2", kFDotted2}, {
"dotted3", kFDotted3}, {
"hatched1", kFHatched1},
36 {
"hatched2", kHatched2}, {
"hatched3", kFHatched3}, {
"hatched4", kFHatched4},
37 {
"wicker", kFWicker}, {
"scales", kFScales}, {
"bricks", kFBricks},
38 {
"snowflakes", kFSnowflakes}, {
"circles", kFCircles}, {
"tiles", kFTiles},
39 {
"mondrian", kFMondrian}, {
"diamonds", kFDiamonds}, {
"waves1", kFWaves1},
40 {
"dashed1", kFDashed1}, {
"dashed2", kFDashed2}, {
"alhambra", kFAlhambra},
41 {
"waves2", kFWaves2}, {
"stars1", kFStars1}, {
"stars2", kFStars2},
42 {
"pyramids", kFPyramids}, {
"frieze", kFFrieze}, {
"metopes", kFMetopes},
43 {
"empty", kFEmpty}, {
"solid", kFSolid}};
52 std::string plotString;
53 std::string cutString;
55 std::map<std::string, std::string>
58 std::string drawOption;
67 TH3F* operator->()
const {
return ptr; }
99 Double_t marginBottom;
106 std::vector<HistoInfoSet> histos;
113 std::vector<Float_t> posX;
114 std::vector<Float_t> posY;
116 std::vector<std::string> label;
125 TVector2 fCanvasSize;
126 TVector2 fCanvasDivisions;
127 TVector2 fCanvasDivisionMargins;
132 Double_t fLabelOffsetX = 1.1;
133 Double_t fLabelOffsetY = 1.3;
134 Double_t fLabelScaleX = 1.2;
135 Double_t fLabelScaleY = 1.3;
136 Double_t fTicksScaleX = 1.5;
137 Double_t fTicksScaleY = 1.5;
139 Double_t fLegendX1 = 0.7;
140 Double_t fLegendY1 = 0.75;
141 Double_t fLegendX2 = 0.88;
142 Double_t fLegendY2 = 0.88;
145 std::vector<PlotInfoSet> fPlots;
146 std::vector<PanelInfo> fPanels;
148 std::vector<std::string> fPlotNamesCheck;
154 Long64_t fDrawFirstEntry;
156 void AddFileFromExternalRun();
157 void AddFileFromEnv();
160 TRestRun* GetRunInfo(
const TString& fileName);
161 bool IsDynamicRange(
const TString& rangeString);
162 Int_t GetColorIDFromString(
const std::string& in);
163 Int_t GetFillStyleIDFromString(
const std::string& in);
164 Int_t GetLineStyleIDFromString(
const std::string& in);
172 void AddFile(
const TString& fileName);
173 void SetFile(
const TString& fileName);
175 void SaveCanvasToPDF(
const TString& fileName);
176 void SavePlotToPDF(
const TString& fileName, Int_t n = 0);
177 void SaveHistoToPDF(
const TString& fileName, Int_t nPlot = 0, Int_t nHisto = 0);
179 void SetOutputPlotsFilename(
const TString& name) { fCanvasSave = name; }
181 Int_t GetPlotIndex(
const TString& plotName);
182 inline TVector2 GetCanvasSize()
const {
return fCanvasSize; }
183 inline TVector2 GetCanvasDivisions()
const {
return fCanvasDivisions; }
185 void SetTreeEntryRange(Long64_t NEntries = TTree::kMaxEntries, Long64_t FirstEntry = 0) {
187 fDrawFirstEntry = FirstEntry;
189 void PlotCombinedCanvas();
void Initialize() override
Making default settings.
Long64_t fDrawNEntries
Output canvas.
std::vector< TString > fRunInputFileName
TRestRun to handle output file.
TCanvas * fCombinedCanvas
TRestRun to handle input file.
void PrintMetadata() override
Implemented it in the derived metadata class to print out specific metadata information.
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
REST core data-saving helper based on TTree.
Data provider and manager in REST.