forked from UCATLAS/xAODAnaHelpers
/
OverlapRemover.h
144 lines (116 loc) · 5.01 KB
/
OverlapRemover.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#ifndef XAODANAHELPERS_OVERLAPREMOVER_H
#define XAODANAHELPERS_OVERLAPREMOVER_H
// EDM include(s):
#include "xAODBase/IParticleHelpers.h"
#include "xAODBase/IParticleContainer.h"
#include "xAODEgamma/ElectronContainer.h"
#include "xAODMuon/MuonContainer.h"
#include "xAODJet/JetContainer.h"
#include "xAODEgamma/PhotonContainer.h"
#include "xAODTau/TauJetContainer.h"
// external tools include(s):
#include "AssociationUtils/OverlapRemovalTool.h"
// algorithm wrapper
#include "xAODAnaHelpers/Algorithm.h"
// ROOT include(s):
#include "TH1D.h"
class OverlapRemover : 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
bool m_useCutFlow;
bool m_decorateSelectedObjects; // decorate selected objects? default passSel
bool m_createSelectedContainers; // fill using SG::VIEW_ELEMENTS to be light weight
bool m_useSelected; // pass only object passing selection to O.R. tool
/* Electrons */
std::string m_inContainerName_Electrons;
std::string m_outContainerName_Electrons; // output container name
std::string m_inputAlgoElectrons; // name of vector<string> of syst retrieved from TStore
std::string m_outputAlgoElectrons; // name of vector<string> of syst pushed in TStore
/* Muons */
std::string m_inContainerName_Muons;
std::string m_outContainerName_Muons; // output container name
std::string m_inputAlgoMuons; // name of vector<string> of syst retrieved from TStore
std::string m_outputAlgoMuons; // name of vector<string> of syst pushed in TStore
/* Jets */
std::string m_inContainerName_Jets;
std::string m_outContainerName_Jets; // output container name
std::string m_inputAlgoJets; // name of vector<string> of syst retrieved from TStore
std::string m_outputAlgoJets; // name of vector<string> of syst pushed in TStore
/* Photons */
std::string m_inContainerName_Photons;
std::string m_outContainerName_Photons; // output container name
std::string m_inputAlgoPhotons; // name of vector<string> of syst retrieved from TStore
std::string m_outputAlgoPhotons; // name of vector<string> of syst pushed in TStore
/* Taus */
std::string m_inContainerName_Taus;
std::string m_outContainerName_Taus; // output container name
private:
int m_numEvent; //!
int m_numObject; //!
int m_numEventPass; //!
int m_weightNumEventPass; //!
int m_numObjectPass; //!
bool m_usePhotons;
bool m_useTaus;
/* Electrons */
std::string m_outAuxContainerName_Electrons; // output auxiliary container name
/* Muons */
std::string m_outAuxContainerName_Muons; // output auxiliary container name
/* Jets */
std::string m_outAuxContainerName_Jets; // output auxiliary container name
/* Photons */
std::string m_outAuxContainerName_Photons; // output auxiliary container name
/* Taus */
std::string m_outAuxContainerName_Taus; // output auxiliary container name
// tools
OverlapRemovalTool *m_overlapRemovalTool; //!
enum SystType {
NOMINAL = 0,
ELSYST = 1,
MUSYST = 2,
JETSYST = 3,
PHSYST = 4,
TAUSYST = 5,
};
/* object-level cutflow */
TH1D* m_el_cutflowHist_1; //!
TH1D* m_mu_cutflowHist_1; //!
TH1D* m_jet_cutflowHist_1; //!
TH1D* m_ph_cutflowHist_1; //!
int m_el_cutflow_OR_cut; //!
int m_mu_cutflow_OR_cut; //!
int m_jet_cutflow_OR_cut; //!
int m_ph_cutflow_OR_cut; //!
// 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
OverlapRemover ();
// 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 configure ();
virtual EL::StatusCode fillObjectCutflow (const char* type, const xAOD::IParticleContainer* objCont, const std::string& selectFlag, const std::string& overlapFlag);
virtual EL::StatusCode executeOR( const xAOD::ElectronContainer* inElectrons, const xAOD::MuonContainer* inMuons, const xAOD::JetContainer* inJets,
const xAOD::PhotonContainer* inPhotons, const xAOD::TauJetContainer* inTaus,
SystType syst_type = NOMINAL, std::vector<std::string>* sysVec = nullptr);
/// @cond
// this is needed to distribute the algorithm to the workers
ClassDef(OverlapRemover, 1);
/// @endcond
};
#endif