Skip to content

Commit e1ccc8b

Browse files
committed
[PWGDQ] Couple of adaptation regarding muon (re-)alignment
1 parent 4892216 commit e1ccc8b

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

Common/TableProducer/muonRealignment.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ struct MuonRealignment {
8181
Configurable<std::string> geoNewPathLocal{"geoNewPathLocal", "", "Local path of the GRP object if not using CCDB"};
8282
Configurable<int64_t> nolaterthanRef{"ccdb-no-later-than-ref", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object of reference basis"};
8383
Configurable<int64_t> nolaterthanNew{"ccdb-no-later-than-new", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object of new basis"};
84-
Configurable<double> cfgChamberResolutionX{"cfgChamberResolutionX", 0.04, "Chamber resolution along X configuration for refit"}; // 0.4cm pp, 0.2cm PbPb
85-
Configurable<double> cfgChamberResolutionY{"cfgChamberResolutionY", 0.04, "Chamber resolution along Y configuration for refit"}; // 0.4cm pp, 0.2cm PbPb
84+
Configurable<double> cfgChamberResolutionX{"cfgChamberResolutionX", 0.4, "Chamber resolution along X configuration for refit"}; // 0.4cm pp, 0.2cm PbPb
85+
Configurable<double> cfgChamberResolutionY{"cfgChamberResolutionY", 0.4, "Chamber resolution along Y configuration for refit"}; // 0.4cm pp, 0.2cm PbPb
8686
Configurable<double> cfgSigmaCutImprove{"cfgSigmaCutImprove", 6., "Sigma cut for track improvement"}; // 6 for pp, 4 for PbPb
8787
Configurable<bool> fUseRemoteField{"cfgUseRemoteField", true, "Chose whether to fetch the magnetic field from ccdb or set it manually"};
8888
Configurable<bool> fUseRemoteGeometry{"cfgUseRemoteGeometry", false, "Chose whether to fetch new geometry from ccdb or set it manually"};

PWGDQ/TableProducer/tableMaker.cxx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,24 @@ struct TableMaker {
11231123
for (const auto& muonId : fwdtrackIndices) { // start loop over tracks
11241124
auto muon = muonId.template fwdtrack_as<TMuons>();
11251125
trackFilteringTag = static_cast<uint64_t>(0);
1126-
VarManager::FillTrack<TMuonFillMap>(muon);
1126+
if constexpr (static_cast<bool>(TMuonRealignFillMap)) {
1127+
// Update muon information using realigned tracks
1128+
if (static_cast<int>(muon.trackType()) > 2) {
1129+
// Update only MCH or MCH-MID tracks with realigned information
1130+
auto muonRealignSelected = tracksMuonRealign.select(aod::fwdtrackrealign::fwdtrackId == muonId.fwdtrackId() && aod::fwdtrackrealign::collisionId == collision.globalIndex());
1131+
if (muonRealignSelected.size() == 1) {
1132+
for (const auto& muonRealign : muonRealignSelected) {
1133+
VarManager::FillTrack<TMuonRealignFillMap>(muonRealign);
1134+
}
1135+
} else {
1136+
LOGF(fatal, "Inconsistent size of realigned muon track candidates.");
1137+
}
1138+
} else {
1139+
VarManager::FillTrack<TMuonFillMap>(muon);
1140+
}
1141+
} else {
1142+
VarManager::FillTrack<TMuonFillMap>(muon);
1143+
}
11271144

11281145
if (muon.index() > idxPrev + 1) { // checks if some muons are filtered even before the skimming function
11291146
nDel += muon.index() - (idxPrev + 1);

PWGDQ/Tasks/mchAlignRecord.cxx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ struct mchAlignRecordTask {
117117
Configurable<double> fAllowedVarZ{"variation-z", 2.0, "Allowed variation for z axis in cm"};
118118
Configurable<double> cfgSigmaX{"cfgSigmaX", 1000., "Sigma cut along X"};
119119
Configurable<double> cfgSigmaY{"cfgSigmaY", 1000., "Sigma cut along Y"};
120-
Configurable<double> cfgChamberResolutionX{"cfgChamberResolutionX", 0.04, "Chamber resolution along X configuration for refit"}; // 0.4cm pp, 0.2cm PbPb
121-
Configurable<double> cfgChamberResolutionY{"cfgChamberResolutionY", 0.04, "Chamber resolution along Y configuration for refit"}; // 0.4cm pp, 0.2cm PbPb
120+
Configurable<double> cfgChamberResolutionX{"cfgChamberResolutionX", 0.4, "Chamber resolution along X configuration for refit"}; // 0.4cm pp, 0.2cm PbPb
121+
Configurable<double> cfgChamberResolutionY{"cfgChamberResolutionY", 0.4, "Chamber resolution along Y configuration for refit"}; // 0.4cm pp, 0.2cm PbPb
122122
Configurable<double> cfgSigmaCutImprove{"cfgSigmaCutImprove", 6., "Sigma cut for track improvement"};
123123
struct : ConfigurableGroup {
124124
Configurable<std::vector<int>> cfgDetElem{"cfgDetElem",
@@ -129,6 +129,8 @@ struct mchAlignRecordTask {
129129
"List of param mask for d.o.f to be fixed"};
130130
} fFixDetElem;
131131

132+
Preslice<aod::FwdTrkCl> perMuon = aod::fwdtrkcl::fwdtrackId;
133+
132134
void init(InitContext& ic)
133135
{
134136

@@ -335,13 +337,9 @@ struct mchAlignRecordTask {
335337
continue;
336338
}
337339

340+
auto clustersSliced = clusters.sliceBy(perMuon, track.globalIndex()); // Slice clusters by muon id
338341
// Loop over attached clusters
339-
for (auto const& cluster : clusters) {
340-
341-
if (cluster.template fwdtrack_as<TTracks>() != track) {
342-
continue;
343-
}
344-
342+
for (auto const& cluster : clustersSliced) {
345343
clIndex += 1;
346344

347345
mch::Cluster* mch_cluster = new mch::Cluster();

0 commit comments

Comments
 (0)