From a109bbe54e5b089a5556bd3c9c6d932b5eff148e Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot <mouginot.baptiste@gmail.com> Date: Sun, 5 Jul 2015 14:22:41 +0000 Subject: [PATCH] GUI syntax cleaning git-svn-id: svn+ssh://svn.in2p3.fr/class@693 0e7d625b-0364-4367-a6be-d5be4a48d228 --- gui/trunk/CLASSGui.cxx | 10 +- gui/trunk/CLASSRead.cxx | 452 ++++++++++++++++++------------------ gui/trunk/CLASSWin.cxx | 490 ++++++++++++++++++++-------------------- gui/trunk/CLASSWin.hxx | 2 +- 4 files changed, 477 insertions(+), 477 deletions(-) diff --git a/gui/trunk/CLASSGui.cxx b/gui/trunk/CLASSGui.cxx index cc36d7a50..e942c3fe5 100755 --- a/gui/trunk/CLASSGui.cxx +++ b/gui/trunk/CLASSGui.cxx @@ -17,13 +17,13 @@ int main(int argc, char** argv) } vector<string> VFileName; - int NumberOfFile=argc-1 + int NumberOfFile = argc-1 ; - for(int i=0;i<NumberOfFile;i++) + for(int i = 0;i<NumberOfFile;i++) VFileName.push_back(string(argv[i+1])); CLASSRead* DataRead = new CLASSRead(VFileName[0]); - if(VFileName.size() == 0) + if(VFileName.size() == 0) { cerr << endl << "Usage: CLASGui FileName1 FileName2 ... " << endl; exit(0); @@ -39,9 +39,9 @@ int main(int argc, char** argv) cout << "Bienvenue dans le GUI" << endl; - argc=1; //avoid to change directory by root TApplication... + argc = 1; //avoid to change directory by root TApplication... TApplication theApp("App", &argc, argv); - MainWin *win=new MainWin(DataRead,VFileName); + MainWin *win = new MainWin(DataRead,VFileName); theApp.Run(); diff --git a/gui/trunk/CLASSRead.cxx b/gui/trunk/CLASSRead.cxx index 0e2b5a5a2..0b95444fb 100755 --- a/gui/trunk/CLASSRead.cxx +++ b/gui/trunk/CLASSRead.cxx @@ -63,7 +63,7 @@ string ReadNucleusName[] = { int CurveColor(int graph_num) { - int ColorTable[]={1,kBlue,kRed,kGreen+1,kMagenta,kCyan+2,kOrange-3,kRed+2,kBlue-2, + int ColorTable[] = {1,kBlue,kRed,kGreen+1,kMagenta,kCyan+2,kOrange-3,kRed+2,kBlue-2, kSpring+9,kGreen+3,kAzure+8,kMagenta+2,kYellow+2,kBlue-9,kOrange+2}; return ColorTable[graph_num%16]; @@ -87,7 +87,7 @@ CLASSRead::CLASSRead(TString filename) FileIn = TFile::Open(filename); fFileIn.push_back(FileIn); - for( int i =0; i < fFileIn.back()->GetNkeys(); i++) + for( int i = 0; i < fFileIn.back()->GetNkeys(); i++) { //cout << "KeyNum " << i << endl; fData.push_back( (TTree*)gDirectory->Get(fFileIn.back()->GetListOfKeys()->At(fFileIn.back()->GetNkeys()-1)->GetName() ) ); @@ -121,9 +121,9 @@ CLASSRead::CLASSRead(TString filename) //________________________________________________________________________ CLASSRead::~CLASSRead() { - for(int i=fData.size()-1; i !=0; i--) + for(int i = fData.size()-1; i != 0; i--) delete fData[i]; - for(int i=fFileIn.size()-1; i !=0; i--) + for(int i = fFileIn.size()-1; i != 0; i--) delete fFileIn[i]; } @@ -137,7 +137,7 @@ void CLASSRead::AddFile(TString filename) TFile *FileIn; FileIn = TFile::Open(filename); fFileIn.push_back(FileIn); - for( int i =0; i < fFileIn.back()->GetNkeys(); i++) + for( int i = 0; i < fFileIn.back()->GetNkeys(); i++) { fData.push_back( (TTree*)gDirectory->Get(fFileIn.back()->GetListOfKeys()->At(i)->GetName() ) ); } @@ -155,33 +155,33 @@ void CLASSRead::ReadName() vector<TString> StockName; Int_t nBranches = fData[j]->GetNbranches(); - int place_reactor=0; - int place_pool=0; - int place_fabrication=0; - int place_stock=0; - for(Int_t i=0;i<nBranches;i++) + int place_reactor = 0; + int place_pool = 0; + int place_fabrication = 0; + int place_stock = 0; + for(Int_t i = 0;i<nBranches;i++) { string Name; - Name=fData[j]->GetListOfBranches()->At(i)->GetName(); + Name = fData[j]->GetListOfBranches()->At(i)->GetName(); string TypeName = Name; TypeName = TypeName.substr(0,2); - if(TypeName=="R_") + if(TypeName == "R_") { ReactorName.push_back(Name.substr(2,Name.size()-1)); } - else if(TypeName=="P_") + else if(TypeName == "P_") { PoolName.push_back(Name.substr(2,Name.size()-1)); } - else if(TypeName=="S_") + else if(TypeName == "S_") { StockName.push_back(Name.substr(2,Name.size()-1)); } - else if(TypeName=="F_") + else if(TypeName == "F_") { FabricationName.push_back(Name.substr(2,Name.size()-1)); @@ -203,7 +203,7 @@ void CLASSRead::ReadZAI() IsotopicVector IVTot; for (int i = 0; i < (int)fData.size() ; i++) { - IsotopicVector *IVIn=0; + IsotopicVector *IVIn = 0; fData[i]->SetBranchStatus("TOTAL.",1); fData[i]->SetBranchAddress("TOTAL.", &IVIn); @@ -258,11 +258,11 @@ void CLASSRead::PlotInv(vector<CLASSPlotElement> toplot, bool DecayChain, int St if(fLegendInv) { - for(int i=0; i < (int)fGraphInv.size(); i++) delete fLegendInv[i]; + for(int i = 0; i < (int)fGraphInv.size(); i++) delete fLegendInv[i]; delete [] fLegendInv; } - for(int i=0; i < (int)fGraphInv.size();i++) delete fGraphInv[i]; + for(int i = 0; i < (int)fGraphInv.size();i++) delete fGraphInv[i]; fGraphInv.clear(); if(fLegendInvSumOfSelected) @@ -275,7 +275,7 @@ void CLASSRead::PlotInv(vector<CLASSPlotElement> toplot, bool DecayChain, int St if(fCNucleiInv && gROOT->FindObject("c_NucleiInv")) { delete fCNucleiInv; - fCNucleiInv=0; + fCNucleiInv = 0; } fCNucleiInv = new TCanvas("c_NucleiInv","NucleiInv",50,110,400,300); @@ -300,7 +300,7 @@ void CLASSRead::PlotInv(vector<CLASSPlotElement> toplot, bool DecayChain, int St bool SumOfSelected = false; - if(toplot[0].fTreeId == -1 ) + if(toplot[0].fTreeId == -1 ) { SumOfSelected = true; toplot.erase(toplot.begin()); @@ -315,8 +315,8 @@ void CLASSRead::PlotInv(vector<CLASSPlotElement> toplot, bool DecayChain, int St for (int i = 0; i < (int)fData.size(); i++) { - if(i == 1) out += " same"; - if(toplotTTree[i].size() !=0) + if(i == 1) out += " same"; + if(toplotTTree[i].size() != 0) { if(!DecayChain) BuildTGraph(toplotTTree[i], 0, out); @@ -340,9 +340,9 @@ void CLASSRead::PlotInv(vector<CLASSPlotElement> toplot, bool DecayChain, int St double x; double y; fGraphInv[i]->GetPoint(j, x, y); - if(i == 0) + if(i == 0) X_Sum[j] = x; - if(i == 0) + if(i == 0) Y_Sum[j] = y; else Y_Sum[j] += y; @@ -350,7 +350,7 @@ void CLASSRead::PlotInv(vector<CLASSPlotElement> toplot, bool DecayChain, int St } - for (int i =0; i < fGraphInv[0]->GetN(); i++) + for (int i = 0; i < fGraphInv[0]->GetN(); i++) { if(X_Sum[i] > Xmax) Xmax = X_Sum[i]; if(X_Sum[i] < Xmin) Xmin = X_Sum[i]; @@ -367,8 +367,8 @@ void CLASSRead::PlotInv(vector<CLASSPlotElement> toplot, bool DecayChain, int St TH1F* fhr = fCNucleiInv->DrawFrame(Xmin,Ymin*0.95,Xmax,Ymax*1.05); - string Xtitle="Time [year]"; - string Ytitle="Mass [kg]"; + string Xtitle = "Time [year]"; + string Ytitle = "Mass [kg]"; fhr->SetXTitle(Xtitle.c_str()); fhr->SetYTitle(Ytitle.c_str()); fhr->GetXaxis()->CenterTitle(); @@ -408,7 +408,7 @@ void CLASSRead::PlotInv(vector<CLASSPlotElement> toplot, bool DecayChain, int St for (int i = 0; i < (int)fGraphInv.size(); i++) { - if( i !=0 || SumOfSelected) out += " same"; + if( i != 0 || SumOfSelected) out += " same"; fGraphInv[i]->SetName(GetTittleOutName(toplot[i]).c_str()); fGraphInv[i]->SetTitle(GetTittleOutName(toplot[i]).c_str()); @@ -445,11 +445,11 @@ void CLASSRead::PlotTox(vector<CLASSPlotElement> toplot, bool DecayChain, int St if(fLegendTox) { - for(int i=0; i < (int)fGraphTox.size();i++) delete fLegendTox[i]; + for(int i = 0; i < (int)fGraphTox.size();i++) delete fLegendTox[i]; delete [] fLegendTox; } - for(int i=0; i < (int)fGraphTox.size();i++) delete fGraphTox[i]; + for(int i = 0; i < (int)fGraphTox.size();i++) delete fGraphTox[i]; fGraphTox.clear(); if(fLegendToxSumOfSelected) @@ -460,7 +460,7 @@ void CLASSRead::PlotTox(vector<CLASSPlotElement> toplot, bool DecayChain, int St if(fCNucleiTox && gROOT->FindObject("c_NucleiTox")) { delete fCNucleiTox; - fCNucleiTox=0; + fCNucleiTox = 0; } fCNucleiTox = new TCanvas("c_NucleiTox","NucleiTox",50,110,400,300); if(!LinBin) @@ -483,7 +483,7 @@ void CLASSRead::PlotTox(vector<CLASSPlotElement> toplot, bool DecayChain, int St bool SumOfSelected = false; - if(toplot[0].fTreeId == -1 ) + if(toplot[0].fTreeId == -1 ) { SumOfSelected = true; toplot.erase(toplot.begin()); @@ -497,8 +497,8 @@ void CLASSRead::PlotTox(vector<CLASSPlotElement> toplot, bool DecayChain, int St string out = opt; for (int i = 0; i < (int)fData.size(); i++) { - if(i == 1) out += " same"; - if(toplotTTree[i].size() !=0) + if(i == 1) out += " same"; + if(toplotTTree[i].size() != 0) { if(!DecayChain) BuildTGraph(toplotTTree[i], 1, out); @@ -522,9 +522,9 @@ void CLASSRead::PlotTox(vector<CLASSPlotElement> toplot, bool DecayChain, int St double x; double y; fGraphTox[i]->GetPoint(j, x, y); - if(i == 0) + if(i == 0) X_Sum[j] = x; - if(i == 0) + if(i == 0) Y_Sum[j] = y; else Y_Sum[j] += y; @@ -532,7 +532,7 @@ void CLASSRead::PlotTox(vector<CLASSPlotElement> toplot, bool DecayChain, int St } - for (int i =0; i < fGraphTox[0]->GetN(); i++) + for (int i = 0; i < fGraphTox[0]->GetN(); i++) { if(X_Sum[i] > Xmax) Xmax = X_Sum[i]; if(X_Sum[i] < Xmin) Xmin = X_Sum[i]; @@ -549,8 +549,8 @@ void CLASSRead::PlotTox(vector<CLASSPlotElement> toplot, bool DecayChain, int St TH1F* fhr = fCNucleiTox->DrawFrame(Xmin,Ymin*0.95,Xmax,Ymax*1.05); - string Xtitle="Time [year]"; - string Ytitle="Radio-Toxicity [Sv]"; + string Xtitle = "Time [year]"; + string Ytitle = "Radio-Toxicity [Sv]"; fhr->SetXTitle(Xtitle.c_str()); fhr->SetYTitle(Ytitle.c_str()); fhr->GetXaxis()->CenterTitle(); @@ -589,7 +589,7 @@ void CLASSRead::PlotTox(vector<CLASSPlotElement> toplot, bool DecayChain, int St for (int i = 0; i < (int)fGraphTox.size(); i++) { - if( i !=0 || SumOfSelected) out += " same"; + if( i != 0 || SumOfSelected) out += " same"; fGraphTox[i]->SetName(GetTittleOutName(toplot[i]).c_str()); fGraphTox[i]->SetTitle(GetTittleOutName(toplot[i]).c_str()); @@ -629,10 +629,10 @@ void CLASSRead::PlotHeat(vector<CLASSPlotElement> toplot, bool DecayChain, int S if(fLegendHeat) { - for(int i=0; i < (int)fGraphHeat.size();i++) delete fLegendHeat[i]; + for(int i = 0; i < (int)fGraphHeat.size();i++) delete fLegendHeat[i]; delete [] fLegendHeat; } - for(int i=0; i < (int)fGraphHeat.size();i++) delete fGraphHeat[i]; + for(int i = 0; i < (int)fGraphHeat.size();i++) delete fGraphHeat[i]; fGraphHeat.clear(); if(fLegendHeatSumOfSelected) delete fLegendHeatSumOfSelected; @@ -642,7 +642,7 @@ void CLASSRead::PlotHeat(vector<CLASSPlotElement> toplot, bool DecayChain, int S if(fCNucleiHeat && gROOT->FindObject("c_NucleiHeat")) { delete fCNucleiHeat; - fCNucleiHeat=0; + fCNucleiHeat = 0; } fCNucleiHeat = new TCanvas("c_NucleiHeat","NucleiHeat",50,110,400,300); if(!LinBin) @@ -666,7 +666,7 @@ void CLASSRead::PlotHeat(vector<CLASSPlotElement> toplot, bool DecayChain, int S bool SumOfSelected = false; - if(toplot[0].fTreeId == -1 ) + if(toplot[0].fTreeId == -1 ) { SumOfSelected = true; toplot.erase(toplot.begin()); @@ -680,8 +680,8 @@ void CLASSRead::PlotHeat(vector<CLASSPlotElement> toplot, bool DecayChain, int S string out = opt; for (int i = 0; i < (int)fData.size(); i++) { - if(i == 1) out += " same"; - if(toplotTTree[i].size() !=0) + if(i == 1) out += " same"; + if(toplotTTree[i].size() != 0) { if(!DecayChain) BuildTGraph(toplotTTree[i], 2, out); @@ -704,9 +704,9 @@ void CLASSRead::PlotHeat(vector<CLASSPlotElement> toplot, bool DecayChain, int S double x; double y; fGraphHeat[i]->GetPoint(j, x, y); - if(i == 0) + if(i == 0) X_Sum[j] = x; - if(i == 0) + if(i == 0) Y_Sum[j] = y; else Y_Sum[j] += y; @@ -714,7 +714,7 @@ void CLASSRead::PlotHeat(vector<CLASSPlotElement> toplot, bool DecayChain, int S } - for (int i =0; i < fGraphHeat[0]->GetN(); i++) + for (int i = 0; i < fGraphHeat[0]->GetN(); i++) { if(X_Sum[i] > Xmax) Xmax = X_Sum[i]; if(X_Sum[i] < Xmin) Xmin = X_Sum[i]; @@ -730,8 +730,8 @@ void CLASSRead::PlotHeat(vector<CLASSPlotElement> toplot, bool DecayChain, int S } TH1F* fhr = fCNucleiHeat->DrawFrame(Xmin,Ymin*0.95,Xmax,Ymax*1.05); - string Xtitle="Time [year]"; - string Ytitle="Decay Heat [W]"; + string Xtitle = "Time [year]"; + string Ytitle = "Decay Heat [W]"; fhr->SetXTitle(Xtitle.c_str()); fhr->SetYTitle(Ytitle.c_str()); fhr->GetXaxis()->CenterTitle(); @@ -770,7 +770,7 @@ void CLASSRead::PlotHeat(vector<CLASSPlotElement> toplot, bool DecayChain, int S for (int i = 0; i < (int)fGraphHeat.size(); i++) { - if( i !=0 || SumOfSelected) out += " same"; + if( i != 0 || SumOfSelected) out += " same"; fGraphHeat[i]->SetName(GetTittleOutName(toplot[i]).c_str()); fGraphHeat[i]->SetTitle(GetTittleOutName(toplot[i]).c_str()); @@ -846,7 +846,7 @@ void CLASSRead::BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId, string vector< double > vTime; vector< double > vQuantity[toplot.size()]; - for (int i=0; i < (int)toplot.size(); i++) + for (int i = 0; i < (int)toplot.size(); i++) { string InBranchName = GetBranchInName(toplot[i]); @@ -854,15 +854,15 @@ void CLASSRead::BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId, string string ActiveInBranchName = InBranchName + "*"; fData[toplot[0].fTreeId]->SetBranchStatus(ActiveInBranchName.c_str(),1); - if(toplot[i].fFacilityId == 0) + if(toplot[i].fFacilityId == 0) fData[toplot[i].fTreeId]->SetBranchAddress(InBranchName.c_str(), &IV[toplot[i].fFacylityNumber]); - else if(toplot[i].fFacilityId == 1) + else if(toplot[i].fFacilityId == 1) fData[toplot[i].fTreeId]->SetBranchAddress(InBranchName.c_str(), &reactor[toplot[i].fFacylityNumber]); - else if(toplot[i].fFacilityId == 2) + else if(toplot[i].fFacilityId == 2) fData[toplot[i].fTreeId]->SetBranchAddress(InBranchName.c_str(), &stock[toplot[i].fFacylityNumber]); - else if(toplot[i].fFacilityId == 3) + else if(toplot[i].fFacilityId == 3) fData[toplot[i].fTreeId]->SetBranchAddress(InBranchName.c_str(), &pool[toplot[i].fFacylityNumber]); - else if(toplot[i].fFacilityId == 4) + else if(toplot[i].fFacilityId == 4) fData[toplot[i].fTreeId]->SetBranchAddress(InBranchName.c_str(), &fabricationplant[toplot[i].fFacylityNumber]); } @@ -876,22 +876,22 @@ void CLASSRead::BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId, string if(Xmin>vTime.back()) Xmin = vTime.back(); if(Xmax<vTime.back()) Xmax = vTime.back(); - for (int i=0; i < (int)toplot.size(); i++) + for (int i = 0; i < (int)toplot.size(); i++) { - if(toplot[i].fFacilityId == 0) + if(toplot[i].fFacilityId == 0) { int Z = toplot[i].fZAI.Z(); int A = toplot[i].fZAI.A(); int I = toplot[i].fZAI.I(); double ZAIQuantity = IV[toplot[i].fFacylityNumber]->GetZAIIsotopicQuantity(Z,A,I); - if(PlotId == 0) - ZAIQuantity *= cZAIMass.GetMass(Z,A)/AVOGADRO*1e-3; - else if(PlotId == 1) - ZAIQuantity *= cZAITox.GetRadioTox(Z,A,I); - else if(PlotId == 2) - ZAIQuantity *= cZAIHeat.GetHeat(Z,A,I); + if(PlotId == 0) + ZAIQuantity *= cZAIMass.GetMass(Z,A)/AVOGADRO*1e-3; + else if(PlotId == 1) + ZAIQuantity *= cZAITox.GetRadioTox(Z,A,I); + else if(PlotId == 2) + ZAIQuantity *= cZAIHeat.GetHeat(Z,A,I); else { cout << "Bad PlotId" << endl; @@ -907,7 +907,7 @@ void CLASSRead::BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId, string if(Ymax<ZAIQuantity) Ymax = ZAIQuantity; } - else if(toplot[i].fFacilityId == 1) + else if(toplot[i].fFacilityId == 1) { int Z = toplot[i].fZAI.Z(); int A = toplot[i].fZAI.A(); @@ -915,11 +915,11 @@ void CLASSRead::BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId, string double ZAIQuantity = 0; - if( toplot[i].fIVNumber == 0 ) + if( toplot[i].fIVNumber == 0 ) ZAIQuantity = reactor[toplot[i].fFacylityNumber]->GetInsideIV().GetZAIIsotopicQuantity(Z,A,I); - else if( toplot[i].fIVNumber == 1 ) + else if( toplot[i].fIVNumber == 1 ) ZAIQuantity = reactor[toplot[i].fFacylityNumber]->GetCumulativeIVIn().GetZAIIsotopicQuantity(Z,A,I); - else if( toplot[i].fIVNumber == 2 ) + else if( toplot[i].fIVNumber == 2 ) ZAIQuantity = reactor[toplot[i].fFacylityNumber]->GetCumulativeIVOut().GetZAIIsotopicQuantity(Z,A,I); else { @@ -927,12 +927,12 @@ void CLASSRead::BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId, string return; } - if(PlotId == 0) - ZAIQuantity *= cZAIMass.GetMass(Z,A)/AVOGADRO*1e-3; - else if(PlotId == 1) - ZAIQuantity *= cZAITox.GetRadioTox(Z,A,I); - else if(PlotId == 2) - ZAIQuantity *= cZAIHeat.GetHeat(Z,A,I); + if(PlotId == 0) + ZAIQuantity *= cZAIMass.GetMass(Z,A)/AVOGADRO*1e-3; + else if(PlotId == 1) + ZAIQuantity *= cZAITox.GetRadioTox(Z,A,I); + else if(PlotId == 2) + ZAIQuantity *= cZAIHeat.GetHeat(Z,A,I); else { cout << "Bad PlotId" << endl; @@ -945,7 +945,7 @@ void CLASSRead::BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId, string if(Ymax<ZAIQuantity) Ymax = ZAIQuantity; } - else if(toplot[i].fFacilityId == 2) + else if(toplot[i].fFacilityId == 2) { int Z = toplot[i].fZAI.Z(); int A = toplot[i].fZAI.A(); @@ -953,11 +953,11 @@ void CLASSRead::BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId, string double ZAIQuantity = 0; - if( toplot[i].fIVNumber == 0 ) + if( toplot[i].fIVNumber == 0 ) ZAIQuantity = stock[toplot[i].fFacylityNumber]->GetInsideIV().GetZAIIsotopicQuantity(Z,A,I); - else if( toplot[i].fIVNumber == 1 ) + else if( toplot[i].fIVNumber == 1 ) ZAIQuantity = stock[toplot[i].fFacylityNumber]->GetCumulativeIVIn().GetZAIIsotopicQuantity(Z,A,I); - else if( toplot[i].fIVNumber == 2 ) + else if( toplot[i].fIVNumber == 2 ) ZAIQuantity = stock[toplot[i].fFacylityNumber]->GetCumulativeIVOut().GetZAIIsotopicQuantity(Z,A,I); else { @@ -965,12 +965,12 @@ void CLASSRead::BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId, string return; } - if(PlotId == 0) - ZAIQuantity *= cZAIMass.GetMass(Z,A)/AVOGADRO*1e-3; - else if(PlotId == 1) - ZAIQuantity *= cZAITox.GetRadioTox(Z,A,I); - else if(PlotId == 2) - ZAIQuantity *= cZAIHeat.GetHeat(Z,A,I); + if(PlotId == 0) + ZAIQuantity *= cZAIMass.GetMass(Z,A)/AVOGADRO*1e-3; + else if(PlotId == 1) + ZAIQuantity *= cZAITox.GetRadioTox(Z,A,I); + else if(PlotId == 2) + ZAIQuantity *= cZAIHeat.GetHeat(Z,A,I); else { cout << "Bad PlotId" << endl; @@ -984,7 +984,7 @@ void CLASSRead::BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId, string if(Ymax<ZAIQuantity) Ymax = ZAIQuantity; } - else if(toplot[i].fFacilityId == 3) + else if(toplot[i].fFacilityId == 3) { int Z = toplot[i].fZAI.Z(); int A = toplot[i].fZAI.A(); @@ -992,11 +992,11 @@ void CLASSRead::BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId, string double ZAIQuantity = 0; - if( toplot[i].fIVNumber == 0 ) + if( toplot[i].fIVNumber == 0 ) ZAIQuantity = pool[toplot[i].fFacylityNumber]->GetInsideIV().GetZAIIsotopicQuantity(Z,A,I); - else if( toplot[i].fIVNumber == 1 ) + else if( toplot[i].fIVNumber == 1 ) ZAIQuantity = pool[toplot[i].fFacylityNumber]->GetCumulativeIVIn().GetZAIIsotopicQuantity(Z,A,I); - else if( toplot[i].fIVNumber == 2 ) + else if( toplot[i].fIVNumber == 2 ) ZAIQuantity = pool[toplot[i].fFacylityNumber]->GetCumulativeIVOut().GetZAIIsotopicQuantity(Z,A,I); else { @@ -1004,12 +1004,12 @@ void CLASSRead::BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId, string return; } - if(PlotId == 0) - ZAIQuantity *= cZAIMass.GetMass(Z,A)/AVOGADRO*1e-3; - else if(PlotId == 1) - ZAIQuantity *= cZAITox.GetRadioTox(Z,A,I); - else if(PlotId == 2) - ZAIQuantity *= cZAIHeat.GetHeat(Z,A,I); + if(PlotId == 0) + ZAIQuantity *= cZAIMass.GetMass(Z,A)/AVOGADRO*1e-3; + else if(PlotId == 1) + ZAIQuantity *= cZAITox.GetRadioTox(Z,A,I); + else if(PlotId == 2) + ZAIQuantity *= cZAIHeat.GetHeat(Z,A,I); else { cout << "Bad PlotId" << endl; @@ -1023,7 +1023,7 @@ void CLASSRead::BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId, string if(Ymax<ZAIQuantity) Ymax = ZAIQuantity; } - else if(toplot[i].fFacilityId == 4) + else if(toplot[i].fFacilityId == 4) { int Z = toplot[i].fZAI.Z(); int A = toplot[i].fZAI.A(); @@ -1031,11 +1031,11 @@ void CLASSRead::BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId, string double ZAIQuantity = 0; - if( toplot[i].fIVNumber == 0 ) + if( toplot[i].fIVNumber == 0 ) ZAIQuantity = fabricationplant[toplot[i].fFacylityNumber]->GetInsideIV().GetZAIIsotopicQuantity(Z,A,I); - else if( toplot[i].fIVNumber == 1 ) + else if( toplot[i].fIVNumber == 1 ) ZAIQuantity = fabricationplant[toplot[i].fFacylityNumber]->GetCumulativeIVIn().GetZAIIsotopicQuantity(Z,A,I); - else if( toplot[i].fIVNumber == 2 ) + else if( toplot[i].fIVNumber == 2 ) ZAIQuantity = fabricationplant[toplot[i].fFacylityNumber]->GetCumulativeIVOut().GetZAIIsotopicQuantity(Z,A,I); else { @@ -1043,12 +1043,12 @@ void CLASSRead::BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId, string return; } - if(PlotId == 0) - ZAIQuantity *= cZAIMass.GetMass(Z,A)/AVOGADRO*1e-3; - else if(PlotId == 1) - ZAIQuantity *= cZAITox.GetRadioTox(Z,A,I); - else if(PlotId == 2) - ZAIQuantity *= cZAIHeat.GetHeat(Z,A,I); + if(PlotId == 0) + ZAIQuantity *= cZAIMass.GetMass(Z,A)/AVOGADRO*1e-3; + else if(PlotId == 1) + ZAIQuantity *= cZAITox.GetRadioTox(Z,A,I); + else if(PlotId == 2) + ZAIQuantity *= cZAIHeat.GetHeat(Z,A,I); else { cout << "Bad PlotId" << endl; @@ -1070,13 +1070,13 @@ void CLASSRead::BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId, string for (int i = 0; i < (int)toplot.size(); i++) { - if(PlotId == 0) + if(PlotId == 0) fGraphInv.push_back(new TGraph(vTime.size(), &vTime[0], &(vQuantity[i])[0])); - else if(PlotId == 1) + else if(PlotId == 1) fGraphTox.push_back(new TGraph(vTime.size(), &vTime[0], &(vQuantity[i])[0])); - else if(PlotId == 2) + else if(PlotId == 2) fGraphHeat.push_back(new TGraph(vTime.size(), &vTime[0], &(vQuantity[i])[0])); else @@ -1089,14 +1089,14 @@ void CLASSRead::BuildTGraph(vector<CLASSPlotElement> toplot, int PlotId, string fData[toplot[0].fTreeId]->ResetBranchAddresses(); { - for(int i=0; i< (int)fReactorName[toplot[0].fTreeId].size(); i++) delete reactor[i]; + for(int i = 0; i< (int)fReactorName[toplot[0].fTreeId].size(); i++) delete reactor[i]; - for(int i=0; i< (int)fPoolName[toplot[0].fTreeId].size(); i++) delete pool[i]; + for(int i = 0; i< (int)fPoolName[toplot[0].fTreeId].size(); i++) delete pool[i]; - for(int i=0; i< (int)fFabricationName[toplot[0].fTreeId].size(); i++) delete fabricationplant[i]; + for(int i = 0; i< (int)fFabricationName[toplot[0].fTreeId].size(); i++) delete fabricationplant[i]; - for(int i=0; i< (int)fStockName[toplot[0].fTreeId].size(); i++) delete stock[i]; - for(int i=0; i< 8; i++) delete IV[i]; + for(int i = 0; i< (int)fStockName[toplot[0].fTreeId].size(); i++) delete stock[i]; + for(int i = 0; i< 8; i++) delete IV[i]; } @@ -1142,7 +1142,7 @@ void CLASSRead::BuildTGraphUsingDecayChain(vector<CLASSPlotElement> toplot, int vector< IsotopicVector > vIV[toplot.size()]; vector< double > vQuantity[toplot.size()]; - for (int i=0; i < (int)toplot.size(); i++) + for (int i = 0; i < (int)toplot.size(); i++) { string InBranchName = GetBranchInName(toplot[i]); @@ -1150,15 +1150,15 @@ void CLASSRead::BuildTGraphUsingDecayChain(vector<CLASSPlotElement> toplot, int string ActiveInBranchName = InBranchName + "*"; fData[toplot[0].fTreeId]->SetBranchStatus(ActiveInBranchName.c_str(),1); - if(toplot[i].fFacilityId == 0) + if(toplot[i].fFacilityId == 0) fData[toplot[i].fTreeId]->SetBranchAddress(InBranchName.c_str(), &IV[toplot[i].fFacylityNumber]); - else if(toplot[i].fFacilityId == 1) + else if(toplot[i].fFacilityId == 1) fData[toplot[i].fTreeId]->SetBranchAddress(InBranchName.c_str(), &reactor[toplot[i].fFacylityNumber]); - else if(toplot[i].fFacilityId == 2) + else if(toplot[i].fFacilityId == 2) fData[toplot[i].fTreeId]->SetBranchAddress(InBranchName.c_str(), &stock[toplot[i].fFacylityNumber]); - else if(toplot[i].fFacilityId == 3) + else if(toplot[i].fFacilityId == 3) fData[toplot[i].fTreeId]->SetBranchAddress(InBranchName.c_str(), &pool[toplot[i].fFacylityNumber]); - else if(toplot[i].fFacilityId == 4) + else if(toplot[i].fFacilityId == 4) fData[toplot[i].fTreeId]->SetBranchAddress(InBranchName.c_str(), &fabricationplant[toplot[i].fFacylityNumber]); } @@ -1173,10 +1173,10 @@ void CLASSRead::BuildTGraphUsingDecayChain(vector<CLASSPlotElement> toplot, int Xmax = vTime[0] + FinalTime/cYear; - for (int i=0; i < (int)toplot.size(); i++) + for (int i = 0; i < (int)toplot.size(); i++) { - if(toplot[i].fFacilityId == 0) + if(toplot[i].fFacilityId == 0) { int Z = toplot[i].fZAI.Z(); int A = toplot[i].fZAI.A(); @@ -1186,7 +1186,7 @@ void CLASSRead::BuildTGraphUsingDecayChain(vector<CLASSPlotElement> toplot, int vIV[i].push_back(ZAIQuantity); } - else if(toplot[i].fFacilityId == 1) + else if(toplot[i].fFacilityId == 1) { int Z = toplot[i].fZAI.Z(); int A = toplot[i].fZAI.A(); @@ -1194,11 +1194,11 @@ void CLASSRead::BuildTGraphUsingDecayChain(vector<CLASSPlotElement> toplot, int IsotopicVector ZAIQuantity; - if( toplot[i].fIVNumber == 0 ) + if( toplot[i].fIVNumber == 0 ) ZAIQuantity = reactor[toplot[i].fFacylityNumber]->GetInsideIV().GetZAIIsotopicQuantity(Z,A,I) * ZAI(Z,A,I); - else if( toplot[i].fIVNumber == 1 ) + else if( toplot[i].fIVNumber == 1 ) ZAIQuantity = reactor[toplot[i].fFacylityNumber]->GetCumulativeIVIn().GetZAIIsotopicQuantity(Z,A,I) * ZAI(Z,A,I); - else if( toplot[i].fIVNumber == 2 ) + else if( toplot[i].fIVNumber == 2 ) ZAIQuantity = reactor[toplot[i].fFacylityNumber]->GetCumulativeIVOut().GetZAIIsotopicQuantity(Z,A,I) * ZAI(Z,A,I); else { @@ -1209,7 +1209,7 @@ void CLASSRead::BuildTGraphUsingDecayChain(vector<CLASSPlotElement> toplot, int vIV[i].push_back(ZAIQuantity); } - else if(toplot[i].fFacilityId == 2) + else if(toplot[i].fFacilityId == 2) { int Z = toplot[i].fZAI.Z(); int A = toplot[i].fZAI.A(); @@ -1217,11 +1217,11 @@ void CLASSRead::BuildTGraphUsingDecayChain(vector<CLASSPlotElement> toplot, int IsotopicVector ZAIQuantity; - if( toplot[i].fIVNumber == 0 ) + if( toplot[i].fIVNumber == 0 ) ZAIQuantity = stock[toplot[i].fFacylityNumber]->GetInsideIV().GetZAIIsotopicQuantity(Z,A,I) * ZAI(Z,A,I); - else if( toplot[i].fIVNumber == 1 ) + else if( toplot[i].fIVNumber == 1 ) ZAIQuantity = stock[toplot[i].fFacylityNumber]->GetCumulativeIVIn().GetZAIIsotopicQuantity(Z,A,I) * ZAI(Z,A,I); - else if( toplot[i].fIVNumber == 2 ) + else if( toplot[i].fIVNumber == 2 ) ZAIQuantity = stock[toplot[i].fFacylityNumber]->GetCumulativeIVOut().GetZAIIsotopicQuantity(Z,A,I) * ZAI(Z,A,I); else { @@ -1232,7 +1232,7 @@ void CLASSRead::BuildTGraphUsingDecayChain(vector<CLASSPlotElement> toplot, int vIV[i].push_back(ZAIQuantity); } - else if(toplot[i].fFacilityId == 3) + else if(toplot[i].fFacilityId == 3) { int Z = toplot[i].fZAI.Z(); int A = toplot[i].fZAI.A(); @@ -1240,11 +1240,11 @@ void CLASSRead::BuildTGraphUsingDecayChain(vector<CLASSPlotElement> toplot, int IsotopicVector ZAIQuantity; - if( toplot[i].fIVNumber == 0 ) + if( toplot[i].fIVNumber == 0 ) ZAIQuantity = pool[toplot[i].fFacylityNumber]->GetInsideIV().GetZAIIsotopicQuantity(Z,A,I) * ZAI(Z,A,I); - else if( toplot[i].fIVNumber == 1 ) + else if( toplot[i].fIVNumber == 1 ) ZAIQuantity = pool[toplot[i].fFacylityNumber]->GetCumulativeIVIn().GetZAIIsotopicQuantity(Z,A,I) * ZAI(Z,A,I); - else if( toplot[i].fIVNumber == 2 ) + else if( toplot[i].fIVNumber == 2 ) ZAIQuantity = pool[toplot[i].fFacylityNumber]->GetCumulativeIVOut().GetZAIIsotopicQuantity(Z,A,I) * ZAI(Z,A,I); else { @@ -1255,7 +1255,7 @@ void CLASSRead::BuildTGraphUsingDecayChain(vector<CLASSPlotElement> toplot, int vIV[i].push_back(ZAIQuantity); } - else if(toplot[i].fFacilityId == 4) + else if(toplot[i].fFacilityId == 4) { int Z = toplot[i].fZAI.Z(); int A = toplot[i].fZAI.A(); @@ -1263,11 +1263,11 @@ void CLASSRead::BuildTGraphUsingDecayChain(vector<CLASSPlotElement> toplot, int IsotopicVector ZAIQuantity; - if( toplot[i].fIVNumber == 0 ) + if( toplot[i].fIVNumber == 0 ) ZAIQuantity = fabricationplant[toplot[i].fFacylityNumber]->GetInsideIV().GetZAIIsotopicQuantity(Z,A,I) * ZAI(Z,A,I); - else if( toplot[i].fIVNumber == 1 ) + else if( toplot[i].fIVNumber == 1 ) ZAIQuantity = fabricationplant[toplot[i].fFacylityNumber]->GetCumulativeIVIn().GetZAIIsotopicQuantity(Z,A,I) * ZAI(Z,A,I); - else if( toplot[i].fIVNumber == 2 ) + else if( toplot[i].fIVNumber == 2 ) ZAIQuantity = fabricationplant[toplot[i].fFacylityNumber]->GetCumulativeIVOut().GetZAIIsotopicQuantity(Z,A,I) * ZAI(Z,A,I); else { @@ -1297,7 +1297,7 @@ void CLASSRead::BuildTGraphUsingDecayChain(vector<CLASSPlotElement> toplot, int double dt = 1./double(StepNUmber) * log( FinalTime/cYear /vTime[0]); - for(int k=1 ; k <= StepNUmber; k++) + for(int k = 1 ; k <= StepNUmber; k++) { vTime.push_back( exp( dt*double(k) ) * vTime[0] ); @@ -1322,11 +1322,11 @@ void CLASSRead::BuildTGraphUsingDecayChain(vector<CLASSPlotElement> toplot, int double ZAIQuantity = 0; - if(PlotId == 0) + if(PlotId == 0) ZAIQuantity = vIV[j][i].GetZAIIsotopicQuantity(Z,A,I) * cZAIMass.GetMass(Z,A)/AVOGADRO*1e-3; - else if(PlotId == 1) + else if(PlotId == 1) ZAIQuantity = cZAITox.GetRadioTox( vIV[j][i] ); - else if(PlotId == 2) + else if(PlotId == 2) ZAIQuantity = cZAIHeat.GetHeat( vIV[j][i] ); else { @@ -1353,13 +1353,13 @@ void CLASSRead::BuildTGraphUsingDecayChain(vector<CLASSPlotElement> toplot, int for (int i = 0; i < (int)toplot.size(); i++) { - if(PlotId == 0) + if(PlotId == 0) fGraphInv.push_back(new TGraph(vTime.size(), &vTime[0], &(vQuantity[i])[0])); - else if(PlotId == 1) + else if(PlotId == 1) fGraphTox.push_back(new TGraph(vTime.size(), &vTime[0], &(vQuantity[i])[0])); - else if(PlotId == 2) + else if(PlotId == 2) fGraphHeat.push_back(new TGraph(vTime.size(), &vTime[0], &(vQuantity[i])[0])); else @@ -1372,14 +1372,14 @@ void CLASSRead::BuildTGraphUsingDecayChain(vector<CLASSPlotElement> toplot, int fData[toplot[0].fTreeId]->ResetBranchAddresses(); { - for(int i=0; i< (int)fReactorName[toplot[0].fTreeId].size(); i++) delete reactor[i]; + for(int i = 0; i< (int)fReactorName[toplot[0].fTreeId].size(); i++) delete reactor[i]; - for(int i=0; i< (int)fPoolName[toplot[0].fTreeId].size(); i++) delete pool[i]; + for(int i = 0; i< (int)fPoolName[toplot[0].fTreeId].size(); i++) delete pool[i]; - for(int i=0; i< (int)fFabricationName[toplot[0].fTreeId].size(); i++) delete fabricationplant[i]; + for(int i = 0; i< (int)fFabricationName[toplot[0].fTreeId].size(); i++) delete fabricationplant[i]; - for(int i=0; i< (int)fStockName[toplot[0].fTreeId].size(); i++) delete stock[i]; - for(int i=0; i< 8; i++) delete IV[i]; + for(int i = 0; i< (int)fStockName[toplot[0].fTreeId].size(); i++) delete stock[i]; + for(int i = 0; i< 8; i++) delete IV[i]; } @@ -1392,20 +1392,20 @@ void CLASSRead::PlotPower(vector<CLASSPlotElement> toplot, string opt) { if(fGraphPower) { - for(int i=0; i < fNumberGraphPowerIterator;i++) delete fGraphPower[i]; + for(int i = 0; i < fNumberGraphPowerIterator;i++) delete fGraphPower[i]; delete [] fGraphPower; } if(fLegendPower) { - for(int i=0; i < fNumberGraphPowerIterator;i++) delete fLegendPower[i]; + for(int i = 0; i < fNumberGraphPowerIterator;i++) delete fLegendPower[i]; delete [] fLegendPower; } if(fCPower && gROOT->FindObject("fCPower")) { delete fCPower; - fCPower=0; + fCPower = 0; } @@ -1441,7 +1441,7 @@ void CLASSRead::PlotPower(vector<CLASSPlotElement> toplot, string opt) { if(i != 0) out += " same"; - if(toplotTTree[i].size() !=0) + if(toplotTTree[i].size() != 0) PlotTTreePower(toplotTTree[i], out); @@ -1449,9 +1449,9 @@ void CLASSRead::PlotPower(vector<CLASSPlotElement> toplot, string opt) fCPower->cd(); - TH1F* fhrPower= fCPower->DrawFrame(Xmin,Ymin*0.95,Xmax,Ymax*1.05); - string Xtitle="Time [year]"; - string Ytitle="Total Thermal Power [GW]"; + TH1F* fhrPower = fCPower->DrawFrame(Xmin,Ymin*0.95,Xmax,Ymax*1.05); + string Xtitle = "Time [year]"; + string Ytitle = "Total Thermal Power [GW]"; fhrPower->SetXTitle(Xtitle.c_str()); fhrPower->SetYTitle(Ytitle.c_str()); fhrPower->GetXaxis()->CenterTitle(); @@ -1461,7 +1461,7 @@ void CLASSRead::PlotPower(vector<CLASSPlotElement> toplot, string opt) for (int i = 0; i < (int)fNumberGraphPowerIterator; i++) { fCPower->cd(); - if( i !=0 ) out += " same"; + if( i != 0 ) out += " same"; fGraphPower[i]->SetName(GetTittleOutName(toplot[i]).c_str()); fGraphPower[i]->SetTitle(GetTittleOutName(toplot[i]).c_str()); @@ -1548,7 +1548,7 @@ void CLASSRead::PlotTTreePower(vector<CLASSPlotElement> toplot, string opt) //________________________________________________________________________ void CLASSRead::Write(string filename, string fileformat, string PadName) { - if(fileformat == "ASCII") + if(fileformat == "ASCII") ASCIIWrite(filename,PadName); } @@ -1565,12 +1565,12 @@ void CLASSRead::ASCIIWrite(string filename, string PadName) cout << "WARNING!! not working if using many CLASS.root file with different timestep!!!" << endl; - if ( (int)fGraphInv.size() != 0 && PadName=="c_NucleiInv") + if ( (int)fGraphInv.size() != 0 && PadName == "c_NucleiInv") { double* X = fGraphInv[0]->GetX(); outfile << "time"; - for(int i= 0; i < fGraphInv[0]->GetN(); i++) + for(int i = 0; i < fGraphInv[0]->GetN(); i++) outfile << "\t" << X[i]; outfile << endl; @@ -1580,7 +1580,7 @@ void CLASSRead::ASCIIWrite(string filename, string PadName) outfile << fGraphInvSumOfSelected->GetTitle(); double* Y = fGraphInvSumOfSelected->GetY(); - for(int j= 0; j < fGraphInvSumOfSelected->GetN(); j++) + for(int j = 0; j < fGraphInvSumOfSelected->GetN(); j++) outfile << "\t" << Y[j]; outfile << endl; } @@ -1590,7 +1590,7 @@ void CLASSRead::ASCIIWrite(string filename, string PadName) { outfile << fGraphInv[i]->GetTitle(); double* Y = fGraphInv[i]->GetY(); - for(int j= 0; j < fGraphInv[i]->GetN(); j++) + for(int j = 0; j < fGraphInv[i]->GetN(); j++) outfile << "\t" << Y[j]; outfile << endl; } @@ -1598,12 +1598,12 @@ void CLASSRead::ASCIIWrite(string filename, string PadName) } - if ( (int)fGraphTox.size() != 0 && PadName=="c_NucleiTox") + if ( (int)fGraphTox.size() != 0 && PadName == "c_NucleiTox") { double* X = fGraphTox[0]->GetX(); outfile << "time"; - for(int i= 0; i < fGraphTox[0]->GetN(); i++) + for(int i = 0; i < fGraphTox[0]->GetN(); i++) outfile << "\t" << X[i]; outfile << endl; @@ -1613,7 +1613,7 @@ void CLASSRead::ASCIIWrite(string filename, string PadName) outfile << fGraphToxSumOfSelected->GetTitle(); double* Y = fGraphToxSumOfSelected->GetY(); - for(int j= 0; j < fGraphToxSumOfSelected->GetN(); j++) + for(int j = 0; j < fGraphToxSumOfSelected->GetN(); j++) outfile << "\t" << Y[j]; outfile << endl; } @@ -1623,19 +1623,19 @@ void CLASSRead::ASCIIWrite(string filename, string PadName) { outfile << fGraphTox[i]->GetTitle(); double* Y = fGraphTox[i]->GetY(); - for(int j= 0; j < fGraphTox[i]->GetN(); j++) + for(int j = 0; j < fGraphTox[i]->GetN(); j++) outfile << "\t" << Y[j]; outfile << endl; } } - if ( (int)fGraphHeat.size() != 0 && PadName=="c_NucleiHeat") + if ( (int)fGraphHeat.size() != 0 && PadName == "c_NucleiHeat") { double* X = fGraphHeat[0]->GetX(); outfile << "time"; - for(int i= 0; i < fGraphHeat[0]->GetN(); i++) + for(int i = 0; i < fGraphHeat[0]->GetN(); i++) outfile << "\t" << X[i]; outfile << endl; @@ -1645,7 +1645,7 @@ void CLASSRead::ASCIIWrite(string filename, string PadName) outfile << fGraphHeatSumOfSelected->GetTitle(); double* Y = fGraphHeatSumOfSelected->GetY(); - for(int j= 0; j < fGraphHeatSumOfSelected->GetN(); j++) + for(int j = 0; j < fGraphHeatSumOfSelected->GetN(); j++) outfile << "\t" << Y[j]; outfile << endl; } @@ -1655,7 +1655,7 @@ void CLASSRead::ASCIIWrite(string filename, string PadName) { outfile << fGraphHeat[i]->GetTitle(); double* Y = fGraphHeat[i]->GetY(); - for(int j= 0; j < fGraphHeat[i]->GetN(); j++) + for(int j = 0; j < fGraphHeat[i]->GetN(); j++) outfile << "\t" << Y[j]; outfile << endl; } @@ -1708,7 +1708,7 @@ void CLASSRead::ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string file vector< double > vTime; vector< double > vQuantity[toplot.size()]; - for (int i=0; i < (int)toplot.size(); i++) + for (int i = 0; i < (int)toplot.size(); i++) { string InBranchName = GetBranchInName(toplot[i]); @@ -1716,15 +1716,15 @@ void CLASSRead::ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string file string ActiveInBranchName = InBranchName + "*"; fData[toplot[0].fTreeId]->SetBranchStatus(ActiveInBranchName.c_str(),1); - if(toplot[i].fFacilityId == 0) + if(toplot[i].fFacilityId == 0) fData[toplot[i].fTreeId]->SetBranchAddress(InBranchName.c_str(), &IV[toplot[i].fFacylityNumber]); - else if(toplot[i].fFacilityId == 1) + else if(toplot[i].fFacilityId == 1) fData[toplot[i].fTreeId]->SetBranchAddress(InBranchName.c_str(), &reactor[toplot[i].fFacylityNumber]); - else if(toplot[i].fFacilityId == 2) + else if(toplot[i].fFacilityId == 2) fData[toplot[i].fTreeId]->SetBranchAddress(InBranchName.c_str(), &stock[toplot[i].fFacylityNumber]); - else if(toplot[i].fFacilityId == 3) + else if(toplot[i].fFacilityId == 3) fData[toplot[i].fTreeId]->SetBranchAddress(InBranchName.c_str(), &pool[toplot[i].fFacylityNumber]); - else if(toplot[i].fFacilityId == 4) + else if(toplot[i].fFacilityId == 4) fData[toplot[i].fTreeId]->SetBranchAddress(InBranchName.c_str(), &fabricationplant[toplot[i].fFacylityNumber]); } @@ -1738,10 +1738,10 @@ void CLASSRead::ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string file if(Xmin>vTime.back()) Xmin = vTime.back(); if(Xmax<vTime.back()) Xmax = vTime.back(); - for (int i=0; i < (int)toplot.size(); i++) + for (int i = 0; i < (int)toplot.size(); i++) { - if(toplot[i].fFacilityId == 0) + if(toplot[i].fFacilityId == 0) { int Z = toplot[i].fZAI.Z(); int A = toplot[i].fZAI.A(); @@ -1756,7 +1756,7 @@ void CLASSRead::ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string file if(Ymax<ZAIQuantity) Ymax = ZAIQuantity; } - else if(toplot[i].fFacilityId == 1) + else if(toplot[i].fFacilityId == 1) { int Z = toplot[i].fZAI.Z(); int A = toplot[i].fZAI.A(); @@ -1764,11 +1764,11 @@ void CLASSRead::ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string file double ZAIQuantity = 0; - if( toplot[i].fIVNumber == 0 ) + if( toplot[i].fIVNumber == 0 ) ZAIQuantity = reactor[toplot[i].fFacylityNumber]->GetInsideIV().GetZAIIsotopicQuantity(Z,A,I)*A/6.02e23*1e-3; - else if( toplot[i].fIVNumber == 1 ) + else if( toplot[i].fIVNumber == 1 ) ZAIQuantity = reactor[toplot[i].fFacylityNumber]->GetCumulativeIVIn().GetZAIIsotopicQuantity(Z,A,I)*A/6.02e23*1e-3; - else if( toplot[i].fIVNumber == 2 ) + else if( toplot[i].fIVNumber == 2 ) ZAIQuantity = reactor[toplot[i].fFacylityNumber]->GetCumulativeIVOut().GetZAIIsotopicQuantity(Z,A,I)*A/6.02e23*1e-3; else { @@ -1782,7 +1782,7 @@ void CLASSRead::ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string file if(Ymax<ZAIQuantity) Ymax = ZAIQuantity; } - else if(toplot[i].fFacilityId == 2) + else if(toplot[i].fFacilityId == 2) { int Z = toplot[i].fZAI.Z(); int A = toplot[i].fZAI.A(); @@ -1790,11 +1790,11 @@ void CLASSRead::ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string file double ZAIQuantity = 0; - if( toplot[i].fIVNumber == 0 ) + if( toplot[i].fIVNumber == 0 ) ZAIQuantity = stock[toplot[i].fFacylityNumber]->GetInsideIV().GetZAIIsotopicQuantity(Z,A,I)*A/6.02e23*1e-3; - else if( toplot[i].fIVNumber == 1 ) + else if( toplot[i].fIVNumber == 1 ) ZAIQuantity = stock[toplot[i].fFacylityNumber]->GetCumulativeIVIn().GetZAIIsotopicQuantity(Z,A,I)*A/6.02e23*1e-3; - else if( toplot[i].fIVNumber == 2 ) + else if( toplot[i].fIVNumber == 2 ) ZAIQuantity = stock[toplot[i].fFacylityNumber]->GetCumulativeIVOut().GetZAIIsotopicQuantity(Z,A,I)*A/6.02e23*1e-3; else { @@ -1809,7 +1809,7 @@ void CLASSRead::ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string file if(Ymax<ZAIQuantity) Ymax = ZAIQuantity; } - else if(toplot[i].fFacilityId == 3) + else if(toplot[i].fFacilityId == 3) { int Z = toplot[i].fZAI.Z(); int A = toplot[i].fZAI.A(); @@ -1817,11 +1817,11 @@ void CLASSRead::ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string file double ZAIQuantity = 0; - if( toplot[i].fIVNumber == 0 ) + if( toplot[i].fIVNumber == 0 ) ZAIQuantity = pool[toplot[i].fFacylityNumber]->GetInsideIV().GetZAIIsotopicQuantity(Z,A,I)*A/6.02e23*1e-3; - else if( toplot[i].fIVNumber == 1 ) + else if( toplot[i].fIVNumber == 1 ) ZAIQuantity = pool[toplot[i].fFacylityNumber]->GetCumulativeIVIn().GetZAIIsotopicQuantity(Z,A,I)*A/6.02e23*1e-3; - else if( toplot[i].fIVNumber == 2 ) + else if( toplot[i].fIVNumber == 2 ) ZAIQuantity = pool[toplot[i].fFacylityNumber]->GetCumulativeIVOut().GetZAIIsotopicQuantity(Z,A,I)*A/6.02e23*1e-3; else { @@ -1836,7 +1836,7 @@ void CLASSRead::ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string file if(Ymax<ZAIQuantity) Ymax = ZAIQuantity; } - else if(toplot[i].fFacilityId == 4) + else if(toplot[i].fFacilityId == 4) { int Z = toplot[i].fZAI.Z(); int A = toplot[i].fZAI.A(); @@ -1844,11 +1844,11 @@ void CLASSRead::ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string file double ZAIQuantity = 0; - if( toplot[i].fIVNumber == 0 ) + if( toplot[i].fIVNumber == 0 ) ZAIQuantity = fabricationplant[toplot[i].fFacylityNumber]->GetInsideIV().GetZAIIsotopicQuantity(Z,A,I)*A/6.02e23*1e-3; - else if( toplot[i].fIVNumber == 1 ) + else if( toplot[i].fIVNumber == 1 ) ZAIQuantity = fabricationplant[toplot[i].fFacylityNumber]->GetCumulativeIVIn().GetZAIIsotopicQuantity(Z,A,I)*A/6.02e23*1e-3; - else if( toplot[i].fIVNumber == 2 ) + else if( toplot[i].fIVNumber == 2 ) ZAIQuantity = fabricationplant[toplot[i].fFacylityNumber]->GetCumulativeIVOut().GetZAIIsotopicQuantity(Z,A,I)*A/6.02e23*1e-3; else { @@ -1880,19 +1880,19 @@ void CLASSRead::ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string file cout << "Impossible d'ouvrir le fichier en ecriture !" << endl; else { - f << "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" << endl; - f << "<file filename = \"" << filename << "\" created=\" \"" << endl; - f << "<unit time=\"years\" Masse=\"kg\" power=\"MW\" />" << endl; - f << "<material matid=\" \">" << endl; + f << "<?xml version = \"1.0\" encoding = \"UTF-8\" ?>" << endl; + f << "<file filename = \"" << filename << "\" created = \" \"" << endl; + f << "<unit time = \"years\" Masse = \"kg\" power = \"MW\" />" << endl; + f << "<material matid = \" \">" << endl; f << "\t<time>" << endl; //Print all information about time(always the same for 0 to 20 yeaur) and the module involved - for (int i =0; i < (int)vTime.size(); i++) { + for (int i = 0; i < (int)vTime.size(); i++) { - f << "\t\t<timestamp tid=\"" << i << "\" time=\"" << vTime[i] << "\" />" << endl; + f << "\t\t<timestamp tid = \"" << i << "\" time = \"" << vTime[i] << "\" />" << endl; } f << "\t</time>" << endl; @@ -1906,15 +1906,15 @@ void CLASSRead::ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string file - for (int i =0; i < (int)vTime.size(); i++) + for (int i = 0; i < (int)vTime.size(); i++) { - f << "\t\t\t<compositiondata tid=\"" << i << "\">" << endl; + f << "\t\t\t<compositiondata tid = \"" << i << "\">" << endl; f << "\t\t\t\t<composition>" << endl; - for (int j =0; j< (int)toplot.size(); j++) + for (int j = 0; j< (int)toplot.size(); j++) { string name; @@ -2016,7 +2016,7 @@ void CLASSRead::ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string file } - f << "\t\t\t\t\t<isotope zamid=\"" << itoa(toplot[j].fZAI.Z()) << itoa(toplot[j].fZAI.A()) << "\">" << endl; + f << "\t\t\t\t\t<isotope zamid = \"" << itoa(toplot[j].fZAI.Z()) << itoa(toplot[j].fZAI.A()) << "\">" << endl; f << "\t\t\t\t\t\t<facility " << name << ">" << "<masse>" << vQuantity[j][i] << "</masse>" << "</facility>" << endl; @@ -2040,14 +2040,14 @@ void CLASSRead::ConvertxmlTTreeMass(vector<CLASSPlotElement> toplot, string file fData[toplot[0].fTreeId]->ResetBranchAddresses(); { - for(int i=0; i< (int)fReactorName[toplot[0].fTreeId].size(); i++) delete reactor[i]; + for(int i = 0; i< (int)fReactorName[toplot[0].fTreeId].size(); i++) delete reactor[i]; - for(int i=0; i< (int)fPoolName[toplot[0].fTreeId].size(); i++) delete pool[i]; + for(int i = 0; i< (int)fPoolName[toplot[0].fTreeId].size(); i++) delete pool[i]; - for(int i=0; i< (int)fFabricationName[toplot[0].fTreeId].size(); i++) delete fabricationplant[i]; + for(int i = 0; i< (int)fFabricationName[toplot[0].fTreeId].size(); i++) delete fabricationplant[i]; - for(int i=0; i< (int)fStockName[toplot[0].fTreeId].size(); i++) delete stock[i]; - for(int i=0; i< 8; i++) delete IV[i]; + for(int i = 0; i< (int)fStockName[toplot[0].fTreeId].size(); i++) delete stock[i]; + for(int i = 0; i< 8; i++) delete IV[i]; } @@ -2070,7 +2070,7 @@ void CLASSRead::ConvertXmlMass(vector<CLASSPlotElement> toplot, string filename) for (int i = 0; i < (int)fData.size(); i++) { - if(toplotTTree[i].size() !=0) + if(toplotTTree[i].size() != 0) ConvertxmlTTreeMass(toplotTTree[i], filename); } @@ -2183,46 +2183,46 @@ string CLASSRead::GetLegendOutName(CLASSPlotElement toplot) case 0: name = "P_{" + itoa(toplot.fTreeId) + "} TOT ^{" + itoa(toplot.fZAI.A()) + "}" + ReadNucleusName[toplot.fZAI.Z()]; - for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; + for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; return name; break; case 1: name = "P_{" + itoa(toplot.fTreeId) + "} INcl ^{" + itoa(toplot.fZAI.A()) + "}" + ReadNucleusName[toplot.fZAI.Z()]; - for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; + for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; return name; break; case 2: name = "P_{" + itoa(toplot.fTreeId) + "} Wst ^{" + itoa(toplot.fZAI.A()) + "}" + ReadNucleusName[toplot.fZAI.Z()]; - for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; + for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; return name; break; case 3: name = "P_{" + itoa(toplot.fTreeId) + "} OUTINCOME ^{" + itoa(toplot.fZAI.A()) + "}" + ReadNucleusName[toplot.fZAI.Z()]; - for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; + for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; break; case 4: name = "P_{" + itoa(toplot.fTreeId) + "} R_{tot} ^{" + itoa(toplot.fZAI.A()) + "}" + ReadNucleusName[toplot.fZAI.Z()]; - for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; + for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; break; case 5: name = "P_{" + itoa(toplot.fTreeId) + "} Pl_{tot} ^{" + itoa(toplot.fZAI.A()) + "}" + ReadNucleusName[toplot.fZAI.Z()]; - for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; + for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; return name; break; case 6: name = "P_{" + itoa(toplot.fTreeId) + "} Stk_{tot} ^{" + itoa(toplot.fZAI.A()) + "}" + ReadNucleusName[toplot.fZAI.Z()]; - for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; + for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; break; case 7: name = "P_{" + itoa(toplot.fTreeId) + "} FP_{tot} ^{" + itoa(toplot.fZAI.A()) + "}" + ReadNucleusName[toplot.fZAI.Z()]; - for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; + for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; return name; break; @@ -2233,23 +2233,23 @@ string CLASSRead::GetLegendOutName(CLASSPlotElement toplot) case 1: name = "P_{" + itoa(toplot.fTreeId) + "} " + fReactorName[toplot.fTreeId][toplot.fFacylityNumber] + " ^{" + itoa(toplot.fZAI.A()) + "}" + ReadNucleusName[toplot.fZAI.Z()]; - for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; + for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; break; case 2: name = "P_{" + itoa(toplot.fTreeId) + "} " + fStockName[toplot.fTreeId][toplot.fFacylityNumber] + " ^{" + itoa(toplot.fZAI.A()) + "}" + ReadNucleusName[toplot.fZAI.Z()]; - for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; + for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; break; case 3: name = "P_{" + itoa(toplot.fTreeId) + "} " + fPoolName[toplot.fTreeId][toplot.fFacylityNumber] + " ^{" + itoa(toplot.fZAI.A()) + "}" + ReadNucleusName[toplot.fZAI.Z()]; - for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; + for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; break; case 4: name = "P_{" + itoa(toplot.fTreeId) + "} " + fFabricationName[toplot.fTreeId][toplot.fFacylityNumber] + " ^{" + itoa(toplot.fZAI.A()) + "}" + ReadNucleusName[toplot.fZAI.Z()]; - for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; + for (int i = 0; i < toplot.fZAI.I(); i++) name+= "*"; break; @@ -2261,17 +2261,17 @@ string CLASSRead::GetLegendOutName(CLASSPlotElement toplot) { case 0: - name+= " Inside"; + name+= " Inside"; return name; break; case 1: - name+= " CumuIN"; + name+= " CumuIN"; return name; break; case 2: - name+= " CumuOUT"; + name+= " CumuOUT"; return name; break; diff --git a/gui/trunk/CLASSWin.cxx b/gui/trunk/CLASSWin.cxx index 6fafadb62..95843eb70 100755 --- a/gui/trunk/CLASSWin.cxx +++ b/gui/trunk/CLASSWin.cxx @@ -66,7 +66,7 @@ const int WIDE = 0; MainWin::MainWin(CLASSRead * DATA,vector<string> VFileName) { - fDATA=DATA; + fDATA = DATA; fSaveFileFormat = "ASCII"; Start( VFileName); } @@ -82,20 +82,20 @@ MainWin::~MainWin() void MainWin::Start(vector<string> VFileName) { - fToxNstep=50; // default number of time step for spent fuel radiotoxicity calculations - fToxTimeFirst=1.0; // default first time for spent fuel radiotoxicity calculations - fToxTimeLast=1.0E08; // default last time for spent fuel radiotoxicity calculations - fMotherIsVisible=false; - fIsByMother=false; - fIsLinear=false; + fToxNstep = 50; // default number of time step for spent fuel radiotoxicity calculations + fToxTimeFirst = 1.0; // default first time for spent fuel radiotoxicity calculations + fToxTimeLast = 1.0E08; // default last time for spent fuel radiotoxicity calculations + fMotherIsVisible = false; + fIsByMother = false; + fIsLinear = false; // // Set the line width for all graph: for PPT presentation a value of 2 is probably better // - fGraphLineWidth = 1; //default=1 + fGraphLineWidth = 1; //default = 1 // // Set the marker size for all graph: for PPT presentation a value of 1 is probably better // - fGraphMarkerSize = 0.5; //default=0.5 + fGraphMarkerSize = 0.5; //default = 0.5 //const TGFont *fontS = gClient->GetFont("-*-helvetica-medium-r-*-*-8-*-*-*-*-*-*"); const TGFont *fontS = gClient->GetFont("-*-helvetica-medium-r-*-*-10-*-*-*-*-*-*"); @@ -160,13 +160,13 @@ void MainWin::Start(vector<string> VFileName) AddFrame(fGeneF0, fL5555); SetHeight(150); SetWidth(60); - int MAXPATHLEN=256; + int MAXPATHLEN = 256; char cDir[MAXPATHLEN]; getcwd(cDir, MAXPATHLEN); stringstream tmp; tmp.str(""); tmp << "CLASSGui " ; - for(int i=0;i<int(VFileName.size());i++) + for(int i = 0;i<int(VFileName.size());i++) tmp << VFileName[i] << " " ; this->SetWindowName(tmp.str().c_str()); @@ -281,8 +281,8 @@ void MainWin::Start(vector<string> VFileName) fDecayOrRadioFrame = new TGGroupFrame(fPlotConfigFoil[1],"Radio-toxicity / decay heat" ); fPlotConfigFoil[1]->AddFrame(fDecayOrRadioFrame,fL5555); - fButtonHeat=new TGRadioButton(fDecayOrRadioFrame,"Decay Heat",M_RADIO_DECAY_HEAT); - fButtonRadiotox=new TGRadioButton(fDecayOrRadioFrame,"Radio-toxicity",M_RADIO_RADIOTOX); + fButtonHeat = new TGRadioButton(fDecayOrRadioFrame,"Decay Heat",M_RADIO_DECAY_HEAT); + fButtonRadiotox = new TGRadioButton(fDecayOrRadioFrame,"Radio-toxicity",M_RADIO_RADIOTOX); fButtonHeat->SetState(kButtonDown); fButtonRadiotox->SetState(kButtonUp); @@ -304,7 +304,7 @@ void MainWin::Start(vector<string> VFileName) fGeneF0->AddFrame(fByMotherMore,fL2222); //the button - fByMotherButton=new TGCheckButton(fByMotherFrame,"By Mother",M_CHECK_BY_MOTHER); + fByMotherButton = new TGCheckButton(fByMotherFrame,"By Mother",M_CHECK_BY_MOTHER); fButtonHeat->SetState(kButtonUp); fByMotherButton->Associate(this); fByMotherFrame->AddFrame(fByMotherButton); @@ -319,7 +319,7 @@ void MainWin::Start(vector<string> VFileName) fScenarTimeCBox->Resize(80,17); int NumOfTimeStep = fDATA->GetTimeVector()[0].size(); - for(int step=0; step<NumOfTimeStep; step++) + for(int step = 0; step<NumOfTimeStep; step++) { stringstream tmp; tmp.str(""); @@ -374,13 +374,13 @@ void MainWin::Start(vector<string> VFileName) ((TGGroupFrame*)fMiscFrame)->SetTextFont(fLabelFontB); fGeneF0->AddFrame(fMiscFrame,fL2222); - fMiscHzFrame=new TGHorizontalFrame(fMiscFrame,400, 50 ); + fMiscHzFrame = new TGHorizontalFrame(fMiscFrame,400, 50 ); fMiscFrame->AddFrame(fMiscHzFrame,fL2222); //misc check buttons - fCheckAMNuc=new TGCheckButton(fMiscHzFrame,"MA",M_CHECK_AM_NUC); - fCheckFPNuc=new TGCheckButton(fMiscHzFrame,"FP",M_CHECK_FP_NUC); - fCheckSumOfSelected=new TGCheckButton(fMiscHzFrame,"Sum of Selected"); + fCheckAMNuc = new TGCheckButton(fMiscHzFrame,"MA",M_CHECK_AM_NUC); + fCheckFPNuc = new TGCheckButton(fMiscHzFrame,"FP",M_CHECK_FP_NUC); + fCheckSumOfSelected = new TGCheckButton(fMiscHzFrame,"Sum of Selected"); fCheckFPNuc->SetFont(fLabelFontS); fCheckAMNuc->SetFont(fLabelFontS); @@ -423,11 +423,11 @@ void MainWin::Start(vector<string> VFileName) MapWindow(); Resize(GetDefaultSize()); // fit to the exact size Move(410,30); - fMainWidth=fGeneF0->GetWidth(); + fMainWidth = fGeneF0->GetWidth(); fGeneF0->HideFrame(fByMotherFrame); //Resize(550,670); // fit to the exact size Resize(GetDefaultSize()); - fMainWidth=fGeneF0->GetWidth(); + fMainWidth = fGeneF0->GetWidth(); } //_____________________________________________________________________________________________ @@ -457,13 +457,13 @@ bool MainWin::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) } nsw = new SubWin("SaveAs", fClient->GetRoot(), this, 200, 200); - if (fSaveFileFormat == "XML") + if (fSaveFileFormat == "XML") Conversionxml(); else - if(fSaveFileName != "" /*&& fSaveFileFormat !=""*/) + if(fSaveFileName != "" /*&& fSaveFileFormat != ""*/) { //si plusieur canvas ouvert sauver l'actif exemple : - string PadName=gPad->GetName(); - //if(PadName=="c_Nuclei") + string PadName = gPad->GetName(); + //if(PadName == "c_Nuclei") fDATA->Write(fSaveFileName, fSaveFileFormat, PadName); } break; @@ -477,7 +477,7 @@ bool MainWin::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) MapWindow(); Resize(fMainWidth,0); fGeneF0->ShowFrame(fByMotherFrame); - fMotherIsVisible=true; + fMotherIsVisible = true; } else { @@ -487,7 +487,7 @@ bool MainWin::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) MapWindow(); fGeneF0->HideFrame(fByMotherFrame); Resize(fMainWidth,0); - fMotherIsVisible=false; + fMotherIsVisible = false; } @@ -513,25 +513,25 @@ bool MainWin::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) case M_CHECK_BY_MOTHER: - if(fByMotherButton->GetState()==kButtonDown ) - fIsByMother=true; + if(fByMotherButton->GetState() == kButtonDown ) + fIsByMother = true; else - fIsByMother=false; + fIsByMother = false; break; case M_CHECK_LINEAR_Tox: - if(fCheckLinear->GetState()==kButtonDown) - fIsLinear=true; + if(fCheckLinear->GetState() == kButtonDown) + fIsLinear = true; else - fIsLinear=false; + fIsLinear = false; break; case M_CHECK_AM_NUC: - if(fCheckAMNuc->GetState()==kButtonDown) + if(fCheckAMNuc->GetState() == kButtonDown) { for( int l = 0; l < (int)fDATA->GetZAIvector().size(); l++ ) { - if(fDATA->GetZAIvector()[l].Z() > 90 && fDATA->GetZAIvector()[l].Z()!=92 && fDATA->GetZAIvector()[l].Z()!=94) + if(fDATA->GetZAIvector()[l].Z() > 90 && fDATA->GetZAIvector()[l].Z() != 92 && fDATA->GetZAIvector()[l].Z() != 94) fCheckArrayNuc[l]->SetState(kButtonDown); } } @@ -539,14 +539,14 @@ bool MainWin::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) { for( int l = 0; l < (int)fDATA->GetZAIvector().size(); l++ ) { - if(fDATA->GetZAIvector()[l].Z() > 90 && fDATA->GetZAIvector()[l].Z()!=92 && fDATA->GetZAIvector()[l].Z()!=94) + if(fDATA->GetZAIvector()[l].Z() > 90 && fDATA->GetZAIvector()[l].Z() != 92 && fDATA->GetZAIvector()[l].Z() != 94) fCheckArrayNuc[l]->SetState(kButtonUp); } } break; case M_CHECK_FP_NUC: - if(fCheckFPNuc->GetState()==kButtonDown) + if(fCheckFPNuc->GetState() == kButtonDown) { for( int l = 0; l < (int)fDATA->GetZAIvector().size(); l++ ) { if( fDATA->GetZAIvector()[l].A() > 50 && fDATA->GetZAIvector()[l].A()< 180 ) @@ -589,25 +589,25 @@ bool MainWin::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) switch (parm1) { case M_TE_toxfirst: // get first time - EnterTextP=TEtoxfirst->GetBuffer()->GetString(); - fToxTimeFirst=StringLine::convert<double>(EnterTextP); // change string in double - if(fToxTimeFirst<=0) + EnterTextP = TEtoxfirst->GetBuffer()->GetString(); + fToxTimeFirst = StringLine::convert<double>(EnterTextP); // change string in double + if(fToxTimeFirst<= 0) { - fToxTimeFirst=Xlogmin; + fToxTimeFirst = Xlogmin; TEtoxfirst->SetText(StringLine::convert<string>(fToxTimeFirst).c_str()); } break; case M_TE_toxlast: // get last time - EnterTextP=TEtoxlast->GetBuffer()->GetString(); - fToxTimeLast=StringLine::convert<double>(EnterTextP); + EnterTextP = TEtoxlast->GetBuffer()->GetString(); + fToxTimeLast = StringLine::convert<double>(EnterTextP); break; case M_TE_toxnstep: // get number of time steps - EnterTextP=TEtoxnstep->GetBuffer()->GetString(); - fToxNstep=StringLine::convert<int>(EnterTextP); + EnterTextP = TEtoxnstep->GetBuffer()->GetString(); + fToxNstep = StringLine::convert<int>(EnterTextP); break; } @@ -639,14 +639,14 @@ void MainWin::Plot() vector<CLASSPlotElement> toplot; vector<CLASSPlotElement> toplotPower; - if(fCheckSumOfSelected->GetState()==kButtonDown) + if(fCheckSumOfSelected->GetState() == kButtonDown) { toplot.push_back( CLASSPlotElement(-1, -1, -1, -1,-1,-1,-1) ); } //Power - for(int i=0; i < fNumberOfParc; i++) + for(int i = 0; i < fNumberOfParc; i++) { - if(fCheckArrayTotal[i][fNumberOfTOT-1]->GetState()==kButtonDown) + if(fCheckArrayTotal[i][fNumberOfTOT-1]->GetState() == kButtonDown) toplotPower.push_back( CLASSPlotElement(i, -2, -2, -2,-2,-2,-2) ); } @@ -655,113 +655,113 @@ void MainWin::Plot() fDATA->PlotPower(toplotPower); - for(int i=0; i < fNumberOfParc; i++) + for(int i = 0; i < fNumberOfParc; i++) { - for(int j=0; j < fNumberOfTOT-1; j++) //fNumberOfTOT -1 ?? ->All except power + for(int j = 0; j < fNumberOfTOT-1; j++) //fNumberOfTOT -1 ?? ->All except power { - if(fCheckArrayTotal[i][j]->GetState()==kButtonDown) - for(int k=0; k < Nnucleus; k++) + if(fCheckArrayTotal[i][j]->GetState() == kButtonDown) + for(int k = 0; k < Nnucleus; k++) { - if(fCheckArrayNuc[k]->GetState()==kButtonDown) + if(fCheckArrayNuc[k]->GetState() == kButtonDown) toplot.push_back( CLASSPlotElement(i, 0, j,0, fDATA->GetZAIvector()[k])); } } - for(int j=0; j < fNumberOfReactor[i]; j++) + for(int j = 0; j < fNumberOfReactor[i]; j++) { - if(fCheckArrayReactor[i][j]->GetState()==kButtonDown) + if(fCheckArrayReactor[i][j]->GetState() == kButtonDown) { - if(fButtonRadiotox->GetState()==kButtonDown || fButtonHeat->GetState()==kButtonDown) + if(fButtonRadiotox->GetState() == kButtonDown || fButtonHeat->GetState() == kButtonDown) { - for(int k=0; k < Nnucleus; k++) + for(int k = 0; k < Nnucleus; k++) { - if(fCheckArrayNuc[k]->GetState()==kButtonDown) + if(fCheckArrayNuc[k]->GetState() == kButtonDown) toplot.push_back( CLASSPlotElement(i,1,j,0, fDATA->GetZAIvector()[k])); } } else { - for(int l=0;l<3;l++) - if (fCheckIVPlot[l]->GetState()==kButtonDown) - for(int k=0; k < Nnucleus; k++) + for(int l = 0;l<3;l++) + if (fCheckIVPlot[l]->GetState() == kButtonDown) + for(int k = 0; k < Nnucleus; k++) { - if(fCheckArrayNuc[k]->GetState()==kButtonDown) + if(fCheckArrayNuc[k]->GetState() == kButtonDown) toplot.push_back( CLASSPlotElement(i,1,j,l, fDATA->GetZAIvector()[k])); } } } } - for(int j=0; j < fNumberOfStock[i]; j++) + for(int j = 0; j < fNumberOfStock[i]; j++) { - if(fCheckArrayStock[i][j]->GetState()==kButtonDown) + if(fCheckArrayStock[i][j]->GetState() == kButtonDown) { - if(fButtonRadiotox->GetState()==kButtonDown || fButtonHeat->GetState()==kButtonDown) + if(fButtonRadiotox->GetState() == kButtonDown || fButtonHeat->GetState() == kButtonDown) { - for(int k=0; k < Nnucleus; k++) + for(int k = 0; k < Nnucleus; k++) { - if(fCheckArrayNuc[k]->GetState()==kButtonDown) + if(fCheckArrayNuc[k]->GetState() == kButtonDown) toplot.push_back( CLASSPlotElement(i,2,j,0, fDATA->GetZAIvector()[k])); } } else { - for(int l=0;l<3;l++) - if (fCheckIVPlot[l]->GetState()==kButtonDown) - for(int k=0; k < Nnucleus; k++) + for(int l = 0;l<3;l++) + if (fCheckIVPlot[l]->GetState() == kButtonDown) + for(int k = 0; k < Nnucleus; k++) { - if(fCheckArrayNuc[k]->GetState()==kButtonDown) + if(fCheckArrayNuc[k]->GetState() == kButtonDown) toplot.push_back( CLASSPlotElement(i,2,j,l, fDATA->GetZAIvector()[k])); } } } } - for(int j=0; j < fNumberOfPool[i]; j++) + for(int j = 0; j < fNumberOfPool[i]; j++) { - if(fCheckArrayPool[i][j]->GetState()==kButtonDown) + if(fCheckArrayPool[i][j]->GetState() == kButtonDown) { - if(fButtonRadiotox->GetState()==kButtonDown || fButtonHeat->GetState()==kButtonDown) + if(fButtonRadiotox->GetState() == kButtonDown || fButtonHeat->GetState() == kButtonDown) { - for(int k=0; k < Nnucleus; k++) + for(int k = 0; k < Nnucleus; k++) { - if(fCheckArrayNuc[k]->GetState()==kButtonDown) + if(fCheckArrayNuc[k]->GetState() == kButtonDown) toplot.push_back( CLASSPlotElement(i,3,j,0, fDATA->GetZAIvector()[k])); } } else { - for(int l=0;l<3;l++) - if (fCheckIVPlot[l]->GetState()==kButtonDown) - for(int k=0; k < Nnucleus; k++) + for(int l = 0;l<3;l++) + if (fCheckIVPlot[l]->GetState() == kButtonDown) + for(int k = 0; k < Nnucleus; k++) { - if(fCheckArrayNuc[k]->GetState()==kButtonDown) + if(fCheckArrayNuc[k]->GetState() == kButtonDown) toplot.push_back( CLASSPlotElement(i,3,j,l, fDATA->GetZAIvector()[k])); } } } } - for(int j=0; j < fNumberOfFab[i]; j++) + for(int j = 0; j < fNumberOfFab[i]; j++) { - if(fCheckArrayFab[i][j]->GetState()==kButtonDown) + if(fCheckArrayFab[i][j]->GetState() == kButtonDown) { - if(fButtonRadiotox->GetState()==kButtonDown || fButtonHeat->GetState()==kButtonDown) + if(fButtonRadiotox->GetState() == kButtonDown || fButtonHeat->GetState() == kButtonDown) { - for(int k=0; k < Nnucleus; k++) + for(int k = 0; k < Nnucleus; k++) { - if(fCheckArrayNuc[k]->GetState()==kButtonDown) + if(fCheckArrayNuc[k]->GetState() == kButtonDown) toplot.push_back( CLASSPlotElement(i,4,j,0, fDATA->GetZAIvector()[k])); } } else { - for(int l=0;l<3;l++) - if (fCheckIVPlot[l]->GetState()==kButtonDown) - for(int k=0; k < Nnucleus; k++) + for(int l = 0;l<3;l++) + if (fCheckIVPlot[l]->GetState() == kButtonDown) + for(int k = 0; k < Nnucleus; k++) { - if(fCheckArrayNuc[k]->GetState()==kButtonDown) + if(fCheckArrayNuc[k]->GetState() == kButtonDown) toplot.push_back( CLASSPlotElement(i,4,j,l, fDATA->GetZAIvector()[k])); } } @@ -771,7 +771,7 @@ void MainWin::Plot() int StartingStep = fTimeStep; - cSecond FinalTime =(cSecond) fToxTimeLast * cYear; + cSecond FinalTime = (cSecond) fToxTimeLast * cYear; int NStep = fToxNstep; bool IsLinear = fIsLinear; if(!fIsByMother) @@ -787,16 +787,16 @@ void MainWin::Plot() { for(int i = 0 ; i<3 ; i++ ) { - if(fCheckIVPlot[i]->GetState()==kButtonDown) + if(fCheckIVPlot[i]->GetState() == kButtonDown) { fDATA->PlotInv(toplot,fIsByMother,StartingStep,FinalTime,NStep,IsLinear); break; } } - if(fButtonRadiotox->GetState()==kButtonDown) + if(fButtonRadiotox->GetState() == kButtonDown) fDATA->PlotTox(toplot,fIsByMother,StartingStep,FinalTime,NStep,IsLinear); - if(fButtonHeat->GetState()==kButtonDown) + if(fButtonHeat->GetState() == kButtonDown) fDATA->PlotHeat(toplot,fIsByMother,StartingStep,FinalTime,NStep,IsLinear); } @@ -810,65 +810,65 @@ void MainWin::Conversionxml() vector<CLASSPlotElement> toplot; vector<CLASSPlotElement> toplotPower; - for(int i=0; i < fNumberOfParc; i++) + for(int i = 0; i < fNumberOfParc; i++) { - for(int j=0; j < fNumberOfTOT-1; j++) //fNumberOfTOT -1 ?? ->All except power + for(int j = 0; j < fNumberOfTOT-1; j++) //fNumberOfTOT -1 ?? ->All except power { - if(fCheckArrayTotal[i][j]->GetState()==kButtonDown) - for(int k=0; k < Nnucleus; k++) + if(fCheckArrayTotal[i][j]->GetState() == kButtonDown) + for(int k = 0; k < Nnucleus; k++) { - if(fCheckArrayNuc[k]->GetState()==kButtonDown) + if(fCheckArrayNuc[k]->GetState() == kButtonDown) toplot.push_back( CLASSPlotElement(i, 0, j,0, fDATA->GetZAIvector()[k])); } } - for(int j=0; j < fNumberOfReactor[i]; j++) + for(int j = 0; j < fNumberOfReactor[i]; j++) { - if(fCheckArrayReactor[i][j]->GetState()==kButtonDown) + if(fCheckArrayReactor[i][j]->GetState() == kButtonDown) { - for(int l =0;l<3;l++) - if (fCheckIVPlot[l]->GetState()==kButtonDown) - for(int k=0; k < Nnucleus; k++) + for(int l = 0;l<3;l++) + if (fCheckIVPlot[l]->GetState() == kButtonDown) + for(int k = 0; k < Nnucleus; k++) { - if(fCheckArrayNuc[k]->GetState()==kButtonDown) + if(fCheckArrayNuc[k]->GetState() == kButtonDown) toplot.push_back( CLASSPlotElement(i, 1, j,l, fDATA->GetZAIvector()[k])); } } } - for(int j=0; j < fNumberOfStock[i]; j++) + for(int j = 0; j < fNumberOfStock[i]; j++) { - if(fCheckArrayStock[i][j]->GetState()==kButtonDown) - for(int l =0;l<3;l++) - if (fCheckIVPlot[l]->GetState()==kButtonDown) - for(int k=0; k < Nnucleus; k++) + if(fCheckArrayStock[i][j]->GetState() == kButtonDown) + for(int l = 0;l<3;l++) + if (fCheckIVPlot[l]->GetState() == kButtonDown) + for(int k = 0; k < Nnucleus; k++) { - if(fCheckArrayNuc[k]->GetState()==kButtonDown) + if(fCheckArrayNuc[k]->GetState() == kButtonDown) toplot.push_back( CLASSPlotElement(i, 2, j,l, fDATA->GetZAIvector()[k])); } } - for(int j=0; j < fNumberOfPool[i]; j++) + for(int j = 0; j < fNumberOfPool[i]; j++) { - if(fCheckArrayPool[i][j]->GetState()==kButtonDown) - for(int l =0;l<3;l++) - if (fCheckIVPlot[l]->GetState()==kButtonDown) - for(int k=0; k < Nnucleus; k++) + if(fCheckArrayPool[i][j]->GetState() == kButtonDown) + for(int l = 0;l<3;l++) + if (fCheckIVPlot[l]->GetState() == kButtonDown) + for(int k = 0; k < Nnucleus; k++) { - if(fCheckArrayNuc[k]->GetState()==kButtonDown) + if(fCheckArrayNuc[k]->GetState() == kButtonDown) toplot.push_back( CLASSPlotElement(i, 3, j,l, fDATA->GetZAIvector()[k])); } } - for(int j=0; j < fNumberOfFab[i]; j++) + for(int j = 0; j < fNumberOfFab[i]; j++) { - if(fCheckArrayFab[i][j]->GetState()==kButtonDown) - for(int l =0;l<3;l++) - if (fCheckIVPlot[l]->GetState()==kButtonDown) - for(int k=0; k < Nnucleus; k++) + if(fCheckArrayFab[i][j]->GetState() == kButtonDown) + for(int l = 0;l<3;l++) + if (fCheckIVPlot[l]->GetState() == kButtonDown) + for(int k = 0; k < Nnucleus; k++) { - if(fCheckArrayNuc[k]->GetState()==kButtonDown) + if(fCheckArrayNuc[k]->GetState() == kButtonDown) toplot.push_back( CLASSPlotElement(i, 4, j,l, fDATA->GetZAIvector()[k])); } } @@ -882,7 +882,7 @@ void MainWin::Conversionxml() //_____________________________________________________________________________________________ void MainWin::FillNucTab() // fill the Inventory Tab foil { - static bool first=true; + static bool first = true; int NCheck = fDATA->GetZAIvector().size(); //number of lines and columns per foil @@ -939,7 +939,7 @@ void MainWin::FillNucTab() // fill the Inventory Tab foil fTabFoilNuc[l]->Layout(); } //select the second foil then the first foil to avoid "save char in back ground storage" - first=false; + first = false; } @@ -953,20 +953,20 @@ void MainWin::FillNucFoil(int n_item, int Ncol,int Nline) stringstream name; int Atmp = fDATA->GetZAIvector()[l].A(); - if(Atmp !=0) + if(Atmp != 0) { - if(fDATA->GetZAIvector()[l].Z() == -3) + if(fDATA->GetZAIvector()[l].Z() == -3) { name << Atmp << "TMP"; //@@@@ } - else if(fDATA->GetZAIvector()[l].Z() == -2) + else if(fDATA->GetZAIvector()[l].Z() == -2) { name << Atmp << "PF"; //@@@@ } - else if(fDATA->GetZAIvector()[l].Z() == -1) + else if(fDATA->GetZAIvector()[l].Z() == -1) { name << Atmp << "ERR"; //@@@@ @@ -1000,15 +1000,15 @@ void MainWin::FillNucFoil(int n_item, int Ncol,int Nline) //_____________________________________________________________________________________________ void MainWin::FillItemTab(int current) { - if (current==0) + if (current == 0) FillTotalTab(); - if (current==1) + if (current == 1) FillReactorTab(); - if (current==2) + if (current == 2) FillStockTab(); - if (current==3) + if (current == 3) FillPoolTab(); - if (current==4) + if (current == 4) FillFabricationTab(); if(current>5 || current<0) @@ -1021,25 +1021,25 @@ void MainWin::FillItemTab(int current) void MainWin::FillTotalTab() { fCheckArrayTotal = new TGCheckButton**[fNumberOfParc]; - for(int i=0;i< fNumberOfParc;i++) - fCheckArrayTotal[i]= new TGCheckButton*[fNumberOfTOT]; - double count=0; - for(int p=0; p<fNumberOfParc; p++) + for(int i = 0;i< fNumberOfParc;i++) + fCheckArrayTotal[i] = new TGCheckButton*[fNumberOfTOT]; + double count = 0; + for(int p = 0; p<fNumberOfParc; p++) { - for(int i=0; i < fNumberOfTOT; i++) + for(int i = 0; i < fNumberOfTOT; i++) { string name; - if(i==0) name="TOTAL"; - if(i==1) name="INCYCLE"; - if(i==2) name="WASTE"; - if(i==3) name="OUTINCOME"; - if(i==4) name="REACTOR"; - if(i==5) name="COOLING"; - if(i==6) name="STOCK"; - if(i==7) name="FUELFABRICATION"; - if(i==8) name="POWER"; + if(i == 0) name = "TOTAL"; + if(i == 1) name = "INCYCLE"; + if(i == 2) name = "WASTE"; + if(i == 3) name = "OUTINCOME"; + if(i == 4) name = "REACTOR"; + if(i == 5) name = "COOLING"; + if(i == 6) name = "STOCK"; + if(i == 7) name = "FUELFABRICATION"; + if(i == 8) name = "POWER"; - fCheckArrayTotal[p][i]=new TGCheckButton(fFacilitiesTabFoil[p][0],name.c_str()); + fCheckArrayTotal[p][i] = new TGCheckButton(fFacilitiesTabFoil[p][0],name.c_str()); fCheckArrayTotal[p][i]->SetFont(fLabelFontS); fFacilitiesTabFoil[p][0]->AddFrame(fCheckArrayTotal[p][i]); fCheckArrayTotal[p][i]->Associate(this); @@ -1053,32 +1053,32 @@ void MainWin::FillTotalTab() //_____________________________________________________________________________________________ void MainWin::FillReactorTab() { - int Nline=7-WIDE; - int Ncol=6+WIDE; + int Nline = 7-WIDE; + int Ncol = 6+WIDE; - fTabFoilReactor= new TGCompositeFrame**[fNumberOfParc]; - fCheckArrayReactor= new TGCheckButton**[fNumberOfParc]; - int *NTab=new int[fNumberOfParc]; + fTabFoilReactor = new TGCompositeFrame**[fNumberOfParc]; + fCheckArrayReactor = new TGCheckButton**[fNumberOfParc]; + int *NTab = new int[fNumberOfParc]; - for (int i=0 ; i<fNumberOfParc;i++) + for (int i = 0 ; i<fNumberOfParc;i++) { - NTab[i]=fNumberOfReactor[i]/(Nline*Ncol)+1; - fTabFoilReactor[i]= new TGCompositeFrame*[NTab[i]]; - fCheckArrayReactor[i]= new TGCheckButton*[fNumberOfReactor[i]]; + NTab[i] = fNumberOfReactor[i]/(Nline*Ncol)+1; + fTabFoilReactor[i] = new TGCompositeFrame*[NTab[i]]; + fCheckArrayReactor[i] = new TGCheckButton*[fNumberOfReactor[i]]; } - for (int p=0;p<fNumberOfParc;p++) + for (int p = 0;p<fNumberOfParc;p++) { string TabName[NTab[p]]; - for(int l=0; l<NTab[p] ; l++) + for(int l = 0; l<NTab[p] ; l++) { stringstream tmp; tmp << "Reactor " << l; - TabName[l]=tmp.str(); + TabName[l] = tmp.str(); //cout << l << " " << TabName[l] << endl; fTabFoilReactor[p][l] = fItemTab[p][1]->AddTab(TabName[l].c_str()); @@ -1087,16 +1087,16 @@ void MainWin::FillReactorTab() } - for (int p=0;p<fNumberOfParc;p++) + for (int p = 0;p<fNumberOfParc;p++) { - int current_foil=0; - int current_item=0; - int current_item_in_the_foil=0; - for(int n=0;n<fNumberOfReactor[p];n++) + int current_foil = 0; + int current_item = 0; + int current_item_in_the_foil = 0; + for(int n = 0;n<fNumberOfReactor[p];n++) { - fCheckArrayReactor[p][current_item]= new TGCheckButton(fTabFoilReactor[p][current_foil],fDATA->GetReactorName()[p][n]); + fCheckArrayReactor[p][current_item] = new TGCheckButton(fTabFoilReactor[p][current_foil],fDATA->GetReactorName()[p][n]); fCheckArrayReactor[p][current_item]->SetFont(fLabelFontS); fTabFoilReactor[p][current_foil]->AddFrame(fCheckArrayReactor[p][current_item]); @@ -1104,9 +1104,9 @@ void MainWin::FillReactorTab() current_item_in_the_foil++; current_item++; - if(current_item_in_the_foil>=Ncol*Nline) + if(current_item_in_the_foil>= Ncol*Nline) { - current_item_in_the_foil=0; + current_item_in_the_foil = 0; current_foil++; } @@ -1118,46 +1118,46 @@ void MainWin::FillReactorTab() //_____________________________________________________________________________________________ void MainWin::FillStockTab() { - int Nline=7-WIDE; - int Ncol=6+WIDE; + int Nline = 7-WIDE; + int Ncol = 6+WIDE; - fTabFoilStock= new TGCompositeFrame**[fNumberOfParc]; - fCheckArrayStock= new TGCheckButton**[fNumberOfParc]; - int *NTab=new int[fNumberOfParc]; + fTabFoilStock = new TGCompositeFrame**[fNumberOfParc]; + fCheckArrayStock = new TGCheckButton**[fNumberOfParc]; + int *NTab = new int[fNumberOfParc]; - for (int i=0 ; i<fNumberOfParc;i++) + for (int i = 0 ; i<fNumberOfParc;i++) { - NTab[i]=fNumberOfStock[i]/(Nline*Ncol)+1; - fTabFoilStock[i]= new TGCompositeFrame*[NTab[i]]; - fCheckArrayStock[i]= new TGCheckButton*[fNumberOfStock[i]]; + NTab[i] = fNumberOfStock[i]/(Nline*Ncol)+1; + fTabFoilStock[i] = new TGCompositeFrame*[NTab[i]]; + fCheckArrayStock[i] = new TGCheckButton*[fNumberOfStock[i]]; } - for (int p=0;p<fNumberOfParc;p++) + for (int p = 0;p<fNumberOfParc;p++) { string TabName[NTab[p]]; - for(int l=0; l<NTab[p] ; l++) + for(int l = 0; l<NTab[p] ; l++) { stringstream tmp; tmp.str(""); tmp << "Stock " << l; - TabName[l]=tmp.str(); - fTabFoilStock[p][l]=fItemTab[p][2]->AddTab(TabName[l].c_str()); + TabName[l] = tmp.str(); + fTabFoilStock[p][l] = fItemTab[p][2]->AddTab(TabName[l].c_str()); fTabFoilStock[p][l]->SetLayoutManager(new TGMatrixLayout(fTabFoilStock[p][l], Nline, 0, 5)); } } - for (int p=0;p<fNumberOfParc;p++) + for (int p = 0;p<fNumberOfParc;p++) { - int current_foil=0; - int current_item=0; - int current_item_in_the_foil=0; - for(int n=0;n<fNumberOfStock[p];n++) + int current_foil = 0; + int current_item = 0; + int current_item_in_the_foil = 0; + for(int n = 0;n<fNumberOfStock[p];n++) { - fCheckArrayStock[p][current_item]= new TGCheckButton(fTabFoilStock[p][current_foil],fDATA->GetStockName()[p][n]); + fCheckArrayStock[p][current_item] = new TGCheckButton(fTabFoilStock[p][current_foil],fDATA->GetStockName()[p][n]); fCheckArrayStock[p][current_item]->SetFont(fLabelFontS); fTabFoilStock[p][current_foil]->AddFrame(fCheckArrayStock[p][current_item]); @@ -1165,9 +1165,9 @@ void MainWin::FillStockTab() current_item_in_the_foil++; current_item++; - if(current_item_in_the_foil>=Ncol*Nline) + if(current_item_in_the_foil>= Ncol*Nline) { - current_item_in_the_foil=0; + current_item_in_the_foil = 0; current_foil++; } @@ -1179,47 +1179,47 @@ void MainWin::FillStockTab() //_____________________________________________________________________________________________ void MainWin::FillPoolTab() { - int Nline=7-WIDE; - int Ncol=6+WIDE; + int Nline = 7-WIDE; + int Ncol = 6+WIDE; - fTabFoilPool= new TGCompositeFrame**[fNumberOfParc]; - fCheckArrayPool= new TGCheckButton**[fNumberOfParc]; - int *NTab=new int[fNumberOfParc]; + fTabFoilPool = new TGCompositeFrame**[fNumberOfParc]; + fCheckArrayPool = new TGCheckButton**[fNumberOfParc]; + int *NTab = new int[fNumberOfParc]; - for (int i=0 ; i<fNumberOfParc;i++) + for (int i = 0 ; i<fNumberOfParc;i++) { - NTab[i]=fNumberOfPool[i]/(Nline*Ncol)+1; - fTabFoilPool[i]= new TGCompositeFrame*[NTab[i]]; - fCheckArrayPool[i]= new TGCheckButton*[fNumberOfPool[i]]; + NTab[i] = fNumberOfPool[i]/(Nline*Ncol)+1; + fTabFoilPool[i] = new TGCompositeFrame*[NTab[i]]; + fCheckArrayPool[i] = new TGCheckButton*[fNumberOfPool[i]]; } - for (int p=0;p<fNumberOfParc;p++) + for (int p = 0;p<fNumberOfParc;p++) { string TabName[NTab[p]]; - for(int l=0; l<NTab[p] ; l++) + for(int l = 0; l<NTab[p] ; l++) { stringstream tmp; tmp.str(""); tmp << "Pool " << l; - TabName[l]=tmp.str(); - fTabFoilPool[p][l]=fItemTab[p][3]->AddTab(TabName[l].c_str()); + TabName[l] = tmp.str(); + fTabFoilPool[p][l] = fItemTab[p][3]->AddTab(TabName[l].c_str()); fTabFoilPool[p][l]->SetLayoutManager(new TGMatrixLayout(fTabFoilPool[p][l], Nline, 0, 5)); } } - for (int p=0;p<fNumberOfParc;p++) + for (int p = 0;p<fNumberOfParc;p++) { - int current_foil=0; - int current_item=0; - int current_item_in_the_foil=0; - for(int n=0;n<fNumberOfPool[p];n++) + int current_foil = 0; + int current_item = 0; + int current_item_in_the_foil = 0; + for(int n = 0;n<fNumberOfPool[p];n++) { - fCheckArrayPool[p][current_item]= new TGCheckButton(fTabFoilPool[p][current_foil],fDATA->GetPoolName()[p][n]); + fCheckArrayPool[p][current_item] = new TGCheckButton(fTabFoilPool[p][current_foil],fDATA->GetPoolName()[p][n]); fCheckArrayPool[p][current_item]->SetFont(fLabelFontS); fTabFoilPool[p][current_foil]->AddFrame(fCheckArrayPool[p][current_item]); @@ -1227,9 +1227,9 @@ void MainWin::FillPoolTab() current_item_in_the_foil++; current_item++; - if(current_item_in_the_foil>=Ncol*Nline) + if(current_item_in_the_foil>= Ncol*Nline) { - current_item_in_the_foil=0; + current_item_in_the_foil = 0; current_foil++; } @@ -1241,47 +1241,47 @@ void MainWin::FillPoolTab() //_____________________________________________________________________________________________ void MainWin::FillFabricationTab() { - int Nline=7-WIDE; - int Ncol=6+WIDE; + int Nline = 7-WIDE; + int Ncol = 6+WIDE; - fTabFoilFab= new TGCompositeFrame**[fNumberOfParc]; - fCheckArrayFab= new TGCheckButton**[fNumberOfParc]; - int *NTab=new int[fNumberOfParc]; + fTabFoilFab = new TGCompositeFrame**[fNumberOfParc]; + fCheckArrayFab = new TGCheckButton**[fNumberOfParc]; + int *NTab = new int[fNumberOfParc]; - for (int i=0 ; i<fNumberOfParc;i++) + for (int i = 0 ; i<fNumberOfParc;i++) { - NTab[i]=fNumberOfFab[i]/(Nline*Ncol)+1; - fTabFoilFab[i]= new TGCompositeFrame*[NTab[i]]; - fCheckArrayFab[i]= new TGCheckButton*[fNumberOfFab[i]]; + NTab[i] = fNumberOfFab[i]/(Nline*Ncol)+1; + fTabFoilFab[i] = new TGCompositeFrame*[NTab[i]]; + fCheckArrayFab[i] = new TGCheckButton*[fNumberOfFab[i]]; } - for (int p=0;p<fNumberOfParc;p++) + for (int p = 0;p<fNumberOfParc;p++) { string TabName[NTab[p]]; - for(int l=0; l<NTab[p] ; l++) + for(int l = 0; l<NTab[p] ; l++) { stringstream tmp; tmp.str(""); tmp << "Fab " << l; - TabName[l]=tmp.str(); - fTabFoilFab[p][l]=fItemTab[p][4]->AddTab(TabName[l].c_str()); + TabName[l] = tmp.str(); + fTabFoilFab[p][l] = fItemTab[p][4]->AddTab(TabName[l].c_str()); fTabFoilFab[p][l]->SetLayoutManager(new TGMatrixLayout(fTabFoilFab[p][l], Nline, 0, 5)); } } - for (int p=0;p<fNumberOfParc;p++) + for (int p = 0;p<fNumberOfParc;p++) { - int current_foil=0; - int current_item=0; - int current_item_in_the_foil=0; - for(int n=0;n<fNumberOfFab[p];n++) + int current_foil = 0; + int current_item = 0; + int current_item_in_the_foil = 0; + for(int n = 0;n<fNumberOfFab[p];n++) { - fCheckArrayFab[p][current_item]= new TGCheckButton(fTabFoilFab[p][current_foil],fDATA->GetFabricationName()[p][n]); + fCheckArrayFab[p][current_item] = new TGCheckButton(fTabFoilFab[p][current_foil],fDATA->GetFabricationName()[p][n]); fCheckArrayFab[p][current_item]->SetFont(fLabelFontS); fTabFoilFab[p][current_foil]->AddFrame(fCheckArrayFab[p][current_item]); @@ -1289,9 +1289,9 @@ void MainWin::FillFabricationTab() current_item_in_the_foil++; current_item++; - if(current_item_in_the_foil>=Ncol*Nline) + if(current_item_in_the_foil>= Ncol*Nline) { - current_item_in_the_foil=0; + current_item_in_the_foil = 0; current_foil++; } @@ -1304,25 +1304,25 @@ void MainWin::FillFabricationTab() SubWin::SubWin(string event, const TGWindow *p, const TGWindow *main, UInt_t w,UInt_t h,UInt_t options ): TGTransientFrame(p, main, w, h, options) { - fParent=(MainWin*)main; + fParent = (MainWin*)main; fS0 = new TGCompositeFrame(this, 50, 20, kVerticalFrame); - fL0= new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX , 2, 2, 2, 2); + fL0 = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX , 2, 2, 2, 2); AddFrame(fS0, fL0); - fSH1=new TGHorizontalFrame(fS0, 200, 20); + fSH1 = new TGHorizontalFrame(fS0, 200, 20); fS0->AddFrame(fSH1,fL0); - fLmsg=0; - TEName=0; + fLmsg = 0; + TEName = 0; - if(event=="SaveAs") SaveAs(); + if(event == "SaveAs") SaveAs(); // Frame for Ok/Cancel button // - fSH2=new TGHorizontalFrame(this, 100, 20,kFixedWidth); + fSH2 = new TGHorizontalFrame(this, 100, 20,kFixedWidth); AddFrame(fSH2,new TGLayoutHints(kLHintsBottom | kLHintsRight,0,0,10,0)); fButtonOK = new TGTextButton(fSH2, "&Ok",M_BUT_OK); - fButtonCan= new TGTextButton(fSH2,"&Cancel",M_BUT_CANCEL); + fButtonCan = new TGTextButton(fSH2,"&Cancel",M_BUT_CANCEL); fSH2->AddFrame(fButtonOK, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX,2, 2, 2, 2)); fSH2->AddFrame(fButtonCan, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX,2, 2, 2, 2)); fButtonOK->Associate(this); @@ -1350,7 +1350,7 @@ TGTransientFrame(p, main, w, h, options) //_____________________________________________________________________________________________ void SubWin::SaveAs() { - fLmsg=new TGLabel(fSH1, new TGString("File Name:")); + fLmsg = new TGLabel(fSH1, new TGString("File Name:")); fSH1->AddFrame(fLmsg, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2)); TGTextBuffer *TBName = new TGTextBuffer(100); TBName->AddText(0, ""); @@ -1359,8 +1359,8 @@ void SubWin::SaveAs() fSH1->AddFrame(TEName, fL0); TEName->Associate(this); - fRadioASCIISave=new TGRadioButton(fSH1,"ASCII",M_RADIO_ASCII_SAVE); - fRadioXMLSave=new TGRadioButton(fSH1,"XML",M_RADIO_XML_SAVE); + fRadioASCIISave = new TGRadioButton(fSH1,"ASCII",M_RADIO_ASCII_SAVE); + fRadioXMLSave = new TGRadioButton(fSH1,"XML",M_RADIO_XML_SAVE); fRadioASCIISave->SetState(kButtonDown); fRadioASCIISave->Associate(this); fRadioXMLSave->Associate(this); @@ -1406,12 +1406,12 @@ Bool_t SubWin::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) case M_RADIO_ASCII_SAVE: fRadioASCIISave->SetState(kButtonDown); fRadioXMLSave->SetState(kButtonUp); - fParent->fSaveFileFormat="ASCII"; + fParent->fSaveFileFormat = "ASCII"; break; case M_RADIO_XML_SAVE: fRadioASCIISave->SetState(kButtonUp); fRadioXMLSave->SetState(kButtonDown); - fParent->fSaveFileFormat="XML"; + fParent->fSaveFileFormat = "XML"; break; } case kCM_BUTTON: @@ -1422,7 +1422,7 @@ Bool_t SubWin::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) break; case M_BUT_OK: if(TEName) - fParent->fSaveFileName=TEName->GetBuffer()->GetString(); + fParent->fSaveFileName = TEName->GetBuffer()->GetString(); CloseWindow(); break; diff --git a/gui/trunk/CLASSWin.hxx b/gui/trunk/CLASSWin.hxx index fbf00bf1b..999cbf2c6 100755 --- a/gui/trunk/CLASSWin.hxx +++ b/gui/trunk/CLASSWin.hxx @@ -54,7 +54,7 @@ using namespace std; //Here is the widget code: it correspond to signal emitted when a widget is activated enum CommandId{ - M_BUTTON_PLOT=20, + M_BUTTON_PLOT = 20, M_BUTTON_SAVE, M_BUTTON_MACRO, M_BUTTON_QUIT, -- GitLab