Skip to content

Commit 22bdf41

Browse files
DataFormatsGlobalTracking: rename CosmicTrack to TrackCosmicsExtended
The per-cosmic output of the cluster collector contains the matcher's TrackCosmics plus the raw hits of its legs; the new name makes that relation explicit (review comment). Header CosmicTrack.h is now TrackCosmicsExtended.h; content and branch names are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent b1a3a03 commit 22bdf41

5 files changed

Lines changed: 24 additions & 24 deletions

File tree

‎DataFormats/Detectors/GlobalTracking/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ o2_target_root_dictionary(
4545
DataFormatsGlobalTracking
4646
HEADERS include/DataFormatsGlobalTracking/FilteredRecoTF.h
4747
include/DataFormatsGlobalTracking/TrackTuneParams.h
48-
include/DataFormatsGlobalTracking/CosmicTrack.h
48+
include/DataFormatsGlobalTracking/TrackCosmicsExtended.h
4949
)

DataFormats/Detectors/GlobalTracking/include/DataFormatsGlobalTracking/CosmicTrack.h renamed to DataFormats/Detectors/GlobalTracking/include/DataFormatsGlobalTracking/TrackCosmicsExtended.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12-
/// \file CosmicTrack.h
12+
/// \file TrackCosmicsExtended.h
1313
/// \brief Matched cosmic track with the raw clusters of its legs and of the road around them, for offline refits
1414

15-
#ifndef ALICEO2_COSMIC_TRACK_H
16-
#define ALICEO2_COSMIC_TRACK_H
15+
#ifndef ALICEO2_TRACK_COSMICS_EXTENDED_H
16+
#define ALICEO2_TRACK_COSMICS_EXTENDED_H
1717

1818
#include <vector>
1919
#include <cstdint>
@@ -32,8 +32,8 @@ struct CosmicTPCCluster {
3232
Attached = 0x1, ///< attached to the TPC track of this leg
3333
Corridor = 0x2, ///< found in the road around the leg
3434
Used = 0x4, ///< attached to some TPC track (for corridor clusters: another track, e.g. a split piece of the leg)
35-
AbsTime = 0x8 ///< found on the other TPC side with the absolute time of the cosmic instead of the time0 of the leg: CosmicTrack::timeTOFMUS
36-
///< if >= 0, else the time of CosmicTrack::cosmic
35+
AbsTime = 0x8 ///< found on the other TPC side with the absolute time of the cosmic instead of the time0 of the leg: TrackCosmicsExtended::timeTOFMUS
36+
///< if >= 0, else the time of TrackCosmicsExtended::cosmic
3737
};
3838
o2::tpc::ClusterNative cl{}; ///< raw cluster: time, pad, widths, charges, flags
3939
uint8_t sector = 0;
@@ -60,7 +60,7 @@ struct CosmicITSCluster {
6060
uint16_t row = 0;
6161
uint16_t col = 0;
6262
uint16_t pattID = 0;
63-
int32_t pattEntry = -1; ///< start of the pattern bytes in CosmicTrack::itsPatterns (pattern not in the dictionary or group pattern), -1: none
63+
int32_t pattEntry = -1; ///< start of the pattern bytes in TrackCosmicsExtended::itsPatterns (pattern not in the dictionary or group pattern), -1: none
6464
int32_t rofBC = 0; ///< start of the cluster's ROF in BCs since the start of the TF
6565
uint8_t leg = 0; ///< 0 bottom, 1 top
6666
uint8_t flags = 0; ///< CosmicHitFlags
@@ -88,7 +88,7 @@ struct CosmicTRDTracklet {
8888
};
8989

9090
/// matched cosmic with everything needed for an offline refit
91-
struct CosmicTrack {
91+
struct TrackCosmicsExtended {
9292
o2::dataformats::TrackCosmics cosmic{}; ///< matcher output (time in mus; the leg references are only valid within the TF)
9393
o2::tpc::TrackTPC tpcBottom{}; ///< TPC part of the bottom leg (default if none); z refers to its time0; its cluster
9494
///< references are only valid within the TF: the clusters are in clTPCBottom
@@ -112,7 +112,7 @@ struct CosmicTrack {
112112
o2::MCCompLabel label{}; ///< MC label of the cosmic (MC only)
113113

114114
bool hasTOFTime() const { return scoreTOFPair >= 0.f; } ///< a HitTOFFlight pair gave the cosmic its time timeTOFMUS
115-
ClassDefNV(CosmicTrack, 1);
115+
ClassDefNV(TrackCosmicsExtended, 1);
116116
};
117117

118118
/// per-TF quantities of the TPC transformation used in the reconstruction

‎DataFormats/Detectors/GlobalTracking/src/DataFormatsGlobalTrackingLinkDef.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
#pragma link C++ class std::vector < o2::dataformats::CosmicTOFCluster> + ;
3131
#pragma link C++ class o2::dataformats::CosmicTRDTracklet + ;
3232
#pragma link C++ class std::vector < o2::dataformats::CosmicTRDTracklet> + ;
33-
#pragma link C++ class o2::dataformats::CosmicTrack + ;
34-
#pragma link C++ class std::vector < o2::dataformats::CosmicTrack> + ;
33+
#pragma link C++ class o2::dataformats::TrackCosmicsExtended + ;
34+
#pragma link C++ class std::vector < o2::dataformats::TrackCosmicsExtended> + ;
3535
#pragma link C++ class o2::dataformats::CosmicsTFInfo + ;
3636

3737
#endif

‎Detectors/GlobalTrackingWorkflow/src/CosmicsClusterCollectorSpec.cxx‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
#include "Framework/DeviceSpec.h"
6565
#include "GlobalTrackingWorkflow/CosmicsClusterCollectorSpec.h"
6666
#include "DataFormatsGlobalTracking/RecoContainer.h"
67-
#include "DataFormatsGlobalTracking/CosmicTrack.h"
67+
#include "DataFormatsGlobalTracking/TrackCosmicsExtended.h"
6868
#include "ReconstructionDataFormats/TrackCosmics.h"
6969
#include "DataFormatsTPC/TrackTPC.h"
7070
#include "DataFormatsTPC/ClusterNative.h"
@@ -186,19 +186,19 @@ class CosmicsClusterCollectorSpec : public Task
186186
int index; ///< index of the cluster in the TF
187187
};
188188
void addITS(const RecoContainer& data, GTrackID gid, uint8_t leg, std::vector<o2::dataformats::CosmicITSCluster>& out, int icosm, std::vector<ITSPattRequest>& requests, std::unordered_set<int>& matched) const;
189-
void fillITSPatterns(const RecoContainer& data, std::vector<ITSPattRequest>& requests, std::vector<o2::dataformats::CosmicTrack>& cosmics) const;
189+
void fillITSPatterns(const RecoContainer& data, std::vector<ITSPattRequest>& requests, std::vector<o2::dataformats::TrackCosmicsExtended>& cosmics) const;
190190
void addTOF(const RecoContainer& data, GTrackID gid, uint8_t leg, std::vector<o2::dataformats::CosmicTOFCluster>& out, std::unordered_set<int>& matched) const;
191191
void addTRD(const RecoContainer& data, GTrackID gid, uint8_t leg, std::vector<o2::dataformats::CosmicTRDTracklet>& out, std::unordered_set<int>& matched) const;
192192
std::pair<float, float> timeWindowMUS(const CosmicTime& cosmicTime) const;
193193
bool predictOutward(const o2::tpc::TrackTPC& leg, const CosmicTime& cosmicTime, int sector, float x, float& y, float& z) const;
194194
void roadTOF(const RecoContainer& data, const o2::tpc::TrackTPC* const* legs, const CosmicTime& cosmicTime, int icosm, std::vector<o2::dataformats::CosmicTOFCluster>& out, const std::unordered_set<int>& matched, float& timeTOFMUS, float& scoreTOFPair, float& scoreTOFReversed) const;
195-
void polish(const o2::tpc::TrackTPC* const* legs, float timeMUS, o2::gpu::GPUO2InterfaceRefit& refitter, o2::dataformats::CosmicTrack& out) const;
195+
void polish(const o2::tpc::TrackTPC* const* legs, float timeMUS, o2::gpu::GPUO2InterfaceRefit& refitter, o2::dataformats::TrackCosmicsExtended& out) const;
196196
void roadTRD(const RecoContainer& data, const o2::tpc::TrackTPC* const* legs, const CosmicTime& cosmicTime, int icosm, std::vector<o2::dataformats::CosmicTRDTracklet>& out, const std::unordered_set<int>& matched) const;
197197
void roadITS(const RecoContainer& data, const o2::dataformats::TrackCosmics& cosm, const CosmicTime& cosmicTime, int legsSide, int icosm, std::vector<o2::dataformats::CosmicITSCluster>& out, std::vector<ITSPattRequest>& requests,
198198
const std::unordered_set<int>& matched) const;
199199
void cacheITSChipCentres();
200-
void writeDebug(const o2::dataformats::CosmicTrack& cosm, int icosm) const;
201-
void flagDuplicates(std::vector<o2::dataformats::CosmicTrack>& cosmics) const;
200+
void writeDebug(const o2::dataformats::TrackCosmicsExtended& cosm, int icosm) const;
201+
void flagDuplicates(std::vector<o2::dataformats::TrackCosmicsExtended>& cosmics) const;
202202
void writeDebugTOF(const o2::tof::Cluster& c, int icosm, int leg, uint8_t flags) const;
203203

204204
std::shared_ptr<DataRequest> mDataRequest;
@@ -303,7 +303,7 @@ void CosmicsClusterCollectorSpec::run(ProcessingContext& pc)
303303
tfInfo.vDrift = mCorrMap->getVDrift();
304304
tfInfo.t0 = mCorrMap->getT0();
305305

306-
std::vector<o2::dataformats::CosmicTrack> cosmicsOut;
306+
std::vector<o2::dataformats::TrackCosmicsExtended> cosmicsOut;
307307
const auto cosmics = recoData.getCosmicTracks();
308308
const size_t nCosmics = std::min(cosmics.size(), mMaxCosmicsPerTF);
309309
if (nCosmics < cosmics.size()) {
@@ -1062,7 +1062,7 @@ void CosmicsClusterCollectorSpec::roadTOF(const RecoContainer& data, const o2::t
10621062
}
10631063
}
10641064

1065-
void CosmicsClusterCollectorSpec::polish(const o2::tpc::TrackTPC* const* legs, float timeMUS, o2::gpu::GPUO2InterfaceRefit& refitter, o2::dataformats::CosmicTrack& out) const
1065+
void CosmicsClusterCollectorSpec::polish(const o2::tpc::TrackTPC* const* legs, float timeMUS, o2::gpu::GPUO2InterfaceRefit& refitter, o2::dataformats::TrackCosmicsExtended& out) const
10661066
{
10671067
// refit of a cosmic with TPC-only legs at its TOF time, as MatchCosmics::refitWinners: the bottom leg inward, then to the closest approach
10681068
// to the beam line; the top leg inward, then to the same point; the two halves combined. Muon mass, energy loss along the muon's flight
@@ -1324,7 +1324,7 @@ void CosmicsClusterCollectorSpec::roadITS(const RecoContainer& data, const o2::d
13241324
}
13251325
}
13261326

1327-
void CosmicsClusterCollectorSpec::fillITSPatterns(const RecoContainer& data, std::vector<ITSPattRequest>& requests, std::vector<o2::dataformats::CosmicTrack>& cosmics) const
1327+
void CosmicsClusterCollectorSpec::fillITSPatterns(const RecoContainer& data, std::vector<ITSPattRequest>& requests, std::vector<o2::dataformats::TrackCosmicsExtended>& cosmics) const
13281328
{
13291329
// the TF's pattern stream holds, in cluster order, the patterns of the clusters with an invalid or a group pattern ID
13301330
if (!mITSDict) {
@@ -1376,7 +1376,7 @@ void CosmicsClusterCollectorSpec::addTRD(const RecoContainer& data, GTrackID gid
13761376
}
13771377
}
13781378

1379-
void CosmicsClusterCollectorSpec::flagDuplicates(std::vector<o2::dataformats::CosmicTrack>& cosmics) const
1379+
void CosmicsClusterCollectorSpec::flagDuplicates(std::vector<o2::dataformats::TrackCosmicsExtended>& cosmics) const
13801380
{
13811381
// the same muon can be matched twice, e.g. when a leg is split into two TPC tracks: the roads then collect largely the same clusters
13821382
// (PbPb 567939: 10 of 47 cosmic pairs in a TF share 56-99 % of the clusters of the smaller one, all others none). The best one (TOF time,
@@ -1421,7 +1421,7 @@ void CosmicsClusterCollectorSpec::flagDuplicates(std::vector<o2::dataformats::Co
14211421
}
14221422
}
14231423

1424-
void CosmicsClusterCollectorSpec::writeDebug(const o2::dataformats::CosmicTrack& cosm, int icosm) const
1424+
void CosmicsClusterCollectorSpec::writeDebug(const o2::dataformats::TrackCosmicsExtended& cosm, int icosm) const
14251425
{
14261426
constexpr int NSectorsA = TPCGeo::getNumberOfSectorsA();
14271427
// the time the other-side corridor used (and the common frame zCos): the TOF time if the TOF road found one, else the TPC time

‎Detectors/GlobalTrackingWorkflow/src/TrackCosmicsWriterSpec.cxx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "DPLUtils/MakeRootTreeWriterSpec.h"
1717
#include "ReconstructionDataFormats/TrackCosmics.h"
1818
#include "SimulationDataFormat/MCCompLabel.h"
19-
#include "DataFormatsGlobalTracking/CosmicTrack.h"
19+
#include "DataFormatsGlobalTracking/TrackCosmicsExtended.h"
2020
#include "CommonDataFormat/TFIDInfo.h"
2121

2222
using namespace o2::framework;
@@ -55,15 +55,15 @@ DataProcessorSpec getTrackCosmicsWriterSpec(bool useMC)
5555

5656
DataProcessorSpec getCosmicsFullWriterSpec()
5757
{
58-
auto logger = [](std::vector<o2::dataformats::CosmicTrack> const& cosmics) {
58+
auto logger = [](std::vector<o2::dataformats::TrackCosmicsExtended> const& cosmics) {
5959
LOG(info) << "Writing " << cosmics.size() << " cosmics with clusters";
6060
};
6161
return MakeRootTreeWriterSpec("cosmics-full-writer",
6262
"o2_cosmics_full.root",
6363
"cosmicsFull",
6464
-1, // do not limit number of events to store
6565
100, // periodically autosave
66-
BranchDefinition<std::vector<o2::dataformats::CosmicTrack>>{InputSpec{"cosmics", "GLO", "COSMFULL", 0}, "cosmics", 1, logger},
66+
BranchDefinition<std::vector<o2::dataformats::TrackCosmicsExtended>>{InputSpec{"cosmics", "GLO", "COSMFULL", 0}, "cosmics", 1, logger},
6767
BranchDefinition<o2::dataformats::CosmicsTFInfo>{InputSpec{"tfinfo", "GLO", "COSMFULLTF", 0}, "tfInfo", 1},
6868
BranchDefinition<o2::dataformats::TFIDInfo>{InputSpec{"tfid", "GLO", "COSMFULLTFID", 0}, "tfID", 1})();
6969
}

0 commit comments

Comments
 (0)