forked from UCATLAS/xAODAnaHelpers
/
MuonEfficiencyCorrector_AnaToolHandle.txt
144 lines (111 loc) · 4.74 KB
/
MuonEfficiencyCorrector_AnaToolHandle.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/**
* @file MuonEfficiencyCorrector.h
* @author Marco Milesi <marco.milesi@cern.ch>
* @brief Interface to the tools of the MuonEfficiencyCorrections package.
*
*/
#ifndef xAODAnaHelpers_MuonEfficiencyCorrector_H
#define xAODAnaHelpers_MuonEfficiencyCorrector_H
// CP interface includes
#include "PATInterfaces/SystematicRegistry.h"
#include "PATInterfaces/SystematicSet.h"
#include "PATInterfaces/SystematicsUtil.h"
#include "PATInterfaces/SystematicVariation.h"
#include "PATInterfaces/ISystematicsTool.h"
// external tools include(s):
#include "AsgTools/AnaToolHandle.h"
// algorithm wrapper
#include "xAODAnaHelpers/Algorithm.h"
namespace CP {
class IMuonEfficiencyScaleFactors;
class MuonEfficiencyScaleFactors;
class IMuonTriggerScaleFactors;
class IPileupReweightingTool;
}
class MuonEfficiencyCorrector : public xAH::Algorithm
{
// put your configuration variables here as public variables.
// that way they can be set directly from CINT and python.
public:
// configuration variables
std::string m_inContainerName;
std::string m_calibRelease;
// Reco efficiency SF
std::string m_WorkingPointReco;
// Iso efficiency SF
std::string m_WorkingPointIso;
// Trigger efficiency SF
int m_runNumber;
bool m_useRandomRunNumber;
std::string m_WorkingPointRecoTrig;
std::string m_WorkingPointIsoTrig;
std::string m_SingleMuTrig; // this can be either a single muon trigger chain, or an OR of ( 2 single muon chains )
std::string m_DiMuTrig; // this can be either a dimuon trigger chain, or an OR of ( N single muon trigger chains, dimuon chain )
// TTVA efficiency SF
std::string m_WorkingPointTTVA;
// systematics
std::string m_inputAlgoSystNames; // this is the name of the vector of names of the systematically varied containers produced by the
// upstream algo (e.g., the SC containers with calibration systematics)
float m_systValReco;
float m_systValIso;
float m_systValTrig;
float m_systValTTVA;
std::string m_systNameReco;
std::string m_systNameIso;
std::string m_systNameTrig;
std::string m_systNameTTVA;
std::string m_outputSystNamesReco;
std::string m_outputSystNamesIso;
std::string m_outputSystNamesTrig;
std::string m_outputSystNamesTrigMCEff;
std::string m_outputSystNamesTTVA;
private:
xAOD::TEvent *m_event; //!
xAOD::TStore *m_store; //!
bool m_isMC; //!
int m_numEvent; //!
int m_numObject; //!
std::vector<CP::SystematicSet> m_systListReco; //!
std::vector<CP::SystematicSet> m_systListIso; //!
std::vector<CP::SystematicSet> m_systListTrig; //!
std::vector<CP::SystematicSet> m_systListTTVA; //!
// tools
asg::AnaToolHandle<CP::IMuonEfficiencyScaleFactors> m_muRecoSF_tool_handle; //!
std::string m_recoEffSF_tool_name; //!
asg::AnaToolHandle<CP::IMuonEfficiencyScaleFactors> m_muIsoSF_tool_handle; //!
std::string m_isoEffSF_tool_name; //!
asg::AnaToolHandle<CP::IMuonTriggerScaleFactors> m_muTrigSF_tool_handle; //!
std::string m_trigEffSF_tool_name; //!
/*
TEMP! Commenting this out b/c stupid AnaToolHandle does not work as it should...
asg::AnaToolHandle<CP::IMuonEfficiencyScaleFactors> m_muTTVASF_tool_handle; //!
*/
CP::MuonEfficiencyScaleFactors* m_muTTVASF_tool; //!
std::string m_TTVAEffSF_tool_name; //!
asg::AnaToolHandle<CP::IPileupReweightingTool> m_pileup_tool_handle; //!
// variables that don't get filled at submission time should be
// protected from being send from the submission node to the worker
// node (done by the //!)
public:
// Tree *myTree; //!
// TH1 *myHist; //!
// this is a standard constructor
MuonEfficiencyCorrector (std::string className = "MuonEfficiencyCorrector");
// these are the functions inherited from Algorithm
virtual EL::StatusCode setupJob (EL::Job& job);
virtual EL::StatusCode fileExecute ();
virtual EL::StatusCode histInitialize ();
virtual EL::StatusCode changeInput (bool firstFile);
virtual EL::StatusCode initialize ();
virtual EL::StatusCode execute ();
virtual EL::StatusCode postExecute ();
virtual EL::StatusCode finalize ();
virtual EL::StatusCode histFinalize ();
// these are the functions not inherited from Algorithm
virtual EL::StatusCode executeSF ( const xAOD::EventInfo* eventInfo, const xAOD::MuonContainer* inputMuons, unsigned int countSyst );
/// @cond
// this is needed to distribute the algorithm to the workers
ClassDef(MuonEfficiencyCorrector, 1);
/// @endcond
};
#endif