forked from UCATLAS/xAODAnaHelpers
/
JetCalibrator.h
126 lines (100 loc) · 3.5 KB
/
JetCalibrator.h
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
/********************************************************
* JetCalibrator:
*
* This class handles jet calibration and systematics
*
* Jeff Dandoy (jeff.dandoy@cern.ch)
*
********************************************************/
#ifndef xAODAnaHelpers_JetCalibrator_H
#define xAODAnaHelpers_JetCalibrator_H
// CP interface includes
#include "PATInterfaces/SystematicRegistry.h"
#include "PATInterfaces/SystematicSet.h"
#include "PATInterfaces/SystematicVariation.h"
// external tools include(s):
#include "JetCalibTools/JetCalibrationTool.h"
#include "JetUncertainties/JetUncertaintiesTool.h"
#include "JetResolution/JERTool.h"
#include "JetResolution/JERSmearingTool.h"
#include "JetSelectorTools/JetCleaningTool.h"
#include "JetMomentTools/JetVertexTaggerTool.h"
// algorithm wrapper
#include "xAODAnaHelpers/Algorithm.h"
class JetCalibrator : 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_outContainerName;
std::string m_jetAlgo;
std::string m_outputAlgo;
std::string m_calibConfigData;
std::string m_calibConfigFullSim;
std::string m_calibConfigAFII;
std::string m_calibConfig;
std::string m_calibSequence;
std::string m_JESUncertConfig;
std::string m_JESUncertMCType;
bool m_setAFII;
bool m_isTrigger; // whether the jet collection is trigger or not (soon: different calibrations)
std::string m_JERUncertConfig;
bool m_JERFullSys;
bool m_JERApplyNominal;
/// enable to apply jet cleaning
bool m_doCleaning;
std::string m_jetCleanCutLevel;
bool m_saveAllCleanDecisions;
bool m_jetCleanUgly;
bool m_redoJVT;
// sort after calibration
bool m_sort;
//Apply jet cleaning to parent jet
bool m_cleanParent;
bool m_applyFatJetPreSel;
// systematics
bool m_runSysts;
private:
int m_numEvent; //!
int m_numObject; //!
bool m_isMC; //!
bool m_isFullSim; //!
std::vector<CP::SystematicSet> m_systList; //!
std::vector<int> m_systType; //!
// tools
JetCalibrationTool * m_jetCalibration; //!
JetUncertaintiesTool * m_JESUncertTool; //!
JERTool * m_JERTool; //!
JERSmearingTool * m_JERSmearTool; //!
ToolHandle<IJERTool> m_JERToolHandle; //!
JetVertexTaggerTool * m_JVTTool; //!
ToolHandle<IJetUpdateJvt> m_JVTToolHandle; //!
JetCleaningTool * m_jetCleaning; //!
std::vector<std::string> m_decisionNames; //!
std::vector< JetCleaningTool* > m_allJetCleaningTools; //!
// 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
JetCalibrator (std::string className = "JetCalibrator");
// 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 ();
/// @cond
// this is needed to distribute the algorithm to the workers
ClassDef(JetCalibrator, 1);
/// @endcond
};
#endif