Skip to content

Commit d60f1b2

Browse files
authored
[PWGEM/Dilepton] update taggingHFE (#16374)
1 parent b7ebe32 commit d60f1b2

7 files changed

Lines changed: 312 additions & 196 deletions

File tree

PWGEM/Dilepton/DataModel/dileptonTables.h

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -691,13 +691,20 @@ DECLARE_SOA_COLUMN(PrefilterBit, pfb, uint8_t); //!
691691
DECLARE_SOA_COLUMN(PrefilterBitDerived, pfbderived, uint16_t); //!
692692
DECLARE_SOA_COLUMN(ProbElBDT, probElBDT, float); //!
693693

694-
DECLARE_SOA_COLUMN(BDTScorePrompt, bdtScorePrompt, std::vector<float>); //!
695-
DECLARE_SOA_COLUMN(BDTScorePromptHc, bdtScorePromptHc, std::vector<float>); //!
696-
DECLARE_SOA_COLUMN(BDTScoreNonpromptHc, bdtScoreNonpromptHc, std::vector<float>); //!
697-
DECLARE_SOA_COLUMN(BDTScoreHb, bdtScoreHb, std::vector<float>); //!
698-
DECLARE_SOA_COLUMN(HadronType, hadronType, std::vector<uint8_t>); //! 0:track, 1:K0S, 2:Lambda, 3:AntiLambda, 4:XiMinus, 5:XiPlus, 6:OmegaMinus, 7:OmegaPlus
699-
700-
DECLARE_SOA_DYNAMIC_COLUMN(ProbaSCT, probaSCT, [](std::vector<float> p0, std::vector<float> p1, std::vector<float> p2, std::vector<float> p3, std::vector<uint8_t> type, int index) -> std::array<float, 5> { return std::array<float, 5>{p0[index], p1[index], p2[index], p3[index], static_cast<float>(type[index])}; });
694+
DECLARE_SOA_COLUMN(BDTScorePromptUINT8, bdtScorePromptUINT8, std::vector<uint8_t>); //! scaling factor is 255.
695+
DECLARE_SOA_COLUMN(BDTScorePromptHcUINT8, bdtScorePromptHcUINT8, std::vector<uint8_t>); //! scaling factor is 255.
696+
DECLARE_SOA_COLUMN(BDTScoreNonpromptHcUINT8, bdtScoreNonpromptHcUINT8, std::vector<uint8_t>); //! scaling factor is 255.
697+
DECLARE_SOA_COLUMN(BDTScoreHbUINT8, bdtScoreHbUINT8, std::vector<uint8_t>); //! scaling factor is 255.
698+
DECLARE_SOA_COLUMN(HadronType, hadronType, std::vector<uint8_t>); //! 0:track, 1:K0S, 2:Lambda, 3:AntiLambda, 4:XiMinus, 5:XiPlus, 6:OmegaMinus, 7:OmegaPlus
699+
700+
DECLARE_SOA_DYNAMIC_COLUMN(ProbaSCT, probaSCT, [](std::vector<uint8_t> p0, std::vector<uint8_t> p1, std::vector<uint8_t> p2, std::vector<uint8_t> p3, std::vector<uint8_t> type, int index) -> std::array<float, 5> {
701+
return std::array<float, 5>{
702+
std::nextafter(p0[index] / 255.f, std::numeric_limits<float>::infinity()),
703+
std::nextafter(p1[index] / 255.f, std::numeric_limits<float>::infinity()),
704+
std::nextafter(p2[index] / 255.f, std::numeric_limits<float>::infinity()),
705+
std::nextafter(p3[index] / 255.f, std::numeric_limits<float>::infinity()),
706+
static_cast<float>(type[index])};
707+
});
701708
DECLARE_SOA_DYNAMIC_COLUMN(NSV, nSV, [](std::vector<uint8_t> type) -> size_t { return type.size(); });
702709

703710
DECLARE_SOA_COLUMN(ITSNSigmaEl, itsNSigmaEl, float); //!
@@ -1017,9 +1024,9 @@ DECLARE_SOA_TABLE(EMPrimaryElectronsPrefilterBitDerived, "AOD", "PRMELPFBDERIVED
10171024
using EMPrimaryElectronPrefilterBitDerived = EMPrimaryElectronsPrefilterBitDerived::iterator;
10181025

10191026
DECLARE_SOA_TABLE(EMPrimaryElectronsBDTSCT, "AOD", "ELBDTSCT", // To be joined with EMPrimaryElectrons table at analysis level.
1020-
emprimaryelectron::BDTScorePrompt, emprimaryelectron::BDTScorePromptHc, emprimaryelectron::BDTScoreNonpromptHc, emprimaryelectron::BDTScoreHb, emprimaryelectron::HadronType,
1027+
emprimaryelectron::BDTScorePromptUINT8, emprimaryelectron::BDTScorePromptHcUINT8, emprimaryelectron::BDTScoreNonpromptHcUINT8, emprimaryelectron::BDTScoreHbUINT8, emprimaryelectron::HadronType,
10211028
emprimaryelectron::NSV<emprimaryelectron::HadronType>,
1022-
emprimaryelectron::ProbaSCT<emprimaryelectron::BDTScorePrompt, emprimaryelectron::BDTScorePromptHc, emprimaryelectron::BDTScoreNonpromptHc, emprimaryelectron::BDTScoreHb, emprimaryelectron::HadronType>);
1029+
emprimaryelectron::ProbaSCT<emprimaryelectron::BDTScorePromptUINT8, emprimaryelectron::BDTScorePromptHcUINT8, emprimaryelectron::BDTScoreNonpromptHcUINT8, emprimaryelectron::BDTScoreHbUINT8, emprimaryelectron::HadronType>);
10231030
// iterators
10241031
using EMPrimaryElectronBDTSCT = EMPrimaryElectronsBDTSCT::iterator;
10251032

PWGEM/Dilepton/DataModel/lmeeMLTables.h

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,14 @@ DECLARE_SOA_COLUMN(ImpParCZYL, impParCZYL, float); //! sigma of i
219219
DECLARE_SOA_COLUMN(ImpParCZZL, impParCZZL, float); //! sigma of impact parameter for lepton in Z
220220
DECLARE_SOA_COLUMN(PdgCodeMother, pdgCodeMother, int); //! pdg code of mother of lepton
221221
DECLARE_SOA_COLUMN(IsCorrectCollision, isCorrectCollision, bool); //! LH pair is associated to correct collision.
222+
DECLARE_SOA_COLUMN(MotherId, motherId, int); //! globalIndex of mother of lepton
222223
} // namespace emmltrack
223224

224225
DECLARE_SOA_TABLE(EMMLLeptons, "AOD", "EMMLLEPTON", //!
225226
o2::soa::Index<>, emmltrack::EMMLEventId, emmlevent::SubGeneratorId,
226227
emmltrack::Signed1PtL, emmltrack::EtaL, emmltrack::PhiL,
227228
emmltrack::ImpParXYL, emmltrack::ImpParZL, emmltrack::ImpParCYYL, emmltrack::ImpParCZYL, emmltrack::ImpParCZZL,
228-
emmltrack::IsMotherFromBeauty, emmltrack::PdgCodeMother, emmltrack::IsCorrectCollision);
229+
emmltrack::IsMotherFromBeauty, emmltrack::PdgCodeMother, emmltrack::MotherId, emmltrack::IsCorrectCollision);
229230
// iterators
230231
using EMMLLepton = EMMLLeptons::iterator;
231232

@@ -248,7 +249,7 @@ DECLARE_SOA_COLUMN(ImpParCZZH, impParCZZH, float); //! sigma of impact parameter
248249

249250
DECLARE_SOA_COLUMN(V0CPA, v0cpa, float); //! cosPA of V0
250251
DECLARE_SOA_COLUMN(V0CPAXY, v0cpaXY, float); //! cosPA of V0 in XY plane
251-
DECLARE_SOA_COLUMN(V0CPARZ, v0cpaRZ, float); //! cosPA of V0 in XY plane
252+
DECLARE_SOA_COLUMN(V0CPARZ, v0cpaRZ, float); //! cosPA of V0 in RZ plane
252253

253254
DECLARE_SOA_COLUMN(CascCPA, casccpa, float); //! cosPA of Cascade
254255
DECLARE_SOA_COLUMN(CascCPAXY, casccpaXY, float); //! cosPA of Cascade in XY plane
@@ -259,11 +260,24 @@ DECLARE_SOA_COLUMN(CascadeType, cascadeType, uint8_t); //! cascade type, 0 = XiM
259260

260261
// LH pair variables
261262
DECLARE_SOA_COLUMN(MassLH, massLH, float); //! invariant mass of LH assuming pion
262-
DECLARE_SOA_COLUMN(PtLH, ptLH, float); //! pT of LH pair
263-
DECLARE_SOA_COLUMN(DcaLH, dcalh, float); //! DCA between lepton and hadron
264-
DECLARE_SOA_COLUMN(CPA, cpa, float); //! cosine of pointing angle of LH pair
265-
DECLARE_SOA_COLUMN(CPAXY, cpaXY, float); //! cosine of pointing angle of LH pair in XY
266-
DECLARE_SOA_COLUMN(CPARZ, cpaRZ, float); //! cosine of pointing angle of LH pair in RZ
263+
264+
DECLARE_SOA_COLUMN(PtSVL, ptSVL, float); //! pT of lepton at SV
265+
DECLARE_SOA_COLUMN(PlSVL, plSVL, float); //! pL of lepton at SV
266+
DECLARE_SOA_COLUMN(PtSVH, ptSVH, float); //! pT of associated hadron at SV
267+
DECLARE_SOA_COLUMN(PlSVH, plSVH, float); //! pL of associated hadron at SV
268+
269+
DECLARE_SOA_COLUMN(PtFDL, ptFDL, float); //! pT of lepton perpendicular to flight direction
270+
DECLARE_SOA_COLUMN(PlFDL, plFDL, float); //! pL of lepton in parallel to flight direction
271+
DECLARE_SOA_COLUMN(PtFDH, ptFDH, float); //! pT of associated hadron perpendicular to flight direction
272+
DECLARE_SOA_COLUMN(PlFDH, plFDH, float); //! pL of associated hadron in parallel to flight direction
273+
274+
DECLARE_SOA_COLUMN(PtFD, ptFD, float); //! visible momentum of LH pair perpendicular to flight direction = - missing pT due to neutrino perpendicular to flight direction
275+
DECLARE_SOA_COLUMN(PlFD, plFD, float); //! visible momentum of LH pair in parallel to flight direction
276+
277+
DECLARE_SOA_COLUMN(DcaLH, dcalh, float); //! DCA between lepton and hadron
278+
DECLARE_SOA_COLUMN(CPA, cpa, float); //! cosine of pointing angle of LH pair
279+
DECLARE_SOA_COLUMN(CPAXY, cpaXY, float); //! cosine of pointing angle of LH pair in XY
280+
DECLARE_SOA_COLUMN(CPARZ, cpaRZ, float); //! cosine of pointing angle of LH pair in RZ
267281

268282
DECLARE_SOA_COLUMN(Lxy, lxy, float); //! decay length of LH pair
269283
DECLARE_SOA_COLUMN(Lz, lz, float); //! decay length of LH pair
@@ -287,10 +301,12 @@ DECLARE_SOA_TABLE(EMMLLTPairs, "AOD", "EMMLLTPAIR", //!
287301
emmllhpair::EMMLLeptonId,
288302
emmllhpair::Signed1PtH, emmllhpair::EtaH,
289303
emmllhpair::ImpParXYH, emmllhpair::ImpParZH, emmllhpair::ImpParCYYH, emmllhpair::ImpParCZYH, emmllhpair::ImpParCZZH,
290-
pidtpc::TPCNSigmaPi, pidtof::TOFNSigmaPi,
304+
// pidtpc::TPCNSigmaPi, pidtof::TOFNSigmaPi,
291305
pidtpc::TPCNSigmaKa, pidtof::TOFNSigmaKa,
292-
pidtpc::TPCNSigmaPr, pidtof::TOFNSigmaPr,
293-
emmllhpair::MassLH, emmllhpair::PtLH, emmllhpair::DcaLH, emmllhpair::CPA, emmllhpair::CPAXY, emmllhpair::CPARZ,
306+
// pidtpc::TPCNSigmaPr, pidtof::TOFNSigmaPr,
307+
emmllhpair::MassLH, emmllhpair::PtSVL, emmllhpair::PlSVL, emmllhpair::PtSVH, emmllhpair::PlSVH,
308+
emmllhpair::PtFD, emmllhpair::PlFD, emmllhpair::PtFDL, emmllhpair::PlFDL, emmllhpair::PtFDH, emmllhpair::PlFDH,
309+
emmllhpair::DcaLH, emmllhpair::CPA, emmllhpair::CPAXY, emmllhpair::CPARZ,
294310
emmllhpair::Lxy, emmllhpair::Lz, emmllhpair::Lxyz, emmllhpair::LxyErr, emmllhpair::LzErr, emmllhpair::LxyzErr,
295311
emmllhpair::ImpParXY, emmllhpair::ImpParZ, emmllhpair::ImpParCYY, emmllhpair::ImpParCZY, emmllhpair::ImpParCZZ,
296312
emmllhpair::PdgCodeH, emmllhpair::PdgCodeIM, emmllhpair::FoundCommonMother);
@@ -302,7 +318,9 @@ DECLARE_SOA_TABLE(EMMLLV0Pairs, "AOD", "EMMLLV0PAIR", //!
302318
emmllhpair::PtH, emmllhpair::RapidityV0,
303319
emmllhpair::V0CPA, emmllhpair::V0CPAXY, emmllhpair::V0CPARZ,
304320
emmllhpair::ImpParXYH, emmllhpair::ImpParZH, emmllhpair::ImpParCYYH, emmllhpair::ImpParCZYH, emmllhpair::ImpParCZZH,
305-
emmllhpair::MassLH, emmllhpair::PtLH, emmllhpair::DcaLH, emmllhpair::CPA, emmllhpair::CPAXY, emmllhpair::CPARZ,
321+
emmllhpair::MassLH, emmllhpair::PtSVL, emmllhpair::PlSVL, emmllhpair::PtSVH, emmllhpair::PlSVH,
322+
emmllhpair::PtFD, emmllhpair::PlFD, emmllhpair::PtFDL, emmllhpair::PlFDL, emmllhpair::PtFDH, emmllhpair::PlFDH,
323+
emmllhpair::DcaLH, emmllhpair::CPA, emmllhpair::CPAXY, emmllhpair::CPARZ,
306324
emmllhpair::Lxy, emmllhpair::Lz, emmllhpair::Lxyz, emmllhpair::LxyErr, emmllhpair::LzErr, emmllhpair::LxyzErr,
307325
emmllhpair::ImpParXY, emmllhpair::ImpParZ, emmllhpair::ImpParCYY, emmllhpair::ImpParCZY, emmllhpair::ImpParCZZ,
308326
emmllhpair::PdgCodeH, emmllhpair::PdgCodeIM, emmllhpair::FoundCommonMother);
@@ -314,7 +332,9 @@ DECLARE_SOA_TABLE(EMMLLCascPairs, "AOD", "EMMLLCPAIR", //!
314332
emmllhpair::Signed1PtH, emmllhpair::RapidityC,
315333
emmllhpair::CascCPA, emmllhpair::CascCPAXY, emmllhpair::CascCPARZ,
316334
emmllhpair::ImpParXYH, emmllhpair::ImpParZH, emmllhpair::ImpParCYYH, emmllhpair::ImpParCZYH, emmllhpair::ImpParCZZH,
317-
emmllhpair::MassLH, emmllhpair::PtLH, emmllhpair::DcaLH, emmllhpair::CPA, emmllhpair::CPAXY, emmllhpair::CPARZ,
335+
emmllhpair::MassLH, emmllhpair::PtSVL, emmllhpair::PlSVL, emmllhpair::PtSVH, emmllhpair::PlSVH,
336+
emmllhpair::PtFD, emmllhpair::PlFD, emmllhpair::PtFDL, emmllhpair::PlFDL, emmllhpair::PtFDH, emmllhpair::PlFDH,
337+
emmllhpair::DcaLH, emmllhpair::CPA, emmllhpair::CPAXY, emmllhpair::CPARZ,
318338
emmllhpair::Lxy, emmllhpair::Lz, emmllhpair::Lxyz, emmllhpair::LxyErr, emmllhpair::LzErr, emmllhpair::LxyzErr,
319339
emmllhpair::ImpParXY, emmllhpair::ImpParZ, emmllhpair::ImpParCYY, emmllhpair::ImpParCZY, emmllhpair::ImpParCZZ,
320340
emmllhpair::PdgCodeH, emmllhpair::PdgCodeIM, emmllhpair::FoundCommonMother);

PWGEM/Dilepton/TableProducer/skimmerPrimaryElectronSCT.cxx

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,10 @@
6666

6767
#include <math.h>
6868

69-
// using namespace o2;
70-
// using namespace o2::soa;
71-
// using namespace o2::framework;
72-
// using namespace o2::framework::expressions;
73-
// using namespace o2::constants::physics;
74-
// using namespace o2::common::core;
75-
7669
struct skimmerPrimaryElectronSCT {
7770

78-
using MyBCs = o2::soa::Join<o2::aod::BCsWithTimestamps, o2::aod::BcSels>;
71+
// using MyBCs = o2::soa::Join<o2::aod::BCsWithTimestamps, o2::aod::BcSels>;
72+
using MyBCs = o2::soa::Join<o2::aod::BCs, o2::aod::Timestamps>;
7973
using MyCollisions = o2::soa::Join<o2::aod::Collisions, o2::aod::EvSels, o2::aod::EMEvSels>;
8074
using MyCollisionsWithSWT = o2::soa::Join<MyCollisions, o2::aod::EMSWTriggerBitsTMP>;
8175

@@ -207,28 +201,44 @@ struct skimmerPrimaryElectronSCT {
207201

208202
void processRec_SA(MyCollisions const& collisions, MyBCs const& bcs, MyTracks const& tracks, filteredMyV0s const& v0s, filteredMyCascades const& cascades)
209203
{
210-
initCCDB(bcs.begin());
204+
if (bcs.size() == 0) {
205+
return;
206+
}
207+
auto bc = bcs.begin();
208+
initCCDB(bc);
211209
electronModule.processWithoutTTCA<false, false>(bcs, collisions, tracks, v0s, cascades, nullptr, products, mRegistry);
212210
}
213211
PROCESS_SWITCH(skimmerPrimaryElectronSCT, processRec_SA, "process reconstructed info only", true); // standalone
214212

215213
void processRec_TTCA(MyCollisions const& collisions, MyBCs const& bcs, MyTracks const& tracks, o2::aod::TrackAssoc const& trackIndices, filteredMyV0s const& v0s, filteredMyCascades const& cascades)
216214
{
217-
initCCDB(bcs.begin());
215+
if (bcs.size() == 0) {
216+
return;
217+
}
218+
auto bc = bcs.begin();
219+
initCCDB(bc);
218220
electronModule.processWithTTCA<false, false>(bcs, collisions, tracks, v0s, cascades, trackIndices, nullptr, products, mRegistry, cache, perCol_track, trackIndicesPerCollision, perCol_v0, perCol_casc);
219221
}
220222
PROCESS_SWITCH(skimmerPrimaryElectronSCT, processRec_TTCA, "process reconstructed info only", false); // with TTCA
221223

222224
void processRec_SA_SWT(MyCollisionsWithSWT const& collisions, MyBCs const& bcs, MyTracks const& tracks, filteredMyV0s const& v0s, filteredMyCascades const& cascades)
223225
{
224-
initCCDB(bcs.begin());
226+
if (bcs.size() == 0) {
227+
return;
228+
}
229+
auto bc = bcs.begin();
230+
initCCDB(bc);
225231
electronModule.processWithoutTTCA<false, true>(bcs, collisions, tracks, v0s, cascades, nullptr, products, mRegistry);
226232
}
227233
PROCESS_SWITCH(skimmerPrimaryElectronSCT, processRec_SA_SWT, "process reconstructed info only", false); // standalone with swt
228234

229235
void processRec_TTCA_SWT(MyCollisionsWithSWT const& collisions, MyBCs const& bcs, MyTracks const& tracks, o2::aod::TrackAssoc const& trackIndices, filteredMyV0s const& v0s, filteredMyCascades const& cascades)
230236
{
231-
initCCDB(bcs.begin());
237+
if (bcs.size() == 0) {
238+
return;
239+
}
240+
auto bc = bcs.begin();
241+
initCCDB(bc);
232242
electronModule.processWithTTCA<false, true>(bcs, collisions, tracks, v0s, cascades, trackIndices, nullptr, products, mRegistry, cache, perCol_track, trackIndicesPerCollision, perCol_v0, perCol_casc);
233243
}
234244
PROCESS_SWITCH(skimmerPrimaryElectronSCT, processRec_TTCA_SWT, "process reconstructed info only", false); // with TTCA with swt
@@ -237,14 +247,22 @@ struct skimmerPrimaryElectronSCT {
237247

238248
void processMC_SA(o2::soa::Join<MyCollisions, o2::aod::McCollisionLabels> const& collisions, MyBCs const& bcs, MyTracksMC const& tracks, filteredMyV0s const& v0s, filteredMyCascades const& cascades, o2::aod::McParticles const& mcParticles)
239249
{
240-
initCCDB(bcs.begin());
250+
if (bcs.size() == 0) {
251+
return;
252+
}
253+
auto bc = bcs.begin();
254+
initCCDB(bc);
241255
electronModule.processWithoutTTCA<true, false>(bcs, collisions, tracks, v0s, cascades, mcParticles, products, mRegistry);
242256
}
243257
PROCESS_SWITCH(skimmerPrimaryElectronSCT, processMC_SA, "process reconstructed and MC info ", false); // without TTCA in MC
244258

245259
void processMC_TTCA(o2::soa::Join<MyCollisions, o2::aod::McCollisionLabels> const& collisions, MyBCs const& bcs, MyTracksMC const& tracks, o2::aod::TrackAssoc const& trackIndices, filteredMyV0s const& v0s, filteredMyCascades const& cascades, o2::aod::McParticles const& mcParticles)
246260
{
247-
initCCDB(bcs.begin());
261+
if (bcs.size() == 0) {
262+
return;
263+
}
264+
auto bc = bcs.begin();
265+
initCCDB(bc);
248266
electronModule.processWithTTCA<true, false>(bcs, collisions, tracks, v0s, cascades, trackIndices, mcParticles, products, mRegistry, cache, perCol_track, trackIndicesPerCollision, perCol_v0, perCol_casc);
249267
}
250268
PROCESS_SWITCH(skimmerPrimaryElectronSCT, processMC_TTCA, "process reconstructed info only", false); // with TTCA in MC

0 commit comments

Comments
 (0)