{ ifstream in; in.open( "threepi_fit.txt" ); enum { kMaxPoints = 100 }; double eventCounter = 0; double mass[kMaxPoints]; double masse[kMaxPoints]; double rhoPiSWave[kMaxPoints]; double rhoPiSWavee[kMaxPoints]; double rhoPiDWave[kMaxPoints]; double rhoPiDWavee[kMaxPoints]; double rhoPiPXWave[kMaxPoints]; double rhoPiPXWavee[kMaxPoints]; double f2PiSWave[kMaxPoints]; double f2PiSWavee[kMaxPoints]; double rhoPiPWave[kMaxPoints]; double rhoPiPWavee[kMaxPoints]; double all[kMaxPoints]; double alle[kMaxPoints]; double phase[kMaxPoints]; double phasee[kMaxPoints]; int line = 0; while( ! in.eof() ){ in >> mass[line] >> rhoPiSWave[line] >> rhoPiSWavee[line] >> rhoPiDWave[line] >> rhoPiDWavee[line] >> rhoPiPXWave[line] >> rhoPiPXWavee[line] >> f2PiSWave[line] >> f2PiSWavee[line] >> rhoPiPWave[line] >> rhoPiPWavee[line] >> all[line] >> alle[line] >> phase[line] >> phasee[line]; eventCounter += all[line]; line++; } TGraphErrors rhoPiSWaveGraph( line, mass, rhoPiSWave, masse, rhoPiSWavee ); rhoPiSWaveGraph.SetMarkerStyle( 20 ); rhoPiSWaveGraph.SetMarkerSize( .5 ); TGraphErrors rhoPiDWaveGraph( line, mass, rhoPiDWave, masse, rhoPiDWavee ); rhoPiDWaveGraph.SetMarkerStyle( 20 ); rhoPiDWaveGraph.SetMarkerSize( 0.5 ); TGraphErrors rhoPiPXWaveGraph( line, mass, rhoPiPXWave, masse, rhoPiPXWavee ); rhoPiPXWaveGraph.SetMarkerStyle( 20 ); rhoPiPXWaveGraph.SetMarkerSize( 0.5 ); TGraphErrors f2PiSWaveGraph( line, mass, f2PiSWave, masse, f2PiSWavee ); f2PiSWaveGraph.SetMarkerStyle( 20 ); f2PiSWaveGraph.SetMarkerSize( 0.5 ); TGraphErrors rhoPiPWaveGraph( line, mass, rhoPiPWave, masse, rhoPiPWavee ); rhoPiPWaveGraph.SetMarkerStyle( 20 ); rhoPiPWaveGraph.SetMarkerSize( 0.5 ); TGraphErrors allGraph( line, mass, all, masse, alle ); allGraph.SetMarkerStyle( 20 ); allGraph.SetMarkerSize( 0.5 ); TGraphErrors phaseGraph( line, mass, phase, masse, phasee ); phaseGraph.SetMarkerStyle( 20 ); phaseGraph.SetMarkerSize( 0.5 ); TCanvas* can = new TCanvas( "can", "Amplitude Analysis Plots", 800, 800 ); can->Divide( 2, 3 ); can->cd( 1 ); TH1F h1( "h1", "1^{+} #rho#pi S", 1, 0.7, 2.2 ); h1.SetMaximum( 3100 ); h1.GetXaxis()->SetTitle( "3#pi Invariant Mass [GeV/c^{2}]" ); h1.SetStats( 0 ); h1.Draw(); rhoPiSWaveGraph.Draw( "P" ); can->cd( 2 ); TH1F h2( "h2", "1^{-} #rho#pi P", 1, 0.7, 2.2 ); h2.SetMaximum( 300 ); h2.GetXaxis()->SetTitle( "3#pi Invariant Mass [GeV/c^{2}]" ); h2.SetStats( 0 ); h2.Draw(); rhoPiPXWaveGraph.Draw( "P" ); can->cd( 3 ); TH1F h3( "h3", "2^{+} #rho#pi D", 1, 0.7, 2.2 ); h3.SetMaximum( 2000 ); h3.GetXaxis()->SetTitle( "3#pi Invariant Mass [GeV/c^{2}]" ); h3.SetStats( 0 ); h3.Draw(); rhoPiDWaveGraph.Draw( "P" ); can->cd( 4 ); TH1F h4( "h4", "2^{-} f_{2}#pi S", 1, 0.7, 2.2 ); h4.SetMaximum( 1200 ); h4.GetXaxis()->SetTitle( "3#pi Invariant Mass [GeV/c^{2}]" ); h4.SetStats( 0 ); h4.Draw(); f2PiSWaveGraph.Draw( "P" ); can->cd( 5 ); TH1F h5( "h5", "2^{-} #rho#pi P", 1, 0.7, 2.2 ); h5.SetMaximum( 1200 ); h5.GetXaxis()->SetTitle( "3#pi Invariant Mass [GeV/c^{2}]" ); h5.SetStats( 0 ); h5.Draw(); rhoPiPWaveGraph.Draw( "P" ); can->cd( 6 ); TH1F h6( "h6", "3#pi All Waves", 1, 0.7, 2.2 ); h6.SetMaximum( 4000 ); h6.GetXaxis()->SetTitle( "3#pi Invariant Mass [GeV/c^{2}]" ); h6.SetStats( 0 ); h6.Draw(); allGraph.Draw( "P" ); cout << "Total number of events: " << eventCounter << endl; }