{ // Header gROOT->Reset(); gROOT->SetStyle("Plain"); #include "Riostream.h"; // Konstanten & Arrays Int_t files=8; Int_t lines = 2046; Double_t x1[lines], y1[lines], z1[lines]; Double_t x2[lines], y2[lines], z2[lines]; Double_t x3[lines], y3[lines], z3[lines]; Double_t x4[lines], y4[lines], z4[lines]; Double_t x5[lines], y5[lines], z5[lines]; Double_t x6[lines], y6[lines], z6[lines]; Double_t x7[lines], y7[lines], z7[lines]; Double_t x8[lines], y8[lines], z8[lines]; // Iteration über alle files for(Int_t i=1;i<=files;i++) { TString filename = "wic_"; filename +=i; filename +=".tab"; cout << filename; TString tempX = "x"; tempX +=i; tempX +="[n]"; TString tempY = "y"; tempY +=i; tempY +="[n]"; TString tempZ = "z"; tempZ +=i; tempZ +="[n]"; cout << " --- Datensatz: " << tempX << ", " << tempY << ", " << tempZ << endl; //Daten einlesen ifstream in; in.open(filename); Int_t n = 0; while (1) { in >> tempX >> tempY >> tempZ; if(!in.good()) break; //cout << "x" << i << "[n] = " << tempX << " <--> " << "y" << i << "[n] = " << tempY << endl; n++; } in.close(); // Canvas & Style TCanvas *c[files]; c[i] = new TCanvas(Form("c%d",i), Form("Canvas %d", i), 600, 400); TPad *pad_a[files]; TPad *pad_b[files]; pad_a[i] = new TPad(Form("pad%d_a",i),"",0,0,1,1); pad_b[i] = new TPad(Form("pad%d_b",i),"",0,0,1,1); pad_b[i]->SetFillStyle(4000); pad_b[i]->SetFrameFillStyle(0); //TLegend *leg = new TLegend(0.6,0.86,0.93,0.995,header=0,option = "NDC"); // Graphs TGraph *chaos[files]; TGraph *treib[files]; chaos[i] = new TGraph(n, Form("x%d[n]",i), Form("y%d[n]",i)); treib[i] = new TGraph(n, Form("x%d[n]",i), Form("y%d[n]",i)); chaos[i]->GetXaxis()->SetTitle("t / s"); chaos[i]->GetYaxis()->SetTitle("U / V"); treib[i]->GetYaxis()->SetTitle("U / V"); treib[i]->SetLineColor(kRed);*/ pad_a[i]->Draw(); pad_b[i]->cd(); treib[i]->Draw("ALY+"); pad_b[i]->Draw(); pad_b[i]->cd(); chaos[i]->Draw("AL"); //leg->Draw(); } /*cout << "x1[0] = " << x1[0] << " <--> " << "y1[0] = " << y1[0] << endl; cout << "x2[0] = " << x2[0] << " <--> " << "y2[0] = " << y2[0] << endl; cout << "x3[0] = " << x3[0] << " <--> " << "y3[0] = " << y3[0] << endl; cout << "x4[0] = " << x4[0] << " <--> " << "y4[0] = " << y4[0] << endl; cout << "x5[0] = " << x5[0] << " <--> " << "y5[0] = " << y5[0] << endl; cout << "x6[0] = " << x6[0] << " <--> " << "y6[0] = " << y6[0] << endl; cout << "x7[0] = " << x7[0] << " <--> " << "y7[0] = " << y7[0] << endl; cout << "x8[0] = " << x8[0] << " <--> " << "y8[0] = " << y8[0] << endl;*/ }