Changeset 13787
- Timestamp:
- 05/18/12 21:38:51 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/rootfilehandler.C
r13737 r13787 1 1 #include <iostream> 2 #include <string> 2 3 #include "TObjArray.h" 3 4 … … 111 112 TString loc_fname, 112 113 TString subdirectory, 113 T ObjArray*histList,114 TList* histList, 114 115 bool saveResults, 115 116 int verbosityLevel 116 117 ) 117 118 { 119 118 120 if (!saveResults) return; 121 if (histList==NULL) return; 119 122 if (verbosityLevel > 2) cout << endl 120 123 << "...saving pixel histograms to subdirectory: " … … 127 130 << "...writing histogram list to root file " 128 131 << endl ; 129 gFile->WriteTObject(histList, subdirectory); // write the histograms into one Key in the top level directory 130 132 gFile->mkdir(subdirectory.Data()); 133 gFile->cd(subdirectory.Data()); 134 gDirectory->pwd(); 135 cout << histList; 136 for ( int idx = 0; idx < histList->GetSize(); idx++) 137 { 138 histList->At(idx)->Write(); 139 } 140 // gFile->WriteTObject(histList, subdirectory); // write the histograms into one Key in the top level directory 141 gFile->cd(".."); 131 142 132 143 if (verbosityLevel > 3) output_rootfile->ls(); … … 175 186 cout << "...opening root-file: "; 176 187 } 177 178 188 path += filename; 179 189 TFile* file = TFile::Open( path ); … … 186 196 return file; 187 197 } 198 199 TString 200 SetHostsPaths( 201 bool isInHomeDir, 202 TString path 203 ) 204 { 205 TString hostName = gSystem->HostName(); 206 TString dataDirectory; 207 TString homeDirectory; 208 209 TString temp_filename; 210 211 if ( hostName.Contains("isdc") ) //IF ONE IS WORKING AT ISDC 212 { 213 214 dataDirectory = "/fact/"; 215 homeDirectory = "/home_nfs/isdc/jbbuss/"; 216 } 217 if ( hostName.Contains("hpc")||hostName.Contains("node") ) //IF ONE IS WORKING AT PHIDO 218 { 219 220 dataDirectory = "/fhgfs/groups/app/fact-construction/"; 221 homeDirectory = "/home/jbuss/"; 222 } 223 else 224 { 225 exit(-1); 226 } 227 if (!isInHomeDir) 228 { 229 temp_filename = dataDirectory; 230 temp_filename += path; 231 path = temp_filename; 232 } 233 else if (isInHomeDir) 234 { 235 temp_filename = homeDirectory; 236 temp_filename += path; 237 path = temp_filename; 238 } 239 240 return path; 241 }
Note:
See TracChangeset
for help on using the changeset viewer.