14 TVector3 theVertexVector(vertexToCorrectTo.
x(), vertexToCorrectTo.
y(), vertexToCorrectTo.
z());
20 TLorentzVector theNewVector(0.0,0.0,0.0,0.0);
21 theNewVector.SetPtEtaPhiM(fe.
pt(), fe.
eta(), fe.
phi(), fe.
m());
29 float clusterEta = theFourVector.Eta();
32 float centerMag = accCenterMag(fe);
34 float radius = centerMag/cosh(clusterEta);
36 float EtaVertexCorrection = 0.0, PhiVertexCorrection = 0.0;
37 float clusterPhi = theFourVector.Phi();
39 if (radius > 1.0 && centerMag > 1e-3){
40 EtaVertexCorrection = (-vertexToCorrectTo.Z()/cosh(clusterEta) + (vertexToCorrectTo.X()*cos(clusterPhi) + vertexToCorrectTo.Y()*sin(clusterPhi))*tanh(clusterEta))/radius;
41 PhiVertexCorrection = (vertexToCorrectTo.X()*sin(clusterPhi) - vertexToCorrectTo.Y()*cos(clusterPhi))/radius;
44 float etaVertexCorrected = clusterEta + EtaVertexCorrection;
45 float p = std::sqrt(theFourVector.E()*theFourVector.E()-theFourVector.M()*theFourVector.M());
46 float ptVertexCorrected = p/cosh(etaVertexCorrected);
47 theFourVector.SetPtEtaPhiM(ptVertexCorrected, etaVertexCorrected, clusterPhi + PhiVertexCorrection, theFourVector.M());
56 if(cluster !=
nullptr){
57 double tmpValue(-99.);
59 value =
static_cast<float>(tmpValue);
67 if(!momentName.empty()){
69 if(acc.isAvailable(fe)){
81 if(accEPerSampling.
isAvailable(fe))
return accEPerSampling(fe);
114 std::vector<float>
result(28, 0);
115 result[0] = accPreSamplerB(fe);
119 result[4] = accPreSamplerE(fe);
127 result[12] = accTileBar0(fe);
128 result[13] = accTileBar1(fe);
129 result[14] = accTileBar2(fe);
130 result[15] = accTileGap1(fe);
131 result[16] = accTileGap2(fe);
132 result[17] = accTileGap3(fe);
133 result[18] = accTileExt0(fe);
134 result[19] = accTileExt1(fe);
135 result[20] = accTileExt2(fe);
136 result[21] = accFCAL0(fe);
137 result[22] = accFCAL1(fe);
138 result[23] = accFCAL2(fe);
139 result[24] = accMINIFCAL0(fe);
140 result[25] = accMINIFCAL1(fe);
141 result[26] = accMINIFCAL2(fe);
142 result[27] = accMINIFCAL3(fe);
192 const std::string& attributeName,
199 float float_moment = moment;
200 feAttribute(theFE) = float_moment;
206 const std::string& attributeName,
210 feAttribute(theFE) = theCluster.
eSample(sampling);
215 const std::array< std::pair<xAOD::CaloCluster::MomentType, const std::string>, 12> momentAttributePairs{{
230 for (
const auto & [moment,attribute]:momentAttributePairs) this->
addMoment(moment,attribute,theCluster,theFE);
235 const std::array< std::pair<xAOD::CaloCluster::MomentType, const std::string>, 4> momentAttributePairs{{
242 for (
const auto & [moment,attribute]:momentAttributePairs) this->
addMoment(moment,attribute,theCluster,theFE);
248 static const std::array< std::pair<xAOD::CaloCluster::CaloSample, const SG::AuxElement::Accessor<float>>, 28> samplingAttributePairs{{
279 for (
const auto & [sampling,attribute]:samplingAttributePairs) {
280 attribute(theFE) = theCluster.
eSample(sampling);
FillNeutralFlowElements()
void addStandardSamplingEnergies(xAOD::FlowElement &theFE, const xAOD::CaloCluster &theCluster)
void addStandardCalHitMoments(xAOD::FlowElement &theFE, const xAOD::CaloCluster &theCluster)
void addStandardMoments(xAOD::FlowElement &theFE, const xAOD::CaloCluster &theCluster)
bool addMoment(const xAOD::CaloCluster::MomentType &momentType, const std::string &attributeName, const xAOD::CaloCluster &theCluster, xAOD::FlowElement &theFE)
Function to add cluster moments onto FE.
void addSamplingEnergy(const xAOD::CaloCluster::CaloSample &sampling, const std::string &attributeName, const xAOD::CaloCluster &theCluster, xAOD::FlowElement &theFE)
SG::ConstAccessor< T, ALLOC > ConstAccessor
SG::Accessor< T, ALLOC > Accessor
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
float eSample(const CaloSample sampling) const
MomentType
Enums to identify different moments.
@ DELTA_ALPHA
Angular shower axis deviation ( ) from IP-to-Center.
@ AVG_TILE_Q
Sum(E_cell_Tile^2 Q_cell_Tile)/Sum(E_cell_Tile^2)
@ SECOND_LAMBDA
Second Moment in .
@ CELL_SIGNIFICANCE
Cell significance = E/sig of the cell with the largest |E|/sig.
@ CELL_SIG_SAMPLING
CaloSample of the cell with the largest |E|/sig.
@ EM_PROBABILITY
Classification probability to be em-like.
@ LATERAL
Normalized lateral moment.
@ N_BAD_CELLS
number of bad cells
@ LONGITUDINAL
Normalized longitudinal moment.
@ ENG_FRAC_MAX
Energy fraction of hottest cell.
@ AVG_LAR_Q
Sum(E_cell_LAr^2 Q_cell_LAr)/Sum(E_cell_LAr^2)
@ SECOND_R
Second Moment in .
@ FIRST_ENG_DENS
First Moment in E/V.
@ ENG_FRAC_CORE
Energy fraction of the sum of the hottest cells in each sampling.
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
@ SIGNIFICANCE
Cluster significance.
@ CENTER_MAG
Cluster Centroid ( )
@ ENG_CALIB_FRAC_REST
Calibration Hit energy inside the cluster caused by other particles.
@ ENG_CALIB_FRAC_EM
Calibration Hit energy inside the cluster caused by e/gamma/pi0.
@ ENG_BAD_CELLS
Total em-scale energy of bad cells in this cluster.
@ ENG_CALIB_TOT
Calibration Hit energy inside the cluster.
@ ENG_CALIB_FRAC_HAD
Calibration Hit energy inside the cluster caused by charged pi+ and pi-.
@ ENG_POS
Total positive Energy of this cluster.
@ BADLARQ_FRAC
Energy fraction of LAr cells with quality larger than a given cut.
@ ISOLATION
Energy weighted fraction of non-clustered perimeter cells.
CaloSampling::CaloSample CaloSample
std::size_t nOtherObjects() const
virtual double pt() const override
virtual double m() const override
The invariant mass of the particle.
virtual double phi() const override
The azimuthal angle ( ) of the particle.
virtual double eta() const override
The pseudorapidity ( ) of the particle.
signal_t signalType() const
const xAOD::IParticle * otherObject(std::size_t i) const
float z() const
Returns the z position.
float y() const
Returns the y position.
float x() const
Returns the x position.
std::vector< float > getEnergiesPerSampling(const xAOD::FlowElement &fe)
void vertexCorrectTheFourVector(const xAOD::FlowElement &fe, const TVector3 &vertexToCorrectTo, TLorentzVector &theFourVector)
bool getClusterMoment(const xAOD::FlowElement &fe, xAOD::CaloCluster::MomentType momentType, float &value)
TLorentzVector getVertexCorrectedFourVec(const xAOD::FlowElement &fe, const xAOD::Vertex &vertexToCorrectTo)
std::string getClusterMomentName(xAOD::CaloCluster::MomentType momentType)
xAOD::Type::ObjectType signalToXAODType(const xAOD::FlowElement &fe)
ObjectType
Type of objects that have a representation in the xAOD EDM.
@ TrackParticle
The object is a charged track particle.
@ ParticleFlow
The object is a particle-flow object.
@ Other
An object not falling into any of the other categories.
@ CaloCluster
The object is a calorimeter cluster.
@ Muon
The object is a muon.
@ TrackCaloCluster
The object is a track-calo-cluster.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
FlowElement_v1 FlowElement
Definition of the current "pfo version".
Vertex_v1 Vertex
Define the latest version of the vertex class.