Skip to content

Commit b9d2e1a

Browse files
committed
adding process info to jet mc particle tables
1 parent 9bfc210 commit b9d2e1a

File tree

7 files changed

+144
-71
lines changed

7 files changed

+144
-71
lines changed

EventFiltering/PWGJE/jetFilter.cxx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,33 @@
1111

1212
// Author: Filip Krizek
1313

14-
#include <TMath.h>
15-
#include <cmath>
16-
#include <string>
17-
#include <vector>
14+
#include "../filterTables.h"
1815

19-
#include "Framework/ASoA.h"
20-
#include "Framework/ASoAHelpers.h"
21-
#include "Framework/AnalysisDataModel.h"
22-
#include "Framework/AnalysisTask.h"
23-
#include "Framework/runDataProcessing.h"
24-
#include "ReconstructionDataFormats/Track.h"
16+
#include "PWGJE/Core/FastJetUtilities.h"
17+
#include "PWGJE/Core/JetBkgSubUtils.h"
18+
#include "PWGJE/Core/JetDerivedDataUtilities.h"
19+
#include "PWGJE/Core/JetFinder.h"
20+
#include "PWGJE/DataModel/EMCALClusters.h"
21+
#include "PWGJE/DataModel/Jet.h"
2522

2623
#include "Common/Core/TrackSelection.h"
2724
#include "Common/Core/TrackSelectionDefaults.h"
2825
#include "Common/DataModel/EventSelection.h"
2926
#include "Common/DataModel/TrackSelectionTables.h"
3027

31-
#include "PWGJE/Core/JetFinder.h"
32-
#include "PWGJE/Core/FastJetUtilities.h"
33-
#include "PWGJE/Core/JetBkgSubUtils.h"
34-
#include "PWGJE/DataModel/EMCALClusters.h"
35-
#include "PWGJE/DataModel/Jet.h"
36-
#include "PWGJE/Core/JetDerivedDataUtilities.h"
28+
#include "Framework/ASoA.h"
29+
#include "Framework/ASoAHelpers.h"
30+
#include "Framework/AnalysisDataModel.h"
31+
#include "Framework/AnalysisTask.h"
32+
#include "Framework/HistogramRegistry.h"
33+
#include "Framework/runDataProcessing.h"
34+
#include "ReconstructionDataFormats/Track.h"
3735

38-
#include "../filterTables.h"
36+
#include <TMath.h>
3937

40-
#include "Framework/HistogramRegistry.h"
38+
#include <cmath>
39+
#include <string>
40+
#include <vector>
4141

4242
using namespace o2;
4343
using namespace o2::framework;

PWGJE/Core/JetDerivedDataUtilities.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
#define PWGJE_CORE_JETDERIVEDDATAUTILITIES_H_
1919

2020
#include "Common/CCDB/EventSelectionParams.h"
21-
#include "Common/CCDB/TriggerAliases.h"
2221
#include "Common/CCDB/RCTSelectionFlags.h"
22+
#include "Common/CCDB/TriggerAliases.h"
2323

2424
#include <Rtypes.h>
2525

@@ -61,7 +61,7 @@ bool selectCollision(T const& collision, std::vector<int> eventSelectionMaskBits
6161
}
6262
o2::aod::rctsel::RCTFlagsChecker rctChecker;
6363
rctChecker.init(rctLabel, requireZDCRct, rejectLimitedAcceptanceRct);
64-
if (rctSelection && !rctChecker.checkTable(collision)) { //CBT_hadronPID given as default so that TOF is included in RCT selection to benefit from better timing for tracks. Impact of this for inclusive jets should be studied
64+
if (rctSelection && !rctChecker.checkTable(collision)) { // CBT_hadronPID given as default so that TOF is included in RCT selection to benefit from better timing for tracks. Impact of this for inclusive jets should be studied
6565
return false;
6666
}
6767
if (eventSelectionMaskBits.size() == 0) {

PWGJE/DataModel/JetReducedData.h

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,14 @@ DECLARE_SOA_COLUMN(Phi, phi, float);
340340
DECLARE_SOA_COLUMN(Y, y, float);
341341
DECLARE_SOA_COLUMN(E, e, float);
342342
DECLARE_SOA_COLUMN(PdgCode, pdgCode, int);
343-
DECLARE_SOA_COLUMN(GenStatusCode, getGenStatusCode, int); // TODO : We can look at combining this with the two below
344-
DECLARE_SOA_COLUMN(HepMCStatusCode, getHepMCStatusCode, int);
345-
DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool);
343+
DECLARE_SOA_COLUMN(StatusCode, statusCode, int);
344+
DECLARE_SOA_COLUMN(Flags, flags, uint8_t);
345+
346346
DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(Mothers, mothers);
347347
DECLARE_SOA_SELF_SLICE_INDEX_COLUMN(Daughters, daughters);
348+
349+
DECLARE_SOA_DYNAMIC_COLUMN(PVector, pVector, //! Momentum vector in x,y,z-directions in GeV/c
350+
[](float px, float py, float pz) -> std::array<float, 3> { return std::array<float, 3>{px, py, pz}; });
348351
DECLARE_SOA_DYNAMIC_COLUMN(Px, px,
349352
[](float pt, float phi) -> float { return pt * std::cos(phi); });
350353
DECLARE_SOA_DYNAMIC_COLUMN(Py, py,
@@ -355,6 +358,20 @@ DECLARE_SOA_DYNAMIC_COLUMN(P, p,
355358
[](float pt, float eta) -> float { return pt * std::cosh(eta); });
356359
DECLARE_SOA_DYNAMIC_COLUMN(Energy, energy,
357360
[](float e) -> float { return e; });
361+
362+
DECLARE_SOA_DYNAMIC_COLUMN(ProducedByGenerator, producedByGenerator, //! True if particle produced by the generator (==TMCProcess::kPrimary); False if by the transport code
363+
[](uint8_t flags) -> bool { return (flags & o2::aod::mcparticle::enums::ProducedByTransport) == 0x0; });
364+
DECLARE_SOA_DYNAMIC_COLUMN(FromBackgroundEvent, fromBackgroundEvent, //! Particle from background event
365+
[](uint8_t flags) -> bool { return (flags & o2::aod::mcparticle::enums::FromBackgroundEvent) == o2::aod::mcparticle::enums::FromBackgroundEvent; });
366+
DECLARE_SOA_DYNAMIC_COLUMN(GetProcess, getProcess, //! The VMC physics code (as int) that generated this particle (see header TMCProcess.h in ROOT)
367+
[](uint8_t flags, int statusCode) -> int { if ((flags & o2::aod::mcparticle::enums::ProducedByTransport) == 0x0) { return 0 /*TMCProcess::kPrimary*/; } else { return statusCode; } });
368+
DECLARE_SOA_DYNAMIC_COLUMN(GetGenStatusCode, getGenStatusCode, //! The native status code put by the generator, or -1 if a particle produced during transport
369+
[](uint8_t flags, int statusCode) -> int { if ((flags & o2::aod::mcparticle::enums::ProducedByTransport) == 0x0) { return o2::mcgenstatus::getGenStatusCode(statusCode); } else { return -1; } });
370+
DECLARE_SOA_DYNAMIC_COLUMN(GetHepMCStatusCode, getHepMCStatusCode, //! The HepMC status code put by the generator, or -1 if a particle produced during transport
371+
[](uint8_t flags, int statusCode) -> int { if ((flags & o2::aod::mcparticle::enums::ProducedByTransport) == 0x0) { return o2::mcgenstatus::getHepMCStatusCode(statusCode); } else { return -1; } });
372+
DECLARE_SOA_DYNAMIC_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, //! True if particle is considered a physical primary according to the ALICE definition
373+
[](uint8_t flags) -> bool { return (flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary; });
374+
358375
} // namespace jmcparticle
359376

360377
DECLARE_SOA_TABLE_STAGED(JMcParticles, "JMCPARTICLE",
@@ -366,16 +383,21 @@ DECLARE_SOA_TABLE_STAGED(JMcParticles, "JMCPARTICLE",
366383
jmcparticle::Y,
367384
jmcparticle::E,
368385
jmcparticle::PdgCode,
369-
jmcparticle::GenStatusCode,
370-
jmcparticle::HepMCStatusCode,
371-
jmcparticle::IsPhysicalPrimary,
386+
jmcparticle::StatusCode,
387+
jmcparticle::Flags,
372388
jmcparticle::MothersIds,
373389
jmcparticle::DaughtersIdSlice,
374390
jmcparticle::Px<jmcparticle::Pt, jmcparticle::Phi>,
375391
jmcparticle::Py<jmcparticle::Pt, jmcparticle::Phi>,
376392
jmcparticle::Pz<jmcparticle::Pt, jmcparticle::Eta>,
377393
jmcparticle::P<jmcparticle::Pt, jmcparticle::Eta>,
378-
jmcparticle::Energy<jmcparticle::E>);
394+
jmcparticle::Energy<jmcparticle::E>,
395+
jmcparticle::ProducedByGenerator<jmcparticle::Flags>,
396+
jmcparticle::FromBackgroundEvent<jmcparticle::Flags>,
397+
jmcparticle::GetProcess<jmcparticle::Flags, jmcparticle::StatusCode>,
398+
jmcparticle::GetGenStatusCode<jmcparticle::Flags, jmcparticle::StatusCode>,
399+
jmcparticle::GetHepMCStatusCode<jmcparticle::Flags, jmcparticle::StatusCode>,
400+
jmcparticle::IsPhysicalPrimary<jmcparticle::Flags>);
379401

380402
using JMcParticle = JMcParticles::iterator;
381403
using StoredJMcParticle = StoredJMcParticles::iterator;

0 commit comments

Comments
 (0)