ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
HeavyIonRec
HIJetRec
HIJetRec
HIJetRecDefs.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef HIJETREC_HIJETRECDEFS_H
6
#define HIJETREC_HIJETRECDEFS_H
7
8
#include "
xAODCaloEvent/CaloCluster.h
"
9
#include "
xAODJet/JetTypes.h
"
10
#include "
HIEventUtils/HIEventDefs.h
"
11
#include "
FourMomUtils/xAODP4Helpers.h
"
12
#include "TLorentzVector.h"
13
14
15
namespace
HIJetRec
{
16
17
//define conventions for HIJets in terms of various signal states
18
constexpr
const
char
*
unsubtractedJetState
() {
return
"JetUnsubtractedScaleMomentum"
;}
19
constexpr
const
char
*
subtractedJetState
() {
return
"JetSubtractedScaleMomentum"
;}
20
constexpr
const
char
*
subtractedOriginCorrectedJetState
() {
return
"JetSubtractedOriginCorrectedScaleMomentum"
;}
21
22
constexpr
xAOD::JetConstitScale
subtractedConstitState
() {
return
xAOD::UncalibratedJetConstituent
;}
23
constexpr
xAOD::JetConstitScale
subtractedOriginCorrectedConstitState
() {
return
xAOD::CalibratedJetConstituent
;}
24
25
constexpr
xAOD::CaloCluster::State
unsubtractedClusterState
() {
return
xAOD::CaloCluster::ALTCALIBRATED
;}
26
constexpr
xAOD::CaloCluster::State
subtractedClusterState
() {
return
xAOD::CaloCluster::UNCALIBRATED
;}
27
constexpr
xAOD::CaloCluster::State
subtractedOriginCorrectedClusterState
() {
return
xAOD::CaloCluster::CALIBRATED
;}
28
29
inline
bool
inTowerBoundary
(
float
eta0,
float
phi0,
float
eta
,
float
phi
)
30
{
31
if
( 2.*std::abs(
eta
-eta0) >
HI::TowerBins::getBinSizeEta
() )
return
false
;
32
if
( 2.*std::abs(
xAOD::P4Helpers::deltaPhi
(phi0,
phi
)) >
HI::TowerBins::getBinSizePhi
() )
return
false
;
33
return
true
;
34
}
35
36
inline
void
setClusterP4
(
const
xAOD::CaloCluster::FourMom_t
& p,
xAOD::CaloCluster
* cl,
xAOD::CaloCluster::State
s)
37
{
38
float
energy=p.Energy();
39
float
eta
=p.Eta();
40
float
phi
=p.Phi();
41
if
(energy < 0.)
42
{
43
eta
*=-1.;
44
if
(
phi
> 0.)
phi
-=
M_PI
;
45
else
phi
+=
M_PI
;
46
}
47
if
(s==
xAOD::CaloCluster::UNCALIBRATED
)
48
{
49
cl->setRawE(energy);
50
cl->setRawEta(
eta
);
51
cl->setRawPhi(
phi
);
52
cl->setRawM(0);
53
}
54
else
if
(s==
xAOD::CaloCluster::ALTCALIBRATED
)
55
{
56
cl->setAltE(energy);
57
cl->setAltEta(
eta
);
58
cl->setAltPhi(
phi
);
59
cl->setAltM(0);
60
}
61
else
if
(s==
xAOD::CaloCluster::CALIBRATED
)
62
{
63
cl->setCalE(energy);
64
cl->setCalEta(
eta
);
65
cl->setCalPhi(
phi
);
66
cl->setCalM(0);
67
}
68
}
69
73
inline
TLorentzVector
getClusterP4
(
const
xAOD::CaloCluster
* cl,
xAOD::CaloCluster::State
s ){
74
TLorentzVector correct_clusP4;
75
float
energy=cl->e(s);
76
float
eta
=cl->eta(s);
77
float
phi
=cl->phi(s);
78
if
(energy < 0.)
79
{
80
eta
*=-1.;
81
if
(
phi
> 0.)
phi
-=
M_PI
;
82
else
phi
+=
M_PI
;
83
}
84
float
pt=energy/std::cosh(
eta
);
85
correct_clusP4.SetPtEtaPhiE(pt,
eta
,
phi
,energy);
86
return
correct_clusP4;
87
}
88
}
89
#endif
M_PI
#define M_PI
Definition
ActiveFraction.h:14
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
CaloCluster.h
HIEventDefs.h
JetTypes.h
xAOD::CaloCluster_v1::State
State
enum of possible signal states.
Definition
CaloCluster_v1.h:307
xAOD::CaloCluster_v1::ALTCALIBRATED
@ ALTCALIBRATED
Definition
CaloCluster_v1.h:311
xAOD::CaloCluster_v1::UNCALIBRATED
@ UNCALIBRATED
Definition
CaloCluster_v1.h:309
xAOD::CaloCluster_v1::CALIBRATED
@ CALIBRATED
Definition
CaloCluster_v1.h:310
xAOD::CaloCluster_v1::FourMom_t
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
Definition
CaloCluster_v1.h:346
HIJetRec
Definition
HIJetRecDefs.h:15
HIJetRec::unsubtractedJetState
constexpr const char * unsubtractedJetState()
Definition
HIJetRecDefs.h:18
HIJetRec::subtractedOriginCorrectedConstitState
constexpr xAOD::JetConstitScale subtractedOriginCorrectedConstitState()
Definition
HIJetRecDefs.h:23
HIJetRec::subtractedJetState
constexpr const char * subtractedJetState()
Definition
HIJetRecDefs.h:19
HIJetRec::getClusterP4
TLorentzVector getClusterP4(const xAOD::CaloCluster *cl, xAOD::CaloCluster::State s)
: getClusterP4 Added during Rel22 migration.
Definition
HIJetRecDefs.h:73
HIJetRec::inTowerBoundary
bool inTowerBoundary(float eta0, float phi0, float eta, float phi)
Definition
HIJetRecDefs.h:29
HIJetRec::subtractedOriginCorrectedJetState
constexpr const char * subtractedOriginCorrectedJetState()
Definition
HIJetRecDefs.h:20
HIJetRec::unsubtractedClusterState
constexpr xAOD::CaloCluster::State unsubtractedClusterState()
Definition
HIJetRecDefs.h:25
HIJetRec::subtractedClusterState
constexpr xAOD::CaloCluster::State subtractedClusterState()
Definition
HIJetRecDefs.h:26
HIJetRec::subtractedConstitState
constexpr xAOD::JetConstitScale subtractedConstitState()
Definition
HIJetRecDefs.h:22
HIJetRec::setClusterP4
void setClusterP4(const xAOD::CaloCluster::FourMom_t &p, xAOD::CaloCluster *cl, xAOD::CaloCluster::State s)
Definition
HIJetRecDefs.h:36
HIJetRec::subtractedOriginCorrectedClusterState
constexpr xAOD::CaloCluster::State subtractedOriginCorrectedClusterState()
Definition
HIJetRecDefs.h:27
HI::TowerBins::getBinSizeEta
constexpr float getBinSizeEta()
Definition
HIEventDefs.h:31
HI::TowerBins::getBinSizePhi
constexpr float getBinSizePhi()
Definition
HIEventDefs.h:32
xAOD::P4Helpers::deltaPhi
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
Definition
xAODP4Helpers.h:69
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
xAOD::JetConstitScale
JetConstitScale
Definition
JetTypes.h:20
xAOD::UncalibratedJetConstituent
@ UncalibratedJetConstituent
Definition
JetTypes.h:21
xAOD::CalibratedJetConstituent
@ CalibratedJetConstituent
Definition
JetTypes.h:22
xAODP4Helpers.h
Generated on
for ATLAS Offline Software by
1.17.0