CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
InspectRatio_calib.cc
Go to the documentation of this file.
1 #include <memory>
2 #include <string>
3 #include <cstdlib>
4 #include <sstream>
5 #include <fstream>
6 #include <iostream>
7 
13 
14 using namespace std;
15 
16 class TopInspectRatio : public ManipHist {
17  public:
20  virtual void readConfig( std::string );
21  void writeOutput(){CompHist::writeOutput(kFirstOnly);};
22 };
23 
24 void TopInspectRatio::readConfig( std::string name )
25 {
26  ConfigFile cfg( name, "=", "$" );
27  configBlockIO ( cfg );
28  configBlockHist ( cfg );
29  configBlockDivide( cfg );
30 }
31 
32 int main(int argc, char* argv[])
33 {
34  setNiceStyle();
35  gStyle->SetOptStat( 0 );
36 
37  if( argc<2 ){
38  std::cerr << "ERROR:"
39  << " Missing argument" << std::endl;
40  return 1;
41  }
42 
43  TopInspectRatio plots;
44  try{
45  plots.readConfig( argv[1] );
46  plots.loadHistograms();
47 
48  //depending on style draw ps/eps/jpg
49  if( !strcmp(plots.writeAs().c_str(), "ps") ){
50  plots.divideAndDrawPs();
51  } else if( !strcmp(plots.writeAs().c_str(), "eps") ){
52  plots.divideAndDrawEps();
53  } else{
54  std::cerr << "ERROR:"
55  << " Unknown file format requested: "
56  << plots.writeAs() << std::endl;
57  return -1;
58  }
59  plots.writeOutput();
60  }
61  catch(char* str){
62  std::cerr << "ERROR: " << str << std::endl;
63  return 1;
64  }
65  catch(...){
66  std::cerr << "ERROR: this one is new...";
67  return 1;
68  }
69  std::cout << "Thanx and GoodBye " << std::endl;
70  return 0;
71 }
def main
— Main —############################
void divideAndDrawEps()
Definition: ManipHist.cc:141
void writeOutput()
Definition: CompHist.h:61
virtual void readConfig(std::string)
void loadHistograms(std::vector< std::string > &, std::vector< TObjArray > &)
Definition: CompHist.cc:159
std::string writeAs()
Definition: CompHist.h:50
tuple cout
Definition: gather_cfg.py:41
void divideAndDrawPs()
Definition: ManipHist.cc:86
boost::shared_ptr< edm::ProcessDesc > readConfig(const std::string &config)
void setNiceStyle()
Definition: NiceStyle.cc:3