ATLAS Offline Software
PMGSherpaVjetsSysTool.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id: PMGSherpaVjetsSysTool.h tripiana $
8 //
9 // Tool calculating event weights for systematic variations of Sherpa V+jets (V=Z,W,gamma) samples
10 //
11 // @author Martin Tripiana <martin.tripiana@cern.ch>
12 // John Anders <john.kenneth.anders@cern.ch>
13 //
14 // $Date: 2016-07-12 $
15 //
16 
17 #ifndef PMGTOOLS_PMGSHERPAVJETSSYSTOOL_H
18 #define PMGTOOLS_PMGSHERPAVJETSSYSTOOL_H
19 
20 // Infrastructure include(s):
21 #include "AsgTools/AsgTool.h"
22 
23 // Interface include(s):
25 
26 // System include(s):
27 #include <map>
28 #include <vector>
29 #include <memory>
30 
31 // ROOT include(s):
32 #include "TFile.h"
33 
34 // Forward declaration
35 class TH2F;
36 
37 namespace PMGTools {
38 
40  public asg::AsgTool {
41 
42  //proper constructor for athena
44 
45  public:
47  PMGSherpaVjetsSysTool( const std::string& name );
48 
50  StatusCode initialize() override;
51 
53  double getWeight( const std::string& sysVariation = "nom") override;
54 
55  protected:
57  void setNjets(int njets) override;
58  void cacheDSID(bool do_it=true) override;
59 
61  std::vector<std::string> getSupportedVariations(SysParType ptype) override;
62 
64  unsigned int getNtruthJets() override;
65 
66  private:
67  int getPtMapping(SysParType& pType);
68 
71 
75  unsigned int m_cache_ptidx;
76 
78  std::unique_ptr< TFile > m_file;
79 
81  std::map<std::string, TH2F*> m_map_w;
82  std::map<std::string, TH2F*> m_map_zll;
83  std::map<std::string, TH2F*> m_map_znunu;
84  std::map<std::string, TH2F*> m_map_gamma;
85 
86  std::vector<std::string> m_supported_w;
87  std::vector<std::string> m_supported_zll;
88  std::vector<std::string> m_supported_znunu;
89  std::vector<std::string> m_supported_gamma;
90 
92 
94  std::string m_weightsFile;
95 
97  std::string m_truthJetContainer;
100 
101  }; // class PMGSherpaVjetsSysTool
102 
103 } //namespace PMGTools
104 
105 #endif //> !PMGTOOLS_PMGSHERPAVJETSSYSTOOL_H
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PMGTools::IPMGSherpaVjetsSysTool
Definition: AnalysisCommon/PMGTools/PMGTools/IPMGSherpaVjetsSysTool.h:27
PMGTools::PMGSherpaVjetsSysTool::PMGSherpaVjetsSysTool
PMGSherpaVjetsSysTool(const std::string &name)
Standard tool constructor, with name.
Definition: PMGSherpaVjetsSysTool.cxx:29
PMGTools::PMGSherpaVjetsSysTool::m_supported_w
std::vector< std::string > m_supported_w
Definition: PMGSherpaVjetsSysTool.h:86
PMGTools::PMGSherpaVjetsSysTool::m_current_njets
int m_current_njets
Current settings.
Definition: PMGSherpaVjetsSysTool.h:70
PMGTools::PMGSherpaVjetsSysTool::initialize
StatusCode initialize() override
Initialize is required by AsgTool base class.
Definition: PMGSherpaVjetsSysTool.cxx:51
PMGTools::PMGSherpaVjetsSysTool::m_supported_zll
std::vector< std::string > m_supported_zll
Definition: PMGSherpaVjetsSysTool.h:87
PMGTools::PMGSherpaVjetsSysTool::cacheDSID
void cacheDSID(bool do_it=true) override
Definition: PMGSherpaVjetsSysTool.cxx:125
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
PMGTools::PMGSherpaVjetsSysTool::m_map_zll
std::map< std::string, TH2F * > m_map_zll
Definition: PMGSherpaVjetsSysTool.h:82
PMGTools::PMGSherpaVjetsSysTool
Definition: PMGSherpaVjetsSysTool.h:40
PMGTools::PMGSherpaVjetsSysTool::getPtMapping
int getPtMapping(SysParType &pType)
Definition: PMGSherpaVjetsSysTool.cxx:171
PMGTools::PMGSherpaVjetsSysTool::m_truthParticleContainer
std::string m_truthParticleContainer
The truth particle container to use for the calculation.
Definition: PMGSherpaVjetsSysTool.h:99
PMGTools::PMGSherpaVjetsSysTool::setNjets
void setNjets(int njets) override
Some setters to speed up the calculation for multiple variations/events.
Definition: PMGSherpaVjetsSysTool.cxx:479
PMGTools::PMGSherpaVjetsSysTool::getWeight
double getWeight(const std::string &sysVariation="nom") override
Return weight for a given systematic variation.
Definition: PMGSherpaVjetsSysTool.cxx:135
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PMGTools
Tool providing sample cross-sections and k-factors etc.
Definition: AnalysisCommon/PMGTools/PMGTools/IPMGCrossSectionTool.h:15
PMGTools::PMGSherpaVjetsSysTool::m_map_znunu
std::map< std::string, TH2F * > m_map_znunu
Definition: PMGSherpaVjetsSysTool.h:83
PMGTools::PMGSherpaVjetsSysTool::m_supported_gamma
std::vector< std::string > m_supported_gamma
Definition: PMGSherpaVjetsSysTool.h:89
PMGTools::PMGSherpaVjetsSysTool::m_supported_znunu
std::vector< std::string > m_supported_znunu
Definition: PMGSherpaVjetsSysTool.h:88
PMGTools::PMGSherpaVjetsSysTool::m_weightsFile
std::string m_weightsFile
Tool properties.
Definition: PMGSherpaVjetsSysTool.h:94
PMGTools::PMGSherpaVjetsSysTool::m_cache_ptype
SysParType m_cache_ptype
Definition: PMGSherpaVjetsSysTool.h:74
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
PMGTools::PMGSherpaVjetsSysTool::m_use_cache
bool m_use_cache
Cache MC DSID (to avoid checking it everytime)
Definition: PMGSherpaVjetsSysTool.h:73
PMGTools::SysParType
SysParType
Definition: AnalysisCommon/PMGTools/PMGTools/IPMGSherpaVjetsSysTool.h:19
PMGTools::PMGSherpaVjetsSysTool::m_truthJetContainer
std::string m_truthJetContainer
The truth jet container to use for the calculation.
Definition: PMGSherpaVjetsSysTool.h:97
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
PMGTools::PMGSherpaVjetsSysTool::getNtruthJets
unsigned int getNtruthJets() override
get number of truth jets as defined in the parametrization analysis
Definition: PMGSherpaVjetsSysTool.cxx:393
PMGTools::PMGSherpaVjetsSysTool::getSupportedVariations
std::vector< std::string > getSupportedVariations(SysParType ptype) override
Helpers to get the list of supported variations for Z/W+jets and gamma+jets.
Definition: PMGSherpaVjetsSysTool.cxx:484
PMGTools::PMGSherpaVjetsSysTool::m_file
std::unique_ptr< TFile > m_file
Parametrization files.
Definition: PMGSherpaVjetsSysTool.h:78
IPMGSherpaVjetsSysTool.h
AsgTool.h
PMGTools::PMGSherpaVjetsSysTool::m_map_w
std::map< std::string, TH2F * > m_map_w
Parametrization maps.
Definition: PMGSherpaVjetsSysTool.h:81
PMGTools::PMGSherpaVjetsSysTool::m_cache_ptidx
unsigned int m_cache_ptidx
Definition: PMGSherpaVjetsSysTool.h:75
PMGTools::PMGSherpaVjetsSysTool::m_map_gamma
std::map< std::string, TH2F * > m_map_gamma
Definition: PMGSherpaVjetsSysTool.h:84