Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ligang Xia
athena
Commits
c51152b7
Commit
c51152b7
authored
Oct 20, 2022
by
Ligang Xia
Browse files
add client for e->y
parent
045281cc
Changes
4
Hide whitespace changes
Inline
Side-by-side
PhysicsAnalysis/AnalysisCommon/FakeBkgTools/FakeBkgTools/ApplyE2YFakeRate.h
View file @
c51152b7
...
...
@@ -3,32 +3,32 @@
*/
/**
* @file LeptonFakeFactorTools/ApplyE2YFakRate.h
* @file LeptonFakeFactorTools/ApplyE2YFak
e
Rate.h
* @authors Joseph Reichert <Joseph.Reichert@cern.ch>
* @date August 2016
* @brief Tool to read fake factor histograms and return
* the binned fake factor value
**/
#ifndef ApplyE2YFakRate_H
#define ApplyE2YFakRate_H
#ifndef ApplyE2YFak
e
Rate_H
#define ApplyE2YFak
e
Rate_H
#include
<FakeBkgTools/BaseLinearFakeBkgTool.h>
namespace
CP
{
class
ApplyE2YFakRate
:
public
CP
::
BaseLinearFakeBkgTool
class
ApplyE2YFak
e
Rate
:
public
CP
::
BaseLinearFakeBkgTool
{
ASG_TOOL_CLASS2
(
ApplyE2YFakRate
,
ILinearFakeBkgTool
,
IFakeBkgTool
)
ASG_TOOL_CLASS2
(
ApplyE2YFak
e
Rate
,
ILinearFakeBkgTool
,
IFakeBkgTool
)
public:
/// Standard constructor
ApplyE2YFakRate
(
const
std
::
string
&
name
);
ApplyE2YFak
e
Rate
(
const
std
::
string
&
name
);
/// Standard destructor
~
ApplyE2YFakRate
();
~
ApplyE2YFak
e
Rate
();
// Main methods
public:
...
...
PhysicsAnalysis/AnalysisCommon/FakeBkgTools/FakeBkgTools/FakeBkgInternals.h
View file @
c51152b7
...
...
@@ -140,7 +140,7 @@ private:
enum
class
Client
{
NONE
,
MATRIX_METHOD
,
FAKE_FACTOR
,
ALL_METHODS
NONE
,
MATRIX_METHOD
,
FAKE_FACTOR
,
E2Y_FAKE
,
ALL_METHODS
};
inline
Uncertainty
&
Uncertainty
::
operator
+=
(
const
Uncertainty
&
rhs
)
...
...
PhysicsAnalysis/AnalysisCommon/FakeBkgTools/Root/ApplyE2YFakeRate.cxx
View file @
c51152b7
...
...
@@ -28,7 +28,7 @@ ApplyE2YFakeRate::~ApplyE2YFakeRate()
FakeBkgTools
::
Client
ApplyE2YFakeRate
::
clientForDB
()
{
return
FakeBkgTools
::
Client
::
FAKE
_FACTOR
;
return
FakeBkgTools
::
Client
::
E2Y_
FAKE
;
}
StatusCode
ApplyE2YFakeRate
::
initialize
()
...
...
@@ -62,8 +62,8 @@ StatusCode ApplyE2YFakeRate::getEventWeightCustom(
// FIXME when we load in the FFs, need to allow for e.g. pT, eta binning and arbitrary parameterizations
float
fake_rate
=
particle
.
fake_efficiency
.
nominal
;
float
fake_rate_sf
=
particle
.
fake_efficiency_sf
.
nominal
;
ATH_MSG_INFO
(
"e2y fake rate is "
<<
fake_rate
);
ATH_MSG_INFO
(
"e2y fake rate SF is "
<<
fake_rate_sf
);
//
ATH_MSG_INFO("e2y fake rate is " << fake_rate);
//
ATH_MSG_INFO("e2y fake rate SF is " << fake_rate_sf);
if
(
m_e2y_option
==
1
)
outputEventWeight
.
nominal
*=
fake_rate
;
else
...
...
PhysicsAnalysis/AnalysisCommon/FakeBkgTools/Root/Database.cxx
View file @
c51152b7
...
...
@@ -69,7 +69,9 @@ bool Database::fillEfficiencies(ParticleData& pd, const xAOD::IParticle& p, cons
{
EfficiencyType
wantedType
=
static_cast
<
EfficiencyType
>
(
wt
);
if
(
!
m_typesToFill
[
wantedType
])
continue
;
//ATH_MSG_INFO("eff 0");
Efficiency
*
eff
=
selectEfficiency
(
pd
,
p
,
wantedType
);
/// pointer to the proper member of ParticleData that needs to be filled
//ATH_MSG_INFO("eff 1");
if
(
!
eff
)
continue
;
/// The efficiency tables to look for might be for a different type (if a Fake efficiency <--> Fake factor conversion is needed)
...
...
@@ -1046,6 +1048,7 @@ Efficiency* Database::selectEfficiency(ParticleData& pd, const xAOD::IParticle&
if
(
type
==
ELECTRON_FAKE_FACTOR
)
return
&
pd
.
fake_factor
;
else
if
(
type
==
ELECTRON_FAKE_EFFICIENCY
)
return
&
pd
.
fake_efficiency
;
else
if
(
type
==
ELECTRON_REAL_EFFICIENCY
)
return
&
pd
.
real_efficiency
;
else
if
(
type
==
PHOTON_electronFAKE_EFFICIENCY
)
return
&
pd
.
fake_efficiency
;
break
;
case
xAOD
::
Type
::
Muon
:
if
(
type
==
MUON_FAKE_FACTOR
)
return
&
pd
.
fake_factor
;
...
...
@@ -1058,8 +1061,7 @@ Efficiency* Database::selectEfficiency(ParticleData& pd, const xAOD::IParticle&
else
if
(
type
==
TAU_REAL_EFFICIENCY
)
return
&
pd
.
real_efficiency
;
break
;
case
xAOD
::
Type
::
Photon
:
if
(
type
==
PHOTON_electronFAKE_EFFICIENCY
)
return
&
pd
.
fake_efficiency
;
else
if
(
type
==
PHOTON_electronFAKE_EFFICIENCY_SF
)
return
&
pd
.
fake_efficiency_sf
;
if
(
type
==
PHOTON_electronFAKE_EFFICIENCY_SF
)
return
&
pd
.
fake_efficiency_sf
;
break
;
default:
;
}
...
...
@@ -1078,8 +1080,6 @@ auto Database::selectTypesToFill(Client client) -> std::bitset<N_EFFICIENCY_TYPE
result
[
ELECTRON_FAKE_EFFICIENCY
]
=
true
;
result
[
MUON_FAKE_EFFICIENCY
]
=
true
;
result
[
TAU_FAKE_EFFICIENCY
]
=
true
;
result
[
PHOTON_electronFAKE_EFFICIENCY
]
=
true
;
result
[
PHOTON_electronFAKE_EFFICIENCY_SF
]
=
true
;
}
if
(
client
==
Client
::
FAKE_FACTOR
||
client
==
Client
::
ALL_METHODS
)
{
...
...
@@ -1087,6 +1087,11 @@ auto Database::selectTypesToFill(Client client) -> std::bitset<N_EFFICIENCY_TYPE
result
[
MUON_FAKE_FACTOR
]
=
true
;
result
[
TAU_FAKE_FACTOR
]
=
true
;
}
if
(
client
==
Client
::
E2Y_FAKE
||
client
==
Client
::
ALL_METHODS
)
{
result
[
PHOTON_electronFAKE_EFFICIENCY
]
=
true
;
result
[
PHOTON_electronFAKE_EFFICIENCY_SF
]
=
true
;
}
if
(
result
.
none
())
throw
(
GenericError
()
<<
"unrecognized client type, implementation incomplete"
);
return
result
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment