CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/Validation/RecoJets/bin/InspectRatio_calib.cc

Go to the documentation of this file.
00001 #include <memory>
00002 #include <string>
00003 #include <cstdlib>
00004 #include <sstream>
00005 #include <fstream>
00006 #include <iostream>
00007 
00008 #include "Validation/RecoJets/interface/RootSystem.h"
00009 #include "Validation/RecoJets/interface/RootHistograms.h"
00010 #include "Validation/RecoJets/interface/RootPostScript.h"
00011 #include "Validation/RecoJets/interface/ManipHist.h"
00012 #include "Validation/RecoJets/bin/NiceStyle.cc"
00013 
00014 using namespace std;
00015 
00016 class TopInspectRatio : public ManipHist {
00017  public:
00018   TopInspectRatio(){};
00019   ~TopInspectRatio(){};
00020   virtual void readConfig( std::string );
00021   void writeOutput(){CompHist::writeOutput(kFirstOnly);};
00022 };
00023 
00024 void TopInspectRatio::readConfig( std::string name )
00025 {
00026   ConfigFile cfg( name, "=", "$" );  
00027   configBlockIO    ( cfg );
00028   configBlockHist  ( cfg );
00029   configBlockDivide( cfg );
00030 }
00031 
00032 int main(int argc, char* argv[])
00033 {
00034   setNiceStyle();
00035   gStyle->SetOptStat( 0 );
00036 
00037   if( argc<2 ){
00038     std::cerr << "ERROR:" 
00039          << " Missing argument" << std::endl;
00040     return 1;
00041   }
00042 
00043   TopInspectRatio plots;
00044   try{
00045     plots.readConfig( argv[1] );
00046     plots.loadHistograms();
00047     
00048     //depending on style draw ps/eps/jpg
00049     if( !strcmp(plots.writeAs().c_str(), "ps") ){
00050       plots.divideAndDrawPs();
00051     } else if( !strcmp(plots.writeAs().c_str(), "eps") ){
00052       plots.divideAndDrawEps();
00053     } else{
00054       std::cerr << "ERROR:"
00055            << " Unknown file format requested: "
00056            << plots.writeAs() << std::endl; 
00057       return -1;
00058     }
00059     plots.writeOutput();
00060   }
00061   catch(char* str){
00062     std::cerr << "ERROR: " << str << std::endl;
00063     return 1;
00064   }
00065   catch(...){
00066     std::cerr << "ERROR: this one is new...";
00067       return 1;
00068   }
00069   std::cout << "Thanx and GoodBye " << std::endl;
00070   return 0;
00071 }