Skip to content

Commit 83c8796

Browse files
committed
Implemented comments Nima
1 parent 73ea449 commit 83c8796

File tree

4 files changed

+11
-48
lines changed

4 files changed

+11
-48
lines changed

PWGJE/Core/JetFindingUtilities.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ bool analyseV0s(std::vector<fastjet::PseudoJet>& inputParticles, T const& v0s, f
271271
* @param doHFJetFinding set whether only jets containing a HF candidate are saved
272272
*/
273273
template <typename T, typename U, typename V>
274-
void findJets(JetFinder& jetFinder, std::vector<fastjet::PseudoJet>& inputParticles, float jetPtMin, float jetPtMax, std::vector<double> jetRadius, float jetAreaFractionMin, T const& collision, U& jetsTable, V& constituentsTable, std::shared_ptr<THn> thnSparseJet, bool fillThnSparse, bool doCandidateJetFinding = false, bool saveJetsWithoutCandidates = false)
274+
void findJets(JetFinder& jetFinder, std::vector<fastjet::PseudoJet>& inputParticles, float jetPtMin, float jetPtMax, std::vector<double> jetRadius, float jetAreaFractionMin, T const& collision, U& jetsTable, V& constituentsTable, std::shared_ptr<THn> thnSparseJet, bool fillThnSparse, bool doCandidateJetFinding = false)
275275
{
276276
auto jetRValues = static_cast<std::vector<double>>(jetRadius);
277277
jetFinder.jetPtMin = jetPtMin;
@@ -296,7 +296,7 @@ void findJets(JetFinder& jetFinder, std::vector<fastjet::PseudoJet>& inputPartic
296296
break;
297297
}
298298
}
299-
if (!isCandidateJet && !saveJetsWithoutCandidates) {
299+
if (!isCandidateJet) {
300300
continue;
301301
}
302302
}

PWGJE/Core/JetV0Utilities.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ auto slicedPerV0Candidate(T const& table, U const& candidate, V const& perV0Cand
138138
}
139139

140140
template <typename T, typename U>
141-
bool isV0Particle(T const& particles, U const& particle, bool onlyChargedDecays)
141+
bool isV0Particle(T const& particles, U const& particle, bool v0ChargedDecaysOnly)
142142
{
143-
if (onlyChargedDecays) {
143+
if (v0ChargedDecaysOnly) {
144144
return RecoDecay::isMatchedMCGen(particles, particle, +kK0Short, std::array{+kPiPlus, -kPiPlus}, true) || RecoDecay::isMatchedMCGen(particles, particle, +kLambda0, std::array{+kProton, -kPiPlus}, true) || RecoDecay::isMatchedMCGen(particles, particle, -kLambda0, std::array{-kProton, +kPiPlus}, true);
145145
} else {
146146
return RecoDecay::isMatchedMCGen(particles, particle, +kK0Short, std::array{+kPiPlus, -kPiPlus}, true) || RecoDecay::isMatchedMCGen(particles, particle, +kK0Short, std::array{+kPi0, +kPi0}, true) || RecoDecay::isMatchedMCGen(particles, particle, +kLambda0, std::array{+kProton, -kPiPlus}, true) || RecoDecay::isMatchedMCGen(particles, particle, +kLambda0, std::array{+kNeutron, +kPi0}, true) || RecoDecay::isMatchedMCGen(particles, particle, -kLambda0, std::array{-kProton, +kPiPlus}, true) || RecoDecay::isMatchedMCGen(particles, particle, -kLambda0, std::array{+kNeutron, +kPi0}, true);

PWGJE/JetFinders/jetFinderV0.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ struct JetFinderV0Task {
9393
Configurable<bool> fillTHnSparse{"fillTHnSparse", true, "switch to fill the THnSparse"};
9494
Configurable<double> jetExtraParam{"jetExtraParam", -99.0, "sets the _extra_param in fastjet"};
9595
Configurable<bool> useV0SignalFlags{"useV0SignalFlags", true, "use V0 signal flags table"};
96-
Configurable<bool> saveJetsWithoutCandidates{"saveJetsWithoutCandidates", false, "save all jets, even those without V0s"};
96+
Configurable<bool> saveJetsWithCandidatesOnly{"saveJetsWithCandidatesOnly", true, "only save jets if they contain a V0"};
9797

9898
Service<o2::framework::O2DatabasePDG> pdgDatabase;
9999
int trackSelection = -1;
@@ -172,7 +172,7 @@ struct JetFinderV0Task {
172172
}
173173
inputParticles.clear();
174174
if (!jetfindingutilities::analyseV0s(inputParticles, candidates, candPtMin, candPtMax, candYMin, candYMax, candIndex, useV0SignalFlags)) {
175-
if (!saveJetsWithoutCandidates) {
175+
if (saveJetsWithCandidatesOnly) {
176176
return;
177177
}
178178
}
@@ -186,7 +186,7 @@ struct JetFinderV0Task {
186186
*/
187187
jetfindingutilities::analyseTracksMultipleCandidates(inputParticles, tracks, trackSelection, trackingEfficiency, candidates);
188188

189-
jetfindingutilities::findJets(jetFinder, inputParticles, minJetPt, maxJetPt, jetRadius, jetAreaFractionMin, collision, jetsTableInput, constituentsTableInput, registry.get<THn>(HIST("hJet")), fillTHnSparse, true, saveJetsWithoutCandidates);
189+
jetfindingutilities::findJets(jetFinder, inputParticles, minJetPt, maxJetPt, jetRadius, jetAreaFractionMin, collision, jetsTableInput, constituentsTableInput, registry.get<THn>(HIST("hJet")), fillTHnSparse, saveJetsWithCandidatesOnly);
190190
}
191191

192192
template <typename T, typename U, typename V>
@@ -195,12 +195,12 @@ struct JetFinderV0Task {
195195

196196
inputParticles.clear();
197197
if (!jetfindingutilities::analyseV0s(inputParticles, candidates, candPtMin, candPtMax, candYMin, candYMax, candIndex, useV0SignalFlags)) {
198-
if (!saveJetsWithoutCandidates) {
198+
if (saveJetsWithCandidatesOnly) {
199199
return;
200200
}
201201
}
202202
jetfindingutilities::analyseParticles<true>(inputParticles, particleSelection, jetTypeParticleLevel, particles, pdgDatabase, &candidates);
203-
jetfindingutilities::findJets(jetFinder, inputParticles, minJetPt, maxJetPt, jetRadius, jetAreaFractionMin, collision, jetsTable, constituentsTable, registry.get<THn>(HIST("hJetMCP")), fillTHnSparse, true, saveJetsWithoutCandidates);
203+
jetfindingutilities::findJets(jetFinder, inputParticles, minJetPt, maxJetPt, jetRadius, jetAreaFractionMin, collision, jetsTable, constituentsTable, registry.get<THn>(HIST("hJetMCP")), fillTHnSparse, saveJetsWithCandidatesOnly);
204204
}
205205

206206
void processDummy(aod::JetCollisions const&)

PWGJE/TableProducer/derivedDataProducer.cxx

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ struct JetDerivedDataProducerTask {
147147
Configurable<std::string> ccdbURL{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
148148
Configurable<bool> includeTriggers{"includeTriggers", false, "fill the collision information with software trigger decisions"};
149149
Configurable<bool> includeHadronicRate{"includeHadronicRate", true, "fill the collision information with the hadronic rate"};
150+
Configurable<bool> v0ChargedDecaysOnly{"v0ChargedDecaysOnly", true, "store V0s (at particle-level) only if they decay to charged particles"};
150151

151152
Preslice<aod::EMCALClusterCells> perClusterCells = aod::emcalclustercell::emcalclusterId;
152153
Preslice<aod::EMCALMatchedTracks> perClusterTracks = aod::emcalclustercell::emcalclusterId;
@@ -763,9 +764,8 @@ struct JetDerivedDataProducerTask {
763764
void processV0MC(aod::McCollision const& mcCollision, aod::McParticles const& particles)
764765
{ // can loop over McV0Labels tables if we want to only store matched V0Particles
765766
bool filledV0McCollisionTable = false;
766-
bool onlyChargedDecays = false;
767767
for (auto const& particle : particles) {
768-
if (jetv0utilities::isV0Particle(particles, particle, onlyChargedDecays)) {
768+
if (jetv0utilities::isV0Particle(particles, particle, v0ChargedDecaysOnly)) {
769769
if (!filledV0McCollisionTable) {
770770
products.jV0McCollisionsTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ());
771771
products.jV0McCollisionIdsTable(mcCollision.globalIndex());
@@ -797,43 +797,6 @@ struct JetDerivedDataProducerTask {
797797
}
798798
PROCESS_SWITCH(JetDerivedDataProducerTask, processV0MC, "produces V0 particles", false);
799799

800-
void processV0MCChargedDecays(aod::McCollision const& mcCollision, aod::McParticles const& particles)
801-
{ // can loop over McV0Labels tables if we want to only store matched V0Particles
802-
bool filledV0McCollisionTable = false;
803-
bool onlyChargedDecays = true;
804-
for (auto const& particle : particles) {
805-
if (jetv0utilities::isV0Particle(particles, particle, onlyChargedDecays)) {
806-
if (!filledV0McCollisionTable) {
807-
products.jV0McCollisionsTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ());
808-
products.jV0McCollisionIdsTable(mcCollision.globalIndex());
809-
filledV0McCollisionTable = true;
810-
}
811-
std::vector<int32_t> mothersId;
812-
if (particle.has_mothers()) {
813-
auto mothersIdTemps = particle.mothersIds();
814-
for (auto mothersIdTemp : mothersIdTemps) {
815-
mothersId.push_back(mothersIdTemp);
816-
}
817-
}
818-
int daughtersId[2] = {-1, -1};
819-
auto i = 0;
820-
if (particle.has_daughters()) {
821-
for (auto daughterId : particle.daughtersIds()) {
822-
if (i > 1) {
823-
break;
824-
}
825-
daughtersId[i] = daughterId;
826-
i++;
827-
}
828-
}
829-
auto pdgParticle = pdgDatabase->GetParticle(particle.pdgCode());
830-
products.jV0McsTable(products.jV0McCollisionsTable.lastIndex(), particle.pt(), particle.eta(), particle.phi(), particle.y(), particle.e(), pdgParticle->Mass(), particle.pdgCode(), particle.getGenStatusCode(), particle.getHepMCStatusCode(), particle.isPhysicalPrimary(), jetv0utilities::setV0ParticleDecayBit(particles, particle));
831-
products.jV0McIdsTable(mcCollision.globalIndex(), particle.globalIndex(), mothersId, daughtersId);
832-
}
833-
}
834-
}
835-
PROCESS_SWITCH(JetDerivedDataProducerTask, processV0MCChargedDecays, "produces V0 particles that decay to charged particles", false);
836-
837800
void processDielectronCollisions(aod::ReducedEventsInfo::iterator const& DielectronCollision)
838801
{
839802
products.jDielectronCollisionIdsTable(DielectronCollision.collisionId());

0 commit comments

Comments
 (0)