Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Common/TableProducer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(multcenttable

Check failure on line 48 in Common/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name multcenttable does not match its file name multCentTable.cxx. (Matches multcenttable.cxx.)
SOURCES multCentTable.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand Down Expand Up @@ -80,12 +80,12 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(propagationservice

Check failure on line 83 in Common/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name propagationservice does not match its file name propagationService.cxx. (Matches propagationservice.cxx.)
SOURCES propagationService.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::TPCDriftManager
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(propagationservice-run2

Check failure on line 88 in Common/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name propagationservice-run2 does not match its file name propagationServiceRun2.cxx. (Matches propagationserviceRun2.cxx.)
SOURCES propagationServiceRun2.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::TPCDriftManager
COMPONENT_NAME Analysis)
Expand All @@ -95,7 +95,7 @@
PUBLIC_LINK_LIBRARIES O2::DetectorsBase O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(calo-clusters

Check failure on line 98 in Common/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name calo-clusters does not match its file name caloClusterProducer.cxx. (Matches caloClusters.cxx.)
SOURCES caloClusterProducer.cxx
PUBLIC_LINK_LIBRARIES O2::DataFormatsPHOS O2::PHOSBase O2::PHOSReconstruction O2Physics::DataModel
COMPONENT_NAME Analysis)
Expand All @@ -104,8 +104,8 @@
SOURCES fwdtrackextension.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
O2::ReconstructionDataFormats
O2::DetectorsBase
O2::DetectorsCommonDataFormats
O2::GlobalTracking
O2::MCHTracking
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(track-to-collision-associator
Expand All @@ -118,12 +118,12 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(mccollisionextra

Check failure on line 121 in Common/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name mccollisionextra does not match its file name mcCollsExtra.cxx. (Matches mccollisionextra.cxx.)
SOURCES mcCollsExtra.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(qvector-table

Check failure on line 126 in Common/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name qvector-table does not match its file name qVectorsTable.cxx. (Matches qvectorTable.cxx.)
SOURCES qVectorsTable.cxx
PUBLIC_LINK_LIBRARIES O2::Framework
O2Physics::AnalysisCore
Expand All @@ -132,7 +132,7 @@
O2::CCDB
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(mftmchmatchingml

Check failure on line 135 in Common/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name mftmchmatchingml does not match its file name mftmchMatchingML.cxx. (Matches mftmchmatchingml.cxx.)
SOURCES mftmchMatchingML.cxx
PUBLIC_LINK_LIBRARIES O2::Framework
O2Physics::AnalysisCore
Expand All @@ -141,7 +141,7 @@
O2::ReconstructionDataFormats
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(match-mft-ft0

Check failure on line 144 in Common/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name match-mft-ft0 does not match its file name match-mft-ft0.cxx. (Matches matchMftFt0.cxx.)
SOURCES match-mft-ft0.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
O2::ReconstructionDataFormats
Expand All @@ -158,12 +158,12 @@
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(mftmch-matching-data

Check failure on line 161 in Common/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name mftmch-matching-data does not match its file name match-mft-mch-data.cxx. (Matches mftmchMatchingData.cxx.)
SOURCES match-mft-mch-data.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::GlobalTracking
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(occ-table-producer

Check failure on line 166 in Common/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name occ-table-producer does not match its file name occupancyTableProducer.cxx. (Matches occTableProducer.cxx.)
SOURCES occupancyTableProducer.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand Down
79 changes: 60 additions & 19 deletions Common/TableProducer/fwdtrackextension.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,30 @@
// or submit itself to any jurisdiction.

//
// Task performing forward track DCA computation
// \file fwdtrackextension.cxx
// \brief Task performing forward track DCA computation.
// \author Maurice Coquet, maurice.louis.coquet@cern.ch
//

#include "Common/Core/fwdtrackUtilities.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include <CCDB/BasicCCDBManager.h>
#include <DataFormatsParameters/GRPMagField.h>
#include <DetectorsBase/GeometryManager.h>
#include <DetectorsBase/Propagator.h>
#include <Framework/AnalysisDataModel.h>
#include <Framework/AnalysisHelpers.h>
#include <Framework/AnalysisTask.h>
#include <Framework/DataTypes.h>
#include <Framework/runDataProcessing.h>
#include <GlobalTracking/MatchGlobalFwd.h>
#include <ReconstructionDataFormats/TrackFwd.h>

#include <Math/MatrixRepresentationsStatic.h>
#include <Math/SMatrix.h>

#include <string>
#include <vector>

using namespace o2;
Expand All @@ -34,30 +43,62 @@ using namespace o2::framework::expressions;
using SMatrix55 = ROOT::Math::SMatrix<double, 5, 5, ROOT::Math::MatRepSym<double, 5>>;
using SMatrix5 = ROOT::Math::SVector<double, 5>;

using MuonsWithCov = soa::Join<aod::FwdTracks, aod::FwdTracksCov>;

struct FwdTrackExtension {
Produces<aod::FwdTracksDCA> extendedTrackQuantities;
Produces<aod::FwdTracksDCA> fwdDCA;
Configurable<std::string> fGeoPath{"fGeoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"};
Configurable<std::string> fGrpmagPath{"fGrpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
Configurable<std::string> fConfigCcdbUrl{"fConfigCcdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
Configurable<bool> fRefitGlobalMuon{"fRefitGlobalMuon", true, "Recompute parameters of global muons"};

Service<o2::ccdb::BasicCCDBManager> fCCDB;
o2::parameters::GRPMagField* grpmag = nullptr; // for run 3, we access GRPMagField from GLO/Config/GRPMagField
int fCurrentRun; // needed to detect if the run changed and trigger update of magnetic field

void process(aod::FwdTracks const& tracks, aod::Collisions const&)
void init(o2::framework::InitContext&)
{
for (auto& track : tracks) {
float dcaX = -999;
float dcaY = -999;
if (track.has_collision()) {
if (track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack || track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalForwardTrack || track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) {
// Load geometry
fCCDB->setURL(fConfigCcdbUrl);
fCCDB->setCaching(true);
fCCDB->setLocalObjectValidityChecking();

auto const& collision = track.collision();
double chi2 = track.chi2();
SMatrix5 tpars(track.x(), track.y(), track.phi(), track.tgl(), track.signed1Pt());
std::vector<double> v1;
SMatrix55 tcovs(v1.begin(), v1.end());
o2::track::TrackParCovFwd pars1{track.z(), tpars, tcovs, chi2};
pars1.propagateToZlinear(collision.posZ());
if (!o2::base::GeometryManager::isGeometryLoaded()) {
LOGF(info, "Load geometry from CCDB");
fCCDB->get<TGeoManager>(fGeoPath);
}
}

dcaX = (pars1.getX() - collision.posX());
dcaY = (pars1.getY() - collision.posY());
}
void process(aod::Collisions::iterator const& collision, o2::aod::BCsWithTimestamps const& /*...*/, MuonsWithCov const& tracks, aod::MFTTracks const& /*...*/)
{
auto bc = collision.template bc_as<o2::aod::BCsWithTimestamps>();
if (fCurrentRun != bc.runNumber()) {
grpmag = fCCDB->getForTimeStamp<o2::parameters::GRPMagField>(fGrpmagPath, bc.timestamp());
if (grpmag != nullptr) {
LOGF(info, "Init field from GRP");
o2::base::Propagator::initFieldFromGRP(grpmag);
}
LOGF(info, "Set field for muons");
o2::mch::TrackExtrap::setField();
fCurrentRun = bc.runNumber();
}
const float zField = grpmag->getNominalL3Field();
for (const auto& track : tracks) {
const auto trackType = track.trackType();
o2::dataformats::GlobalFwdTrack fwdtrack = o2::aod::fwdtrackutils::getTrackParCovFwd(track, track);
if (fRefitGlobalMuon && (trackType == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack || trackType == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalForwardTrack)) {
auto muontrack = track.template matchMCHTrack_as<MuonsWithCov>();
auto mfttrack = track.template matchMFTTrack_as<aod::MFTTracks>();
o2::dataformats::GlobalFwdTrack propmuon = o2::aod::fwdtrackutils::propagateMuon(muontrack, muontrack, collision, o2::aod::fwdtrackutils::propagationPoint::kToVertex, 0.f, zField);
SMatrix5 tpars(mfttrack.x(), mfttrack.y(), mfttrack.phi(), mfttrack.tgl(), mfttrack.signed1Pt());
SMatrix55 tcovs{};
o2::track::TrackParCovFwd mft{mfttrack.z(), tpars, tcovs, mfttrack.chi2()};
fwdtrack = o2::aod::fwdtrackutils::refitGlobalMuonCov(propmuon, mft);
}
extendedTrackQuantities(dcaX, dcaY);
const auto proptrack = o2::aod::fwdtrackutils::propagateTrackParCovFwd(fwdtrack, trackType, collision, o2::aod::fwdtrackutils::propagationPoint::kToDCA, 0.f, zField);
const float dcaX = (proptrack.getX() - collision.posX());
const float dcaY = (proptrack.getY() - collision.posY());
fwdDCA(dcaX, dcaY);
}
}
};
Expand Down
Loading