DAS  3.0
Das Analysis System
Variation.cc File Reference
#include <Variation.h>
#include <TList.h>
#include <TObjString.h>
#include <boost/test/included/unit_test.hpp>
#include <boost/exception/all.hpp>
+ Include dependency graph for Variation.cc:

Macros

#define BOOST_TEST_MODULE   Variation
 

Functions

 BOOST_AUTO_TEST_CASE (variation)
 

Macro Definition Documentation

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   Variation

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( variation  )
18 {
19  auto userinfo = new TList;
20  userinfo->SetName("variations");
21  vector<Variation> variations = GetVariations(*userinfo);
22  BOOST_TEST( variations.size() == 1 );
23 
24  auto groupContents = new TList;
25  groupContents->SetName("RecJetWeights");
26  groupContents->Add(new TObjString("bSFUp" ));
27  groupContents->Add(new TObjString("bSFDown"));
28  groupContents->Add(new TObjString("lSFUp" ));
29  groupContents->Add(new TObjString("lSFDown"));
30 
31  userinfo->Add(groupContents);
32 
33  BOOST_REQUIRE_NO_THROW( variations = GetVariations(*userinfo) );
34  BOOST_TEST( variations.size() == 5 ); // nominal + 4 variations
35  BOOST_TEST( variations.front().Group() == "" );
36  BOOST_TEST( variations.front().Name() == "nominal" );
37  for (size_t i = 1; i < variations.size(); ++i) {
38  cout << i << ' ' << variations[i] << endl;
39  BOOST_TEST( variations[i].Group() == "RecJetWeights" );
40  }
41  BOOST_TEST( variations[1].Name() == "bSFUp" );
42  BOOST_TEST( variations[2].Name() == "bSFDown" );
43  BOOST_TEST( variations[3].Name() == "lSFUp" );
44  BOOST_TEST( variations[4].Name() == "lSFDown" );
45 
46  // TODO: test index and correlation bit
47 
48  groupContents->Add(new TObjString(""));
49  BOOST_REQUIRE_THROW( variations = GetVariations(*userinfo), boost::wrapexcept<invalid_argument> );
50 }
BOOST_TEST
BOOST_TEST(gendijet.Rapidity()==1.3573785791881385)
DAS::Unfolding::GetVariations
std::vector< DistVariation > GetVariations(Darwin::Tools::MetaInfo &, bool=false, std::ostream &=std::cout)
Get all variations availables according to metainfo.
Definition: DistVariation.cc:199