ROOTPWA
pwaplots.cc
Go to the documentation of this file.
1 
2 //
3 // Copyright 2009 Sebastian Neubert
4 //
5 // This file is part of rootpwa
6 //
7 // rootpwa is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // rootpwa is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with rootpwa. If not, see <http://www.gnu.org/licenses/>.
19 //
21 
22 // Reads in the results of N fits and creates intensity plots using
23 // the pwaPlotter class
24 
25 #include <vector>
26 #include <iostream>
27 #include <iomanip>
28 #include <string>
29 #include <cstdlib>
30 
31 int atoi ( const char * str );
32 
33 
34 #include "pwaPlotter.h"
35 
36 using namespace std;
37 using namespace rpwa;
38 
39 
40 int
41 main(int argc, char** argv){
42 
43  if(argc<2){
44  cerr<<"Usage: pwaplot nbins outputfile fit1 fit2 fit3 ..."<<endl;
45  return 1;
46  }
47 
48  unsigned int nbins=atoi(argv[1]);
49  string outfilename=argv[2];
50  vector<string> inputfiles;
51  for(int i=3; i<argc; ++i){
52  inputfiles.push_back(argv[i]);
53  }
54 
55  pwaPlotter plotter;
56 
57  for(unsigned int i=0; i<inputfiles.size();++i){
58  plotter.addFit(inputfiles[i],inputfiles[i],1,"pwa","fitResult_v2",nbins);
59  }
60 
61 
62  plotter.produceDensityPlots();
63  plotter.printStats();
64  plotter.writeAll(outfilename);
65 
66  return 0;
67 }