Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of the TPC & ITS Standalone Track Parameters (and Track Time0) Together with the Combined Track for Fake Tagging and Track Reassociation #13293

Open
miranov25 opened this issue Jul 12, 2024 · 9 comments

Comments

@miranov25
Copy link
Contributor

Usage of the TPC & ITS Standalone Track Parameters (and Track Time0) Together with the Combined Track for Fake Tagging and Track Reassociation

The TPC and ITS standalone track parameters are by default not written to the AO2D, as the AO2D structure is optimized for output storage and physics analysis size. These parameters were not originally intended for systematic detector and reconstruction performance studies.

However, the TPC and ITS track parameters, and their deltas, can be very effectively used to improve the systematic and statistical error of the physics measurements. These measurements will be utilized in "simple" systematic track cut variations and also in advanced precise analysis using machine learning techniques.

Goal:

  1. Storage: Store the TPC and ITS standalone track parameters at the reference radius in the trackQA table, for performance parameterization and further physics studies.
  2. Optimization of Data Storage: Store the delta of the track parameters using the precision of the measurement. In total, 10 bytes—2 x 5 bytes—should be allocated for encoding the TPC and ITS standalone track parameters.

Proposed Implementation and Data Compression:

  1. Propagation: TPC and ITS standalone tracks and the combined track are propagated to the reference radius (R_{\text{ref}}) (radius with minimal average delta parameters between ITS and TPC).

  2. Normalized Delta: Store the normalized delta between the TPC+ITS parameters at this radius. This delta will later be used for "fake removal" and track splitting.

  3. Error Normalization: Normalize deltas to the effective error of the track parameters determined by multiple scattering, space point error, and errors in alignment and calibration.

    [ \text{error} \approx k_{\text{offset}} + \frac{k_{\text{slope}}}{\beta \times p_t} ]

  4. Normalized Delta Calculation: Calculate the normalized delta between the average of TPC and ITS parameters and the combined track at the reference radius, utilizing a similar normalized error parameterization.

@miranov25
Copy link
Contributor Author

Track Propagation

The track propagation will be performed using a simple propagation method (without material effects and in a homogeneous magnetic field). The primary purpose is to facilitate the relative encoding of track delta parameters as described above and retrieving the delta and track parameters later in the physics analysis.

o2::track::TrackParametrizationWithError<float> getTrackAt(o2::track::TrackParametrizationWithError<float> tIn,
o2::track::TrackParametrizationWithError<float> tRef, float radius,float bz) {
    o2::track::TrackParametrizationWithError<float> tOut(tIn);
    if (!tOut.rotate(tRef.getAlpha()) || !tOut.propagateParamTo(radius, bz)) {
        tOut.invalidate();
    }
    return tOut;
}

@miranov25
Copy link
Contributor Author

Reference Radius Selection

The MAE estimator for TPC-ITS delta parameters is used to define the optimal reference radius by comparing the track delta at different radii (50, 60, 70 cm). The resolution is dependent on the q/pt, with the optimum being influenced by their β * p_t:

Error ≈ k_offset + (k_slope / (β * p_t))

From the q/pt fit, the optimal range is identified to be between 50-60 cm. Regarding the storage of combined track parameters, it is preferable to use a smaller radius, as detailed in the following comment. The radius must be fixed since it will not be stored in the table but only included in some metadata.

root [10] treeRef->Draw("abs(dzITSTPC50):abs(itstpc.mP[4])>>hisdz(20)","abs(itstpc.mP[4])<5&&mP[3]>0&&abs(dzITSTPC50)<6","prof"); treeRef->GetHistogram()->Fit("pol1")
****************************************
Minimizer is Linear / Migrad
Chi2                      =      83.3584
NDf                       =           18
p0                        =     0.235287   +/-   0.00636955
p1                        =     0.455464   +/-   0.00416119
(TFitResultPtr) <nullptr TFitResult>
root [11] treeRef->Draw("abs(dzITSTPC60):abs(itstpc.mP[4])>>hisdz(20)","abs(itstpc.mP[4])<5&&mP[3]>0&&abs(dzITSTPC60)<6","prof"); treeRef->GetHistogram()->Fit("pol1")
****************************************
Minimizer is Linear / Migrad
Chi2                      =      94.0741
NDf                       =           18
p0                        =     0.284964   +/-   0.00643166
p1                        =     0.425554   +/-   0.00417727
(TFitResultPtr) <nullptr TFitResult>
root [12] treeRef->Draw("abs(dzITSTPC70):abs(itstpc.mP[4])>>hisdz(20)","abs(itstpc.mP[4])<5&&mP[3]>0&&abs(dzITSTPC70)<6","prof"); treeRef->GetHistogram()->Fit("pol1")
****************************************
Minimizer is Linear / Migrad
Chi2                      =       149.58
NDf                       =           18
p0                        =     0.320054   +/-   0.00663716
p1                        =     0.464565   +/-   0.00437907

@miranov25
Copy link
Contributor Author

Track error effective parameterization:

Error ≈ k_offset (+) (k_slope / (β * p_t))
TF1 * f1 = new TF1("f1","sqrt([0]**2+([1]*x)**2)",0,5)

Example dz fit:

image

@miranov25
Copy link
Contributor Author

Dy error (MAE ) fit

 treeRef->Draw("abs(dyITSTPC50):abs(itstpc.mP[4])>>hisdy(40)","abs(itstpc.mP[4])<5&&abs(dyITSTPC50)<6","prof"); treeRef->GetHistogram()->Fit(f1);

image

@miranov25
Copy link
Contributor Author

Delta tgl fit (TPC-ITS)

image

@miranov25
Copy link
Contributor Author

Delta snp fit MAE fit (ITS-TPC)

 treeRef->Draw("abs(trackITS50.mP[2]-trackTPC50.mP[2]):abs(itstpc.mP[4])>>his(40)","abs(itstpc.mP[4])<5&&abs(trackITS50.mP[2]-trackTPC50.mP[2])<0.5","prof"); treeRef->GetHistogram()->Fit(f1);

image

@miranov25
Copy link
Contributor Author

miranov25 commented Jul 12, 2024

delta Q/pt MAE fit:

root [39]        treeRef->Draw("abs(trackITS50.mP[4]-trackTPC50.mP[4]):abs(itstpc.mP[4])>>his(40)","abs(itstpc.mP[4])<5&&abs(trackITS50.mP[2]-trackTPC50.mP[2])<0.5","prof"); treeRef->GetHistogram()->Fit(f1);
****************************************
Minimizer is Minuit2 / Migrad
Chi2                      =      288.598
NDf                       =           36
Edm                       =  4.10156e-09
NCalls                    =           96
p0                        =    -0.382441   +/-   0.0130881
p1                        =    -0.573735   +/-   0.00583715

@miranov25
Copy link
Contributor Author

miranov25 commented Jul 12, 2024

Data coding:

Data storage will utilize char type. Parameters for division can be optimized based on the desired granularity. By using 3 samples per sigma, we can accommodate a range of ±42 sigma, with the first and last values serving as overflow indicators. Alternatively, using 5 samples per sigma allows for a range of ±25 sigma.

Example coding for 3 bins per sigma

treeRef->SetAlias("pull3","(trackITS50.mP[3]-trackTPC50.mP[3])/sqrt(0.005**2+(0.02*itstpc.mP[4])**2)");

treeRef->Draw("pull3>>his(256,-42,42)","abs(itstpc.mP[4])<5&&mdEdx.dEdxMaxTPC<70","colz");
image

@miranov25
Copy link
Contributor Author

miranov25 commented Jul 12, 2024

Data storage estimate - for Entropy for the data 2.7 bits for the pull using byte representation in range +-42 sigma

3 bins:
root [82] calculateEntropy(treeRef->GetHistogram())
(double) 2.6896584
5 bins:
root [86] calculateEntropy(treeRef->GetHistogram())
(double) 3.0155571

double calculateEntropy(TH1* histogram) {
    if (!histogram) return 0.0;  // Ensure the histogram exists
    double entropy = 0.0;
    double total = histogram->GetSumOfWeights();  // Total number of entries

    int numBins = histogram->GetNbinsX();
    for (int i = 1; i <= numBins; ++i) {
        double probability = histogram->GetBinContent(i) / total;
        if (probability > 0) {
            entropy -= probability * TMath::Log(probability);
        }
    }
    return entropy;
}

root [82] calculateEntropy(treeRef->GetHistogram())
(double) 2.6896584

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant