Commit aee56f36 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'MSVertex_dPhi' into 'master'

MSVertexUtils - Employ FourMomUtils to calculate dPhi

See merge request atlas/athena!48201
parents 7e63badf 2c347d1b
......@@ -13,4 +13,6 @@ atlas_add_component( MSVertexTools
src/*.cxx
src/components/*.cxx
INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthContainers StoreGateLib GeoPrimitives Identifier EventPrimitives xAODTracking GaudiKernel MSVertexUtils MuonReadoutGeometry MuonIdHelpersLib MuonPrepRawData TrkParameters TrkExInterfaces MSVertexToolInterfaces )
LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthContainers StoreGateLib GeoPrimitives Identifier
EventPrimitives xAODTracking GaudiKernel MSVertexUtils MuonReadoutGeometry MuonIdHelpersLib MuonPrepRawData
TrkParameters TrkExInterfaces MSVertexToolInterfaces FourMomUtils)
......@@ -12,6 +12,7 @@
#include "xAODTracking/Vertex.h"
#include "xAODTracking/VertexAuxContainer.h"
#include "xAODTracking/VertexContainer.h"
#include "FourMomUtils/xAODP4Helpers.h"
namespace {
constexpr int MAXPLANES = 100;
/// Shortcut to square a number
......@@ -270,13 +271,7 @@ namespace Muon {
int ntracks(0);
for (int jcl = 0; jcl < ncluster; ++jcl) {
float dEta = trkClu[icl].eta - trkClu0[jcl].eta;
float dPhi = trkClu[icl].phi - trkClu0[jcl].phi;
while (std::abs(dPhi) > M_PI) {
if (dPhi < 0)
dPhi += 2 * M_PI;
else
dPhi -= 2 * M_PI;
}
float dPhi = xAOD::P4Helpers::deltaPhi(trkClu[icl].phi , trkClu0[jcl].phi);
if (std::abs(dEta) < 0.7 && std::abs(dPhi) < M_PI / 3.) {
ntracks++;
trkClu[icl].eta = trkClu[icl].eta - dEta / ntracks;
......@@ -304,15 +299,7 @@ namespace Muon {
for (int jcl = 0; jcl < ncluster; ++jcl) {
float dEta = std::abs(trkClu[icl].eta - trkClu0[jcl].eta);
float dPhi = trkClu[icl].phi - trkClu0[jcl].phi;
while (std::abs(dPhi) > M_PI) {
if (dPhi < 0)
dPhi += 2 * M_PI;
else
dPhi -= 2 * M_PI;
}
float dPhi = xAOD::P4Helpers::deltaPhi(trkClu[icl].phi , trkClu0[jcl].phi);
if (dEta < 0.7 && std::abs(dPhi) < M_PI / 3.) {
eta_avg += trkClu0[jcl].eta;
cosPhi_avg += std::cos(trkClu0[jcl].phi);
......@@ -356,13 +343,7 @@ namespace Muon {
std::vector<Tracklet> unusedTracks;
for (std::vector<Tracklet>::iterator trkItr = tracks.begin(); trkItr != tracks.end(); ++trkItr) {
float dEta = std::abs(BestCluster.eta - trkItr->globalPosition().eta());
float dPhi = BestCluster.phi - trkItr->globalPosition().phi();
while (std::abs(dPhi) > M_PI) {
if (dPhi < 0)
dPhi += 2 * M_PI;
else
dPhi -= 2 * M_PI;
}
float dPhi = xAOD::P4Helpers::deltaPhi(BestCluster.phi , trkItr->globalPosition().phi());
if (dEta < 0.7 && std::abs(dPhi) < M_PI / 3.)
BestCluster.tracks.push_back((*trkItr));
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment