ATLAS Offline Software
Loading...
Searching...
No Matches
PMGTools Namespace Reference

Tool providing sample cross-sections and k-factors etc. More...

Classes

struct  AllSampleInfo
class  IPMGCrossSectionTool
class  IPMGSherpaVjetsSysTool
class  IPMGTruthWeightTool
 Interface for xAOD Truth Weight Tool which retrieves Meta Data from a truth record to interface the event weights. More...
class  ISysTruthWeightTool
 Interface for xAOD Truth Weight Tool which returns an event weight based on truth particle container. More...
class  PMGCrossSectionTool
class  PMGDecayProductsSelectionTool
 an IAsgSelectionTool that select particles based on the allowed decay chain More...
class  PMGHFProductionFractionTool
 Implementation for xAOD Truth Weight Tool which retrieves the charm / bottom hadron content of an event and derives an event weight based on the HF production fractions. More...
class  PMGSherpa22VJetsWeightTool
class  PMGSherpaVjetsSysTool
class  PMGTruthWeightTool
 Implementation for the xAOD truth meta data weight tool. More...

Enumerations

enum  SysParType {
  None = 0 , Znunu , Zll , Wlnu ,
  GammaJets , None = 0 , Znunu , Zll ,
  Wlnu , GammaJets
}
enum  SysParType {
  None = 0 , Znunu , Zll , Wlnu ,
  GammaJets , None = 0 , Znunu , Zll ,
  Wlnu , GammaJets
}

Functions

std::string weightNameCleanup (const std::string &name)
 cleanup the weight name
std::string weightNameWithPrefix (const std::string &name)
 cleanup the weight name and add prefix

Variables

constexpr char generatorWeightsPrefix [] {"GEN_"}
 the prefix for generator weights

Detailed Description

Tool providing sample cross-sections and k-factors etc.

Tool calculating correct event weights for Sherpa V+jets samples.

Author
Tadej Novak

Longer documentation to be written...

Author
Paul Thompson Paul..nosp@m.Thom.nosp@m.pson@.nosp@m.cern.nosp@m..ch
Revision
764400
Date
2016-07-26 19:47:39 +0200 (Tue, 26 Jul 2016)

Enumeration Type Documentation

◆ SysParType [1/2]

◆ SysParType [2/2]

Enumerator
None 
Znunu 
Zll 
Wlnu 
GammaJets 
None 
Znunu 
Zll 
Wlnu 
GammaJets 

Definition at line 19 of file Interfaces/PMGAnalysisInterfaces/PMGAnalysisInterfaces/IPMGSherpaVjetsSysTool.h.

19 {
20 None = 0,
21 Znunu,
22 Zll,
23 Wlnu,
25 };

Function Documentation

◆ weightNameCleanup()

std::string PMGTools::weightNameCleanup ( const std::string & name)

cleanup the weight name

Definition at line 18 of file WeightHelpers.cxx.

19{
20 // empty weight is nominal
21 if (name.empty())
22 {
23 return {};
24 }
25
26 // Trim trailing whitespace
27 size_t start = name.find_first_not_of(" \t\n\r");
28 size_t end = name.find_last_not_of(" \t\n\r");
29 std::string out = name.substr(start,end-start+1);
30 std::string outLowercase = out;
31 std::transform(outLowercase.begin(), outLowercase.end(), outLowercase.begin(),
32 [](unsigned char c){ return std::tolower(c); });
33
34 // more cases of nominal weights
35 if (outLowercase == "default" // This is a primary weight in newer samples
36 || outLowercase == "nominal" // Powheg calls it "nominal"
37 || outLowercase == "weight" // Sherpa names the nominal weight just "Weight"
38 || outLowercase == "0")
39 {
40 return {};
41 }
42
43 static const std::vector<std::pair<std::string, std::string>> substitutions =
44 {
45 {" set = ", "_"}, // Powheg
46 {" = ", "_"}, // Powheg
47 {"+", "plus"},
48 {"-", "minus"},
49 {"=", ""},
50 {",", ""},
51 {".", ""},
52 {":", ""},
53 {" ", "_"},
54 {"#", "num"},
55 {"\n", "_"},
56 {"/", "over"}, // MadGraph
57 };
58
59 for (const auto &[before, after] : substitutions)
60 {
61 size_t location = out.find(before);
62 while (location != std::string::npos)
63 {
64 out.replace(location, before.length(), after);
65 location = out.find(before);
66 }
67 }
68
69 return out;
70}

◆ weightNameWithPrefix()

std::string PMGTools::weightNameWithPrefix ( const std::string & name)

cleanup the weight name and add prefix

Definition at line 72 of file WeightHelpers.cxx.

73{
74 std::string out = weightNameCleanup(name);
75 if (out.empty())
76 {
77 return out;
78 }
79
80 return generatorWeightsPrefix + out;
81}
constexpr char generatorWeightsPrefix[]
the prefix for generator weights
std::string weightNameCleanup(const std::string &name)
cleanup the weight name

Variable Documentation

◆ generatorWeightsPrefix

char PMGTools::generatorWeightsPrefix[] {"GEN_"}
constexpr

the prefix for generator weights

Definition at line 19 of file WeightHelpers.h.

19{"GEN_"};