CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
InspectSum_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 TopInspectSum : public ManipHist {
17  public:
20  virtual void readConfig( std::string );
21  void writeOutput(){CompHist::writeOutput(kLastOnly);};
22 };
23 
24 void TopInspectSum::readConfig( std::string name )
25 {
26  ConfigFile cfg( name, "=", "$" );
27  configBlockIO ( cfg );
28  configBlockHist( cfg );
29  configBlockSum ( 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  TopInspectSum plots;
44  try{
45  plots.readConfig( argv[1] );
46  plots.loadHistograms();
47 
48  //histogram manipulations
49  plots.sumHistograms();
50 
51  //depending on style draw ps/eps/jpg
52  if( !strcmp(plots.writeAs().c_str(), "ps") ){
53  plots.drawPs();
54  } else if( !strcmp(plots.writeAs().c_str(), "eps") ){
55  plots.drawEps();
56  } else{
57  std::cerr << "ERROR:"
58  << " Unknown file format requested: "
59  << plots.writeAs() << std::endl;
60  return -1;
61  }
62  plots.writeOutput();
63  }
64  catch(char* str){
65  std::cerr << "ERROR: " << str << std::endl;
66  return 1;
67  }
68  catch(...){
69  std::cerr << "ERROR: this one is new...";
70  return 1;
71  }
72  std::cout << "Thanx and GoodBye " << std::endl;
73  return 0;
74 }
void sumHistograms()
Definition: ManipHist.cc:42
def main
— Main —############################
void writeOutput()
Definition: CompHist.h:61
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
virtual void readConfig(std::string)
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