Skip to content
Snippets Groups Projects
Commit 6e9231c2 authored by Baptiste LENIAU's avatar Baptiste LENIAU
Browse files

save trunk as version 4.1

git-svn-id: svn+ssh://svn.in2p3.fr/class@793 0e7d625b-0364-4367-a6be-d5be4a48d228
parent 2f6c89eb
No related branches found
No related tags found
No related merge requests found
#include "CLASSWin.hxx"
#include <TApplication.h>
#include <string>
#include <stdlib.h>
using namespace std;
int main(int argc, char** argv)
{
if(argc<2)
{
cerr << endl << "Usage: CLASGui FileName1 FileName2 ... " << endl;
exit(0);
}
vector<string> VFileName;
int NumberOfFile = argc-1
;
for(int i = 0;i<NumberOfFile;i++)
VFileName.push_back(string(argv[i+1]));
CLASSRead* DataRead = new CLASSRead(VFileName[0]);
if(VFileName.size() == 0)
{
cerr << endl << "Usage: CLASGui FileName1 FileName2 ... " << endl;
exit(0);
}
for (int i = 1; i < (int)VFileName.size(); i++)
{
cout << "File " << i << endl;
DataRead->AddFile(VFileName[i]);
}
DataRead->ReadName();
DataRead->ReadZAI();
DataRead->ReadTime();
cout << "Bienvenue dans le GUI" << endl;
argc = 1; //avoid to change directory by root TApplication...
TApplication theApp("App", &argc, argv);
MainWin *win = new MainWin(DataRead,VFileName);
theApp.Run();
return 0;
}
//g++ -O3 `root-config --cflags` -o Inventory Inventory.cxx `root-config --glibs`
#include "CLASSPlotElement.hxx"
using namespace std;
// for gcc3.2.3 only
CLASSPlotElement::CLASSPlotElement(int treeId, int facilityId, int facylitynumber, int IVNumber, ZAI zai)
{
fTreeId = treeId;
fFacilityId = facilityId;
fFacylityNumber = facylitynumber;
fIVNumber = IVNumber;
fZAI = zai;
}
CLASSPlotElement::CLASSPlotElement(int treeId, int facilityId, int facylitynumber, int IVNumber, int Z, int A, int I)
{
fTreeId = treeId;
fFacilityId = facilityId;
fFacylityNumber = facylitynumber;
fIVNumber = IVNumber;
fZAI = ZAI(Z,A,I);
}
#ifndef _CLASSPlotElement_
#define _CLASSPlotElement_
#include "ZAI.hxx"
#include <vector>
#include <iostream>
using namespace std;
//________________________________________________________________________
//
// CLASSPlotElement
//@{
//@}
//________________________________________________________________________
class CLASSPlotElement
{
public :
CLASSPlotElement(int treeId, int facilityId, int facylitynumber, int IVNumber, ZAI zai);
CLASSPlotElement(int treeId, int facilityId, int facylitynumber, int IVNumber, int Z, int A, int I);
virtual ~CLASSPlotElement(){} //@- destructor
int fTreeId; // Tree Id
int fFacilityId; // FacilityType
// 0 General
// 1 reactor
// 2 Stock
// 3 Pool
// 4 FabricationPlant
int fIVNumber; // Id of IsotopicVector
// 0 Incycle
// 1 CumulativeIN
// 2 CulumativeOUT
int fFacylityNumber; // Id of Facility
// For General :
// 0 TOTAL
// 1 INCYCLE
// 2 WASTE
// 3 OUTINCOME
// 4 REACTOR
// 5 COOLING
// 6 STOCK
// 7 FUELFABRICATION
ZAI fZAI; // ZAI Neeeded
};
#endif
This diff is collapsed.
#ifndef _CLASSRead
#define _CLASSRead_
#include <TROOT.h>
#include <TTree.h>
#include <TString.h>
#include <TCanvas.h>
#include <TGraph.h>
#include <TLatex.h>
#include <vector>
#include <iostream>
#include "ZAI.hxx"
#include "CLASSPlotElement.hxx"
#include "CLASSHeaders.hxx"
using namespace std;
//________________________________________________________________________
//
// CLASSRead
//@{
// CLASSRead is a class that allows to retrieve results in Binary or Ascii Data
// files written by CLASS. By default binary files are read.
//
// Thank to Francisco, Guerin, Louard, Shi for their participation to the XML ouput implementation
// @author BLG
// @author BAM
// @version 1.0
// @version 0.1
//
//@}
//________________________________________________________________________
class CLASSRead
{
public :
CLASSRead(TString filemname);
~CLASSRead(); //@- destructor
vector< vector< TString > > GetReactorName() {return fReactorName;}
vector< vector< TString > > GetPoolName() {return fPoolName;}
vector< vector< TString > > GetFabricationName() {return fFabricationName;}
vector< vector< TString > > GetStockName() {return fStockName;}
vector< ZAI > GetZAIvector() {return fZAIvector;}
vector< TTree* > GetData() {return fData;}
string GetBranchInName(CLASSPlotElement toplot);
string GetLegendOutName(CLASSPlotElement toplot);
string GetTittleOutName(CLASSPlotElement toplot);
vector< vector<cSecond> > GetTimeVector() {return fTimeVector;}
void ReadName();
void ReadZAI();
void ReadTime();
void BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId = 0, string opt = "L");
void BuildTGraphUsingDecayChain(vector<CLASSPlotElement> toplot, int PlotId, int StartingStep, cSecond FinalTime, int StepNUmber, bool LinBin, string opt);
void PlotInv(vector<CLASSPlotElement> toplot, bool DecayChain = false, int StartingStep = 0, cSecond FinalTime = 0, int StepNUmber = 0, bool LinBin = true , string opt = "L");
void PlotTox(vector<CLASSPlotElement> toplot, bool DecayChain = false, int StartingStep = 0, cSecond FinalTime = 0, int StepNUmber = 0, bool LinBin = true , string opt = "L");
void PlotHeat(vector<CLASSPlotElement> toplot, bool DecayChain = false, int StartingStep = 0, cSecond FinalTime = 0, int StepNUmber = 0, bool LinBin = true , string opt = "L");
void PlotPower(vector<CLASSPlotElement> toplot, string opt = "L");
void PlotTTreePower(vector<CLASSPlotElement> toplot, string opt = "L");
void ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string filename);
void ConvertXmlMass(vector<CLASSPlotElement> toplot, string opt);
void ConvertxmlTTreePower(vector<CLASSPlotElement> toplotPower, string opt);
void ConvertXmlPower(vector<CLASSPlotElement> toplotPower, string opt );
void Write(string filename, string fileformat, string PadName);
void ASCIIWrite(string filename , string PadName);
void AddFile(TString filemname);
TCanvas* fCNucleiInv;
TCanvas* fCNucleiTox;
TCanvas* fCNucleiHeat;
TCanvas* fCPower;
private :
vector< vector< TString > > fReactorName;
vector< vector< TString > > fPoolName;
vector< vector< TString > > fFabricationName;
vector< vector< TString > > fStockName;
vector< ZAI > fZAIvector;
vector< TTree* > fData;
vector<TFile* > fFileIn;
vector<TGraph*> fGraphInv;
TGraph* fGraphInvSumOfSelected;
TLatex** fLegendInv;
TLatex* fLegendInvSumOfSelected;
vector<TGraph*> fGraphTox;
TGraph* fGraphToxSumOfSelected;
TLatex** fLegendTox;
TLatex* fLegendToxSumOfSelected;
vector<TGraph*> fGraphHeat;
TGraph* fGraphHeatSumOfSelected;
TLatex** fLegendHeat;
TLatex* fLegendHeatSumOfSelected;
TGraph** fGraphPower;
TLatex** fLegendPower;
int fNumberGraphPowerIterator;
vector< vector<cSecond> > fTimeVector;
double Xmin;
double Xmax;
double Ymin;
double Ymax;
};
#endif
This diff is collapsed.
#ifndef _CLASSWIN_
#define _CLASSWIN_
#include <time.h>
#include <vector>
#include <iostream>
#include <TROOT.h>
#include <TStyle.h>
#include <TGFrame.h>
#include "TGLayout.h"
#include <TGTab.h>
#include <TGButton.h>
#include <TGMsgBox.h>
#include <TGComboBox.h>
#include <TGTextBuffer.h>
#include <TGLabel.h>
#include <TGTextEntry.h>
#include <TCanvas.h>
#include <TH1.h>
#include <TLegend.h>
#include <TH2.h>
#include "TColor.h"
#include "THStack.h"
#include <TGraph.h>
#include <TGraphErrors.h>
#include <TLatex.h>
#include <TGClient.h>
#include <TGTextView.h>
#include <TGSlider.h>
#include <TImage.h>
#include "CLASSRead.hxx"
using namespace std;
//________________________________________________________________________
//
// Windows and Widgets classes.
//@{
// MainWin is the main window with Tab (1 for inventory, 1 for cross-section
// and 1 for fluxes). SubWin is used for small windows that appears when
// some buttons are pressed (e.g. Save As button, Exec Macro button, ...)
// Thank to Francisco, Guerin, Louard, Shi for their participation to the XML ouput implementation
// @author BLG
// @author BAM
// @version 1.0
//@}
//Here is the widget code: it correspond to signal emitted when a widget is activated
enum CommandId{
M_BUTTON_PLOT = 20,
M_BUTTON_SAVE,
M_BUTTON_MACRO,
M_BUTTON_QUIT,
M_BUT_OK,
M_BUT_CANCEL,
M_CHECK_PLOTALL,
M_RADIO_XML_SAVE,
M_RADIO_ASCII_SAVE,
M_RADIO_DECAY_HEAT,
M_RADIO_RADIOTOX,
M_CB_SCENAR_Time,
M_CHECK_LINEAR_Tox,
M_TE_toxfirst,
M_TE_toxlast,
M_TE_toxnstep,
M_CHECK_AM_NUC,
M_CHECK_FP_NUC,
M_CHECK_BY_MOTHER,
M_CHECK_INSIDE,
M_CHECK_CUMIN,
M_CHECK_CUMOUT,
M_BUTTON_MOTHER_MORE};
class MainWin : public TGMainFrame
{
public:
MainWin(CLASSRead *DATA,vector<string> VFileName);
MainWin(){}
~MainWin(); //@- destructor
void Start(vector<string> VFileName);
bool ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2); //@- widget signal handler method
void CloseWindow(); //@- destroy the main window
void Plot(); //@- general Plot method
void Conversionxml(); //@- general Conversionxml method
void FillItemTab(int i);
void FillNucTab(); //@- fill the Inventory Tab foil
void FillTotalTab();
void FillReactorTab(); //@- fill the Cross-section Tab foil
void FillStockTab(); //@- fill the Flux Tab foil
void FillPoolTab(); //@- fill the Reaction Rate Tab foil
void FillFabricationTab(); //@- fill the Breeding Ratio Tab foil
void FillNucFoil(int NCheck,int Ncol,int Nline);
string fSaveFileName;
string fSaveFileFormat;
private:
CLASSRead* fDATA;
int fGraphLineWidth;
double fGraphMarkerSize;
int fNumberOfParc;
int fNumberOfTOT;
int * fNumberOfReactor;
int * fNumberOfStock;
int * fNumberOfPool;
int * fNumberOfFab;
vector<TGCheckButton*> fSaveCheckButton; //@- save each of these check boxes
//
//widgets
//
FontStruct_t fLabelFontB;
FontStruct_t fLabelFontS;
//main tab
TGCompositeFrame * fGeneF0; //@- Common widget frame
TGCompositeFrame * fPlotSaveQuitFrame;
TGCompositeFrame ** fParcTabFoil;
TGTab * fParcTab; //Parc table
TGCompositeFrame *** fFacilitiesTabFoil;
TGTab ** fFacilitiesTab;// tab
TGTab *** fItemTab;
//Configuration Tab
TGTab * fPlotConfigTab; //Plot configuratio tab
TGCompositeFrame ** fPlotConfigFoil;
TGCompositeFrame *fInventoryFrame;
//Radio Or Decay
TGCompositeFrame * fDecayOrRadioFrame;
TGRadioButton *fButtonRadiotox,*fButtonHeat;
//By mother
bool fMotherIsVisible,fIsByMother,fIsLinear;
TGPictureButton *fByMotherMore; //@- hide or show by mother
int fTimeStep;
TGCheckButton *fByMotherButton ;
TGComboBox *fScenarTimeCBox;
TGCompositeFrame *fTimeParametersFrame,*fByMotherFrame,*fScenarTimeFrame;
TGTextEntry *TEtoxfirst,*TEtoxlast,*TEtoxnstep;// the write text widget in time evolution parameters
TGCheckButton *fCheckLinear;
double fToxTimeFirst; // first time steps for radiotoxicity calculations
double fToxTimeLast; // last time steps for radiotoxicity calculations
int fToxNstep; // number of time steps for radiotoxicity calculations
//misc frame
TGCompositeFrame *fMiscFrame,*fMiscHzFrame;
TGCheckButton *fCheckAMNuc,*fCheckFPNuc,*fCheckSumOfSelected;
//Factories Arrays
TGCheckButton *** fCheckArrayTotal;
TGCheckButton *** fCheckArrayReactor;
TGCheckButton *** fCheckArrayStock;
TGCheckButton *** fCheckArrayPool;
TGCheckButton *** fCheckArrayFab;
//Factories Foils
TGCompositeFrame *** fTabFoilReactor;
TGCompositeFrame *** fTabFoilStock;
TGCompositeFrame *** fTabFoilPool;
TGCompositeFrame *** fTabFoilFab;
TGCheckButton ** fCheckIVPlot ;
TGTextButton * fButtonPlot; //@- Press buttons to Plot,Save,...
TGTextButton * fButtonSave;
TGTextButton * fButtonQuit;
int fMainWidth; //@- Width of fGeneF0
//Inventory tab
TGTab * fTabNuc; //@- Tab of Inventory nuclei
TGCompositeFrame ** fTabFoilNuc; //@- its foils: AM,FP0,...,FPN, gaz, misc
TGComboBox * fTimeScaleNuc; //@- time scale combo box
//@- specific frames
TGCompositeFrame * fMiscGrpFNuc;
TGCompositeFrame * fXGprFNuc;
TGCompositeFrame * fYGprFNuc;
TGCheckButton ** fCheckArrayNuc; //@- array of check box for inventory nuclei tab
int fNselectedNucleus; //@- number of check box selected in the previous array
};
class SubWin: public TGTransientFrame
{
public :
SubWin(string event,const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h,
UInt_t options = kVerticalFrame); //@- Normal constructor
~SubWin();
Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2); //@- widget signal handler method
void CloseWindow(){delete this;} //@- Close windows
void SaveAs();
private:
TGLayoutHints * fL0; //@- position hints in the sub win
TGCompositeFrame * fS0; //@- main frame of the sub win
TGHorizontalFrame * fSH1; //@- misc frame
TGHorizontalFrame * fSH2; //@- misc frame
TGTextButton * fButtonOK; //@- OK an Cancel button
TGTextButton * fButtonCan; //@- OK an Cancel button
TGLabel * fLmsg; //@- a label for the write text widget
TGLabel * fNucLabel[11];
TGTextView * fTGVNuclei;
TGTextEntry * TEName; //@- the write text widget in save as and exec macro
TGTextEntry * TEExtract[11]; //@- the extract nuclei
MainWin * fParent; //@- parent of the sub win (i.e. MainWin)
TGRadioButton *fRadioASCIISave;
TGRadioButton *fRadioXMLSave;
};
#endif
include ../config/Makefile.config
OMPFLAGS=
OMPLIB=
# Directory containing includes for CLASS
LOCALINC = ../source/include
######################################################
######### nothing to change from here ################
######################################################
#------------------------------------------------------------------------------
CXXFLAGS += -g -I$(LOCALINC)
LD = $(CXX)
LIBS += -L$(LIBDIR) -lCLASSpkg $(OMPLIB)
LDFLAGS =
GLIBS = $(ROOTGLIBS) -lTMVA
CXXFLAGS += $(ROOTCFLAGS)
#------------------------------------------------------------------------------
subO = CLASSPlotElement.o \
CLASSWin.o \
CLASSRead.o
#------------------------------------------------------------------------------
subS = CLASSPlotElement.cxx \
CLASSWin.cxx \
CLASSRead.cxx
#
mainO = CLASSGui.o
mainS = CLASSGui.cxx
main = CLASSGui
OBJS = $(subO) $(mainO)
all: $(OBJS)
$(LD) $(LDFLAGS) $(OBJS) $(LIBS) $(GLIBS) -o $(main)
@mkdir -p $(Gui_bin_PATH)
@mv $(main) $(Gui_bin_PATH)
@echo "$(main) done"
@echo "CLASSGui is now available in $(Gui_bin_PATH) "
clean:
@rm -f $(OBJS)
@rm -f ./bin/CLASSGui
.SUFFIXES: .cxx
CLASSRead.o: CLASSRead.hxx \
CLASSPlotElement.hxx
CLASSWin.o: CLASSRead.hxx \
CLASSPlotElement.hxx \
CLASSWin.hxx
CLASSPlotElement.o: CLASSPlotElement.hxx
.cxx.o:
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment