9 void DelphesSkim(TString input_filename, TString output_filename, TString skimCuts =
"")
11 auto input_file = TFile::Open(input_filename);
13 if (input_file ==
nullptr || input_file->IsZombie() || input_file->TestBit(TFile::kRecovered)) {
14 std::cout <<
"The input ROOT file is corrupted. Exiting..." << std::endl;
18 auto input_tree =
static_cast<TTree*
>(input_file->Get(
"Delphes"));
20 std::cout <<
"Input Delphes TTree contains " << input_tree->GetEntries() <<
" events..." << std::endl;
22 auto output_file = TFile::Open(output_filename,
"RECREATE");
24 auto output_tree =
static_cast<TTree*
>(input_tree->CopyTree(skimCuts));
27 std::cout <<
"... skimmed output Delphes TTree contains " << output_tree->GetEntries() <<
" events." << std::endl;