Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)

Check failure on line 1 in PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Specify task name only when it cannot be derived from the struct name. Only append to the default name.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -67,7 +67,7 @@
Produces<aod::EMPrimaryMuonsCov> emprimarymuonscov;

// Configurables
Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};

Check failure on line 70 in PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
Configurable<std::string> geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"};
Configurable<bool> fillQAHistograms{"fillQAHistograms", false, "flag to fill QA histograms"};
Expand Down Expand Up @@ -132,7 +132,7 @@
const double centerMFT[3] = {0, 0, -61.4};
o2::field::MagneticField* field = static_cast<o2::field::MagneticField*>(TGeoGlobalMagField::Instance()->GetField());
mBz = field->getBz(centerMFT); // Get field at centre of MFT
LOGF(info, "Bz at center of MFT = %f kZG", mBz);
LOGF(info, "Bz at center of MFT = %f kZG", mBz); // this is dummy comment.
}

void addHistograms()
Expand Down Expand Up @@ -311,12 +311,13 @@
pDCA = mchtrack.p() * dcaXY_Matched;

if (refitGlobalMuon) {
eta = mfttrack.eta();
// eta = mfttrack.eta();
// phi = mfttrack.phi();
// o2::math_utils::bringTo02Pi(phi);
pt = propmuonAtPV_Matched.getP() * std::sin(2.f * std::atan(std::exp(-eta)));
eta = propmuonAtDCA.getEta();
phi = propmuonAtDCA.getPhi();
o2::math_utils::bringTo02Pi(phi);
pt = propmuonAtPV_Matched.getP() * std::sin(2.f * std::atan(std::exp(-eta)));

// x = mfttrack.x();
// y = mfttrack.y();
Expand Down Expand Up @@ -906,7 +907,7 @@
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<skimmerPrimaryMuon>(cfgc, TaskName{"skimmer-primary-muon"}),

Check failure on line 910 in PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Specified task name skimmer-primary-muon and the struct name skimmerPrimaryMuon produce the same device name skimmer-primary-muon. TaskName is redundant.
adaptAnalysisTask<associateAmbiguousMuon>(cfgc, TaskName{"associate-ambiguous-muon"}),

Check failure on line 911 in PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Specified task name associate-ambiguous-muon and the struct name associateAmbiguousMuon produce the same device name associate-ambiguous-muon. TaskName is redundant.
adaptAnalysisTask<associateSameMFT>(cfgc, TaskName{"associate-same-mft"})};

Check failure on line 912 in PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Device names associate-same-mft and associate-same-m-f-t generated from the specified task name associate-same-mft and from the struct name associateSameMFT, respectively, differ in hyphenation. Consider fixing capitalisation of the struct name to AssociateSameMft and removing TaskName.
}
5 changes: 3 additions & 2 deletions PWGEM/Dilepton/Tasks/createResolutionMap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@
void fillMuon(TCollision const& collision, TMuon const& muon, TMFTTracksCov const& mftCovs, const float centrality)
{
auto mcparticle = muon.template mcParticle_as<aod::McParticles>();
if (std::abs(mcparticle.pdgCode()) != 13 || !(mcparticle.isPhysicalPrimary() || mcparticle.producedByGenerator())) {

Check failure on line 536 in PWGEM/Dilepton/Tasks/createResolutionMap.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
return;
}
if (cfg_require_true_mc_collision_association && mcparticle.mcCollisionId() != collision.mcCollisionId()) {
Expand Down Expand Up @@ -611,12 +611,13 @@
}

if (muoncuts.refitGlobalMuon) {
eta = mfttrack.eta();
// eta = mfttrack.eta();
// phi = mfttrack.phi();
// o2::math_utils::bringTo02Pi(phi);
pt = propmuonAtPV_Matched.getP() * std::sin(2.f * std::atan(std::exp(-eta)));
eta = propmuonAtDCA.getEta();
phi = propmuonAtDCA.getPhi();
o2::math_utils::bringTo02Pi(phi);
pt = propmuonAtPV_Matched.getP() * std::sin(2.f * std::atan(std::exp(-eta)));

if constexpr (withMFTCov) {
auto mfttrackcov = mftCovs.rawIteratorAt(map_mfttrackcovs[mfttrack.globalIndex()]);
Expand Down Expand Up @@ -702,9 +703,9 @@
registry.fill(HIST("StandaloneMuon/hEtaPhi"), phi, eta);
registry.fill(HIST("StandaloneMuon/Ptgen_RelDeltaPt"), mcparticle.pt(), (mcparticle.pt() - pt) / mcparticle.pt());
registry.fill(HIST("StandaloneMuon/Ptgen_DeltaEta"), mcparticle.pt(), mcparticle.eta() - eta);
if (mcparticle.pdgCode() == -13) { // positive muon

Check failure on line 706 in PWGEM/Dilepton/Tasks/createResolutionMap.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
registry.fill(HIST("StandaloneMuon/Ptgen_DeltaPhi_Pos"), mcparticle.pt(), mcparticle.phi() - phi);
} else if (mcparticle.pdgCode() == 13) { // negative muon

Check failure on line 708 in PWGEM/Dilepton/Tasks/createResolutionMap.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
registry.fill(HIST("StandaloneMuon/Ptgen_DeltaPhi_Neg"), mcparticle.pt(), mcparticle.phi() - phi);
}
}
Expand All @@ -720,7 +721,7 @@
registry.fill(HIST("GlobalMuon/hEtaPhi"), phi, eta);
registry.fill(HIST("GlobalMuon/Ptgen_RelDeltaPt"), mcparticle.pt(), (mcparticle.pt() - pt) / mcparticle.pt());
registry.fill(HIST("GlobalMuon/Ptgen_DeltaEta"), mcparticle.pt(), mcparticle.eta() - eta);
if (mcparticle.pdgCode() == -13) { // positive muon

Check failure on line 724 in PWGEM/Dilepton/Tasks/createResolutionMap.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
registry.fill(HIST("GlobalMuon/Ptgen_DeltaPhi_Pos"), mcparticle.pt(), mcparticle.phi() - phi);
} else if (mcparticle.pdgCode() == 13) { // negative muon
registry.fill(HIST("GlobalMuon/Ptgen_DeltaPhi_Neg"), mcparticle.pt(), mcparticle.phi() - phi);
Expand Down
58 changes: 25 additions & 33 deletions PWGEM/Dilepton/Tasks/matchingMFT.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,9 @@ struct matchingMFT {
fRegistry.add("MFTMCHMID/primary/correct/hDCAxyResolutionvsPt", "DCA_{xy} resolution vs. p_{T};p_{T} (GeV/c);DCA_{xy} resolution (#mum);", kTH2F, {{100, 0, 10.f}, {500, 0, 500}}, false);
fRegistry.add("MFTMCHMID/primary/correct/hMCHBitMap", "MCH bit map;MCH bit map", kTH1F, {{1024, -0.5, 1023.5}}, false);
fRegistry.add("MFTMCHMID/primary/correct/hMIDBitMap", "MID bit map;MID bit map", kTH1F, {{256, -0.5, 255.5}}, false);
fRegistry.add("MFTMCHMID/primary/correct/hMeanMFTClusterSize", "mean MFT cluster size vs. p;p (GeV/c);<MFT cluster size> #times sin(#lambda)", kTH2F, {{100, 0, 100}, {100, 0, 10}}, false);

fRegistry.add("MFTMCHMID/primary/correct/hProdVtxZ", "prod. vtx Z of muon;V_{z} (cm)", kTH1F, {{200, -100, 100}}, false);
fRegistry.add("MFTMCHMID/primary/correct/hRelDeltaPt", "pT resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", kTH2F, {{100, 0, 10}, {400, -1, +1}}, false);
fRegistry.add("MFTMCHMID/primary/correct/hRelDeltaPt", "pT resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", kTH2F, {{100, 0, 10}, {200, -1, +1}}, false);
fRegistry.add("MFTMCHMID/primary/correct/hDeltaEta_Pos", "#eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", kTH2F, {{100, 0, 10}, {400, -0.2, +0.2}}, false);
fRegistry.add("MFTMCHMID/primary/correct/hDeltaEta_Neg", "#eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", kTH2F, {{100, 0, 10}, {400, -0.2, +0.2}}, false);
fRegistry.add("MFTMCHMID/primary/correct/hDeltaPhi_Pos", "#varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", kTH2F, {{100, 0, 10}, {400, -0.2, +0.2}}, false);
Expand Down Expand Up @@ -275,27 +274,27 @@ struct matchingMFT {
return (clmap > 0);
}

template <typename T>
float meanClusterSizeMFT(T const& track)
{
uint64_t mftClusterSizesAndTrackFlags = track.mftClusterSizesAndTrackFlags();
uint16_t clsSize = 0;
uint16_t n = 0;
for (unsigned int layer = 0; layer < 10; layer++) {
uint16_t size_per_layer = (mftClusterSizesAndTrackFlags >> (layer * 6)) & 0x3f;
clsSize += size_per_layer;
if (size_per_layer > 0) {
n++;
}
// LOGF(info, "track.globalIndex() = %d, layer = %d, size_per_layer = %d", track.globalIndex(), layer, size_per_layer);
}

if (n > 0) {
return static_cast<float>(clsSize) / static_cast<float>(n) * std::fabs(std::sin(std::atan(track.tgl())));
} else {
return 0.f;
}
}
// template <typename T>
// float meanClusterSizeMFT(T const& track)
// {
// uint64_t mftClusterSizesAndTrackFlags = track.mftClusterSizesAndTrackFlags();
// uint16_t clsSize = 0;
// uint16_t n = 0;
// for (unsigned int layer = 0; layer < 10; layer++) {
// uint16_t size_per_layer = (mftClusterSizesAndTrackFlags >> (layer * 6)) & 0x3f;
// clsSize += size_per_layer;
// if (size_per_layer > 0) {
// n++;
// }
// // LOGF(info, "track.globalIndex() = %d, layer = %d, size_per_layer = %d", track.globalIndex(), layer, size_per_layer);
// }

// if (n > 0) {
// return static_cast<float>(clsSize) / static_cast<float>(n) * std::fabs(std::sin(std::atan(track.tgl())));
// } else {
// return 0.f;
// }
// }

template <typename TFwdTracks, typename TMFTTracks, typename TCollision, typename TFwdTrack, typename TMFTrackCov>
void getDeltaEtaDeltaPhiAtMatchingPlane(TCollision const& collision, TFwdTrack const& fwdtrack, TMFTrackCov const& mftCovs, float& deta, float& dphi)
Expand Down Expand Up @@ -393,7 +392,6 @@ struct matchingMFT {
o2::dataformats::GlobalFwdTrack propmuonAtDCA_Matched = propagateMuon(mchtrack, mchtrack, collision, propagationPoint::kToDCA, matchingZ, mBz);
o2::dataformats::GlobalFwdTrack propmuonAtPV_Matched = propagateMuon(mchtrack, mchtrack, collision, propagationPoint::kToVertex, matchingZ, mBz);

float p = propmuonAtPV.getP();
float pt = propmuonAtPV.getPt();
float eta = propmuonAtPV.getEta();
float phi = propmuonAtPV.getPhi();
Expand Down Expand Up @@ -424,13 +422,13 @@ struct matchingMFT {
float dphiMP = 999.f, detaMP = 999.f;

if (refitGlobalMuon) {
eta = mfttrack.eta();
// eta = mfttrack.eta();
// phi = mfttrack.phi();
// o2::math_utils::bringTo02Pi(phi);
pt = propmuonAtPV_Matched.getP() * std::sin(2.f * std::atan(std::exp(-eta)));
p = propmuonAtPV_Matched.getP();
eta = propmuonAtDCA.getEta();
phi = propmuonAtDCA.getPhi();
o2::math_utils::bringTo02Pi(phi);
pt = propmuonAtPV_Matched.getP() * std::sin(2.f * std::atan(std::exp(-eta)));

if constexpr (withMFTCov) {
// auto mfttrackcov = mftCovs.rawIteratorAt(map_mfttrackcovs[mfttrack.globalIndex()]);
Expand Down Expand Up @@ -464,8 +462,6 @@ struct matchingMFT {
// }
// sigma_dcaXY = dcaXY / dcaXYinSigma;

// o2::track::TrackParCovFwd mftsaAtDCA = getTrackParCovFwd(mfttrack, mfttrackcov); // values at innermost update
// mftsaAtDCA.propagateToZhelix(collision.posZ(), mBz); // propagated to matching plane
// cXXatDCA = mftsaAtDCA.getSigma2X();
// cYYatDCA = mftsaAtDCA.getSigma2Y();
// cXYatDCA = mftsaAtDCA.getSigmaXY();
Expand Down Expand Up @@ -541,7 +537,6 @@ struct matchingMFT {
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hDCAxyinSigma"), dcaXYinSigma);
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hMCHBitMap"), fwdtrack.mchBitMap());
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hMIDBitMap"), fwdtrack.midBitMap());
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hMeanMFTClusterSize"), p, meanClusterSizeMFT(mfttrack));
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hDCAxResolutionvsPt"), pt, std::sqrt(cXXatDCA) * 1e+4); // convert cm to um
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hDCAyResolutionvsPt"), pt, std::sqrt(cYYatDCA) * 1e+4); // convert cm to um
fRegistry.fill(HIST("MFTMCHMID/primary/correct/hDCAxyResolutionvsPt"), pt, sigma_dcaXY * 1e+4); // convert cm to um
Expand Down Expand Up @@ -578,7 +573,6 @@ struct matchingMFT {
fRegistry.fill(HIST("MFTMCHMID/primary/wrong/hDCAxyinSigma"), dcaXYinSigma);
fRegistry.fill(HIST("MFTMCHMID/primary/wrong/hMCHBitMap"), fwdtrack.mchBitMap());
fRegistry.fill(HIST("MFTMCHMID/primary/wrong/hMIDBitMap"), fwdtrack.midBitMap());
fRegistry.fill(HIST("MFTMCHMID/primary/wrong/hMeanMFTClusterSize"), p, meanClusterSizeMFT(mfttrack));
fRegistry.fill(HIST("MFTMCHMID/primary/wrong/hDCAxResolutionvsPt"), pt, std::sqrt(cXXatDCA) * 1e+4); // convert cm to um
fRegistry.fill(HIST("MFTMCHMID/primary/wrong/hDCAyResolutionvsPt"), pt, std::sqrt(cYYatDCA) * 1e+4); // convert cm to um
fRegistry.fill(HIST("MFTMCHMID/primary/wrong/hDCAxyResolutionvsPt"), pt, sigma_dcaXY * 1e+4); // convert cm to um
Expand Down Expand Up @@ -617,7 +611,6 @@ struct matchingMFT {
fRegistry.fill(HIST("MFTMCHMID/secondary/correct/hDCAxyinSigma"), dcaXYinSigma);
fRegistry.fill(HIST("MFTMCHMID/secondary/correct/hMCHBitMap"), fwdtrack.mchBitMap());
fRegistry.fill(HIST("MFTMCHMID/secondary/correct/hMIDBitMap"), fwdtrack.midBitMap());
fRegistry.fill(HIST("MFTMCHMID/secondary/correct/hMeanMFTClusterSize"), p, meanClusterSizeMFT(mfttrack));
fRegistry.fill(HIST("MFTMCHMID/secondary/correct/hDCAxResolutionvsPt"), pt, std::sqrt(cXXatDCA) * 1e+4); // convert cm to um
fRegistry.fill(HIST("MFTMCHMID/secondary/correct/hDCAyResolutionvsPt"), pt, std::sqrt(cYYatDCA) * 1e+4); // convert cm to um
fRegistry.fill(HIST("MFTMCHMID/secondary/correct/hDCAxyResolutionvsPt"), pt, sigma_dcaXY * 1e+4); // convert cm to um
Expand Down Expand Up @@ -654,7 +647,6 @@ struct matchingMFT {
fRegistry.fill(HIST("MFTMCHMID/secondary/wrong/hDCAxyinSigma"), dcaXYinSigma);
fRegistry.fill(HIST("MFTMCHMID/secondary/wrong/hMCHBitMap"), fwdtrack.mchBitMap());
fRegistry.fill(HIST("MFTMCHMID/secondary/wrong/hMIDBitMap"), fwdtrack.midBitMap());
fRegistry.fill(HIST("MFTMCHMID/secondary/wrong/hMeanMFTClusterSize"), p, meanClusterSizeMFT(mfttrack));
fRegistry.fill(HIST("MFTMCHMID/secondary/wrong/hDCAxResolutionvsPt"), pt, std::sqrt(cXXatDCA) * 1e+4); // convert cm to um
fRegistry.fill(HIST("MFTMCHMID/secondary/wrong/hDCAyResolutionvsPt"), pt, std::sqrt(cYYatDCA) * 1e+4); // convert cm to um
fRegistry.fill(HIST("MFTMCHMID/secondary/wrong/hDCAxyResolutionvsPt"), pt, sigma_dcaXY * 1e+4); // convert cm to um
Expand Down
Loading