Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JRootMakeProject.cc File Reference
#include <string>
#include <iostream>
#include <filesystem>
#include "TObject.h"
#include "TFile.h"
#include "TError.h"
#include "TKey.h"
#include "TClass.h"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 Example application to make ROOT project.
 

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Example application to make ROOT project.

Definition at line 19 of file JRootMakeProject.cc.

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}
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Utility class to parse command line options.
Definition JParser.hh:1698