Skip to content

Commit f1eef1b

Browse files
authored
[PWGEM/Dilepton] fix for dimuon again (#11663)
1 parent 5a1aa28 commit f1eef1b

File tree

1 file changed

+32
-31
lines changed

1 file changed

+32
-31
lines changed

PWGEM/Dilepton/Tasks/matchingMFT.cxx

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,33 @@
1313
/// \brief a task to study matching MFT-[MCH-MID] in MC
1414
/// \author daiki.sekihata@cern.ch
1515

16-
#include <vector>
17-
#include <string>
18-
#include <map>
19-
#include <unordered_map>
20-
21-
#include "Framework/DataTypes.h"
22-
#include "Framework/runDataProcessing.h"
23-
#include "Framework/AnalysisTask.h"
2416
#include "TableHelper.h"
17+
18+
#include "Common/CCDB/RCTSelectionFlags.h"
19+
#include "Common/Core/fwdtrackUtilities.h"
20+
#include "Common/DataModel/Centrality.h"
21+
#include "Common/DataModel/CollisionAssociationTables.h"
22+
#include "Common/DataModel/EventSelection.h"
23+
#include "Common/DataModel/Multiplicity.h"
24+
2525
#include "CCDB/BasicCCDBManager.h"
2626
#include "DataFormatsParameters/GRPMagField.h"
27-
#include "TGeoGlobalMagField.h"
28-
#include "Field/MagneticField.h"
29-
3027
#include "DetectorsBase/Propagator.h"
28+
#include "Field/MagneticField.h"
29+
#include "Framework/AnalysisTask.h"
30+
#include "Framework/DataTypes.h"
31+
#include "Framework/runDataProcessing.h"
3132
#include "GlobalTracking/MatchGlobalFwd.h"
3233
#include "MCHTracking/TrackExtrap.h"
3334
#include "MCHTracking/TrackParam.h"
3435
#include "ReconstructionDataFormats/TrackFwd.h"
3536

36-
#include "Common/DataModel/CollisionAssociationTables.h"
37-
#include "Common/Core/fwdtrackUtilities.h"
38-
#include "Common/DataModel/EventSelection.h"
39-
#include "Common/DataModel/Multiplicity.h"
40-
#include "Common/DataModel/Centrality.h"
41-
#include "Common/CCDB/RCTSelectionFlags.h"
37+
#include "TGeoGlobalMagField.h"
38+
39+
#include <map>
40+
#include <string>
41+
#include <unordered_map>
42+
#include <vector>
4243

4344
using namespace o2;
4445
using namespace o2::soa;
@@ -172,10 +173,10 @@ struct matchingMFT {
172173
fRegistry.add("MFTMCHMID/primary/correct/hMFTClusterMap", "MFT cluster map", kTH1F, {{1024, -0.5, 1023.5}}, false);
173174
fRegistry.add("MFTMCHMID/primary/correct/hRatAbsorberEnd", "R at absorber end;R at absorber end (cm)", kTH1F, {{100, 0.0f, 100}}, false);
174175
fRegistry.add("MFTMCHMID/primary/correct/hPDCA_Rabs", "pDCA vs. Rabs;R at absorber end (cm);p #times DCA (GeV/c #upoint cm)", kTH2F, {{100, 0, 100}, {100, 0.0f, 1000}}, false);
175-
fRegistry.add("MFTMCHMID/primary/correct/hChi2", "chi2;chi2", kTH1F, {{100, 0.0f, 100}}, false);
176+
fRegistry.add("MFTMCHMID/primary/correct/hChi2", "chi2;chi2/ndf", kTH1F, {{100, 0.0f, 10}}, false);
176177
fRegistry.add("MFTMCHMID/primary/correct/hChi2MFT", "chi2 MFT/ndf;chi2 MFT/ndf", kTH1F, {{100, 0.0f, 10}}, false);
177-
fRegistry.add("MFTMCHMID/primary/correct/hChi2MatchMCHMID", "chi2 match MCH-MID;chi2", kTH1F, {{100, 0.0f, 10}}, false);
178-
fRegistry.add("MFTMCHMID/primary/correct/hChi2MatchMCHMFT", "chi2 match MCH-MFT;chi2/ndf", kTH1F, {{100, 0.0f, 10}}, false);
178+
fRegistry.add("MFTMCHMID/primary/correct/hChi2MatchMCHMID", "chi2 match MCH-MID;chi2", kTH1F, {{100, 0.0f, 100}}, false);
179+
fRegistry.add("MFTMCHMID/primary/correct/hChi2MatchMCHMFT", "chi2 match MCH-MFT;chi2", kTH1F, {{100, 0.0f, 100}}, false);
179180
fRegistry.add("MFTMCHMID/primary/correct/hDCAxy2D", "DCA x vs. y;DCA_{x} (cm);DCA_{y} (cm)", kTH2F, {{200, -0.5, 0.5}, {200, -0.5, +0.5}}, false);
180181
fRegistry.add("MFTMCHMID/primary/correct/hDCAz", "DCA z;DCA_{z} (cm);", kTH1F, {{1000, 0, 10}}, false);
181182
fRegistry.add("MFTMCHMID/primary/correct/hDCAxy2DinSigma", "DCA x vs. y in sigma;DCA_{x} (#sigma);DCA_{y} (#sigma)", kTH2F, {{200, -10, 10}, {200, -10, +10}}, false);
@@ -198,7 +199,7 @@ struct matchingMFT {
198199
fRegistry.addClone("MFTMCHMID/primary/", "MFTMCHMID/secondary/");
199200
}
200201

201-
bool isSelected(const float pt, const float eta, const float rAtAbsorberEnd, const float pDCA, const float chi2, const uint8_t trackType, const float dcaXY)
202+
bool isSelected(const float pt, const float eta, const float rAtAbsorberEnd, const float pDCA, const float chi2_per_ndf, const uint8_t trackType, const float dcaXY)
202203
{
203204
if (pt < minPt || maxPt < pt) {
204205
return false;
@@ -217,14 +218,14 @@ struct matchingMFT {
217218
if (maxDCAxy < dcaXY) {
218219
return false;
219220
}
220-
if (chi2 < 0.f || maxChi2GL < chi2) {
221+
if (chi2_per_ndf < 0.f || maxChi2GL < chi2_per_ndf) {
221222
return false;
222223
}
223224
} else if (trackType == static_cast<uint8_t>(o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack)) {
224225
if (eta < minEtaSA || maxEtaSA < eta) {
225226
return false;
226227
}
227-
if (chi2 < 0.f || maxChi2SA < chi2) {
228+
if (chi2_per_ndf < 0.f || maxChi2SA < chi2_per_ndf) {
228229
return false;
229230
}
230231
} else {
@@ -305,11 +306,11 @@ struct matchingMFT {
305306
return;
306307
}
307308

308-
if (fwdtrack.chi2MatchMCHMFT() > maxMatchingChi2MCHMFT / (2.f * (mchtrack.nClusters() + nClustersMFT) - 5.f)) {
309+
if (fwdtrack.chi2MatchMCHMFT() > maxMatchingChi2MCHMFT) {
309310
return;
310311
}
311312

312-
if (fwdtrack.chi2() < 0.f || maxChi2GL < fwdtrack.chi2()) {
313+
if (fwdtrack.chi2() < 0.f || maxChi2GL < fwdtrack.chi2() / (2.f * (mchtrack.nClusters() + nClustersMFT) - 5.f)) {
313314
return;
314315
}
315316

@@ -387,7 +388,7 @@ struct matchingMFT {
387388
return;
388389
}
389390

390-
if (!isSelected(pt, eta, rAtAbsorberEnd, pDCA, fwdtrack.chi2(), fwdtrack.trackType(), dcaXY)) {
391+
if (!isSelected(pt, eta, rAtAbsorberEnd, pDCA, fwdtrack.chi2() / (2.f * (mchtrack.nClusters() + nClustersMFT) - 5.f), fwdtrack.trackType(), dcaXY)) {
391392
return;
392393
}
393394

@@ -414,10 +415,10 @@ struct matchingMFT {
414415
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hMFTClusterMap"), mftClusterMap(mfttrack));
415416
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hPDCA_Rabs"), rAtAbsorberEnd, pDCA);
416417
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hRatAbsorberEnd"), rAtAbsorberEnd);
417-
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hChi2"), fwdtrack.chi2());
418+
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hChi2"), fwdtrack.chi2() / (2.f * (fwdtrack.nClusters() + nClustersMFT) - 5.f));
418419
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hChi2MFT"), chi2mft);
419420
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hChi2MatchMCHMID"), fwdtrack.chi2MatchMCHMID());
420-
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hChi2MatchMCHMFT"), fwdtrack.chi2MatchMCHMFT() / (2 * (fwdtrack.nClusters() + nClustersMFT) - 5));
421+
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hChi2MatchMCHMFT"), fwdtrack.chi2MatchMCHMFT());
421422
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hDCAxy2D"), dcaX, dcaY);
422423
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hDCAz"), dcaZ);
423424
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hDCAxy2DinSigma"), dcaX / std::sqrt(cXXatDCA), dcaY / std::sqrt(cYYatDCA));
@@ -451,7 +452,7 @@ struct matchingMFT {
451452
fRegistry.fill(HIST("MFTMCHMID/primary/wrong/hMFTClusterMap"), mftClusterMap(mfttrack));
452453
fRegistry.fill(HIST("MFTMCHMID/primary/wrong/hPDCA_Rabs"), rAtAbsorberEnd, pDCA);
453454
fRegistry.fill(HIST("MFTMCHMID/primary/wrong/hRatAbsorberEnd"), rAtAbsorberEnd);
454-
fRegistry.fill(HIST("MFTMCHMID/primary/wrong/hChi2"), fwdtrack.chi2());
455+
fRegistry.fill(HIST("MFTMCHMID/primary/wrong/hChi2"), fwdtrack.chi2() / (2.f * (fwdtrack.nClusters() + nClustersMFT) - 5.f));
455456
fRegistry.fill(HIST("MFTMCHMID/primary/wrong/hChi2MFT"), chi2mft);
456457
fRegistry.fill(HIST("MFTMCHMID/primary/wrong/hChi2MatchMCHMID"), fwdtrack.chi2MatchMCHMID());
457458
fRegistry.fill(HIST("MFTMCHMID/primary/wrong/hChi2MatchMCHMFT"), fwdtrack.chi2MatchMCHMFT());
@@ -489,7 +490,7 @@ struct matchingMFT {
489490
fRegistry.fill(HIST("MFTMCHMID/secondary/correct/hMFTClusterMap"), mftClusterMap(mfttrack));
490491
fRegistry.fill(HIST("MFTMCHMID/secondary/correct/hPDCA_Rabs"), rAtAbsorberEnd, pDCA);
491492
fRegistry.fill(HIST("MFTMCHMID/secondary/correct/hRatAbsorberEnd"), rAtAbsorberEnd);
492-
fRegistry.fill(HIST("MFTMCHMID/secondary/correct/hChi2"), fwdtrack.chi2());
493+
fRegistry.fill(HIST("MFTMCHMID/secondary/correct/hChi2"), fwdtrack.chi2() / (2.f * (fwdtrack.nClusters() + nClustersMFT) - 5.f));
493494
fRegistry.fill(HIST("MFTMCHMID/secondary/correct/hChi2MFT"), chi2mft);
494495
fRegistry.fill(HIST("MFTMCHMID/secondary/correct/hChi2MatchMCHMID"), fwdtrack.chi2MatchMCHMID());
495496
fRegistry.fill(HIST("MFTMCHMID/secondary/correct/hChi2MatchMCHMFT"), fwdtrack.chi2MatchMCHMFT());
@@ -525,7 +526,7 @@ struct matchingMFT {
525526
fRegistry.fill(HIST("MFTMCHMID/secondary/wrong/hMFTClusterMap"), mftClusterMap(mfttrack));
526527
fRegistry.fill(HIST("MFTMCHMID/secondary/wrong/hPDCA_Rabs"), rAtAbsorberEnd, pDCA);
527528
fRegistry.fill(HIST("MFTMCHMID/secondary/wrong/hRatAbsorberEnd"), rAtAbsorberEnd);
528-
fRegistry.fill(HIST("MFTMCHMID/secondary/wrong/hChi2"), fwdtrack.chi2());
529+
fRegistry.fill(HIST("MFTMCHMID/secondary/wrong/hChi2"), fwdtrack.chi2() / (2.f * (fwdtrack.nClusters() + nClustersMFT) - 5.f));
529530
fRegistry.fill(HIST("MFTMCHMID/secondary/wrong/hChi2MFT"), chi2mft);
530531
fRegistry.fill(HIST("MFTMCHMID/secondary/wrong/hChi2MatchMCHMID"), fwdtrack.chi2MatchMCHMID());
531532
fRegistry.fill(HIST("MFTMCHMID/secondary/wrong/hChi2MatchMCHMFT"), fwdtrack.chi2MatchMCHMFT());

0 commit comments

Comments
 (0)