File indexing completed on 2026-09-29 09:29:02
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TTreeDrawArgsParser
0013 #define ROOT_TTreeDrawArgsParser
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "TObject.h"
0025
0026 #include "TString.h"
0027
0028
0029 class TTreeDrawArgsParser : public TObject {
0030
0031 public:
0032 enum EOutputType {
0033
0034 #if defined(__clang__) && __clang_major__ < 20
0035 #pragma clang diagnostic push
0036 #pragma clang diagnostic ignored "-Wshadow"
0037 #endif
0038 kUNKNOWN,
0039 #if defined(__clang__) && __clang_major__ < 20
0040 #pragma clang diagnostic pop
0041 #endif
0042 kEVENTLIST,
0043 kENTRYLIST,
0044 kPROFILE,
0045 kPROFILE2D,
0046 kGRAPH,
0047 kPOLYMARKER3D,
0048 kHISTOGRAM1D,
0049 kHISTOGRAM2D,
0050 kLISTOFGRAPHS,
0051 kLISTOFPOLYMARKERS3D,
0052 kHISTOGRAM3D
0053 };
0054
0055 static Int_t fgMaxDimension;
0056 static Int_t fgMaxParameters;
0057
0058 protected:
0059 TString fExp;
0060 TString fSelection;
0061 TString fOption;
0062
0063 Int_t fDimension;
0064 TString fVarExp[4];
0065
0066
0067
0068 bool fAdd;
0069 TString fName;
0070
0071 Int_t fNoParameters;
0072 bool fParameterGiven[9];
0073 Double_t fParameters[9];
0074
0075 bool fShouldDraw;
0076 bool fOptionSame;
0077 bool fEntryList;
0078 TObject *fOriginal;
0079 bool fDrawProfile;
0080 EOutputType fOutputType;
0081
0082 void ClearPrevious();
0083 TTreeDrawArgsParser::EOutputType DefineType();
0084 bool SplitVariables(TString variables);
0085 bool ParseName(TString name);
0086 bool ParseOption();
0087 bool ParseVarExp();
0088
0089 public:
0090 TTreeDrawArgsParser();
0091 ~TTreeDrawArgsParser() override;
0092
0093 bool Parse(const char *varexp, const char *selection, Option_t *option);
0094 bool GetAdd() const { return fAdd; }
0095 Int_t GetDimension() const { return fDimension; }
0096 bool GetShouldDraw() const { return fShouldDraw; }
0097 TString const& GetExp() const { return fExp; }
0098 Double_t GetIfSpecified(Int_t num, Double_t def) const;
0099 Int_t GetNoParameters() const { return fNoParameters; }
0100 Double_t GetParameter(int num) const;
0101 TString const& GetObjectName() const { return fName; }
0102 TString GetObjectTitle() const;
0103 bool GetOptionSame() const { return fOptionSame; }
0104 TObject *GetOriginal() const { return fOriginal; }
0105 TString const& GetSelection() const { return fSelection; }
0106 TString GetVarExp(Int_t num) const;
0107 TString GetVarExp() const;
0108 bool IsSpecified(int num) const;
0109 void SetObjectName(const char *s) { fName = s; }
0110 void SetOriginal(TObject *o) { fOriginal = o; }
0111 static Int_t GetMaxDimension();
0112
0113 ClassDefOverride(TTreeDrawArgsParser,0);
0114 };
0115
0116 #endif
0117