// $Id$ // // Author: David Lawrence April 7, 2006 // // // root2email.cc // #include #include #include #include #include #include using namespace std; #include #include #include #include #include const char *filename = "mctrk_ana.root"; typedef struct{ string message; string gif_file; }plot_t; vector email_address; vector histnames; vector plots; void ParseCommandLineArguments(int narg, char *argv[]); void Usage(void); void AddPlot(TFile &f, string what); int colors[] = {kRed, kBlue, kGreen}; int Ncolors = 3; //----------- // main //----------- int main(int narg, char *argv[]) { ParseCommandLineArguments(narg, argv); // open ROOT file for reading TFile f(filename); if(!f.IsOpen()){ cout<<"Can't open file \""<FindObject(histname.c_str()); //f.GetObject(histname.c_str(), hist); if(!hist){ mess<<"Unable to read in histogram '"<SetLineColor(colors[plots.size()%Ncolors]); hist->Draw(); c1.Print("tmp.eps"); // Convert EPS to PPM using ghostscript(gs) retcode = system("echo quit | gs -sDEVICE=ppm -r72x72 -g565x405 -sOutputFile=tmp.ppm -dNOPAUSE tmp.eps > /dev/null"); // Generate unique name of GIF file stringstream outfile; outfile<<"plot"< "<