Skip to content
Open
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
20 changes: 14 additions & 6 deletions Common/TableProducer/fwdtrackextension.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 Common/TableProducer/fwdtrackextension.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.)
// 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 @@ -50,6 +50,7 @@
Configurable<std::string> geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"};
Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
Configurable<std::string> configCcdbUrl{"configCcdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
Configurable<bool> propInTheAbsorber{"propInTheAbsorber", false, "Propagate muon in the absober: false to minimize standalone muons DCA calculation"};
Configurable<bool> refitGlobalMuon{"refitGlobalMuon", false, "Recompute parameters of global muons"};

Service<o2::ccdb::BasicCCDBManager> fCCDB;
Expand All @@ -63,7 +64,7 @@
fCCDB->setCaching(true);
fCCDB->setLocalObjectValidityChecking();

if (!o2::base::GeometryManager::isGeometryLoaded()) {
if (propInTheAbsorber && !o2::base::GeometryManager::isGeometryLoaded()) {
LOGF(info, "Load geometry from CCDB");
fCCDB->get<TGeoManager>(geoPath);
}
Expand All @@ -84,8 +85,10 @@
LOGF(info, "Init field from GRP");
o2::base::Propagator::initFieldFromGRP(grpmag);
}
LOGF(info, "Set field for muons");
o2::mch::TrackExtrap::setField();
if (propInTheAbsorber) {
LOGF(info, "Set field for muons");
o2::mch::TrackExtrap::setField();
}
fCurrentRun = bc.runNumber();
}
const float zField = grpmag->getNominalL3Field();
Expand All @@ -100,9 +103,14 @@
o2::track::TrackParCovFwd mft{mfttrack.z(), tpars, tcovs, mfttrack.chi2()};
fwdtrack = o2::aod::fwdtrackutils::refitGlobalMuonCov(propmuon, mft);
}
auto proptrack = o2::aod::fwdtrackutils::propagateTrackParCovFwd(fwdtrack, trackType, collision, o2::aod::fwdtrackutils::propagationPoint::kToDCA, 0.f, zField);
dcaX = (proptrack.getX() - collision.posX());
dcaY = (proptrack.getY() - collision.posY());
if (!propInTheAbsorber && (trackType == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack || trackType == o2::aod::fwdtrack::ForwardTrackTypeEnum::MCHStandaloneTrack)) {
auto proptrack = o2::aod::fwdtrackutils::propagateTrackParCovFwd(fwdtrack, trackType, collision, o2::aod::fwdtrackutils::propagationPoint::kToDCA, 0.f, zField);
dcaX = (proptrack.getX() - collision.posX());
dcaY = (proptrack.getY() - collision.posY());
} else {
dcaX = track.pDca() / sqrt(2) / track.p();

Check failure on line 111 in Common/TableProducer/fwdtrackextension.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using std::numbers::sqrt2 from <numbers>.

dcaY = dcaX;
}
}
fwdDCA(dcaX, dcaY);
}
Expand Down
Loading