377 {
379 unsigned nIgnored=0;
380 TDirectory* histDir=nullptr;
381 std::string lastDir;
384 for(;
it!=it_e;++
it) {
385 const std::string
fulldir=
it->first +
"/";
386
387 std::string::size_type
j=0,
j1=0;
388 while (j1!=std::string::npos) {
389 do {
392
393 }
394 while(j1!=std::string::npos && !
fulldir.compare(0,j1,lastDir,0,j1));
395 const std::string currDirAtLevel(
fulldir.substr(j,j1-j));
396 const std::string currFullDir(
fulldir.substr(0,j1));
397 const std::string currBaseDir(
fulldir.substr(0,j));
398
399 lastDir=std::move(currFullDir);
400 out->cd(currBaseDir.c_str());
402 }
403
405 it->second.md->SetDirectory(histDir);
406 it->second.md->Write(
nullptr,TObject::kOverwrite);
407 std::vector<histPerDir_t>::const_iterator ith=
it->second.histos.begin();
408 std::vector<histPerDir_t>::const_iterator ith_e=
it->second.histos.end();
409 for (;ith!=ith_e;++ith) {
410 if (ith->obj) {
411 ith->obj->Write();
412 std::cout <<
"Writing " << ith->name <<
" to dir " <<
fulldir << std::endl;
414 }
415 else {
416 std::cout << "NOT writing " << ith->name << ". Invalid." << std::endl;
417 ++nIgnored;
418 }
419 }
420 }
421 std::cout <<
"Wrote " <<
nWritten <<
" histograms to output file.";
422 if (nIgnored)
423 std::cout << " Omitting " << nIgnored << " histograms." << std::endl;
424 else
425 std::cout << std::endl;
426 return;
427}
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)