ATLAS Offline Software
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 
9 #include "xAODJet/JetTypes.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 
24 
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 
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  }
48  {
49  cl->setRawE(energy);
50  cl->setRawEta(eta);
51  cl->setRawPhi(phi);
52  cl->setRawM(0);
53  }
55  {
56  cl->setAltE(energy);
57  cl->setAltEta(eta);
58  cl->setAltPhi(phi);
59  cl->setAltM(0);
60  }
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
HIJetRec::getClusterP4
TLorentzVector getClusterP4(const xAOD::CaloCluster *cl, xAOD::CaloCluster::State s)
: getClusterP4 Added during Rel22 migration.
Definition: HIJetRecDefs.h:73
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
HIJetRec::subtractedOriginCorrectedClusterState
constexpr xAOD::CaloCluster::State subtractedOriginCorrectedClusterState()
Definition: HIJetRecDefs.h:27
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
xAODP4Helpers.h
InDetAccessor::phi0
@ phi0
Definition: InDetAccessor.h:33
xAOD::CaloCluster_v1::State
State
enum of possible signal states.
Definition: CaloCluster_v1.h:304
HIJetRec::inTowerBoundary
bool inTowerBoundary(float eta0, float phi0, float eta, float phi)
Definition: HIJetRecDefs.h:29
test_pyathena.pt
pt
Definition: test_pyathena.py:11
M_PI
#define M_PI
Definition: ActiveFraction.h:11
xAOD::P4Helpers::deltaPhi
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
Definition: xAODP4Helpers.h:69
HIEventDefs.h
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
HIJetRec::subtractedJetState
constexpr const char * subtractedJetState()
Definition: HIJetRecDefs.h:19
HIJetRec::subtractedClusterState
constexpr xAOD::CaloCluster::State subtractedClusterState()
Definition: HIJetRecDefs.h:26
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
xAOD::CaloCluster_v1::CALIBRATED
@ CALIBRATED
Definition: CaloCluster_v1.h:307
CaloCluster.h
xAOD::CalibratedJetConstituent
@ CalibratedJetConstituent
Definition: JetTypes.h:22
xAOD::CaloCluster_v1::UNCALIBRATED
@ UNCALIBRATED
Definition: CaloCluster_v1.h:306
xAOD::CaloCluster_v1::FourMom_t
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
Definition: CaloCluster_v1.h:343
xAOD::JetConstitScale
JetConstitScale
Definition: JetTypes.h:20
HI::TowerBins::getBinSizeEta
constexpr float getBinSizeEta()
Definition: HIEventDefs.h:31
HIJetRec::subtractedOriginCorrectedJetState
constexpr const char * subtractedOriginCorrectedJetState()
Definition: HIJetRecDefs.h:20
HIJetRec::unsubtractedJetState
constexpr const char * unsubtractedJetState()
Definition: HIJetRecDefs.h:18
HIJetRec
Definition: HIJetRecDefs.h:15
xAOD::UncalibratedJetConstituent
@ UncalibratedJetConstituent
Definition: JetTypes.h:21
xAOD::CaloCluster_v1::ALTCALIBRATED
@ ALTCALIBRATED
Definition: CaloCluster_v1.h:308
HIJetRec::subtractedOriginCorrectedConstitState
constexpr xAOD::JetConstitScale subtractedOriginCorrectedConstitState()
Definition: HIJetRecDefs.h:23
HIJetRec::unsubtractedClusterState
constexpr xAOD::CaloCluster::State unsubtractedClusterState()
Definition: HIJetRecDefs.h:25
HIJetRec::subtractedConstitState
constexpr xAOD::JetConstitScale subtractedConstitState()
Definition: HIJetRecDefs.h:22
HI::TowerBins::getBinSizePhi
constexpr float getBinSizePhi()
Definition: HIEventDefs.h:32
JetTypes.h
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
HIJetRec::setClusterP4
void setClusterP4(const xAOD::CaloCluster::FourMom_t &p, xAOD::CaloCluster *cl, xAOD::CaloCluster::State s)
Definition: HIJetRecDefs.h:36