|
47 | 47 | #include <Framework/AnalysisTask.h> |
48 | 48 | #include <Framework/Configurable.h> |
49 | 49 | #include <Framework/InitContext.h> |
| 50 | +#include <Framework/O2DatabasePDGPlugin.h> |
50 | 51 | #include <Framework/runDataProcessing.h> |
51 | 52 | #include <ReconstructionDataFormats/Track.h> |
52 | 53 |
|
@@ -1151,6 +1152,8 @@ struct AnalysisSameEventPairing { |
1151 | 1152 | } fConfigCCDB; |
1152 | 1153 |
|
1153 | 1154 | Service<o2::ccdb::BasicCCDBManager> fCCDB; |
| 1155 | + // PDG database |
| 1156 | + Service<o2::framework::O2DatabasePDG> pdgDB; |
1154 | 1157 |
|
1155 | 1158 | HistogramManager* fHistMan; |
1156 | 1159 |
|
@@ -2076,6 +2079,16 @@ struct AnalysisSameEventPairing { |
2076 | 2079 | mcDecision |= (static_cast<uint32_t>(1) << isig); |
2077 | 2080 | VarManager::FillPairMC<TPairType>(t1_raw, t2_raw); |
2078 | 2081 | // cout << " Filled VarManager for the pair." << endl; |
| 2082 | + // check if t1_raw and t2_raw have same mother to compute decay length related variables |
| 2083 | + if (t1_raw.has_mothers() && t2_raw.has_mothers()) { |
| 2084 | + auto motherMCParticle_t1 = t1_raw.template mothers_first_as<McParticles>(); |
| 2085 | + auto motherMCParticle_t2 = t2_raw.template mothers_first_as<McParticles>(); |
| 2086 | + if (motherMCParticle_t1 == motherMCParticle_t2) { |
| 2087 | + auto mcEvent = mcEvents.rawIteratorAt(motherMCParticle_t1.mcCollisionId()); |
| 2088 | + std::array<double, 3> collVtxPos = {mcEvent.posX(), mcEvent.posY(), mcEvent.posZ()}; |
| 2089 | + VarManager::FillTrackCollisionMC<TPairType>(motherMCParticle_t1, collVtxPos, pdgDB->Mass(motherMCParticle_t1.pdgCode())); |
| 2090 | + } |
| 2091 | + } |
2079 | 2092 | if (fUseMCGenAccCut) { |
2080 | 2093 | if (!fMCGenAccCut.IsSelected(VarManager::fgValues)) { |
2081 | 2094 | continue; |
|
0 commit comments