Skip to content

Commit 2c4eccd

Browse files
authored
[PWGDQ] fixed reassociated collision indices in alignment derived tables (#18568)
1 parent bd4523e commit 2c4eccd

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

‎PWGDQ/Tasks/muonGlobalAlignment.cxx‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "Common/Core/fwdtrackUtilities.h"
2222
#include "Common/DataModel/CollisionAssociationTables.h"
2323
#include "Common/DataModel/EventSelection.h"
24-
#include "Common/DataModel/FwdTrackReAlignTables.h"
2524
#include "Common/DataModel/TrackSelectionTables.h"
2625

2726
#include <CCDB/BasicCCDBManager.h>
@@ -124,6 +123,7 @@ using o2::track::TrackParCovFwd;
124123
namespace muonaligncoll
125124
{
126125
DECLARE_SOA_COLUMN(RunNumber, runNumber, int);
126+
DECLARE_SOA_COLUMN(GlobalBC, globalBC, uint64_t); //! Bunch crossing number (globally unique in this run)
127127
DECLARE_SOA_COLUMN(Timestamp, timestamp, uint64_t); //! Timestamp of a BC in ms (epoch style)
128128
DECLARE_SOA_COLUMN(CollisionTime, collisionTime, float); //! Collision time in ns relative to BC stored in bc()
129129
DECLARE_SOA_COLUMN(CollisionTimeRes, collisionTimeRes, float); //! Resolution of collision time
@@ -133,7 +133,8 @@ namespace o2::aod
133133
{
134134
// Reduced collisions table
135135
DECLARE_SOA_TABLE(MACollisions, "AOD", "MACOLL", //! Time and vertex information of collision
136-
o2::soa::Index<>, muonaligncoll::RunNumber, muonaligncoll::Timestamp,
136+
o2::soa::Index<>, muonaligncoll::RunNumber,
137+
muonaligncoll::GlobalBC, muonaligncoll::Timestamp,
137138
collision::PosX, collision::PosY, collision::PosZ,
138139
collision::CovXX, collision::CovYY, collision::CovZZ,
139140
collision::CollisionTime, collision::CollisionTimeRes);
@@ -247,8 +248,8 @@ namespace o2::aod
247248

248249
namespace ma_track_association
249250
{
250-
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! Collision index
251-
DECLARE_SOA_ARRAY_INDEX_COLUMN(Collision, compatibleColl); //! Array of collision indices
251+
DECLARE_SOA_INDEX_COLUMN_FULL_CUSTOM(Collision, collision, int32_t, MACollisions, "MACOLLs", ""); //! Collision index
252+
DECLARE_SOA_ARRAY_INDEX_COLUMN_FULL_CUSTOM(Collision, compatibleColl, int32_t, MACollisions, "MACOLLs", ""); //! Array of collision indices
252253
} // namespace ma_track_association
253254

254255
DECLARE_SOA_TABLE(MAFwdTrackAssoc, "AOD", "MAFWDTRACKASSOC", //! Table for fwdtrack-to-collision association
@@ -275,7 +276,7 @@ using CompactMFTTrack = CompactMFTTracks::iterator;
275276
// Switch to enable/disable the processing of the derived tables
276277
// 0: process standard AO2Ds and produce the derived tables
277278
// 1: process derived AO2Ds and disable the derived tables creation
278-
#define PROCESS_DERIVED_TABLES 0
279+
#define PROCESS_DERIVED_TABLES 0 // NOLINT(cppcoreguidelines-macro-usage)
279280

280281
struct MuonGlobalAlignment { // o2-linter: disable=name/workflow-file,name/struct (exception)
281282

@@ -518,6 +519,7 @@ struct MuonGlobalAlignment { // o2-linter: disable=name/workflow-file,name/struc
518519

519520
struct CollisionInfo {
520521
int runNumber{0};
522+
uint64_t globalBC{0};
521523
uint64_t timestamp{0};
522524
// z position of the collision
523525
double zVertex{0};
@@ -2029,6 +2031,7 @@ struct MuonGlobalAlignment { // o2-linter: disable=name/workflow-file,name/struc
20292031

20302032
auto& collisionInfo = collisionInfos[collisionIndex];
20312033
collisionInfo.runNumber = bc.runNumber();
2034+
collisionInfo.globalBC = bc.globalBC();
20322035
collisionInfo.timestamp = bc.timestamp();
20332036
collisionInfo.zVertex = collision.posZ();
20342037

@@ -2178,6 +2181,7 @@ struct MuonGlobalAlignment { // o2-linter: disable=name/workflow-file,name/struc
21782181

21792182
auto& collisionInfo = collisionInfos[collisionIndex];
21802183
collisionInfo.runNumber = collision.runNumber();
2184+
collisionInfo.globalBC = collision.globalBC();
21812185
collisionInfo.timestamp = collision.timestamp();
21822186
collisionInfo.zVertex = collision.posZ();
21832187

@@ -2323,7 +2327,9 @@ struct MuonGlobalAlignment { // o2-linter: disable=name/workflow-file,name/struc
23232327
continue;
23242328
}
23252329

2326-
collTable(collisionInfo.runNumber, collisionInfo.timestamp,
2330+
collTable(collisionInfo.runNumber,
2331+
collisionInfo.globalBC,
2332+
collisionInfo.timestamp,
23272333
c.posX(), c.posY(), c.posZ(),
23282334
c.covXX(), c.covYY(), c.covZZ(),
23292335
c.collisionTime(), c.collisionTimeRes());

0 commit comments

Comments
 (0)