|
13 | 13 | /// \brief task for the correlation calculations with CF-filtered tracks for O2 analysis |
14 | 14 | /// \author Jan Fiete Grosse-Oetringhaus <jan.fiete.grosse-oetringhaus@cern.ch>, Jasper Parkkila <jasper.parkkila@cern.ch> |
15 | 15 |
|
16 | | -#include <experimental/type_traits> |
17 | | -#include <vector> |
18 | | -#include <string> |
| 16 | +#include "PWGCF/Core/CorrelationContainer.h" |
| 17 | +#include "PWGCF/Core/PairCuts.h" |
| 18 | +#include "PWGCF/DataModel/CorrelationsDerived.h" |
19 | 19 |
|
20 | | -#include <TH1F.h> |
21 | | -#include <cmath> |
22 | | -#include <TDirectory.h> |
23 | | -#include <THn.h> |
24 | | -#include <TFile.h> |
25 | | -#include <TVector2.h> |
| 20 | +#include "Common/Core/RecoDecay.h" |
| 21 | +#include "Common/DataModel/Centrality.h" |
| 22 | +#include "Common/DataModel/EventSelection.h" |
| 23 | +#include "Common/DataModel/TrackSelectionTables.h" |
26 | 24 |
|
27 | | -#include "Framework/runDataProcessing.h" |
28 | | -#include "Framework/AnalysisTask.h" |
29 | | -#include "Framework/AnalysisDataModel.h" |
30 | | -#include "Framework/ASoAHelpers.h" |
31 | 25 | #include "CCDB/BasicCCDBManager.h" |
32 | | -#include "Framework/StepTHn.h" |
| 26 | +#include "CommonConstants/MathConstants.h" |
| 27 | +#include "DataFormatsParameters/GRPMagField.h" |
| 28 | +#include "DataFormatsParameters/GRPObject.h" |
| 29 | +#include "Framework/ASoAHelpers.h" |
| 30 | +#include "Framework/AnalysisDataModel.h" |
| 31 | +#include "Framework/AnalysisTask.h" |
33 | 32 | #include "Framework/HistogramRegistry.h" |
34 | 33 | #include "Framework/RunningWorkflowInfo.h" |
35 | | -#include "CommonConstants/MathConstants.h" |
36 | | -#include "Common/Core/RecoDecay.h" |
| 34 | +#include "Framework/StepTHn.h" |
| 35 | +#include "Framework/runDataProcessing.h" |
37 | 36 |
|
38 | | -#include "Common/DataModel/EventSelection.h" |
39 | | -#include "Common/DataModel/TrackSelectionTables.h" |
40 | | -#include "Common/DataModel/Centrality.h" |
41 | | -#include "PWGCF/DataModel/CorrelationsDerived.h" |
42 | | -#include "PWGCF/Core/CorrelationContainer.h" |
43 | | -#include "PWGCF/Core/PairCuts.h" |
44 | | -#include "DataFormatsParameters/GRPObject.h" |
45 | | -#include "DataFormatsParameters/GRPMagField.h" |
| 37 | +#include <TDirectory.h> |
| 38 | +#include <TFile.h> |
| 39 | +#include <TH1F.h> |
| 40 | +#include <THn.h> |
| 41 | +#include <TVector2.h> |
| 42 | + |
| 43 | +#include <cmath> |
| 44 | +#include <experimental/type_traits> |
| 45 | +#include <string> |
| 46 | +#include <vector> |
46 | 47 |
|
47 | 48 | using namespace o2; |
48 | 49 | using namespace o2::framework; |
@@ -1065,17 +1066,21 @@ struct CorrelationTask { |
1065 | 1066 |
|
1066 | 1067 | for (const auto& p2track : grouped2ProngTracks) { |
1067 | 1068 | // Check if the mc particles of the prongs are found. |
| 1069 | + if (p2track.cfTrackProng0Id() < 0 || p2track.cfTrackProng1Id() < 0) { |
| 1070 | + // fake track |
| 1071 | + same->getTrackHistEfficiency()->Fill(CorrelationContainer::Fake, p2track.eta(), p2track.pt(), 0, multiplicity, mcCollision.posZ()); |
| 1072 | + } |
1068 | 1073 | const auto& p0 = p2track.cfTrackProng0_as<aod::CFTracksWithLabel>(); |
1069 | 1074 | const auto& p1 = p2track.cfTrackProng1_as<aod::CFTracksWithLabel>(); |
1070 | 1075 | if (p0.has_cfMCParticle() && p1.has_cfMCParticle()) { |
1071 | 1076 | // find the 2-prong MC particle by the daughter MC particle IDs |
1072 | 1077 | auto m = std::find_if(p2indexCache.begin(), p2indexCache.end(), [&](const auto& t) -> bool { |
1073 | | - const auto& mcParticle = mcParticles.iteratorAt(t); |
| 1078 | + const auto& mcParticle = mcParticles.iteratorAt(t - mcParticles.begin().globalIndex()); |
1074 | 1079 | return p0.cfMCParticleId() == mcParticle.cfParticleDaugh0Id() && p1.cfMCParticleId() == mcParticle.cfParticleDaugh1Id(); |
1075 | 1080 | }); |
1076 | 1081 | if (m == p2indexCache.end()) |
1077 | 1082 | continue; |
1078 | | - const auto& mcParticle = mcParticles.iteratorAt(*m); |
| 1083 | + const auto& mcParticle = mcParticles.iteratorAt(*m - mcParticles.begin().globalIndex()); |
1079 | 1084 | if (mcParticle.isPhysicalPrimary()) { |
1080 | 1085 | same->getTrackHistEfficiency()->Fill(CorrelationContainer::RecoPrimaries, mcParticle.eta(), mcParticle.pt(), getSpecies(mcParticle.pdgCode()), multiplicity, mcCollision.posZ()); |
1081 | 1086 | } |
|
0 commit comments