ATLAS Offline Software
Classes | Enumerations | Functions | Variables
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  PMGCrossSectionTool
 
class  PMGDecayProductsSelectionTool
 an IAsgSelectionTool that select particles based on the allowed decay chain 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 More...
 
std::string weightNameWithPrefix (const std::string &name)
 cleanup the weight name and add prefix More...
 

Variables

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

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]

Enumerator
None 
Znunu 
Zll 
Wlnu 
GammaJets 
None 
Znunu 
Zll 
Wlnu 
GammaJets 

Definition at line 19 of file AnalysisCommon/PMGTools/PMGTools/IPMGSherpaVjetsSysTool.h.

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

◆ 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,
24  GammaJets
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  {"+", ""},
48  {"-", ""},
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 }

Variable Documentation

◆ generatorWeightsPrefix

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

the prefix for generator weights

Definition at line 19 of file WeightHelpers.h.

PMGTools::None
@ None
Definition: AnalysisCommon/PMGTools/PMGTools/IPMGSherpaVjetsSysTool.h:20
WeightHelpers.weightNameCleanup
weightNameCleanup
Definition: WeightHelpers.py:7
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
PMGTools::Wlnu
@ Wlnu
Definition: AnalysisCommon/PMGTools/PMGTools/IPMGSherpaVjetsSysTool.h:23
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
PMGTools::Znunu
@ Znunu
Definition: AnalysisCommon/PMGTools/PMGTools/IPMGSherpaVjetsSysTool.h:21
PMGTools::GammaJets
@ GammaJets
Definition: AnalysisCommon/PMGTools/PMGTools/IPMGSherpaVjetsSysTool.h:24
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
CaloCellPos2Ntuple.None
None
Definition: CaloCellPos2Ntuple.py:23
python.sizes.location
string location
Definition: sizes.py:11
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
PMGTools::generatorWeightsPrefix
constexpr char generatorWeightsPrefix[]
the prefix for generator weights
Definition: WeightHelpers.h:19
PMGTools::Zll
@ Zll
Definition: AnalysisCommon/PMGTools/PMGTools/IPMGSherpaVjetsSysTool.h:22
python.compressB64.c
def c
Definition: compressB64.py:93