Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions Detectors/GlobalTracking/include/GlobalTracking/MatchCosmics.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class VDriftCorrFact;
namespace gpu
{
class TPCFastTransformPOD;
}
class GPUO2InterfaceRefit;
} // namespace gpu
namespace globaltracking
{

Expand Down Expand Up @@ -82,7 +83,20 @@ class MatchCosmics
float chi2 = -1.f; ///< matching chi2
int next = MinusOne; ///< index of eventual next record
float tCommon = 0.f; ///< common time [mus] fixed by z continuity of TPC-only legs on opposite TPC sides
float tCommonErr = -1.f; ///< its 1 sigma error [mus]; < 0: not fixed, the refit uses the centre of the time-bracket overlap and the cosmic's time error is the overlap's half-width
float tCommonErr = -1.f; ///< its 1 sigma error [mus]; < 0: not fixed, the refit uses the centre of the time-bracket overlap and the cosmic's time error is the overlap's half-width
float tofScore = -1.f; ///< score of the top / bottom TOF hit pair matching the muon's flight (tofFlightSelection; < 0: none); a pair with one wins against pairs without
float tCommonNoTOF = 0.f; ///< tCommon before a TOF flight pair replaced it: the refit falls back to it if the refit at the TOF time fails
float tCommonErrNoTOF = -1.f; ///< tCommonErr before a TOF flight pair replaced it
};

struct TOFCandidate { ///< TOF cluster along the outward continuation of a TPC-only seed
int index = -1; ///< index of the TOF cluster
double timeNS = 0.; ///< its time since the start of the TF [ns]
float dy = 0.f; ///< cluster - predicted y in the frame of the cluster's sector [cm]
float dz = 0.f; ///< cluster - predicted z, the leg's z taken at its own reference time tRef [cm]
float gx = 0.f; ///< global position of the cluster [cm]
float gy = 0.f;
float gz = 0.f;
};

struct TrackSeed : public o2::track::TrackParCov {
Expand Down Expand Up @@ -137,7 +151,11 @@ class MatchCosmics
private:
void updateTimeDependentParams();
RejFlag checkPair(int i, int j);
void registerMatch(int i, int j, float chi2, float tCommon = 0.f, float tCommonErr = -1.f);
bool refitSeedAtTime(const TrackSeed& seed, float timeMUS, TrackSeed& out);
void registerMatch(int i, int j, float chi2, float tCommon = 0.f, float tCommonErr = -1.f, float tofScore = -1.f, float tCommonNoTOF = 0.f, float tCommonErrNoTOF = -1.f);
void prepareTOFClusters(const o2::globaltracking::RecoContainer& data);
const std::vector<TOFCandidate>& getTOFCandidates(int iseed);
float findTOFFlightPair(int i, int j, float tMinMUS, float tMaxMUS, float& tofTimeMUS);
void suppressMatch(int partner0, int partner1);
void createSeeds(const o2::globaltracking::RecoContainer& data);
bool validateMatch(int partner0);
Expand All @@ -164,6 +182,15 @@ class MatchCosmics
float mQ2PtCutoff = 1e9;
float mQ2PtCutoffOppositeSides = 1e9;
const MatchCosmicsParams* mMatchParams = nullptr;
const o2::globaltracking::RecoContainer* mRecoData = nullptr; ///< inputs of the TF being processed
o2::gpu::GPUO2InterfaceRefit* mTPCRefitter = nullptr; ///< TPC refitter of the TF being processed (owned by process())
size_t mNRefitsCommonTime = 0; ///< seeds refitted at the common time of a same-side pair in this TF
std::vector<int> mTOFClusterOrder; ///< TOF clusters of the TF sorted in time (tofFlightSelection)
std::vector<float> mTOFClusterTimeMUS; ///< their times since the start of the TF [mus], same order
std::vector<std::vector<TOFCandidate>> mSeedTOFCandidates; ///< TOF candidates per seed, filled on first use
std::vector<bool> mSeedTOFDone; ///< the TOF candidates of the seed are filled
size_t mNTOFConfirmed = 0; ///< accepted pairs with a TOF flight pair in this TF
size_t mNTOFFallbacks = 0; ///< TOF-confirmed winners refitted at their time without TOF in this TF

std::vector<o2d::TrackCosmics> mCosmicTracks;
std::vector<o2::MCCompLabel> mCosmicTracksLbl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ struct MatchCosmicsParams : public o2::conf::ConfigurableParamHelper<MatchCosmic
float minSeedPt = 0.10f; // use only tracks above this pT (scaled with field)
int minSeedNClTPC = 0; // use only TPC-only seeds with at least this number of clusters (0: no cut)
float minSeedDCAxy = 0.f; // use only tracks with |DCA_xy| to the beam line >= this [cm] (0: no cut; rejects collision tracks in physics data)
float minSeedDCAxyNSigma = 0.f; // use only tracks with |DCA_xy| >= this * sigma(DCA_xy) (0: no cut; poorly measured collision tracks)
bool constrainTPCOnlyZ = false; // TPC-only legs: test z at a common time (same side, or a leg with known time), else require the time implied by z continuity in both brackets
bool vetoSameHalf = false; // reject pairs whose two legs lie on the same side of the closest approach (two pieces of one leg)
float minSeedDCAxyNSigma = 0.f; // use only tracks with |DCA_xy| >= this * sigma(DCA_xy) (0: no cut; poorly measured collision tracks)
bool constrainTPCOnlyZ = false; // TPC-only legs: test z at a common time (same side, or a leg with known time), else require the time implied by z continuity in both brackets
bool vetoSameHalf = false; // reject pairs whose two legs lie on the same side of the closest approach (two pieces of one leg)
bool refitSameSideAtCommonTime = false; // TPC-only legs on the same side: compare them refitted at the centre of their brackets' overlap instead of at their own time0s
bool tofFlightSelection = false; // needs TOF clusters: accepted pairs of TPC-only legs pointing to a top / bottom TOF hit pair with the muon's flight time win the selection, refit at that time (if that fails, at their time without TOF)
float tofRoad = 5.f; // half-width [cm] in y and z of the road at the TOF around the outward continuation of a TPC-only leg
float tofFlightTolerance = 2.f; // max. deviation [ns] of the top / bottom TOF time difference from the flight time along the helix
float tofTimeError = 0.1f; // error [mus] of the TOF time of a confirmed cosmic, for its refit and time window (covers TPC vs TOF offsets)
float nSigmaTError = 4.f; // number of sigmas on track time error for matching (except for TPC which provides an interval)
float tpcExtraZError2 = 1.f; // extra error^2 on the TPC-only track Z coordinate
float fiducialRIP = 1.0f; // consider track having |Y@x=0|< this as passing DCA cut (if requested)
Expand Down
Loading
Loading