Skip to content

Commit

Permalink
Merge branch 'mc-implementation' of https://github.com/ljoergen/O2Phy…
Browse files Browse the repository at this point in the history
…sics into mc-implementation
  • Loading branch information
ljoergen committed Dec 12, 2024
2 parents d019175 + 94462f0 commit 644ad99
Show file tree
Hide file tree
Showing 99 changed files with 4,165 additions and 1,915 deletions.
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/PWGCF/TableProducer @alibuild @jgrosseo @saganatt @victor-gonzalez @zchochul @lgraczykCern @prchakra @lauraser @ariedel-cern @EmilGorm @otonvd @shouqiye
/PWGCF/Tasks @alibuild @jgrosseo @saganatt @victor-gonzalez @zchochul @lgraczykCern @prchakra @lauraser @ariedel-cern @EmilGorm @otonvd @shouqiye
/PWGDQ @alibuild @iarsene @dsekihat @feisenhu @lucamicheletti93
/PWGEM @alibuild @mikesas @rbailhac @feisenhu
/PWGEM @alibuild @feisenhu @dsekihat @ivorobye
/PWGEM/Dilepton @alibuild @mikesas @rbailhac @dsekihat @ivorobye @feisenhu
/PWGEM/PhotonMeson @alibuild @mikesas @rbailhac @m-c-danisch @novitzky @mhemmer-cern @dsekihat
/PWGHF @alibuild @vkucera @fcolamar @fgrosa @fcatalan92 @mfaggin @mmazzilli @deepathoms @NicoleBastid @hahassan7 @jpxrk @apalasciano
Expand Down
4 changes: 2 additions & 2 deletions Common/Core/RecoDecay.h
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ struct RecoDecay {
auto mother = particlesMC.rawIteratorAt(particleMother.mothersIds().front() - particlesMC.offset());
auto PDGParticleIMother = std::abs(mother.pdgCode()); // PDG code of the mother
if (PDGParticleIMother < 9 || (PDGParticleIMother > 20 && PDGParticleIMother < 38)) {
auto PDGPaticle = std::abs(particleMother.pdgCode());
// auto PDGPaticle = std::abs(particleMother.pdgCode());
if (
(PDGParticleIMother / 100 == 5 || // b mesons
PDGParticleIMother / 1000 == 5) // b baryons
Expand All @@ -1100,7 +1100,7 @@ struct RecoDecay {
}
auto mother = particlesMC.rawIteratorAt(iMother - particlesMC.offset());
// Check status code
auto motherStatusCode = std::abs(mother.getGenStatusCode());
// auto motherStatusCode = std::abs(mother.getGenStatusCode());
auto PDGParticleIMother = std::abs(mother.pdgCode()); // PDG code of the mother
// Check mother's PDG code.
// printf("getMother: ");
Expand Down
5 changes: 5 additions & 0 deletions Common/TableProducer/Converters/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,8 @@ o2physics_add_dpl_workflow(trackqa-converter
SOURCES trackQAConverter.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(trackqa-converter-002
SOURCES trackQA002Converter.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
97 changes: 97 additions & 0 deletions Common/TableProducer/Converters/trackQA002Converter.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#include <limits>

#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"

using namespace o2;
using namespace o2::framework;

struct TrackQAConverter002 {
Produces<aod::TracksQA_002> tracksQA_002;

void process000(aod::TracksQA_000 const& tracksQA_000)
{
for (const auto& trackQA : tracksQA_000) {
tracksQA_002(
trackQA.trackId(),
trackQA.tpcTime0(),
trackQA.tpcdcaR(),
trackQA.tpcdcaZ(),
trackQA.tpcClusterByteMask(),
trackQA.tpcdEdxMax0R(),
trackQA.tpcdEdxMax1R(),
trackQA.tpcdEdxMax2R(),
trackQA.tpcdEdxMax3R(),
trackQA.tpcdEdxTot0R(),
trackQA.tpcdEdxTot1R(),
trackQA.tpcdEdxTot2R(),
trackQA.tpcdEdxTot3R(),
// dummy values, not available in _000
std::numeric_limits<int8_t>::min(), // deltaRefContParamY
std::numeric_limits<int8_t>::min(), // deltaRefContParamZ
std::numeric_limits<int8_t>::min(), // deltaRefContParamSnp
std::numeric_limits<int8_t>::min(), // deltaRefContParamTgl
std::numeric_limits<int8_t>::min(), // deltaRefContParamQ2Pt
std::numeric_limits<int8_t>::min(), // deltaRefGloParamY
std::numeric_limits<int8_t>::min(), // deltaRefGloParamZ
std::numeric_limits<int8_t>::min(), // deltaRefGloParamSnp
std::numeric_limits<int8_t>::min(), // deltaRefGloParamTgl
std::numeric_limits<int8_t>::min(), // deltaRefGloParamQ2Pt
std::numeric_limits<int8_t>::min(), // dTofdX
std::numeric_limits<int8_t>::min()); // dTofdY
}
}
PROCESS_SWITCH(TrackQAConverter002, process000, "process v000-to-v002 conversion", false);

void process001(aod::TracksQA_001 const& tracksQA_001)
{
for (const auto& trackQA : tracksQA_001) {
tracksQA_002(
trackQA.trackId(),
trackQA.tpcTime0(),
trackQA.tpcdcaR(),
trackQA.tpcdcaZ(),
trackQA.tpcClusterByteMask(),
trackQA.tpcdEdxMax0R(),
trackQA.tpcdEdxMax1R(),
trackQA.tpcdEdxMax2R(),
trackQA.tpcdEdxMax3R(),
trackQA.tpcdEdxTot0R(),
trackQA.tpcdEdxTot1R(),
trackQA.tpcdEdxTot2R(),
trackQA.tpcdEdxTot3R(),
trackQA.deltaRefContParamY(),
trackQA.deltaRefITSParamZ(),
trackQA.deltaRefContParamSnp(),
trackQA.deltaRefContParamTgl(),
trackQA.deltaRefContParamQ2Pt(),
trackQA.deltaRefGloParamY(),
trackQA.deltaRefGloParamZ(),
trackQA.deltaRefGloParamSnp(),
trackQA.deltaRefGloParamTgl(),
trackQA.deltaRefGloParamQ2Pt(),
// dummy values, not available in _001
std::numeric_limits<int8_t>::min(), // dTofdX
std::numeric_limits<int8_t>::min()); // dTofdY
}
}
PROCESS_SWITCH(TrackQAConverter002, process001, "process v001-to-v002 conversion", false);
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<TrackQAConverter002>(cfgc),
};
}
2 changes: 1 addition & 1 deletion Common/TableProducer/match-mft-mch-data.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ struct match_mft_mch_data {
return true;
}

void process(aod::Collisions const& collisions, ExtBCs const& ebcs,
void process(aod::Collisions const&, ExtBCs const& ebcs,
MyMuons const& fwdtracks, MyMFTs const& mfttracks)
{
initCCDB(ebcs.begin());
Expand Down
2 changes: 1 addition & 1 deletion DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ struct tpcPidQaSignal {
return false;
}
histos.fill(HIST("trksel"), 6);
if (pidInTracking != -1 && (track.pidForTracking() != std::abs(pidInTracking))) {
if (pidInTracking != -1 && (track.pidForTracking() != static_cast<unsigned int>(std::abs(pidInTracking)))) {
return false;
}
histos.fill(HIST("trksel"), 7);
Expand Down
8 changes: 5 additions & 3 deletions DPG/Tasks/AOTTrack/qaEfficiency.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ struct QaEfficiency {
phiMin, phiMax,
yMin, yMax);
const int histogramIndex = id + pdgSign * nSpecies;
hPtmotherGenerated = histos.add<TH1>("MC/mother/pt/generated", "Generated pT of mother Lambda or Xi", kTH1D, {axisPt});

// Pt
hPtIts[histogramIndex] = histos.add<TH1>(Form("MC/pdg%i/pt/its", PDGs[histogramIndex]), "ITS tracks " + tagPt, kTH1D, {axisPt});
Expand Down Expand Up @@ -664,6 +663,9 @@ struct QaEfficiency {
histos.add("MC/occ_cent/reco/neg/its", "ITS Negative ", kTH3D, {axisOcc, axisCent, axisPt});
}

AxisSpec axisPtMother{ptBins, "#it{p}_{T} (GeV/#it{c})"};
hPtmotherGenerated = histos.add<TH1>("MC/mother/pt/generated", "Generated pT of mother Lambda or Xi", kTH1D, {axisPtMother});

static_for<0, 1>([&](auto pdgSign) {
makeMCHistograms<pdgSign, o2::track::PID::Electron>(doEl);
makeMCHistograms<pdgSign, o2::track::PID::Muon>(doMu);
Expand Down Expand Up @@ -2071,8 +2073,8 @@ struct QaEfficiency {
float trackEta = track.eta();
float trackPhi = track.phi();
float trackSign = track.sign();
float occupancy;
float centrality;
float occupancy{};
float centrality{};
if (doOccupancy) {
centrality = collision.centFT0C();
if (useFT0OccEstimator) {
Expand Down
4 changes: 2 additions & 2 deletions DPG/Tasks/AOTTrack/qaEventTrack.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,7 @@ void qaEventTrack::fillRecoHistogramsGroupedTracks(const C& collision, const T&
sign = pdgInfo->Charge() / abs(pdgInfo->Charge());
}
// resolution plots
if (doExtraPIDqa && track.pidForTracking() != std::abs(PartIdentifier)) {
if (doExtraPIDqa && track.pidForTracking() != static_cast<unsigned int>(std::abs(PartIdentifier))) {
// full eta range
histos.fill(HIST("Tracks/Kine/resoPtVsptmcWrongPIDinTrk"), track.pt() - particle.pt(), particle.pt());
histos.fill(HIST("Tracks/Kine/resoPtVsptmcScaledWrongPIDinTrk"), (track.pt() - particle.pt()) / particle.pt(), particle.pt());
Expand Down Expand Up @@ -1651,7 +1651,7 @@ void qaEventTrack::fillRecoHistogramsGroupedTracks(const C& collision, const T&
}

// optionally check for PID in tracking: select tracks with correct PID in tracking
if (checkPIDforTracking && track.pidForTracking() != std::abs(PartIdentifier)) {
if (checkPIDforTracking && track.pidForTracking() != static_cast<unsigned int>(std::abs(PartIdentifier))) {
continue;
}

Expand Down
Loading

0 comments on commit 644ad99

Please sign in to comment.