Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JRootMakeProject.cc
Go to the documentation of this file.
1#include <string>
2#include <iostream>
3#include <filesystem>
4
5#include "TObject.h"
6#include "TFile.h"
7#include "TError.h"
8#include "TKey.h"
9#include "TClass.h"
10#include "TObject.h"
11
12#include "Jeep/JParser.hh"
13#include "Jeep/JMessage.hh"
14
15
16/**
17 * Example application to make ROOT project.
18 */
19int main(int argc, char **argv)
20{
21 using namespace std;
22
23 string inputFile;
24 string path;
25 int debug;
26
27 try {
28
29 JParser<> zap("Example application to make ROOT project.");
30
31 zap['f'] = make_field(inputFile, "input file with streamer information");
32 zap['P'] = make_field(path, "output directory for library") = "./";
33 zap['d'] = make_field(debug) = 1;
34
35 zap(argc, argv);
36 }
37 catch(const exception &error) {
38 FATAL(error.what() << endl);
39 }
40
41 gErrorIgnoreLevel = kError;
42
43
44 TFile* in = TFile::Open(inputFile.c_str());
45
46 if (in == NULL || !in->IsOpen()) {
47 FATAL("Error opening file " << inputFile << endl);
48 }
49
50 path.append("/ROOT");
51
52 in->MakeProject(path.c_str(), "*", "recreate++");
53
54 in->Close();
55}
General purpose messaging.
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
int main(int argc, char **argv)
Example application to make ROOT project.
Utility class to parse command line options.
Definition JParser.hh:1698