1 |
|
#include<iostream> |
2 |
|
#include<math.h> |
3 |
+ |
#include<string> |
4 |
|
|
5 |
|
#include "TSystem.h" |
6 |
|
|
20 |
|
event = new susy::Event; |
21 |
|
inputTree->SetBranchAddress("susyEvent", &event); |
22 |
|
|
23 |
+ |
if (outputName == "") { |
24 |
+ |
// Here the output filename is generated automaticly |
25 |
+ |
try{ |
26 |
+ |
string fName = (string) inputName; |
27 |
+ |
// Search for 'susyEvents_', and get the unique characters afterwards. |
28 |
+ |
// eg /path/susyEvents_123_Myl.root -> susyTree_123_Mly.root |
29 |
+ |
outputName = "susyTree_" + fName.substr(fName.find("susyEvents_")+11,-1); |
30 |
+ |
} catch (int e ) { |
31 |
+ |
outputName = "susyTree.root"; |
32 |
+ |
} |
33 |
+ |
} |
34 |
+ |
|
35 |
+ |
if (loggingVerbosity_>0) |
36 |
+ |
std::cout << "Open file " << outputName << " for writing." << std::endl; |
37 |
|
// open the output file |
38 |
|
outFile = new TFile( outputName, "recreate" ); |
39 |
|
tree = new TTree("susyTree","Tree for single photon analysis"); |