Skip to content

Commit 9694b18

Browse files
authored
Merge pull request #4135 from adfrawley/new_tpc_transforms
Minor updates to PHActsSiliconSeeder, TrackResiduals, PHSimpleVertexFinder
2 parents 802d4d2 + 344e32c commit 9694b18

File tree

4 files changed

+79
-15
lines changed

4 files changed

+79
-15
lines changed

offline/packages/TrackingDiagnostics/TrackResiduals.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,6 +1728,7 @@ void TrackResiduals::createBranches()
17281728
m_clustree->Branch("timebucket", &m_timebucket, "m_timebucket/I");
17291729
m_clustree->Branch("segtype", &m_segtype, "m_segtype/I");
17301730
m_clustree->Branch("tile", &m_tileid, "m_tileid/I");
1731+
m_clustree->Branch("layer", &m_scluslayer, "m_scluslayer/I");
17311732

17321733
m_tree = new TTree("residualtree", "A tree with track, cluster, and state info");
17331734
m_tree->Branch("run", &m_runnumber, "m_runnumber/I");

offline/packages/trackreco/PHActsSiliconSeeding.cc

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -818,10 +818,13 @@ std::vector<TrkrDefs::cluskey> PHActsSiliconSeeding::findMatches(
818818
float avgtriplety = 0;
819819
for (auto& pos : clusters)
820820
{
821-
avgtripletx += std::cos(std::atan2(pos(1), pos(0)));
822-
avgtriplety += std::sin(std::atan2(pos(1), pos(0)));
821+
822+
avgtripletx += std::cos(getPhiFromBeamSpot(pos(1), pos(0)));
823+
avgtriplety += std::sin(getPhiFromBeamSpot(pos(1), pos(0)));
823824
}
825+
824826
float avgtripletphi = std::atan2(avgtriplety, avgtripletx);
827+
825828
std::vector<TrkrDefs::cluskey> dummykeys = keys;
826829
std::vector<Acts::Vector3> dummyclusters = clusters;
827830

@@ -889,19 +892,31 @@ std::vector<TrkrDefs::cluskey> PHActsSiliconSeeding::findMatches(
889892
// get an estimate of the phi of the track at this layer
890893
// to know which hitsetkeys to look at
891894
float layerradius = 0;
895+
float x0 = 0.0;
896+
float y0 = 0.0;
897+
892898
if (layer > 2)
893899
{
894900
layerradius = m_geomContainerIntt->GetLayerGeom(layer)->get_radius();
895901
}
896902
else
897903
{
898904
layerradius = m_geomContainerMvtx->GetLayerGeom(layer)->get_radius();
905+
x0 = m_mvtx_x0;
906+
y0 = m_mvtx_y0;
899907
}
908+
float xfitradius_moved = fitpars[1] - x0;
909+
float yfitradius_moved = fitpars[2] - y0;
900910
const auto [xplus, yplus, xminus, yminus] = TrackFitUtils::circle_circle_intersection(layerradius, fitpars[0],
901-
fitpars[1], fitpars[2]);
902-
903-
float approximate_phi1 = atan2(yplus, xplus);
904-
float approximate_phi2 = atan2(yminus, xminus);
911+
xfitradius_moved, yfitradius_moved);
912+
float xp = xplus + x0;
913+
float xm = xminus + x0;
914+
float yp = yplus + y0;
915+
float ym = yminus + y0;
916+
917+
918+
float approximate_phi1 = getPhiFromBeamSpot(yp, xp);
919+
float approximate_phi2 = getPhiFromBeamSpot(ym, xm);
905920
float approximatephi = approximate_phi1;
906921
if (std::fabs(normPhi2Pi(approximate_phi2 - avgtripletphi)) < std::fabs(normPhi2Pi(approximate_phi1 - avgtripletphi)))
907922
{
@@ -911,7 +926,7 @@ std::vector<TrkrDefs::cluskey> PHActsSiliconSeeding::findMatches(
911926
{
912927
auto surf = m_tGeometry->maps().getSiliconSurface(hitsetkey);
913928
auto surfcenter = surf->center(m_tGeometry->geometry().geoContext);
914-
float surfphi = atan2(surfcenter.y(), surfcenter.x());
929+
float surfphi = getPhiFromBeamSpot(surfcenter.y(), surfcenter.x());
915930

916931
float dphi = normPhi2Pi(approximatephi - surfphi);
917932
/// Check that the projection is within some reasonable amount of the segment
@@ -1141,9 +1156,10 @@ std::vector<std::vector<TrkrDefs::cluskey>> PHActsSiliconSeeding::iterateLayers(
11411156
float avgtriplety = 0;
11421157
for (const auto& pos : positions)
11431158
{
1144-
avgtripletx += std::cos(std::atan2(pos(1), pos(0)));
1145-
avgtriplety += std::sin(std::atan2(pos(1), pos(0)));
1159+
avgtripletx += std::cos(getPhiFromBeamSpot(pos(1), pos(0)));
1160+
avgtriplety += std::sin(getPhiFromBeamSpot(pos(1), pos(0)));
11461161
}
1162+
11471163
float avgtripletphi = std::atan2(avgtriplety, avgtripletx);
11481164

11491165
int layer34timebucket = std::numeric_limits<int>::max();
@@ -1155,13 +1171,29 @@ std::vector<std::vector<TrkrDefs::cluskey>> PHActsSiliconSeeding::iterateLayers(
11551171
}
11561172
}
11571173

1174+
// move the fitted circle center the negative of the MVTX center position
1175+
float x0 = 0.0; // cm
1176+
float y0 = 0.0;
11581177
for (int layer = startLayer; layer < endLayer; ++layer)
11591178
{
11601179
float layerradius = m_geomContainerIntt->GetLayerGeom(layer)->get_radius();
1161-
const auto [xplus, yplus, xminus, yminus] = TrackFitUtils::circle_circle_intersection(layerradius, fitpars[0], fitpars[1], fitpars[2]);
1180+
if(layer < 3)
1181+
{
1182+
x0 = m_mvtx_x0;
1183+
y0 = m_mvtx_y0;
1184+
}
11621185

1163-
float approximate_phi1 = atan2(yplus, xplus);
1164-
float approximate_phi2 = atan2(yminus, xminus);
1186+
float xfitradius_moved = fitpars[1] - x0;
1187+
float yfitradius_moved = fitpars[2] - y0;
1188+
1189+
const auto [xplus, yplus, xminus, yminus] = TrackFitUtils::circle_circle_intersection(layerradius, fitpars[0], xfitradius_moved, yfitradius_moved);
1190+
1191+
float xp = xplus + x0;
1192+
float xm = xminus + x0;
1193+
float yp = yplus + y0;
1194+
float ym = yminus + y0;
1195+
float approximate_phi1 = getPhiFromBeamSpot(yp, xp);
1196+
float approximate_phi2 = getPhiFromBeamSpot(ym, xm);
11651197
float approximatephi = approximate_phi1;
11661198
if (std::fabs(normPhi2Pi(approximate_phi2 - avgtripletphi)) < std::fabs(normPhi2Pi(approximate_phi1 - avgtripletphi)))
11671199
{
@@ -1171,7 +1203,7 @@ std::vector<std::vector<TrkrDefs::cluskey>> PHActsSiliconSeeding::iterateLayers(
11711203
{
11721204
auto surf = m_tGeometry->maps().getSiliconSurface(hitsetkey);
11731205
auto surfcenter = surf->center(m_tGeometry->geometry().geoContext);
1174-
float surfphi = atan2(surfcenter.y(), surfcenter.x());
1206+
float surfphi = getPhiFromBeamSpot(surfcenter.y(), surfcenter.x());
11751207
if(Verbosity() > 5)
11761208
{
11771209
std::cout << "approximate phis " << approximate_phi1 << " " << approximate_phi2 << " using " << approximatephi
@@ -1404,7 +1436,8 @@ std::vector<const SpacePoint*> PHActsSiliconSeeding::getSiliconSpacePoints(Acts:
14041436
if (det == TrkrDefs::TrkrId::mvtxId)
14051437
{
14061438
auto strobeId = MvtxDefs::getStrobeId(hitsetkey);
1407-
if (strobeId != strobe)
1439+
//if (strobeId != strobe)
1440+
if (abs(strobeId - strobe) > 1)
14081441
{
14091442
continue;
14101443
}
@@ -1713,6 +1746,15 @@ double PHActsSiliconSeeding::normPhi2Pi(const double phi)
17131746
return returnPhi;
17141747
}
17151748

1749+
float PHActsSiliconSeeding::getPhiFromBeamSpot(float clusy, float clusx) const
1750+
{
1751+
// Calculate the phi value for (clusx, clusy) relative to the beam spot (x,y) position
1752+
1753+
float phirel = std::atan2(clusy - m_beamSpoty, clusx - m_beamSpotx);
1754+
1755+
return phirel;
1756+
}
1757+
17161758
void PHActsSiliconSeeding::largeGridSpacing(const bool spacing)
17171759
{
17181760
if (!spacing)

offline/packages/trackreco/PHActsSiliconSeeding.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@ class PHActsSiliconSeeding : public SubsysReco
176176
{
177177
m_minSeedPt = pt;
178178
}
179+
void set_mvtxCenterXY(const float X, const float Y)
180+
{
181+
m_mvtx_x0 = X;
182+
m_mvtx_y0 = Y;
183+
}
184+
void set_beamSpotXY(const float X, const float Y)
185+
{
186+
m_beamSpotx = X;
187+
m_beamSpoty = Y;
188+
}
179189

180190
/// A function to run the seeder with large (true)
181191
/// or small (false) grid spacing
@@ -243,6 +253,8 @@ class PHActsSiliconSeeding : public SubsysReco
243253
short int getCrossingIntt(TrackSeed &si_track);
244254
std::vector<short int> getInttCrossings(TrackSeed &si_track);
245255

256+
float getPhiFromBeamSpot(float clusy, float clusx) const;
257+
246258
void createHistograms();
247259
void writeHistograms();
248260
double normPhi2Pi(const double phi);
@@ -354,6 +366,15 @@ class PHActsSiliconSeeding : public SubsysReco
354366
float m_inttzSearchWin = 2.0; // default to one strip width
355367
double m_mvtxrPhiSearchWin = 0.2;
356368
float m_mvtxzSearchWin = 0.5;
369+
370+
// collision point in sPHENIX coordinates, from vertex finder (pp run 3)
371+
float m_beamSpotx = -0.072; // cm
372+
float m_beamSpoty = 0.141; // cm
373+
374+
// center of MVTX barrel in sPHENIX coordinates - default is for Run 3 pp
375+
float m_mvtx_x0 = 0.6; // cm
376+
float m_mvtx_y0 = -0.1;
377+
357378
/// Whether or not to use truth clusters in hit lookup
358379
bool m_useTruthClusters = false;
359380

offline/packages/trackreco/PHSimpleVertexFinder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class PHSimpleVertexFinder : public SubsysReco
9191
double _beamline_y_cut_hi = 0.2;
9292
double _qual_cut = 10.0;
9393
bool _require_mvtx = true;
94-
unsigned int _nmvtx_required = 3;
94+
unsigned int _nmvtx_required = 2;
9595
double _track_pt_cut = 0.0;
9696
double _outlier_cut = 0.015;
9797

0 commit comments

Comments
 (0)