Skip to content

Commit 71a39dc

Browse files
committed
Troubleshooting MC data storage
1 parent 3ec537f commit 71a39dc

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ void IdentifiedBfFilter::processWithoutCent(aod::CollisionEvSel const& collision
411411
}
412412

413413
void IdentifiedBfFilter::processWithCentPID(aod::CollisionEvSelCent const& collision, IdBfFullTracksPID const& ftracks)
414-
{
414+
{
415415
processReconstructed(collision, ftracks, getCentMultPercentile(collision));
416416
}
417417

@@ -522,7 +522,7 @@ void IdentifiedBfFilter::processGeneratorLevel(aod::McCollision const& mccollisi
522522
if (tmpcollision.mcCollisionId() == mccollision.globalIndex()) {
523523
typename AllCollisions::iterator const& collision = allcollisions.iteratorAt(tmpcollision.globalIndex());
524524
if (IsEvtSelected(collision, defaultcent)) {
525-
fhTrueVertexZAA->Fill((mccollision.posZ()));
525+
fhTrueVertexZAA->Fill(mccollision.posZ());
526526
processGenerated(mccollision, mcparticles, defaultcent);
527527
processed = true;
528528
break; /* TODO: only processing the first reconstructed accepted collision */
@@ -1033,13 +1033,14 @@ struct IdentifiedBfFilterTracks {
10331033
}
10341034

10351035
for (auto& particle : particles) {
1036-
float charge = 0.0;
1037-
TParticlePDG* pdgparticle = fPDG->GetParticle(particle.pdgCode());
1038-
if (pdgparticle != nullptr) {
1039-
charge = (pdgparticle->Charge() / 3 >= 1) ? 1.0 : ((pdgparticle->Charge() / 3 <= -1) ? -1.0 : 0.0);
1040-
}
1036+
10411037

10421038
int8_t pid = -1;
1039+
TParticlePDG* pdgpart = fPDG->GetParticle(particle.pdgCode());
1040+
float charge = 0;
1041+
if (pdgpart != nullptr){
1042+
charge = getCharge(pdgpart->Charge());
1043+
}
10431044

10441045
if (charge != 0) {
10451046
if (particle.has_mcCollision() && (particle.template mcCollision_as<soa::Join<aod::McCollisions, aod::IdentifiedBfCFGenCollisionsInfo>>()).collisionaccepted()) {
@@ -1062,7 +1063,7 @@ struct IdentifiedBfFilterTracks {
10621063
gentracksinfo(pid);
10631064
}
10641065
}
1065-
LOGF(IDENTIFIEDBFFILTERLOGCOLLISIONS,
1066+
LOGF(info,
10661067
"Processed %d accepted generated collisions out of a total of %d with %d accepted particles out of a "
10671068
"total of %d",
10681069
acceptedcollisions,
@@ -1147,17 +1148,13 @@ struct IdentifiedBfFilterTracks {
11471148
{
11481149
filterParticles(gencollisions, particles);
11491150
}
1150-
PROCESS_SWITCH(IdentifiedBfFilterTracks, filterGenerated, "Generated particles filering", true)
1151+
PROCESS_SWITCH(IdentifiedBfFilterTracks, filterGenerated, "Generated particles filtering", true)
11511152
};
11521153

11531154
template <typename ParticleObject>
11541155
inline MatchRecoGenSpecies IdentifiedBfFilterTracks::IdentifyParticle(ParticleObject const& particle)
11551156
{
11561157
using namespace identifiedbffilter;
1157-
constexpr int pdgcodeEl = 11;
1158-
constexpr int pdgcodePi = 211;
1159-
constexpr int pdgcodeKa = 321;
1160-
constexpr int pdgcodePr = 2212;
11611158

11621159
int pdgcode = abs(particle.pdgCode());
11631160

@@ -1396,8 +1393,12 @@ inline int8_t IdentifiedBfFilterTracks::AcceptParticle(ParticleObject& particle,
13961393
if (!(overallminp < particle.p())) {
13971394
return kWrongSpecies;
13981395
}
1396+
TParticlePDG* pdgpart = fPDG->GetParticle(particle.pdgCode());
1397+
float charge = 0;
1398+
if (pdgpart != nullptr){
1399+
charge = getCharge(pdgpart->Charge());
1400+
}
13991401

1400-
float charge = getCharge(particle);
14011402

14021403
if (particle.isPhysicalPrimary()) {
14031404
if ((particle.mcCollisionId() == 0) && traceCollId0) {
@@ -1600,7 +1601,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
16001601
WorkflowSpec workflow{adaptAnalysisTask<IdentifiedBfFilter>(cfgc,
16011602
SetDefaultProcesses{
16021603
{{"processWithoutCent", true},
1603-
{"processWithoutCentMC", true}}}),
1604+
{"processWithoutCentGeneratorLevel", true}}}),
16041605
adaptAnalysisTask<IdentifiedBfFilterTracks>(cfgc)};
16051606
return workflow;
16061607
}

PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ enum MatchRecoGenSpecies {
5959
kWrongSpecies = -1
6060
};
6161

62+
constexpr int pdgcodeEl = 11;
63+
constexpr int pdgcodePi = 211;
64+
constexpr int pdgcodeKa = 321;
65+
constexpr int pdgcodePr = 2212;
66+
6267
/// \enum SpeciesPairMatch
6368
/// \brief The species pair considered by the matching test
6469
enum SpeciesPairMatch {
@@ -690,6 +695,7 @@ inline bool IsEvtSelected(CollisionObject const& collision, float& centormult)
690695
}
691696

692697
bool centmultsel = centralitySelection(collision, centormult);
698+
693699
return trigsel && zvtxsel && centmultsel;
694700
}
695701

@@ -720,6 +726,8 @@ inline bool matchTrackType(TrackObject const& track)
720726
}
721727
}
722728

729+
730+
723731
/// \brief Accepts or not the passed track
724732
/// \param track the track of interest
725733
/// \return the internal track id, -1 if not accepted
@@ -742,14 +750,9 @@ void exploreMothers(ParticleObject& particle, MCCollisionObject& collision)
742750
}
743751
}
744752

745-
template <typename ParticleObject>
746-
inline float getCharge(ParticleObject& particle)
753+
inline float getCharge(float pdgCharge)
747754
{
748-
float charge = 0.0;
749-
TParticlePDG* pdgparticle = fPDG->GetParticle(particle.pdgCode());
750-
if (pdgparticle != nullptr) {
751-
charge = (pdgparticle->Charge() / 3 >= 1) ? 1.0 : ((pdgparticle->Charge() / 3 <= -1) ? -1.0 : 0);
752-
}
755+
float charge = (pdgCharge / 3 >= 1) ? 1.0 : ((pdgCharge / 3 <= -1) ? -1.0 : 0);
753756
return charge;
754757
}
755758

0 commit comments

Comments
 (0)