ATLAS Offline Software
SampleXsection.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef SAMPLEXSECTION_H
6 #define SAMPLEXSECTION_H
7 
8 #include <map>
9 #include <string>
10 #include <unordered_map>
11 
20 public:
21  enum showering {
22  pythia=0,
23  herwig=1,
24  sherpa=2,
35  unknown=14
36  };
37 
38  inline SampleXsection() : m_Xsects() {}
39  inline SampleXsection(const SampleXsection& xs) : m_Xsects(xs.m_Xsects) {}
40  inline ~SampleXsection() {}
41 
43 
44  bool readFromFile(const char* fName);
45  void setSample(const int dsid, const double xSect, const double kFact, const showering shower, const double xSectDw,
46  const double xSectUp);
47 
48  double getRawXsection(const int dsid) const;
49  double getKfactor(const int dsid) const;
50  double getXsection(const int dsid) const;
51  double getXsectionUp(const int dsid) const;
52  double getXsectionDown(const int dsid) const;
53  std::pair<double, double> getXsectionDownUp(const int dsid) const;
54  showering getShowering(const int dsid) const;
55  std::string getShoweringString(const int dsid) const;
56  int getShoweringIndex(const int dsid) const;
57  void setTranslator(const std::unordered_map<std::string, std::string>& map) {m_translator = map;}
58 
59 private:
60  std::map<int, std::pair<double, double> > m_Xsects;
61  std::map<int, std::pair<double, double> > m_Uncert;
62  std::map<int, showering > m_Showering;
63  std::unordered_map<std::string, std::string> m_translator;
64 
65  showering applyTranslation(const showering shower) const;
66  std::string showerToString(const showering shower) const;
67  showering stringToShower(const std::string& name) const;
68 };
69 
70 #endif // SAMPLEXSECTION_H
SampleXsection::getKfactor
double getKfactor(const int dsid) const
Definition: SampleXsection.cxx:95
SampleXsection::sherpa2212
@ sherpa2212
Definition: SampleXsection.h:33
SampleXsection::amcatnlopythia8
@ amcatnlopythia8
Definition: SampleXsection.h:28
SampleXsection::m_Showering
std::map< int, showering > m_Showering
Definition: SampleXsection.h:62
SampleXsection::sherpa
@ sherpa
Definition: SampleXsection.h:24
SampleXsection::herwig
@ herwig
Definition: SampleXsection.h:23
SampleXsection::amcatnloherwig7
@ amcatnloherwig7
Definition: SampleXsection.h:34
rootconvert.fName
string fName
Definition: rootconvert.py:5
SampleXsection::setSample
void setSample(const int dsid, const double xSect, const double kFact, const showering shower, const double xSectDw, const double xSectUp)
Definition: SampleXsection.cxx:73
SampleXsection::operator=
SampleXsection & operator=(const SampleXsection &xs)
Definition: SampleXsection.cxx:15
SampleXsection::SampleXsection
SampleXsection()
Definition: SampleXsection.h:38
SampleXsection::showering
showering
Definition: SampleXsection.h:21
SampleXsection::~SampleXsection
~SampleXsection()
Definition: SampleXsection.h:40
SampleXsection::getXsectionDownUp
std::pair< double, double > getXsectionDownUp(const int dsid) const
Definition: SampleXsection.cxx:123
SampleXsection::sherpa2210
@ sherpa2210
Definition: SampleXsection.h:31
SampleXsection
Definition: SampleXsection.h:19
SampleXsection::herwigpp
@ herwigpp
Definition: SampleXsection.h:26
SampleXsection::setTranslator
void setTranslator(const std::unordered_map< std::string, std::string > &map)
Definition: SampleXsection.h:57
SampleXsection::m_Uncert
std::map< int, std::pair< double, double > > m_Uncert
Definition: SampleXsection.h:61
SampleXsection::SampleXsection
SampleXsection(const SampleXsection &xs)
Definition: SampleXsection.h:39
SampleXsection::readFromFile
bool readFromFile(const char *fName)
Definition: SampleXsection.cxx:23
SampleXsection::getShoweringString
std::string getShoweringString(const int dsid) const
Definition: SampleXsection.cxx:145
Generate_dsid_ranseed.dsid
dsid
Definition: Generate_dsid_ranseed.py:6
SampleXsection::herwigpp713
@ herwigpp713
Definition: SampleXsection.h:29
SampleXsection::herwigpp721
@ herwigpp721
Definition: SampleXsection.h:32
SampleXsection::getRawXsection
double getRawXsection(const int dsid) const
Definition: SampleXsection.cxx:88
SampleXsection::pythia
@ pythia
Definition: SampleXsection.h:22
SampleXsection::m_translator
std::unordered_map< std::string, std::string > m_translator
Definition: SampleXsection.h:63
SampleXsection::getShowering
showering getShowering(const int dsid) const
Definition: SampleXsection.cxx:131
SampleXsection::sherpa21
@ sherpa21
Definition: SampleXsection.h:27
SampleXsection::sherpa228
@ sherpa228
Definition: SampleXsection.h:30
SampleXsection::m_Xsects
std::map< int, std::pair< double, double > > m_Xsects
Definition: SampleXsection.h:60
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SampleXsection::pythia8
@ pythia8
Definition: SampleXsection.h:25
SampleXsection::unknown
@ unknown
Definition: SampleXsection.h:35
SampleXsection::getXsection
double getXsection(const int dsid) const
Definition: SampleXsection.cxx:102
SampleXsection::applyTranslation
showering applyTranslation(const showering shower) const
Definition: SampleXsection.cxx:183
SampleXsection::getXsectionDown
double getXsectionDown(const int dsid) const
Definition: SampleXsection.cxx:109
SampleXsection::stringToShower
showering stringToShower(const std::string &name) const
Definition: SampleXsection.cxx:214
SampleXsection::getShoweringIndex
int getShoweringIndex(const int dsid) const
Definition: SampleXsection.cxx:150
SampleXsection::getXsectionUp
double getXsectionUp(const int dsid) const
Definition: SampleXsection.cxx:116
SampleXsection::showerToString
std::string showerToString(const showering shower) const
Definition: SampleXsection.cxx:196