DAS  3.0
Das Analysis System
main.cc File Reference
#include <boost/test/included/unit_test.hpp>
#include <boost/exception/all.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/info_parser.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include "test.h"
#include "exceptions.h"
#include "Options.h"
#include "UserInfo.h"
#include "MetaInfo.h"
#include "example01.cc"
#include "example02.cc"
#include "example03.cc"
#include "example04.cc"
#include "../bin/getMetaInfo.cc"
#include "../bin/printMetaInfo.cc"
#include "../bin/printEntries.cc"
#include "../bin/printBranches.cc"
#include "../bin/forceMetaInfo.cc"
#include "../bin/applyPlugins.cc"
+ Include dependency graph for main.cc:

Namespaces

 Darwin
 
 Darwin::Physics
 

Macros

#define DOXYGEN_SHOULD_SKIP_THIS
 
#define BOOST_TEST_MODULE   test
 
#define DARWIN_GIT_REPO   DARWIN
 

Functions

template<bool DARWIN_TEST_EXCEPTIONS = false>
void example02 (const fs::path &input, const fs::path &output, const pt::ptree &config, const int steering, const DT::Slice slice={1, 0})
 
template<bool DARWIN_TEST_EXCEPTIONS = false>
void example03 (const fs::path &input, const fs::path &output, const pt::ptree &config, const int steering, const DT::Slice slice={1, 0}, const vector< fs::path > plugins={})
 
void example04 (const fs::path &input, const fs::path &output, const pt::ptree &config, const int steering, const DT::Slice slice={1, 0})
 
 BOOST_AUTO_TEST_CASE (output)
 
 BOOST_AUTO_TEST_CASE (getters_empty_input)
 
 BOOST_AUTO_TEST_CASE (getters_broken_input)
 
 BOOST_AUTO_TEST_CASE (getters_wrong_objects)
 
 BOOST_AUTO_TEST_CASE (ntuple_producer)
 
 BOOST_AUTO_TEST_CASE (ntuple_weight_modifier)
 
 BOOST_AUTO_TEST_CASE (ntuple_JEC_modifier)
 
 BOOST_AUTO_TEST_CASE (plugins)
 
 BOOST_AUTO_TEST_CASE (projection)
 
 BOOST_AUTO_TEST_CASE (all_steps)
 
 BOOST_AUTO_TEST_CASE (getBool)
 
 BOOST_AUTO_TEST_CASE (forceMetaInfo)
 
 BOOST_AUTO_TEST_CASE (GetFirstTreeLocation)
 
 BOOST_AUTO_TEST_CASE (printEntries)
 
 BOOST_AUTO_TEST_CASE (printBranches)
 
 BOOST_AUTO_TEST_CASE (printMetaInfo)
 
 BOOST_AUTO_TEST_CASE (closure)
 
 BOOST_AUTO_TEST_CASE (exceptions)
 

Macro Definition Documentation

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   test

◆ DARWIN_GIT_REPO

#define DARWIN_GIT_REPO   DARWIN

◆ DOXYGEN_SHOULD_SKIP_THIS

#define DOXYGEN_SHOULD_SKIP_THIS

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/18]

BOOST_AUTO_TEST_CASE ( all_steps  )
300  {
301  pt::ptree config;
302  BOOST_REQUIRE_NO_THROW( pt::read_info("example.info", config) );
303  BOOST_REQUIRE_NO_THROW( DT::Options::parse_config(config) );
304  const int steering = DT::fill | DT::syst;
305  BOOST_REQUIRE_NO_THROW( DP::example01("ntuple01.root", config, steering) );
306  BOOST_REQUIRE_NO_THROW( DP::example02("ntuple01.root", "ntuple02.root", config, steering) );
307  BOOST_REQUIRE_NO_THROW( DP::example03("ntuple02.root", "ntuple03.root", config, steering) );
308  BOOST_REQUIRE_NO_THROW( DP::example04("ntuple03.root", "hists04.root", config, steering) );
309  }

◆ BOOST_AUTO_TEST_CASE() [2/18]

BOOST_AUTO_TEST_CASE ( closure  )
373  {
374  {
375  unique_ptr<TFile> f(TFile::Open("ntuple02.root"));
376  f->ls();
377  }
378 
379  vector<string> exts {"info", "xml", "json"};
380  for (string ext: exts) {
381  fs::path file = "out1." + ext;
382  vector<fs::path> inputs = {"ntuple02.root"};
383  BOOST_REQUIRE_NO_THROW( DT::getMetaInfo(inputs, file) );
384  }
385 
386  auto getHash = [](const fs::path& ntuple) {
387  auto rootfile = unique_ptr<TFile>(TFile::Open(ntuple.c_str(), "READ"));
388  auto events = unique_ptr<TTree>(rootfile->Get<TTree>("events"));
389  size_t Hash = hash<TTree*>{}(events.get());
390  return Hash;
391  };
392 
393  size_t Hash = getHash("ntuple02.root");
394 
395  pt::ptree config;
396  auto chain = [&config,&getHash](const fs::path& fOut, bool isMC) {
397  fs::remove("ntuple02.root");
398  fs::remove("ntuple03.root");
399  config.put<bool>("flags.isMC", isMC);
400  const int steering = DT::fill | DT::syst;
401  BOOST_REQUIRE_NO_THROW( DT::Options::parse_config(config) );
402  DP::example01("ntuple01.root", config, steering);
403  DP::example02("ntuple01.root", "ntuple02.root", config, steering);
404  DP::example03("ntuple02.root", "ntuple03.root", config, steering);
405  DP::example04("ntuple03.root", "hists04.root", config, steering);
406  vector<fs::path> inputs = {"hists04.root"};
407  DT::getMetaInfo(inputs, fOut);
408  size_t Hash = getHash("ntuple02.root");
409  fs::remove("ntuple01.root");
410  fs::rename("hists04.root", Form("hists04_%s_%s.root", &(fOut.extension().c_str()[1]), isMC ? "true" : "false"));
411  return Hash;
412  };
413 
414  BOOST_TEST_MESSAGE( "Reading config in INFO format" );
415  pt::read_info("out1.info", config);
416  int oldseed = config.get<int>("preseed");
417  config.put<int>("preseed", 2*oldseed);
418  BOOST_TEST( Hash != chain("out2.info", true ) );
419  config.put<int>("preseed", oldseed);
420  BOOST_TEST( Hash == chain("out2.info", true ) );
421  BOOST_TEST( Hash != chain("out2.info", false) );
422 
423  BOOST_TEST_MESSAGE( "Reading config in JSON format" );
424  pt::read_json("out1.json", config);
425  BOOST_TEST( Hash == chain("out2.json", true ) );
426  BOOST_TEST( Hash != chain("out2.json", false) );
427 
428  BOOST_TEST_MESSAGE( "Reading config in XML format" );
429  pt::read_xml("out1.xml", config);
430  config = config.get_child("userinfo");
431  BOOST_TEST( Hash == chain("out2.xml", true ) );
432  BOOST_TEST( Hash != chain("out2.xml", false) );
433 
434  vector<fs::path> inputs = {"hists04_info_true.root" , "hists04_json_true.root" , "hists04_xml_true.root" };
435  BOOST_TEST( DT::getMetaInfo(inputs, "true.info" ) == EXIT_SUCCESS );
436  inputs = {"hists04_info_false.root", "hists04_json_false.root", "hists04_xml_false.root"};
437  BOOST_TEST( DT::getMetaInfo(inputs, "false.info" ) == EXIT_SUCCESS );
438  inputs = {"hists04_info_true.root" , "hists04_info_false.root"};
439  BOOST_TEST( DT::getMetaInfo(inputs, "failure.info") == EXIT_FAILURE );
440 
441  for (string name: {"true", "false", "failure"})
442  fs::remove(name + ".info");
443 
444  for (string ext: exts) {
445  fs::remove("out1." + ext);
446  fs::remove("out2." + ext);
447  for (string b: {"true", "false"})
448  fs::remove("hists04_" + ext + "_" + b + ".root");
449  }
450  }

◆ BOOST_AUTO_TEST_CASE() [3/18]

BOOST_AUTO_TEST_CASE ( exceptions  )
453  {
454  // testing raw exception object
455  auto f = unique_ptr<TFile>(TFile::Open("ntuple02.root", "READ"));
456  auto t = unique_ptr<TTree>(f->Get<TTree>("events"));
457  DT::MetaInfo metainfo(t);
458  cout << DE::BadInput("Here is a bad input", metainfo).what() << endl;
459  t->GetEntry(5);
460  cout << DE::AnomalousEvent("Here is an anomally (just for the example)", t).what() << endl;
461 
462  // testing in real context
463  pt::ptree config;
464  BOOST_REQUIRE_NO_THROW( pt::read_info(DARWIN "/test/example.info", config) );
465  BOOST_REQUIRE_NO_THROW( DT::Options::parse_config(config) );
466  const int steering = DT::fill | DT::syst;
467  DP::example01("ntuple01.root", config, steering);
468  BOOST_REQUIRE_THROW( DP::example02<true>("ntuple01.root", "ntuple02.root", config, steering), wrapexcept<DE::AnomalousEvent> );
469  BOOST_REQUIRE_THROW( DP::example01<true>("ntuple01.root", config, steering), wrapexcept<DE::BadInput > );
470 
471  fs::remove("inexistent.out");
472  fs::remove("ntuple01.root");
473  }

◆ BOOST_AUTO_TEST_CASE() [4/18]

BOOST_AUTO_TEST_CASE ( forceMetaInfo  )
322  {
323  vector<fs::path> input = {"ntuple02.root"};
324  DT::getMetaInfo(input, "force02.info");
325  DT::forceMetaInfo("force02.info", "ntuple01.root", DT::verbose);
326  input = {"ntuple01.root"};
327  DT::getMetaInfo(input, "force01.info");
328  unique_ptr<TFile> f(TFile::Open("ntuple01.root", "READ"));
329  auto events = unique_ptr<TTree>(f->Get<TTree>("events"));
330  DT::MetaInfo metainfo(events);
331  BOOST_TEST( !metainfo.Find("history") );
332  BOOST_TEST( !metainfo.Get<bool>("git", "reproducible") );
333  }

◆ BOOST_AUTO_TEST_CASE() [5/18]

BOOST_AUTO_TEST_CASE ( getBool  )
312  {
313  BOOST_TEST( !DT::getBool("this will not work").has_value());
314  BOOST_TEST( DT::getBool("yes").has_value());
315  BOOST_TEST( DT::getBool("true" ).value() == true );
316  BOOST_TEST( DT::getBool("kTRUE").value() == true );
317  BOOST_TEST( DT::getBool("off" ).value() == false );
318  BOOST_TEST( DT::getBool("NO" ).value() == false );
319  }

◆ BOOST_AUTO_TEST_CASE() [6/18]

BOOST_AUTO_TEST_CASE ( GetFirstTreeLocation  )
336  {
337  BOOST_TEST( DT::GetFirstTreeLocation("ntuple01.root") == "events" );
338  BOOST_REQUIRE_NO_THROW( DT::GetFirstTreeLocation("ntuple01.root") );
339 
340  TFile::Open("GetFirstTreeLocation.root", "RECREATE")->Close();
341  BOOST_REQUIRE_THROW( DT::GetFirstTreeLocation("GetFirstTreeLocation.root"), wrapexcept<DE::BadInput> );
342  }

◆ BOOST_AUTO_TEST_CASE() [7/18]

BOOST_AUTO_TEST_CASE ( getters_broken_input  )
90  {
91  vector<fs::path> files{"/this/dir/does/not/exist"};
92  BOOST_REQUIRE_THROW( DT::Flow(DT::verbose, files), wrapexcept<fs::filesystem_error> );
93  }

◆ BOOST_AUTO_TEST_CASE() [8/18]

BOOST_AUTO_TEST_CASE ( getters_empty_input  )
81  {
82  vector<fs::path> files;
83  DT::Flow flow(DT::none, files);
84  BOOST_TEST_MESSAGE( "Testing exceptions for empty list of input files" );
85  BOOST_REQUIRE_THROW( flow.GetInputHist("h") , wrapexcept<invalid_argument> );
86  BOOST_REQUIRE_THROW( flow.GetInputTree({1, 0}, "t"), wrapexcept<invalid_argument> );
87  }

◆ BOOST_AUTO_TEST_CASE() [9/18]

BOOST_AUTO_TEST_CASE ( getters_wrong_objects  )
96  {
97  vector<fs::path> files;
98  for (int i = 1; i < 4; ++i) {
99  fs::path name = Form("getters_%d.root", i);
100  cout << name << endl;
101  files.push_back(name);
102  unique_ptr<TFile> f(TFile::Open(name.c_str(), "RECREATE"));
103  auto h = make_unique<TH1F>("h", "h", 1, 0., 1.);
104  auto t = make_unique<TTree>("t", "t");
105  h->SetDirectory(f.get());
106  t->SetDirectory(f.get());
107  h->Write();
108  t->Write();
109  }
110 
111  DT::Flow flow(DT::none, files);
112  BOOST_TEST_MESSAGE( "Testing exceptions for inexisting histogram" );
113  BOOST_REQUIRE_THROW( flow.GetInputHist( "thisHistDoesNotExist"), wrapexcept<DE::BadInput> );
114  BOOST_TEST_MESSAGE( "Testing exceptions for empty tree" );
115  BOOST_REQUIRE_THROW( flow.GetInputTree({1, 0}, "t" ), wrapexcept<invalid_argument> );
116  BOOST_TEST_MESSAGE( "Testing exceptions for inexisting tree" );
117  BOOST_REQUIRE_THROW( flow.GetInputTree({1, 0}, "thisTreeDoesNotExist"), wrapexcept<DE::BadInput> );
118 
119  BOOST_REQUIRE_NO_THROW( flow.GetInputHist("h") );
120  }

◆ BOOST_AUTO_TEST_CASE() [10/18]

BOOST_AUTO_TEST_CASE ( ntuple_JEC_modifier  )
193  {
194  fs::path input, output;
195 
196  DT::Options options("Toy example to modify a n-tuple (JES corrections).",
198  options.input ("input" , &input , "input ROOT file" )
199  .output("output", &output, "output ROOT file");
200 
201  for (string mode: {"fill", "Friend"}) {
202  string cmd = "example03 ntuple02_" + mode + ".root ntuple03_" + mode
203  + ".root -j 3 -k 1 -" + mode.at(0)
204  + " -v -p ../plugins/libFlattener." DLL_EXT;
205  auto const args = tokenize(cmd.c_str());
206  BOOST_REQUIRE_NO_THROW( options(args.size(), args.data()) );
207 
208  const auto& config = options(args.size(), args.data());
209  const auto& slice = options.slice();
210  const int steering = options.steering();
211  const vector plugins = options.plugins();
212 
213  BOOST_REQUIRE_THROW( DP::example03(input, output, config, steering | DT::syst, slice, plugins), DE::PluginException );
214  BOOST_REQUIRE_NO_THROW( DP::example03(input, output, config, steering, slice) );
215  }
216 
217  vector<DP::RecJet> * recs_f = nullptr,
218  * recs_F = nullptr;
219  DT::Flow flow_f(DT::verbose , {"ntuple03_fill.root"}),
220  flow_F(DT::verbose | DT::Friend, {"ntuple03_Friend.root"});
221  flow_f.GetInputTree();
222  flow_F.GetInputTree();
223  BOOST_REQUIRE_NO_THROW( recs_f = flow_f.GetBranchReadOnly<vector<DP::RecJet>>("recJets") );
224  BOOST_REQUIRE_NO_THROW( recs_F = flow_F.GetBranchReadOnly<vector<DP::RecJet>>("recJets") );
225 
226  string active_branches_f = flow_f.DumpActiveBranches(),
227  active_branches_F = flow_F.DumpActiveBranches();
228  cout << "Without friends: " << active_branches_f << endl;
229  cout << "With friends: " << active_branches_F << endl;
230  BOOST_TEST( active_branches_f == active_branches_F );
231 
232  auto tIn_f = flow_f.GetInputTree(),
233  tIn_F = flow_F.GetInputTree();
234  BOOST_TEST( tIn_f->GetEntries() == tIn_F->GetEntries() );
235 
236  for (long long i = 0; i < tIn_f->GetEntries(); ++i) {
237  tIn_f->GetEntry(i);
238  tIn_F->GetEntry(i);
239  BOOST_TEST( recs_f->size() == recs_F->size() );
240  for (size_t j = 0; j < recs_f->size(); ++j)
241  BOOST_TEST( recs_f->at(j).CorrPt() == recs_F->at(j).CorrPt() );
242  }
243 
244  fs::remove("ntuple02_fill.root");
245  }

◆ BOOST_AUTO_TEST_CASE() [11/18]

BOOST_AUTO_TEST_CASE ( ntuple_producer  )
127  {
128  fs::path output;
129 
130  DT::Options options("This is just a toy example to generate a n-tuple.", DT::config | DT::fill);
131  options.output("output" , &output, "output ROOT file")
132  .arg<bool> ("isMC" , "flags.isMC" , "flag" )
133  .arg<float> ("R" , "flags.R" , "R parameter in jet clustering algorithm")
134  .arg<int > ("year" , "flags.year" , "year (20xx)" );
135 
136  auto const args = tokenize("example01 ntuple01.root -c example.info -f");
137  BOOST_REQUIRE_NO_THROW( options(args.size(), args.data()) );
138 
139  const auto& config = options(args.size(), args.data());
140  const int steering = options.steering();
141 
142  DP::example01(output, config, steering);
143  BOOST_REQUIRE_NO_THROW( DP::example01(output, config, steering) );
144  }

◆ BOOST_AUTO_TEST_CASE() [12/18]

BOOST_AUTO_TEST_CASE ( ntuple_weight_modifier  )
147  {
148  fs::path input, output;
149 
150  DT::Options options("Toy example to modify a n-tuple (filter application).",
152  options.input ("input" , &input , "input ROOT file" )
153  .output("output", &output, "output ROOT file")
154  .arg<fs::path>("filters", "corrections.filters", "location of list of event filters to apply");
155 
156  for (string mode: {"fill", "Friend"}) {
157  string cmd = "example02 ntuple01.root ntuple02_" + mode + ".root -c example.info -v -j 2 -k 1 -" + mode.at(0);
158  auto const args = tokenize(cmd.c_str());
159  BOOST_REQUIRE_NO_THROW( options(args.size(), args.data()) );
160 
161  const auto& config = options(args.size(), args.data());
162  const auto& slice = options.slice();
163  const int steering = options.steering();
164 
165  BOOST_REQUIRE_NO_THROW( DP::example02(input, output, config, steering, slice) );
166  }
167 
168  DP::RecEvent * event_f = nullptr,
169  * event_F = nullptr;
170  DT::Flow flow_f(DT::verbose , {"ntuple02_fill.root"}),
171  flow_F(DT::verbose | DT::Friend, {"ntuple02_Friend.root"});
172 
173  auto tIn_f = flow_f.GetInputTree(),
174  tIn_F = flow_F.GetInputTree();
175  BOOST_TEST( tIn_f->GetEntries() == tIn_F->GetEntries() );
176 
177  BOOST_TEST_MESSAGE( "Trying to load an inexistant branch" );
178  BOOST_TEST( flow_f.GetBranchReadOnly<DP::RecEvent>("event", DT::facultative) == nullptr );
179  BOOST_REQUIRE_THROW( flow_f.GetBranchReadOnly<DP::RecEvent>("event", DT::mandatory ), wrapexcept<DE::BadInput> );
180 
181  BOOST_TEST_MESSAGE( "Loading the analog branch in the friend and no-friend n-tuples." );
182  BOOST_REQUIRE_NO_THROW( event_f = flow_f.GetBranchReadOnly<DP::RecEvent>("recEvent") );
183  BOOST_REQUIRE_NO_THROW( event_F = flow_F.GetBranchReadOnly<DP::RecEvent>("recEvent") );
184 
185  for (long long i = 0; i < tIn_f->GetEntries(); ++i) {
186  tIn_f->GetEntry(i);
187  tIn_F->GetEntry(i);
188  BOOST_TEST( event_f->weights.front() == event_F->weights.front() );
189  }
190  }

◆ BOOST_AUTO_TEST_CASE() [13/18]

BOOST_AUTO_TEST_CASE ( output  )
74  {
75  DT::Flow flow(DT::verbose);
76  BOOST_REQUIRE_THROW( DT::GetOutputFile("/this/file/does/not/exists.root"), wrapexcept<fs::filesystem_error> );
77  BOOST_REQUIRE_NO_THROW( DT::GetOutputFile("this_file_is_allowed.root") );;
78  }

◆ BOOST_AUTO_TEST_CASE() [14/18]

BOOST_AUTO_TEST_CASE ( plugins  )
248  {
249  vector<fs::path> inputs;
250  fs::path output;
251 
252  DT::Options options("Apply plugins",
254  options.inputs("inputs", &inputs, "input ROOT file(s) or directory")
255  .output("output", &output, "output ROOT file")
256  .args("plugins", "corrections.plugins", "plugins");
257 
258  auto const args = tokenize("applyPlugins ntuple03_fill.root -f -v "
259  "applyPlugins04.root ../plugins/libFlattener." DLL_EXT);
260  BOOST_REQUIRE_NO_THROW( options(args.size(), args.data()) );
261 
262  const auto& config = options(args.size(), args.data());
263  const auto& slice = options.slice();
264  const int steering = options.steering();
265  BOOST_REQUIRE_THROW( options.plugins(), runtime_error );
266 
267  BOOST_REQUIRE_NO_THROW( DT::applyPlugins(inputs, output, config, steering, slice) );
268  fs::remove("ntuple03_fill.root");
269  }

◆ BOOST_AUTO_TEST_CASE() [15/18]

BOOST_AUTO_TEST_CASE ( printBranches  )
359  {
360  vector<fs::path> inputs {"ntuple01.root"};
361  BOOST_REQUIRE_NO_THROW( DT::printBranches(inputs, DT::verbose) );
362  }

◆ BOOST_AUTO_TEST_CASE() [16/18]

BOOST_AUTO_TEST_CASE ( printEntries  )
345  {
346  auto f = TFile::Open("printEntries.root", "RECREATE");
347  f->mkdir("dir1");
348  auto d = f->mkdir("dir2"); d->cd();
349  auto dd = d->mkdir("subdir"); dd->cd();
350  auto t = new TTree("one_tree", "");
351  t->SetDirectory(dd);
352  t->Write();
353  f->Close();
354  BOOST_REQUIRE_NO_THROW( DT::printEntries({"printEntries.root"}, DT::verbose) );
355  fs::remove("printEntries.root");
356  }

◆ BOOST_AUTO_TEST_CASE() [17/18]

BOOST_AUTO_TEST_CASE ( printMetaInfo  )
365  {
366  vector<fs::path> inputs {"ntuple01.root"};
367  pt::ptree tree;
368  tree.put<string>("path", "preseed");
369  BOOST_REQUIRE_NO_THROW( DT::printMetaInfo(inputs, tree) );
370  }

◆ BOOST_AUTO_TEST_CASE() [18/18]

BOOST_AUTO_TEST_CASE ( projection  )
272  {
273  fs::path input, output;
274 
275  DT::Options options("Toy example to project a n-tuple.", DT::split);
276  options.input ("input" , &input , "input ROOT file" )
277  .output("output", &output, "output ROOT file");
278 
279  BOOST_TEST( fs::exists("ntuple03_Friend.root") );
280  auto const args = tokenize("example04 ntuple03_Friend.root hists04.root");
281  BOOST_REQUIRE_NO_THROW( options(args.size(), args.data()) );
282 
283  const auto& config = options(args.size(), args.data());
284  const auto& slice = options.slice();
285  const int steering = options.steering();
286 
287  BOOST_REQUIRE_NO_THROW( DP::example04(input, output, config, steering, slice) );
288 
289  fs::remove("ntuple01.root");
290  fs::remove("ntuple02_Friend.root");
291  fs::remove("ntuple03_Friend.root");
292  fs::remove("hists04.root");
293  }
Darwin::Tools::GetFirstTreeLocation
std::string GetFirstTreeLocation(const std::filesystem::path &input)
one input ROOT file
Definition: FileUtils.cc:112
DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.name
name
Definition: DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.py:48
Darwin::Tools::mandatory
@ mandatory
mounting branch is mandatory
Definition: Flow.h:32
Darwin::Tools::fill
@ fill
activate -f to fill the tree
Definition: Options.h:32
DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.options
options
Definition: DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.py:41
Darwin::Exceptions::PluginException
Exception type to throw from plugins.
Definition: exceptions.h:132
Darwin::Tools::Flow
User-friendly handling of input and output n-tuples.
Definition: Flow.h:80
Step::verbose
static bool verbose
Definition: Step.h:40
Darwin::Tools::Friend
@ Friend
activate -F to only fill the new branches
Definition: Options.h:33
Ntupliser_cfg.args
args
Definition: Ntupliser_cfg.py:11
BOOST_TEST
BOOST_TEST(gendijet.Rapidity()==1.3573785791881385)
Darwin::Tools::split
@ split
activate -k and -j to define slice
Definition: Options.h:31
std::hash< TTree * >
Hash from TTree obtained by combination of different elements.
Definition: UserInfo.h:313
Ntupliser_cfg.f
f
Definition: Ntupliser_cfg.py:322
Darwin::Physics::example02
void example02(const fs::path &input, const fs::path &output, const pt::ptree &config, const int steering, const DT::Slice slice={1, 0})
Definition: main.cc:44
Darwin::Tools::syst
@ syst
activate -s to systematic uncertainties
Definition: Options.h:34
Darwin::Tools::none
@ none
default (for simple executables)
Definition: Options.h:28
Darwin::Physics::example04
void example04(const fs::path &input, const fs::path &output, const pt::ptree &config, const int steering, const DT::Slice slice={1, 0})
Definition: main.cc:60
compareFiles.files
files
Definition: compareFiles.py:125
Darwin::Tools::Options::parse_config
static void parse_config(boost::property_tree::ptree &, std::string="")
Parse config if given. This method calls itself to parse the tree structure.
Darwin::Tools::MetaInfo
Generic meta-information for n-tuple (including speficities to Darwin).
Definition: MetaInfo.h:68
Darwin::Tools::plugin
@ plugin
activate -p to run a plugin
Definition: Options.h:35
Darwin::Tools::GetOutputFile
std::shared_ptr< TFile > GetOutputFile(const std::filesystem::path &, const std::source_location=std::source_location::current())
Shortcut to create a reproducible output file (see ROOT Doxygen for details)
Definition: FileUtils.cc:147
Darwin::Tools::forceMetaInfo
void forceMetaInfo(const fs::path &input, const fs::path &output, const int steering)
Definition: forceMetaInfo.cc:92
plugins
PluginsVec * plugins()
Definition: IPlugin.h:77
Darwin::Tools::printEntries
void printEntries(vector< fs::path > inputs, const int steering)
Definition: printEntries.cc:22
cmd
cmd
Definition: Core-cfgcmd.txt:1
Darwin::Physics::example03
void example03(const fs::path &input, const fs::path &output, const pt::ptree &config, const int steering, const DT::Slice slice={1, 0}, const vector< fs::path > plugins={})
Definition: main.cc:52
Ntupliser_cfg.config
config
Definition: Ntupliser_cfg.py:330
DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.input
input
Definition: DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.py:35
Darwin::Tools::Options
Common class to interpret the command line, based on Boost Program Options.
Definition: Options.h:63
Darwin::Physics::AnonymousWeightableObject::weights
Weights weights
e.g. cross section normalisation
Definition: GenericObject.h:45
Darwin::Tools::Flow::GetInputTree
ChainSlice * GetInputTree(const Slice, const std::string &="events")
Load chain from a list of files with non-empty trees.
Definition: Flow.cc:67
Darwin::Physics::RecEvent
Generic detector-level event.
Definition: Event.h:32
Darwin::Tools::printBranches
void printBranches(vector< fs::path > inputs, const int steering)
Adapted from ROOT example
Definition: printBranches.cc:87
Ntupliser_cfg.isMC
dictionary isMC
Definition: Ntupliser_cfg.py:62
Darwin::Tools::printMetaInfo
int printMetaInfo(vector< fs::path > inputs, const pt::ptree &config)
Definition: printMetaInfo.cc:33
jercExample.inputs
def inputs
Definition: jercExample.py:118
Darwin::Exceptions::AnomalousEvent
Generic exception for problematic event (during event loop).
Definition: exceptions.h:63
Darwin::Tools::tokenize
std::vector< const char * > tokenize(const char *str)
Definition: test.h:15
Darwin::Exceptions::BadInput
Generic exception for ill-defined input (before the event loop).
Definition: exceptions.h:83
Darwin::Tools::applyPlugins
void applyPlugins(const vector< fs::path > &inputs, const fs::path &output, const pt::ptree &config, const int steering, const Slice slice={1, 0})
Generic function to run generic plugins.
Definition: applyPlugins.cc:34
Darwin::Tools::facultative
@ facultative
mounting branch is facultative
Definition: Flow.h:33
Darwin::Tools::getBool
optional< bool > getBool(string s)
Translates a string into a boolean if possible.
Definition: forceMetaInfo.cc:32
Darwin::Tools::getMetaInfo
int getMetaInfo(vector< fs::path > inputs, const fs::path &output)
Print content of the first TTree::UserInfo() found in the root file.
Definition: getMetaInfo.cc:25