Low-Energy Muon (LEM) Experiment  1.1.0
tempCalib.cpp
Go to the documentation of this file.
1 /***************************************************************************
2 
3  tempCalib.cpp
4 
5  Author: Andreas Suter
6  e-mail: andreas.suter@psi.ch
7 
8 ***************************************************************************/
9 
10 /***************************************************************************
11  * Copyright (C) 2010 by Andreas Suter *
12  * andreas.suter@psi.ch *
13  * *
14  * This program is free software; you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation; either version 2 of the License, or *
17  * (at your option) any later version. *
18  * *
19  * This program is distributed in the hope that it will be useful, *
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22  * GNU General Public License for more details. *
23  * *
24  * You should have received a copy of the GNU General Public License *
25  * along with this program; if not, write to the *
26  * Free Software Foundation, Inc., *
27  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
28  ***************************************************************************/
29 
30 #include <iostream>
31 
32 #include <TApplication.h>
33 #include <TROOT.h>
34 
35 #include "PTempCalibGui.h"
36 
38 {
39  std::cerr << std::endl;
40  std::cerr << ">> usage: tempCalib <LakeShore>" << std::endl;
41  std::cerr << " <LakeShore> : 340 or 336" << std::endl;
42  std::cerr << std::endl;
43 }
44 
45 int main(int argc, char **argv)
46 {
47  if (argc != 2) {
49  return 1;
50  }
51  std::string lakeShore(argv[1]);
52  if ((lakeShore != "340") && (lakeShore != "336")) {
53  std::cerr << std::endl;
54  std::cerr << ">> **ERROR** found unsupported LakeShore type: " << lakeShore << std::endl;
56  return 2;
57  }
58 
59  TApplication theApp("App", &argc, argv);
60 
61  if (gROOT->IsBatch()) {
62  std::cerr << std::endl << ">> **ERROR** " << argv[0] << " cannot run in batch mode." << std::endl << std::endl;
63  return 3;
64  }
65 
66  PTempCalibGui *gui = new PTempCalibGui(gClient->GetRoot(), TCG_WIDTH, TCG_HEIGHT, lakeShore);
67  if (gui == nullptr) {
68  std::cerr << std::endl << ">> **ERROR** Couldn't invoke GUI, sorry." << std::endl << std::endl;
69  return 1;
70  }
71 
72  theApp.Run(true);
73 
74  // clean up
75  if (gui) {
76  delete gui;
77  gui = 0;
78  }
79 
80  return 0;
81 }
int main(int argc, char **argv)
Definition: tempCalib.cpp:45
#define TCG_HEIGHT
Definition: PTempCalibGui.h:53
void tempCalib_Syntax()
Definition: tempCalib.cpp:37
#define TCG_WIDTH
Definition: PTempCalibGui.h:52