#ifndef TDynamicSlice_HH #define TDynamicSlice_HH #include "TNamed.h" #include "TGClient.h" #include "TGDockableFrame.h" #include "TGMenu.h" #include "TGMdiDecorFrame.h" #include "TGMdiFrame.h" #include "TGMdiMainFrame.h" #include "TGFrame.h" #include "TGFileDialog.h" #include "TGCanvas.h" #include "TGButton.h" #include "TGLabel.h" #include "TRootEmbeddedCanvas.h" #include "TCanvas.h" #include "TPad.h" #include "TH1.h" #include "TH2.h" #include "TPad.h" #include "TList.h" #include "TROOT.h" #include "TBox.h" #include <iostream> using namespace std; class TDynamicSlice : public TObject { private: TH2* fHist; // original histogram TH1D* fProjection; // projection histogram int fType; // 0= projection X, 1 = projection Y TGMainFrame* fMainFrame; TGRadioButton* fRadio[2]; TGCheckButton* fCheck[3]; TBox* fBox; TCanvas* fCanvas; // preview canvas TPad* fPad; // original pad bool fDoIt; bool fPreview; // enable/disable preview bool fLog[2]; int fEdge; int fWidth; // width of the cut in number of bins int fCenter; // center of the cut in number of bins enum {kPREVIEW, kLOGX, kLOGY}; enum {kPROJX, kPROJY}; public: TDynamicSlice(TH2*, TPad*, int); virtual ~TDynamicSlice(); void setProjection(int); void switchPreview(); void switchLog(int); void process(); void close(int); void closeWindow(); void draw(int); ClassDef(TDynamicSlice,1) }; #endif