@@ -221,8 +221,8 @@ DECLARE_SOA_EXPRESSION_COLUMN(C1Pt21Pt2, c1Pt21Pt2, float, //!
221221// TRACKEXTRA TABLE definition
222222DECLARE_SOA_COLUMN (TPCInnerParam, tpcInnerParam, float ); // ! Momentum at inner wall of the TPC
223223DECLARE_SOA_COLUMN (Flags, flags, uint32_t ); // ! Track flags. Run 2: see TrackFlagsRun2Enum | Run 3: see TrackFlags
224- DECLARE_SOA_COLUMN (ITSClusterMap, itsClusterMap, uint8_t ); // ! ITS cluster map, one bit per a layer, starting from the innermost
225224DECLARE_SOA_COLUMN (ITSClusterSizes, itsClusterSizes, uint32_t ); // ! Clusters sizes, four bits per a layer, starting from the innermost
225+ DECLARE_SOA_COLUMN (ITSClusterMap, itsClusterMap, uint8_t ); // ! Old cluster ITS cluster map, kept for retrocompatibility
226226DECLARE_SOA_COLUMN (TPCNClsFindable, tpcNClsFindable, uint8_t ); // ! Findable TPC clusters for this track geometry
227227DECLARE_SOA_COLUMN (TPCNClsFindableMinusFound, tpcNClsFindableMinusFound, int8_t ); // ! TPC Clusters: Findable - Found
228228DECLARE_SOA_COLUMN (TPCNClsFindableMinusCrossedRows, tpcNClsFindableMinusCrossedRows, int8_t ); // ! TPC Clusters: Findable - crossed rows
@@ -241,10 +241,11 @@ DECLARE_SOA_COLUMN(TrackPhiEMCAL, trackPhiEmcal, float);
241241DECLARE_SOA_COLUMN (TrackTime, trackTime, float ); // ! Estimated time of the track in ns wrt collision().bc() or ambiguoustrack.bcSlice()[0]
242242DECLARE_SOA_COLUMN (TrackTimeRes, trackTimeRes, float ); // ! Resolution of the track time in ns (see TrackFlags::TrackTimeResIsRange)
243243DECLARE_SOA_EXPRESSION_COLUMN (DetectorMap, detectorMap, uint8_t , // ! Detector map: see enum DetectorMapEnum
244- ifnode (aod::track::itsClusterMap > (uint8_t )0, static_cast<uint8_t>(o2::aod::track::ITS), (uint8_t )0x0) |
244+ ifnode (aod::track::itsClusterSizes > (uint32_t )0, static_cast<uint8_t>(o2::aod::track::ITS), (uint8_t )0x0) |
245245 ifnode(aod::track::tpcNClsFindable > (uint8_t )0, static_cast<uint8_t>(o2::aod::track::TPC), (uint8_t )0x0) |
246246 ifnode(aod::track::trdPattern > (uint8_t )0, static_cast<uint8_t>(o2::aod::track::TRD), (uint8_t )0x0) |
247247 ifnode((aod::track::tofChi2 >= 0 .f) && (aod::track::tofExpMom > 0 .f), static_cast<uint8_t>(o2::aod::track::TOF), (uint8_t )0x0));
248+
248249DECLARE_SOA_DYNAMIC_COLUMN (HasITS, hasITS, // ! Flag to check if track has a ITS match
249250 [](uint8_t detectorMap) -> bool { return detectorMap & o2::aod::track::ITS; });
250251DECLARE_SOA_DYNAMIC_COLUMN (HasTPC, hasTPC, // ! Flag to check if track has a TPC match
@@ -261,6 +262,16 @@ DECLARE_SOA_DYNAMIC_COLUMN(TPCNClsFound, tpcNClsFound, //! Number of found TPC c
261262 [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> int16_t { return (int16_t )tpcNClsFindable - tpcNClsFindableMinusFound; });
262263DECLARE_SOA_DYNAMIC_COLUMN (TPCNClsCrossedRows, tpcNClsCrossedRows, // ! Number of crossed TPC Rows
263264 [](uint8_t tpcNClsFindable, int8_t TPCNClsFindableMinusCrossedRows) -> int16_t { return (int16_t )tpcNClsFindable - TPCNClsFindableMinusCrossedRows; });
265+ DECLARE_SOA_DYNAMIC_COLUMN (ITSClusterMapDyn, itsClusterMap, // ! ITS cluster map, one bit per a layer, starting from the innermost
266+ [](uint32_t itsClusterSizes) -> uint8_t {
267+ uint8_t clmap = 0 ;
268+ for (unsigned int layer = 0 ; layer < 7 ; layer++) {
269+ if ((itsClusterSizes >> (layer * 4 )) & 0xf ) {
270+ clmap |= (1 << layer);
271+ }
272+ }
273+ return clmap;
274+ });
264275DECLARE_SOA_DYNAMIC_COLUMN (ITSNCls, itsNCls, // ! Number of ITS clusters
265276 [](uint8_t itsClusterMap) -> uint8_t {
266277 uint8_t itsNcls = 0 ;
@@ -281,6 +292,24 @@ DECLARE_SOA_DYNAMIC_COLUMN(ITSNClsInnerBarrel, itsNClsInnerBarrel, //! Number of
281292 }
282293 return itsNclsInnerBarrel;
283294 });
295+ DECLARE_SOA_DYNAMIC_COLUMN (ITSNCls001, itsNCls, // ! Number of ITS clusters
296+ [](uint8_t itsClusterSizes) -> uint8_t {
297+ uint8_t itsNcls = 0 ;
298+ for (int layer = 0 ; layer < 7 ; layer++) {
299+ if ((itsClusterSizes >> (layer * 4 )) & 0xf )
300+ itsNcls++;
301+ }
302+ return itsNcls;
303+ });
304+ DECLARE_SOA_DYNAMIC_COLUMN (ITSNClsInnerBarrel001, itsNClsInnerBarrel, // ! Number of ITS clusters in the Inner Barrel
305+ [](uint8_t itsClusterSizes) -> uint8_t {
306+ uint8_t itsNclsInnerBarrel = 0 ;
307+ for (int layer = 0 ; layer < 3 ; layer++) {
308+ if ((itsClusterSizes >> (layer * 4 )) & 0xf )
309+ itsNclsInnerBarrel++;
310+ }
311+ return itsNclsInnerBarrel;
312+ });
284313
285314DECLARE_SOA_DYNAMIC_COLUMN (TPCFoundOverFindableCls, tpcFoundOverFindableCls, // ! Ratio of found over findable clusters
286315 [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> float {
@@ -410,7 +439,7 @@ DECLARE_SOA_TABLE_FULL(StoredTracksExtra_000, "TracksExtra", "AOD", "TRACKEXTRA"
410439 track::TrackEtaEMCAL, track::TrackPhiEMCAL, track::TrackTime, track::TrackTimeRes);
411440
412441DECLARE_SOA_TABLE_FULL_VERSIONED (StoredTracksExtra_001, " TracksExtra" , " AOD" , " TRACKEXTRA" , 1 , // Version 1 of TracksExtra
413- track::TPCInnerParam, track::Flags, track::ITSClusterMap, track:: ITSClusterSizes,
442+ track::TPCInnerParam, track::Flags, track::ITSClusterSizes,
414443 track::TPCNClsFindable, track::TPCNClsFindableMinusFound, track::TPCNClsFindableMinusCrossedRows,
415444 track::TPCNClsShared, track::TRDPattern, track::ITSChi2NCl,
416445 track::TPCChi2NCl, track::TRDChi2, track::TOFChi2,
@@ -421,13 +450,12 @@ DECLARE_SOA_TABLE_FULL_VERSIONED(StoredTracksExtra_001, "TracksExtra", "AOD", "T
421450 track::HasTRD<track::DetectorMap>, track::HasTOF<track::DetectorMap>,
422451 track::TPCNClsFound<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
423452 track::TPCNClsCrossedRows<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows>,
424- track::ITSNCls <track::ITSClusterMap >, track::ITSNClsInnerBarrel <track::ITSClusterMap >,
453+ track::ITSClusterMapDyn <track::ITSClusterSizes >, track::ITSNCls001 <track::ITSClusterSizes>, track::ITSNClsInnerBarrel001<track::ITSClusterSizes >,
425454 track::TPCCrossedRowsOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows>,
426455 track::TPCFoundOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
427456 track::TPCFractionSharedCls<track::TPCNClsShared, track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
428457 track::TrackEtaEMCAL, track::TrackPhiEMCAL, track::TrackTime, track::TrackTimeRes);
429458
430-
431459DECLARE_SOA_EXTENDED_TABLE (TracksExtra_000, StoredTracksExtra_000, " TRACKEXTRA" , // ! Additional track information (clusters, PID, etc.)
432460 track::DetectorMap);
433461
0 commit comments