ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/kiesel/TreeWriter/treeWriter.cc
(Generate patch)

Comparing UserCode/kiesel/TreeWriter/treeWriter.cc (file contents):
Revision 1.6 by kiesel, Tue Apr 9 08:24:40 2013 UTC vs.
Revision 1.7 by kiesel, Tue Apr 9 12:13:55 2013 UTC

# Line 1 | Line 1
1   #include<iostream>
2   #include<math.h>
3 + #include<string>
4  
5   #include "TSystem.h"
6  
# Line 19 | Line 20 | TreeWriter::TreeWriter(TString inputName
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");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines