CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Inspect_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 TopInspect : public CompHist {
17  public:
20  virtual void readConfig( std::string );
21 };
22 
23 void TopInspect::readConfig( std::string name )
24 {
25  ConfigFile cfg( name, "=", "$" );
26  configBlockIO( cfg );
27  configBlockHist( cfg );
28 }
29 
30 int main(int argc, char* argv[])
31 {
32  setNiceStyle();
33  gStyle->SetOptStat( 0 );
34 
35  if( argc<2 ){
36  std::cerr << "ERROR:"
37  << " Missing argument" << std::endl;
38  return 1;
39  }
40 
41  TopInspect plots;
42  try{
43  plots.readConfig( argv[1] );
44  plots.loadHistograms();
45 
46  //depending on style draw ps/eps/jpg
47  if( !strcmp(plots.writeAs().c_str(), "ps") ){
48  plots.drawPs();
49  } else if( !strcmp(plots.writeAs().c_str(), "eps") ){
50  plots.drawEps();
51  } else{
52  std::cerr << "ERROR:"
53  << " Unknown file format requested: "
54  << plots.writeAs() << std::endl;
55  return -1;
56  }
57  }
58  catch(char* str){
59  std::cerr << "ERROR: " << str << std::endl;
60  return 1;
61  }
62  catch(...){
63  std::cerr << "ERROR: this one is new...";
64  return 1;
65  }
66  std::cout << "Thanx and GoodBye " << std::endl;
67  return 0;
68 }
def main
— Main —############################
virtual void readConfig(std::string)
void drawPs()
Definition: CompHist.cc:351
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
boost::shared_ptr< edm::ProcessDesc > readConfig(const std::string &config)
void drawEps()
Definition: CompHist.cc:404
void setNiceStyle()
Definition: NiceStyle.cc:3