Skip to content

Commit b5403ef

Browse files
authored
[PWGDQ] Add global configuration for tracking parameters used in record task (#5362)
* Added MCH-MID matching selection * Removed non necessary setup for track fitter * Setup for global tracking configuration
1 parent 1527a32 commit b5403ef

1 file changed

Lines changed: 19 additions & 26 deletions

File tree

PWGDQ/Tasks/mchAlignRecord.cxx

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
#include "MCHTracking/TrackExtrap.h"
6565
#include "MCHTracking/TrackParam.h"
6666
#include "MCHTracking/TrackFitter.h"
67+
#include "MCHBase/TrackerParam.h"
6768
#include "ReconstructionDataFormats/TrackMCHMID.h"
6869
#include "MCHAlign/Aligner.h"
6970
#include "DetectorsCommonDataFormats/AlignParam.h"
@@ -94,11 +95,9 @@ struct mchAlignRecordTask {
9495

9596
mch::TrackFitter trackFitter;
9697
mch::Aligner mAlign{};
98+
double mImproveCutChi2{};
9799
Double_t weightRecord{1.0};
98100

99-
double Reso_X = 0.0;
100-
double Reso_Y = 0.0;
101-
double ImproveCut = 6.0;
102101
int fCurrentRun;
103102

104103
map<int, math_utils::Transform3D> transformOld;
@@ -108,13 +107,10 @@ struct mchAlignRecordTask {
108107
Configurable<string> fConfigCcdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
109108
Configurable<string> geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"};
110109
Configurable<string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
111-
Configurable<string> fConfigCollType{"collision-type", "pp", "Resolution specification for trackfitter"};
112110
Configurable<string> fFixChamber{"fix-chamber", "", "Fixing chamber"};
113111
Configurable<bool> fDoNewGeo{"do-realign", false, "Transform to a given new geometry"};
114112
Configurable<bool> fDoEvaluation{"do-evaluation", false, "Enable storage of residuals"};
115113
Configurable<string> fConfigNewGeoFile{"new-geo", "o2sim_geometry-aligned.root", "New geometry for transformation"};
116-
Configurable<string> fOutputRecFileName{"outfile-data", "recDataFile.root", "Name of output data record file"};
117-
Configurable<string> fOutputConsFileName{"outfile-constraint", "recConsFile.root", "Name of output constraint record file"};
118114

119115
void init(InitContext& ic)
120116
{
@@ -124,28 +120,21 @@ struct mchAlignRecordTask {
124120
fCCDB->setCaching(true);
125121
fCCDB->setLocalObjectValidityChecking();
126122

127-
// Congiguration of resolution for track fitter
128-
if (fConfigCollType.value == "pp") {
129-
Reso_X = 0.4;
130-
Reso_Y = 0.4;
131-
ImproveCut = 6.0;
132-
LOG(info) << "Using pp parameter set for TrackFitter";
133-
} else {
134-
Reso_X = 0.2;
135-
Reso_Y = 0.2;
136-
ImproveCut = 4.0;
137-
LOG(info) << "Using PbPb parameter set for TrackFitter";
138-
}
139-
trackFitter.setChamberResolution(Reso_X, Reso_Y);
140-
trackFitter.useChamberResolution();
141-
142123
// Configuration for alignment object
143124
mAlign.SetDoEvaluation(fDoEvaluation.value);
144125
mAlign.SetAllowedVariation(0, 2.0);
145126
mAlign.SetAllowedVariation(1, 0.3);
146127
mAlign.SetAllowedVariation(2, 0.002);
147128
mAlign.SetAllowedVariation(3, 2.0);
148129

130+
// Configuration for track fitter
131+
const auto& trackerParam = o2::mch::TrackerParam::Instance();
132+
trackFitter.setBendingVertexDispersion(trackerParam.bendingVertexDispersion);
133+
trackFitter.setChamberResolution(trackerParam.chamberResolutionX, trackerParam.chamberResolutionY);
134+
trackFitter.smoothTracks(true);
135+
trackFitter.useChamberResolution();
136+
mImproveCutChi2 = 2. * trackerParam.sigmaCutForImprovement * trackerParam.sigmaCutForImprovement;
137+
149138
// Configuration for chamber fixing
150139
auto chambers = fFixChamber.value;
151140
for (int i = 0; i < chambers.length(); ++i) {
@@ -157,7 +146,7 @@ struct mchAlignRecordTask {
157146
}
158147

159148
// Init for output saving
160-
mAlign.init(fOutputRecFileName.value, fOutputConsFileName.value);
149+
mAlign.init();
161150

162151
ic.services().get<CallbackService>().set<CallbackService::Id::Stop>([this]() {
163152
LOG(info) << "Saving records into ROOT file";
@@ -195,9 +184,8 @@ struct mchAlignRecordTask {
195184
}
196185

197186
//_________________________________________________________________________________________________
198-
bool RemoveTrack(mch::Track& track, double ImproveCut)
187+
bool RemoveTrack(mch::Track& track)
199188
{
200-
double maxChi2Cluster = 2 * ImproveCut * ImproveCut;
201189
bool removeTrack = false;
202190

203191
try {
@@ -229,7 +217,7 @@ struct mchAlignRecordTask {
229217
}
230218
}
231219

232-
if (worstLocalChi2 < maxChi2Cluster)
220+
if (worstLocalChi2 < mImproveCutChi2)
233221
break;
234222

235223
if (!itWorstParam->isRemovable()) {
@@ -311,6 +299,11 @@ struct mchAlignRecordTask {
311299
int clIndex = -1;
312300
mch::Track convertedTrack;
313301

302+
// Use only MCH-MID matched tracks
303+
if (static_cast<int>(track.trackType()) != 3) {
304+
continue;
305+
}
306+
314307
// Loop over attached clusters
315308
for (auto const& cluster : clusters) {
316309

@@ -350,7 +343,7 @@ struct mchAlignRecordTask {
350343

351344
if (convertedTrack.getNClusters() > 9) {
352345
// Erase removable track
353-
if (!RemoveTrack(convertedTrack, ImproveCut)) {
346+
if (!RemoveTrack(convertedTrack)) {
354347
mAlign.ProcessTrack(convertedTrack, transformation, true, weightRecord);
355348
}
356349
}

0 commit comments

Comments
 (0)