Project
Loading...
Searching...
No Matches
CosmicsClusterCollectorSpec.cxx File Reference

Collects the raw clusters of matched cosmics (attached + road around the legs) for offline refits. More...

#include <vector>
#include <array>
#include <limits>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <iterator>
#include <cmath>
#include "TStopwatch.h"
#include "Framework/Task.h"
#include "Framework/ConfigParamRegistry.h"
#include "Framework/DataProcessorSpec.h"
#include "Framework/DeviceSpec.h"
#include "GlobalTrackingWorkflow/CosmicsClusterCollectorSpec.h"
#include "GlobalTrackingWorkflow/CosmicsMatchingSpec.h"
#include "DataFormatsGlobalTracking/RecoContainer.h"
#include "DataFormatsGlobalTracking/TrackCosmicsExtended.h"
#include "ReconstructionDataFormats/TrackCosmics.h"
#include "DataFormatsTPC/TrackTPC.h"
#include "DataFormatsTPC/ClusterNative.h"
#include "DataFormatsITS/TrackITS.h"
#include "DataFormatsITSMFT/CompCluster.h"
#include "DataFormatsITSMFT/ROFRecord.h"
#include "DataFormatsITSMFT/TopologyDictionary.h"
#include "DataFormatsITSMFT/ClusterPattern.h"
#include "ITSMFTBase/SegmentationAlpide.h"
#include "DataFormatsTOF/Cluster.h"
#include "DataFormatsTRD/TrackTRD.h"
#include "DataFormatsTRD/Tracklet64.h"
#include "DataFormatsTRD/TriggerRecord.h"
#include "DataFormatsTRD/CalibratedTracklet.h"
#include "DataFormatsTRD/Constants.h"
#include "DataFormatsITSMFT/DPLAlpideParam.h"
#include "ITSBase/GeometryTGeo.h"
#include "DetectorsCommonDataFormats/DetID.h"
#include "CommonConstants/LHCConstants.h"
#include "CommonDataFormat/TFIDInfo.h"
#include "CommonDataFormat/InteractionRecord.h"
#include "DetectorsBase/GRPGeomHelper.h"
#include "DetectorsBase/Propagator.h"
#include "GPUO2InterfaceRefit.h"
#include "GlobalTracking/MatchCosmicsParams.h"
#include "DataFormatsTPC/WorkflowHelper.h"
#include "ReconstructionDataFormats/Vertex.h"
#include "DetectorsBase/TFIDInfoHelper.h"
#include "TPCBase/ParameterElectronics.h"
#include "MathUtils/Utils.h"
#include "MathUtils/Primitive2D.h"
#include "TPCFastTransformPOD.h"
#include "CommonUtils/TreeStreamRedirector.h"

Go to the source code of this file.

Classes

class  o2::globaltracking::CosmicsClusterCollectorSpec
 

Namespaces

namespace  o2
 a couple of static helper functions to create timestamp values for CCDB queries or override obsolete objects
 
namespace  o2::globaltracking
 

Typedefs

using GTrackID = o2::dataformats::GlobalTrackID
 
using TPCGeo = o2::gpu::TPCFastTransformGeoPOD
 
using DetID = o2::detectors::DetID
 

Functions

framework::DataProcessorSpec o2::globaltracking::getCosmicsClusterCollectorSpec (o2::dataformats::GlobalTrackID::mask_t src, bool useMC, bool itsStag, o2::detectors::DetID::mask_t roadDets)
 

Detailed Description

Collects the raw clusters of matched cosmics (attached + road around the legs) for offline refits.

The async reconstruction stores neither TPC tracks nor TPC clusters, so the leg references of TrackCosmics cannot be resolved offline. For every cosmic this device stores the TPC tracks of both legs, the raw TPC clusters attached to them, all raw TPC clusters in a road around each leg (gaps, split pieces, delta electrons; clusters attached to other tracks are flagged), the ITS / TOF / TRD hits of the legs' matched tracks and along roads in these detectors, and per TF the quantities of the TPC transformation.

Road: each leg's helix is propagated through all pad rows of all sectors on its TPC side, in the frame of its own time0 (the frame in which its clusters are consistent). Points on the other side of the leg's closest approach to the beam line belong to the other leg and are skipped. The predicted real (y, z) is mapped to nominal coordinates with the inverse correction, and clusters with nominal coordinates within the corridor width of the predicted point (distance perpendicular to the track) are taken. The other TPC side is searched only when the time of the cosmic is known (z-continuity time of legs on opposite sides with a small error, or a TOF time); a CE-crossing leg's own frame already covers both sides. Parts of a leg nearly parallel to the pad rows (|snp| >= 0.8 in the sector frame, e.g. around a closest approach to the beam line inside the TPC, where the track runs along one pad row) cannot be reached row by row: there the helix is followed in steps of path length and the rows within the road width of each point are searched.

TOF tag: all TOF clusters close to the outward extrapolation of the legs within the cosmic's time window are candidates; the top / bottom pair whose time difference matches the muon's flight along the helix (HitTOFFlight) gives the cosmic its TOF time. The same search in the impossible order (bottom hit first) only finds accidental pairs and is kept as QA of the flag's background.

Roads in the other detectors (–road-detectors): TRD tracklets close to the outward extrapolation of the legs and ITS clusters close to the trajectory near the beam line, within the time window of the cosmic (the TOF time if there is one, else the matcher's time, which is precise for TPC-only legs on opposite sides; otherwise the time window of the legs, with a correspondingly loose z cut). They are flagged as found on the road; hits of the legs' matched global tracks are flagged as matched. In the ITS the road keeps per half of the cosmic and layer the cluster closest to the trajectory, in the inner barrel (dense with collision clusters near the beam line) the 5 closest, best first. Cosmics sharing >= 30 % of their TPC clusters with a better one (a leg split into two TPC tracks) are flagged as duplicates, nothing is removed.

Polish: a cosmic with a TOF time and TPC-only legs is refitted at that time (as in the matcher: muon mass, energy loss along the flight); one-side legs then have their real z, hence the right material, which the matcher's TPC time cannot always give.

Besides the matcher's and the polished track, only raw detector data are stored (TPC ClusterNative, ITS compact clusters + patterns, raw TOF time, TRD tracklet words); calibrations, the cluster dictionary and the geometry are applied offline.

–debug-tree writes cosmics_collector_debug.root for test runs: tree "cosmics" with one entry per cosmic, its matching and timing quantities and vectors per detector: cl* every stored TPC cluster transformed (local x, y, z in the frame used by the road, zCos in the common frame of the cosmic's time, global gx, gy), road* the predicted track points of each leg (same frames; roadFrame 0 / 1 own / cosmic's time frame row by row, 2 / 3 the same along the low-angle walk), its* the local (with the ITS road also global) coordinates of the ITS clusters, tof* the raw and calibrated TOF time and the cluster position, trd* the road tracklets and their residuals. E.g. Draw("clGy:clGx", "scoreTOF >= 0") (TOF-tagged; tTOF can be negative).

Definition in file CosmicsClusterCollectorSpec.cxx.

Typedef Documentation

◆ DetID

Definition at line 108 of file CosmicsClusterCollectorSpec.cxx.

◆ GTrackID

◆ TPCGeo