ATLAS Offline Software
JetOriginHelpers.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
8 #include "xAODTracking/Vertex.h"
9 
10 namespace jet {
11 
13 
14 
15  xAOD::CaloCluster::State constitScale = state;
16  if(constitScale==xAOD::CaloCluster::UNKNOWN) constitScale = (xAOD::CaloCluster::State) jet.getConstituentsSignalState();
17 
18  int numC = jet.numConstituents();
19  const Amg::Vector3D& vxpos= vx.position();
20 
21  xAOD::IParticle::FourMom_t corrP4(0,0,0,0);
22 
23  for(int i=0; i<numC;i++){
24  const xAOD::CaloCluster* cl = dynamic_cast<const xAOD::CaloCluster*>(jet.rawConstituent(i) );
25  if( ! cl ) continue;
26 
27  xAOD::CaloVertexedTopoCluster corrCl(*cl, constitScale, vxpos );
28  xAOD::IParticle::FourMom_t p4CorrCl=corrCl.p4();
29  if(cl->e(constitScale) < 0.) p4CorrCl*=-1.;
30  corrP4 += p4CorrCl;
31  }
32 
33  xAOD::JetFourMom_t corrJet;
34  corrJet.SetPxPyPzE(corrP4.Px(), corrP4.Py(), corrP4.Pz(), corrP4.E() );
35  return corrJet;
36 
37  }
38 
39 }
xAOD::CaloVertexedClusterBase::p4
virtual FourMom_t p4() const final
The full 4-momentum of the particle.
Definition: Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloVertexedClusterBase.h:88
xAOD::CaloCluster_v1::State
State
enum of possible signal states.
Definition: CaloCluster_v1.h:304
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
jet::clusterOriginCorrection
xAOD::JetFourMom_t clusterOriginCorrection(const xAOD::Jet &jet, const xAOD::Vertex &vx)
returns 4-vector of the jet relative to the vertex
xAOD::IParticle::FourMom_t
TLorentzVector FourMom_t
Definition of the 4-momentum type.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:69
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
lumiFormat.i
int i
Definition: lumiFormat.py:85
JetOriginHelpers.h
Helpers to calculate corrected 4-vectors w.r.t to a given orign.
Vertex.h
xAOD::JetFourMom_t
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition: JetTypes.h:17
CaloVertexedTopoCluster.h
Evaluate cluster kinematics with a different vertex / signal state.
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
xAOD::CaloVertexedTopoCluster
Evaluate cluster kinematics with a different vertex / signal state.
Definition: Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloVertexedTopoCluster.h:38
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
xAOD::CaloCluster_v1::UNKNOWN
@ UNKNOWN
Definition: CaloCluster_v1.h:305