Skip to content
Merged
Changes from all 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
12 changes: 7 additions & 5 deletions PWGEM/Dilepton/Tasks/createResolutionMap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@
}

// In case override, don't proceed, please - no CCDB access required
if (d_bz_input > -990) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
d_bz = d_bz_input;
o2::parameters::GRPMagField grpmag;
if (std::fabs(d_bz) > 1e-5) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
grpmag.setL3Current(30000.f / (d_bz / 5.0f));
}
o2::base::Propagator::initFieldFromGRP(&grpmag);
Expand All @@ -313,10 +313,8 @@
ccdb->get<TGeoManager>(geoPath);
}
o2::mch::TrackExtrap::setField();
const double centerMFT[3] = {0, 0, -61.4};
o2::field::MagneticField* field = static_cast<o2::field::MagneticField*>(TGeoGlobalMagField::Instance()->GetField());
mBzMFT = field->getBz(centerMFT); // Get field at centre of MFT
LOGF(info, "Bz at center of MFT = %f kZG", mBzMFT);
mBzMFT = d_bz;
LOGF(info, "Bz at center of MFT = %f kZG manually", mBzMFT);
}

auto run3grp_timestamp = bc.timestamp();
Expand Down Expand Up @@ -345,7 +343,6 @@
d_bz = std::lround(5.f * grpmag->getL3Current() / 30000.f);
LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG";
}
mRunNumber = bc.runNumber();

// std::map<string, string> metadata;
// auto soreor = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, mRunNumber);
Expand All @@ -357,6 +354,11 @@
ccdb->get<TGeoManager>(geoPath);
}
o2::mch::TrackExtrap::setField();
const double centerMFT[3] = {0, 0, -61.4};
o2::field::MagneticField* field = static_cast<o2::field::MagneticField*>(TGeoGlobalMagField::Instance()->GetField());
mBzMFT = field->getBz(centerMFT); // Get field at centre of MFT
LOGF(info, "Bz at center of MFT = %f kZG", mBzMFT);
mRunNumber = bc.runNumber();
}

template <typename TCollision>
Expand Down Expand Up @@ -533,7 +535,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 538 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 @@ -703,9 +705,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 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_Pos"), mcparticle.pt(), mcparticle.phi() - phi);
} else if (mcparticle.pdgCode() == 13) { // negative muon

Check failure on line 710 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 @@ -721,9 +723,9 @@
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 726 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

Check failure on line 728 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_Neg"), mcparticle.pt(), mcparticle.phi() - phi);
}
}
Expand Down Expand Up @@ -809,7 +811,7 @@
}
const auto& mcparticle = track.template mcParticle_as<aod::McParticles>();

if (std::abs(mcparticle.pdgCode()) != 11 || !(mcparticle.isPhysicalPrimary() || mcparticle.producedByGenerator())) {

Check failure on line 814 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_reject_fake_match_its_tpc && o2::aod::pwgem::dilepton::utils::mcutil::hasFakeMatchITSTPC(track)) {
Expand Down Expand Up @@ -853,9 +855,9 @@
registry.fill(HIST("Electron/hEtaPhi"), phi, eta);
registry.fill(HIST("Electron/Ptgen_RelDeltaPt"), mcparticle.pt(), (mcparticle.pt() - pt) / mcparticle.pt());
registry.fill(HIST("Electron/Ptgen_DeltaEta"), mcparticle.pt(), mcparticle.eta() - eta);
if (mcparticle.pdgCode() == -11) { // positron

Check failure on line 858 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("Electron/Ptgen_DeltaPhi_Pos"), mcparticle.pt(), mcparticle.phi() - phi);
} else if (mcparticle.pdgCode() == 11) { // electron

Check failure on line 860 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("Electron/Ptgen_DeltaPhi_Neg"), mcparticle.pt(), mcparticle.phi() - phi);
}
}
Expand Down
Loading