Skip to content

Commit 64300ed

Browse files
committed
fixes
1 parent 9d4259e commit 64300ed

File tree

4 files changed

+32
-32
lines changed

4 files changed

+32
-32
lines changed

PWGUD/Core/UPCTauCentralBarrelHelperRL.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11-
///
12-
/// \brief
11+
12+
/// \file UPCTauCentralBarrelHelperRL.h
13+
/// \brief Personal helper file to analyze tau events from UPC collisions
1314
/// \author Roman Lavicka, roman.lavicka@cern.ch
1415
/// \since 27.10.2022
16+
///
1517

1618
#ifndef PWGUD_CORE_UPCTAUCENTRALBARRELHELPERRL_H_
1719
#define PWGUD_CORE_UPCTAUCENTRALBARRELHELPERRL_H_

PWGUD/DataModel/TwoTracksEventTables.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ DECLARE_SOA_COLUMN(TruePosX, truePosX, float);
8989
DECLARE_SOA_COLUMN(TruePosY, truePosY, float);
9090
DECLARE_SOA_COLUMN(TruePosZ, truePosZ, float);
9191
// truth particles
92-
DECLARE_SOA_COLUMN(TrueMotherPx, trueTauPx, float[2]);
93-
DECLARE_SOA_COLUMN(TrueMotherPy, trueTauPy, float[2]);
94-
DECLARE_SOA_COLUMN(TrueMotherPz, trueTauPz, float[2]);
92+
DECLARE_SOA_COLUMN(TrueMotherPx, trueMotherPx, float[2]);
93+
DECLARE_SOA_COLUMN(TrueMotherPy, trueMotherPy, float[2]);
94+
DECLARE_SOA_COLUMN(TrueMotherPz, trueMotherPz, float[2]);
9595
DECLARE_SOA_COLUMN(TrueDaugPx, trueDaugPx, float[2]);
9696
DECLARE_SOA_COLUMN(TrueDaugPy, trueDaugPy, float[2]);
9797
DECLARE_SOA_COLUMN(TrueDaugPz, trueDaugPz, float[2]);

PWGUD/TableProducer/twoTracksEventTableProducer.cxx

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,17 @@
3131
#include "Framework/runDataProcessing.h"
3232

3333
// O2Physics headers
34-
#include "PWGUD/Core/SGSelector.h"
35-
#include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h"
36-
#include "PWGUD/DataModel/TauEventTables.h"
37-
#include "PWGUD/DataModel/UDTables.h"
38-
3934
#include "Common/CCDB/EventSelectionParams.h"
4035
#include "Common/Core/TrackSelection.h"
4136
#include "Common/Core/TrackSelectionDefaults.h"
4237
#include "Common/Core/trackUtilities.h"
4338
#include "Common/DataModel/EventSelection.h"
4439
#include "Common/DataModel/PIDResponse.h"
4540
#include "Common/DataModel/TrackSelectionTables.h"
41+
#include "PWGUD/Core/SGSelector.h"
42+
#include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h"
43+
#include "PWGUD/DataModel/TwoTracksEventTables.h"
44+
#include "PWGUD/DataModel/UDTables.h"
4645

4746
// ROOT
4847
#include "Math/Vector4D.h"
@@ -54,7 +53,7 @@ using namespace o2::framework;
5453
using namespace o2::framework::expressions;
5554
using namespace o2::constants::physics;
5655

57-
struct TauEventTableProducer {
56+
struct TwoTracksEventTableProducer {
5857
Produces<o2::aod::TwoTracks> twoTracks;
5958
Produces<o2::aod::TrueTwoTracks> trueTwoTracks;
6059

@@ -482,7 +481,7 @@ struct TauEventTableProducer {
482481
tpcSignal, tpcEl, tpcMu, tpcPi, tpcKa, tpcPr, tpcIP,
483482
tofSignal, tofEl, tofMu, tofPi, tofKa, tofPr, tofEP);
484483
}
485-
PROCESS_SWITCH(TauEventTableProducer, processDataSG, "Iterate UD tables with measured data created by SG-Candidate-Producer.", false);
484+
PROCESS_SWITCH(TwoTracksEventTableProducer, processDataSG, "Iterate UD tables with measured data created by SG-Candidate-Producer.", false);
486485

487486
PresliceUnsorted<aod::UDMcParticles> partPerMcCollision = aod::udmcparticle::udMcCollisionId;
488487
PresliceUnsorted<FullMCSGUDCollisions> colPerMcCollision = aod::udcollision::udMcCollisionId;
@@ -535,9 +534,9 @@ struct TauEventTableProducer {
535534

536535
int trueChannel = -1;
537536
bool trueHasRecoColl = false;
538-
float trueTauX[2] = {-999., -999.};
539-
float trueTauY[2] = {-999., -999.};
540-
float trueTauZ[2] = {-999., -999.};
537+
float trueMotherX[2] = {-999., -999.};
538+
float trueMotherY[2] = {-999., -999.};
539+
float trueMotherZ[2] = {-999., -999.};
541540
float trueDaugX[2] = {-999., -999.};
542541
float trueDaugY[2] = {-999., -999.};
543542
float trueDaugZ[2] = {-999., -999.};
@@ -602,22 +601,22 @@ struct TauEventTableProducer {
602601
auto const& partsFromMcColl = parts.sliceBy(partPerMcCollision, mccoll.globalIndex());
603602
int countMothers = 0;
604603
for (const auto& particle : partsFromMcColl) {
605-
// select only tauons with checking if particle has no mother
604+
// select only mothers with checking if particle has no mother
606605
if (particle.has_mothers())
607606
continue;
608607
countMothers++;
609-
// check the generated collision does not have more than 2 tauons
608+
// check the generated collision does not have more than 2 mothers
610609
if (countMothers > 2) {
611610
if (verboseInfo)
612611
printLargeMessage("Truth collision has more than 2 no mother particles. Breaking the particle loop.");
613612
histos.get<TH1>(HIST("Truth/hTroubles"))->Fill(2);
614613
problem = true;
615614
break;
616615
}
617-
// fill info for each tau
618-
trueTauX[countMothers - 1] = particle.px();
619-
trueTauY[countMothers - 1] = particle.py();
620-
trueTauZ[countMothers - 1] = particle.pz();
616+
// fill info for each mother
617+
trueMotherX[countMothers - 1] = particle.px();
618+
trueMotherY[countMothers - 1] = particle.py();
619+
trueMotherZ[countMothers - 1] = particle.pz();
621620

622621
// get daughters of the tau
623622
const auto& daughters = particle.daughters_as<aod::UDMcParticles>();
@@ -690,7 +689,7 @@ struct TauEventTableProducer {
690689
if (particle.has_mothers())
691690
continue;
692691
countMothers++;
693-
// check the generated collision does not have more than 2 tauons
692+
// check the generated collision does not have more than 2 mothers
694693
if (countMothers > 2) {
695694
if (verboseInfo)
696695
printLargeMessage("Truth collision has more than 2 no mother particles. Breaking the particle loop.");
@@ -699,9 +698,9 @@ struct TauEventTableProducer {
699698
break;
700699
}
701700
// fill info for each tau
702-
trueTauX[countMothers - 1] = particle.px();
703-
trueTauY[countMothers - 1] = particle.py();
704-
trueTauZ[countMothers - 1] = particle.pz();
701+
trueMotherX[countMothers - 1] = particle.px();
702+
trueMotherY[countMothers - 1] = particle.py();
703+
trueMotherZ[countMothers - 1] = particle.pz();
705704

706705
// get daughters of the tau
707706
const auto& daughters = particle.daughters_as<aod::UDMcParticles>();
@@ -746,16 +745,15 @@ struct TauEventTableProducer {
746745
tpcSignal, tpcEl, tpcMu, tpcPi, tpcKa, tpcPr, tpcIP,
747746
tofSignal, tofEl, tofMu, tofPi, tofKa, tofPr, tofEP,
748747
trueChannel, trueHasRecoColl, mccoll.posX(), mccoll.posY(), mccoll.posZ(),
749-
trueTauX, trueTauY, trueTauZ, trueDaugX, trueDaugY, trueDaugZ, trueDaugPdgCode, problem);
748+
trueMotherX, trueMotherY, trueMotherZ, trueDaugX, trueDaugY, trueDaugZ, trueDaugPdgCode, problem);
750749
} // mccollisions
751750
}
752-
PROCESS_SWITCH(TauEventTableProducer, processMonteCarlo, "Iterate UD tables with simulated data created by SG-Candidate-Producer.", false);
751+
PROCESS_SWITCH(TwoTracksEventTableProducer, processMonteCarlo, "Iterate UD tables with simulated data created by SG-Candidate-Producer.", false);
753752
};
754753

755754
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
756755
{
757756
return WorkflowSpec{
758-
adaptAnalysisTask<TauEventTableProducer>(cfgc)};
757+
adaptAnalysisTask<TwoTracksEventTableProducer>(cfgc)};
759758
}
760759

761-
#pragma clang diagnostic pop

PWGUD/Tasks/testMCstdTabsRL.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h"
3434

3535
// ROOT headers
36-
#include "TLorentzVector.h"
36+
#include "Math/Vector4D.h"
3737

3838
using namespace o2;
3939
using namespace o2::framework;
@@ -76,8 +76,8 @@ struct TestMCstdTabsRL {
7676

7777
histos.get<TH2>(HIST("Events/Truth/hGenIDvsCountCollisions"))->Fill(collision.getGeneratorId(), 1);
7878
histos.get<TH2>(HIST("Events/Truth/hGenIDvsNparticles"))->Fill(collision.getGeneratorId(), particles.size());
79-
80-
TLorentzVector mother;
79+
80+
ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>> mother;
8181
for (const auto& particle : particles) {
8282
histos.get<TH2>(HIST("Events/Truth/hGenIDvsPDGcodesAll"))->Fill(collision.getGeneratorId(), particle.pdgCode());
8383
// if (!particle.isPhysicalPrimary()) continue;

0 commit comments

Comments
 (0)