Skip to content

Commit

Permalink
New configuration parameters for seeding
Browse files Browse the repository at this point in the history
  • Loading branch information
pandreetto committed May 7, 2024
1 parent b474315 commit dd91728
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 8 deletions.
10 changes: 10 additions & 0 deletions ACTSTracking/ACTSSeededCKFTrackingProc.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,23 @@ class ACTSSeededCKFTrackingProc : public ACTSProcBase {
float _seedFinding_rMax = 150;
float _seedFinding_deltaRMin = 5;
float _seedFinding_deltaRMax = 80;
float _seedFinding_deltaRMinTop = 0;
float _seedFinding_deltaRMaxTop = 0;
float _seedFinding_deltaRMinBottom = 0;
float _seedFinding_deltaRMaxBottom = 0;
float _seedFinding_collisionRegion = 75;
float _seedFinding_zMax = 600;
float _seedFinding_sigmaScattering = 50;
float _seedFinding_radLengthPerSeed = 0.1;
float _seedFinding_minPt = 500;
float _seedFinding_impactMax = 3 * Acts::UnitConstants::mm;

StringVec _seedFinding_zBinEdges;
int _zTopBinLen = 1;
int _zBottomBinLen = 1;
int _phiTopBinLen = 1;
int _phiBottomBinLen = 1;

// Track fit parameters
double _initialTrackError_pos;
double _initialTrackError_phi;
Expand Down
74 changes: 66 additions & 8 deletions src/ACTSSeededCKFTrackingProc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,42 @@ ACTSSeededCKFTrackingProc::ACTSSeededCKFTrackingProc()
"Maximum dR between hits in a seed.",
_seedFinding_deltaRMax, _seedFinding_deltaRMax);

registerProcessorParameter("SeedFinding_DeltaRMinTop",
"Minimum dR between the reference hit and outer ones in a seed.",
_seedFinding_deltaRMinTop, 0.f);

registerProcessorParameter("SeedFinding_DeltaRMaxTop",
"Maximum dR between the reference hit and outer ones in a seed.",
_seedFinding_deltaRMaxTop, 0.f);

registerProcessorParameter("SeedFinding_DeltaRMinBottom",
"Minimum dR between the reference hit and inner ones in a seed.",
_seedFinding_deltaRMinBottom, 0.f);

registerProcessorParameter("SeedFinding_DeltaRMaxBottom",
"Maximum dR between the reference hit and inner ones in a seed.",
_seedFinding_deltaRMaxBottom, 0.f);

registerProcessorParameter("SeedFinding_zTopBinLen",
"Number of top bins along Z for seeding",
_zTopBinLen, 1);

registerProcessorParameter("SeedFinding_zBottomBinLen",
"Number of bottom bins along Z for seeding",
_zBottomBinLen, 1);

registerProcessorParameter("SeedFinding_phiTopBinLen",
"Number of top bins along phi for seeding",
_phiTopBinLen, 1);

registerProcessorParameter("SeedFinding_phiBottomBinLen",
"Number of bottom bins along phi for seeding",
_phiBottomBinLen, 1);

registerProcessorParameter("SeedFinding_zBinEdges",
"Bins placement along Z for seeding.",
_seedFinding_zBinEdges, StringVec(0));

registerProcessorParameter(
"SeedFinding_CollisionRegion",
"Size of the collision region in one direction (assumed symmetric).",
Expand Down Expand Up @@ -175,6 +211,11 @@ void ACTSSeededCKFTrackingProc::init() {
}

_seedGeometrySelection = ACTSTracking::GeometryIdSelector(geoSelection);

if (_seedFinding_deltaRMinTop == 0.f) _seedFinding_deltaRMinTop = _seedFinding_deltaRMin;
if (_seedFinding_deltaRMaxTop == 0.f) _seedFinding_deltaRMaxTop = _seedFinding_deltaRMax;
if (_seedFinding_deltaRMinBottom == 0.f) _seedFinding_deltaRMinBottom = _seedFinding_deltaRMin;
if (_seedFinding_deltaRMaxBottom == 0.f) _seedFinding_deltaRMaxBottom = _seedFinding_deltaRMax;
}

void ACTSSeededCKFTrackingProc::processRunHeader(LCRunHeader *) {}
Expand Down Expand Up @@ -395,10 +436,10 @@ void ACTSSeededCKFTrackingProc::processEvent(LCEvent *evt) {
finderCfg.rMax = _seedFinding_rMax;
finderCfg.deltaRMin = _seedFinding_deltaRMin;
finderCfg.deltaRMax = _seedFinding_deltaRMax;
finderCfg.deltaRMinTopSP = _seedFinding_deltaRMin;
finderCfg.deltaRMaxTopSP = _seedFinding_deltaRMax;
finderCfg.deltaRMinBottomSP = _seedFinding_deltaRMin; // TODO missing config params
finderCfg.deltaRMaxBottomSP = _seedFinding_deltaRMax;
finderCfg.deltaRMinTopSP = _seedFinding_deltaRMinTop;
finderCfg.deltaRMaxTopSP = _seedFinding_deltaRMaxTop;
finderCfg.deltaRMinBottomSP = _seedFinding_deltaRMinBottom;
finderCfg.deltaRMaxBottomSP = _seedFinding_deltaRMaxBottom;
finderCfg.collisionRegionMin = -_seedFinding_collisionRegion;
finderCfg.collisionRegionMax = _seedFinding_collisionRegion;
finderCfg.zMin = -_seedFinding_zMax;
Expand Down Expand Up @@ -433,6 +474,25 @@ void ACTSSeededCKFTrackingProc::processEvent(LCEvent *evt) {
gridCfg.zMax = finderCfg.zMax;
gridCfg.zMin = finderCfg.zMin;
gridCfg.impactMax = finderCfg.impactMax;
if (_seedFinding_zBinEdges.size() > 0)
{
gridCfg.zBinEdges.resize(_seedFinding_zBinEdges.size());
for (int k = 0; k < _seedFinding_zBinEdges.size(); k++)
{
float pos = std::atof(_seedFinding_zBinEdges[k].c_str());
if (pos >= finderCfg.zMin && pos < finderCfg.zMax)
{
gridCfg.zBinEdges[k] = pos;
}
else
{
streamlog_out(WARNING) << "Wrong parameter SeedFinding_zBinEdges; "
<< "default used" << std::endl;
gridCfg.zBinEdges.clear();
break;
}
}
}

Acts::CylindricalSpacePointGridOptions gridOpts;
gridOpts.bFieldInZ = (*magneticField()->getField(zeropos, magCache))[2];
Expand All @@ -459,8 +519,8 @@ void ACTSSeededCKFTrackingProc::processEvent(LCEvent *evt) {
spacePointPtrs.begin(), spacePointPtrs.end(), extractGlobalQuantities,
rRangeSPExtent);

const Acts::GridBinFinder<2ul> bottomBinFinder(1, 1); // TODO missing params
const Acts::GridBinFinder<2ul> topBinFinder(1, 1); // TODO move into init
const Acts::GridBinFinder<2ul> bottomBinFinder(_phiBottomBinLen, _zBottomBinLen);
const Acts::GridBinFinder<2ul> topBinFinder(_phiTopBinLen, _zTopBinLen);

auto spacePointsGrouping = Acts::CylindricalBinnedGroup<SSPoint>(
std::move(grid), bottomBinFinder, topBinFinder);
Expand All @@ -479,8 +539,6 @@ void ACTSSeededCKFTrackingProc::processEvent(LCEvent *evt) {
finderCfg.deltaRMiddleMinSPRange,
up - finderCfg.deltaRMiddleMaxSPRange); // TODO investigate

// TODO missing check for finderCfg.useDetailedDoubleMeasurementInfo

std::vector<Acts::BoundTrackParameters> paramseeds;

for (const auto [bottom, middle, top] : spacePointsGrouping)
Expand Down

0 comments on commit dd91728

Please sign in to comment.