#include <TFile.h>
#include <TTree.h>
#include <iostream>
#include <string>
#include "garana/Processors/MillGenTree.h"
#include "garana/Processors/MillHeaderTree.h"
Go to the source code of this file.
Definition at line 130 of file paulbunyan.cxx.
133 std::cout <<
"parsing file '" << path <<
"'" <<
std::endl;
135 while(base.find(
"/")!=string::npos){
136 base = base.substr(base.find(
"/")+1,base.size());
139 base = base.substr(0,base.find(
"."));
140 path = path.substr(0,path.find(base));
141 string outstr = path+base+
"_chopped.root";
142 std::cout <<
"generated output file path '" << outstr <<
"'" <<
std::endl;
QTextStream & endl(QTextStream &s)
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 28 of file paulbunyan.cxx.
32 cerr <<
"ERROR(paulbunyan): you must specify a root file to analyze ->" <<
'\n' 33 <<
" usage: paulbunyan <my_structured_tree.root>" <<
endl;
38 cerr <<
"ERROR(paulbunyan): too many arguments! using file name, " 45 if(!inFile || !inFile->IsOpen())
49 cerr <<
"ERROR(paulbunyan): could not open file , '" <<
string(
argv[1]) <<
"'" <<
endl;
55 TTree* header = (TTree*)inFile->Get(
"structuredtree/headerTree");
59 std::cout <<
"INFO(paulbunyan): found (required) input headerTree" <<
std::endl;
62 cerr <<
"ERROR(paulbunyan): paulbunyan is not happy with your file. he does not want to chop your trees!" <<
'\n' 63 <<
" required 'headerTree' not found. fix your file and try again." <<
endl;
68 TTree*
gen = (TTree*)inFile->Get(
"structuredtree/genTree");
69 TTree*
g4 = (TTree*)inFile->Get(
"structuredtree/g4Tree");
70 TTree* det = (TTree*)inFile->Get(
"structuredtree/detTree");
71 TTree*
reco = (TTree*)inFile->Get(
"structuredtree/recoTree");
72 TTree* display = (TTree*)inFile->Get(
"structuredtree/displayTree");
76 TFile*
outFile =
new TFile(outname.c_str(),
"RECREATE");
78 TTree* header_out =
new TTree(
"headerTree",
"sample provenance information");
80 header_out->SetDirectory(outFile);
86 TTree* gen_out =
new TTree(
"genTree",
"generator level info");
94 std::cout <<
"INFO(paulbunyan): found input genTree" <<
std::endl;
98 gen_out->SetDirectory(outFile);
104 std::cout <<
"INFO(paulbunyan): found input g4Tree" <<
std::endl;
107 std::cout <<
"INFO(paulbunyan): found input detTree" <<
std::endl;
110 std::cout <<
"INFO(paulbunyan): found input recoTree" <<
std::endl;
114 std::cout <<
"INFO(paulbunyan): found input displayTree" <<
std::endl;
std::string GetOutfileName(const char *inName)
QTextStream & endl(QTextStream &s)