forked from UCATLAS/xAODAnaHelpers
/
ElectronSelector.h
179 lines (131 loc) · 6.21 KB
/
ElectronSelector.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
#ifndef xAODAnaHelpers_ElectronSelector_H
#define xAODAnaHelpers_ElectronSelector_H
// EDM include(s):
#include "xAODEgamma/ElectronContainer.h"
#include "xAODTracking/Vertex.h"
// package include(s):
#include "xAODAnaHelpers/ParticlePIDManager.h"
// ROOT include(s):
#include "TH1D.h"
// external tools include(s):
#include "IsolationSelection/IsolationSelectionTool.h"
// algorithm wrapper
#include "xAODAnaHelpers/Algorithm.h"
namespace Trig {
class TrigDecisionTool;
class TrigEgammaMatchingTool;
}
class ElectronSelector : public xAH::Algorithm
{
/*
put your configuration variables here as public variables.
that way they can be set directly from CINT and python.
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:
bool m_useCutFlow;
/* configuration variables */
std::string m_inContainerName; /* input container name */
std::string m_outContainerName; /* output container name */
std::string m_outAuxContainerName; /* output auxiliary container name */
std::string m_inputAlgoSystNames;
std::string m_outputAlgoSystNames;
bool m_decorateSelectedObjects; /* decorate selected objects - default "passSel" */
bool m_createSelectedContainer; /* fill using SG::VIEW_ELEMENTS to be light weight */
int m_nToProcess; /* look at n objects */
int m_pass_min; /* minimum number of objects passing cuts */
int m_pass_max; /* maximum number of objects passing cuts */
float m_pT_max; /* require pT < pt_max */
float m_pT_min; /* require pT > pt_min */
float m_eta_max; /* require |eta| < eta_max */
bool m_vetoCrack; /* require |eta| outside crack region */
float m_d0_max; /* require d0 < m_d0_max */
float m_d0sig_max; /* require d0 significance (at BL) < m_d0sig_max */
float m_z0sintheta_max; /* require z0*sin(theta) (at BL - corrected with vertex info) < m_z0sintheta_max */
bool m_doAuthorCut;
bool m_doOQCut;
/* electron PID */
bool m_readIDFlagsFromDerivation;
std::string m_confDirPID;
/* likelihood-based */
bool m_doLHPIDcut;
std::string m_LHConfigYear;
std::string m_LHOperatingPoint;
/* cut-based */
bool m_doCutBasedPIDcut;
std::string m_CutBasedConfigYear;
std::string m_CutBasedOperatingPoint;
/* isolation */
std::string m_MinIsoWPCut; /* reject objects which do not pass this isolation cut - default = "" (no cut) */
std::string m_IsoWPList; /* decorate objects with 'isIsolated_*' flag for each WP in this input list - default = all current ASG WPs */
std::string m_CaloIsoEff; /* to define a custom WP - make sure "UserDefined" is added in the above input list! */
std::string m_TrackIsoEff; /* to define a custom WP - make sure "UserDefined" is added in the above input list! */
std::string m_CaloBasedIsoType; /* to define a custom WP - make sure "UserDefined" is added in the above input list! */
std::string m_TrackBasedIsoType; /* to define a custom WP - make sure "UserDefined" is added in the above input list! */
/* trigger matching */
std::string m_ElTrigChains; /* A comma-separated string w/ alll the HLT electron trigger chains for which you want to perform the matching.
This is passed by the user as input in configuration
If left empty (as it is by default), no trigger matching will be attempted at all */
private:
int m_numEvent; //!
int m_numObject; //!
int m_numEventPass; //!
int m_weightNumEventPass; //!
int m_numObjectPass; //!
/* event-level cutflow */
TH1D* m_cutflowHist; //!
TH1D* m_cutflowHistW; //!
int m_cutflow_bin; //!
bool m_isUsedBefore; //!
/* object-level cutflow */
TH1D* m_el_cutflowHist_1; //!
TH1D* m_el_cutflowHist_2; //!
int m_el_cutflow_all; //!
int m_el_cutflow_author_cut; //!
int m_el_cutflow_OQ_cut; //!
int m_el_cutflow_ptmax_cut; //!
int m_el_cutflow_ptmin_cut; //!
int m_el_cutflow_eta_cut; //!
int m_el_cutflow_PID_cut; //!
int m_el_cutflow_z0sintheta_cut; //!
int m_el_cutflow_d0_cut; //!
int m_el_cutflow_d0sig_cut; //!
int m_el_cutflow_iso_cut; //!
std::vector<std::string> m_IsoKeys; //!
/* tools */
CP::IsolationSelectionTool* m_IsolationSelectionTool; //!
/* PID manager(s) */
ElectronLHPIDManager* m_el_LH_PIDManager; //!
ElectronCutBasedPIDManager* m_el_CutBased_PIDManager; //!
Trig::TrigDecisionTool* m_trigDecTool; //!
Trig::TrigEgammaMatchingTool* m_trigElMatchTool; //!
/* other private members */
std::vector<std::string> m_ElTrigChainsList; //! /* contains all the HLT trigger chains tokens extracted from m_ElTrigChains */
public:
/* this is a standard constructor */
ElectronSelector ();
~ElectronSelector();
/* 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 ();
/* added functions not from Algorithm */
bool executeSelection( const xAOD::ElectronContainer* inElectrons, float mcEvtWeight, bool countPass,
ConstDataVector<xAOD::ElectronContainer>* selectedElectrons );
virtual int passCuts( const xAOD::Electron* electron, const xAOD::Vertex *primaryVertex );
/// @cond
/* this is needed to distribute the algorithm to the workers */
ClassDef(ElectronSelector, 1);
/// @endcond
};
#endif