From 39d06f8416604d6346ce3ba86616ba6d292ee2da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Fri, 7 Jun 2024 18:23:22 +0200 Subject: [PATCH 1/6] [PWG-LF] add centrality MC into spectra --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 588 +++++++++--------------------- 1 file changed, 176 insertions(+), 412 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index 230c9ab978f..caf9fa915ef 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -35,6 +35,7 @@ #include "PWGLF/DataModel/spectraTOF.h" #include "Framework/O2DatabasePDGPlugin.h" #include "PWGLF/Utils/inelGt.h" +#include "PWGLF/DataModel/mcCentrality.h" #include "TPDGCode.h" @@ -79,18 +80,19 @@ struct tofSpectra { Configurable enableDCAxyzHistograms{"enableDCAxyzHistograms", false, "Enables DCAxyz correlation histograms"}; Configurable enableDCAxyphiHistograms{"enableDCAxyphiHistograms", false, "Enables DCAxyphi correlation histograms"}; - ConfigurableAxis binsPt{"binsPt", {VARIABLE_WIDTH, 0.0, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8, 5.0}, "Binning of the pT axis"}; - ConfigurableAxis binsEta{"binsEta", {100, -1, 1}, "Binning of the eta axis"}; - ConfigurableAxis binsnsigmaTPC{"binsnsigmaTPC", {200, -10, 10}, "Binning of the nsigmaTPC axis"}; - ConfigurableAxis binsnsigmaTOF{"binsnsigmaTOF", {200, -10, 10}, "Binning of the nsigmaTOF axis"}; - ConfigurableAxis binsdeltaTPC{"binsdeltaTPC", {500, -1000, 1000}, "Binning of the nsigmaTPC axis"}; - ConfigurableAxis binsdeltaTOF{"binsdeltaTOF", {500, -1000, 1000}, "Binning of the nsigmaTOF axis"}; - ConfigurableAxis binsDca{"binsDca", {VARIABLE_WIDTH, -3.0, -2.95, -2.9, -2.85, -2.8, -2.75, -2.7, -2.65, -2.6, -2.55, -2.5, -2.45, -2.4, -2.35, -2.3, -2.25, -2.2, -2.15, -2.1, -2.05, -2.0, -1.975, -1.95, -1.925, -1.9, -1.875, -1.85, -1.825, -1.8, -1.775, -1.75, -1.725, -1.7, -1.675, -1.65, -1.625, -1.6, -1.575, -1.55, -1.525, -1.5, -1.475, -1.45, -1.425, -1.4, -1.375, -1.35, -1.325, -1.3, -1.275, -1.25, -1.225, -1.2, -1.175, -1.15, -1.125, -1.1, -1.075, -1.05, -1.025, -1.0, -0.99, -0.98, -0.97, -0.96, -0.95, -0.94, -0.93, -0.92, -0.91, -0.9, -0.89, -0.88, -0.87, -0.86, -0.85, -0.84, -0.83, -0.82, -0.81, -0.8, -0.79, -0.78, -0.77, -0.76, -0.75, -0.74, -0.73, -0.72, -0.71, -0.7, -0.69, -0.68, -0.67, -0.66, -0.65, -0.64, -0.63, -0.62, -0.61, -0.6, -0.59, -0.58, -0.57, -0.56, -0.55, -0.54, -0.53, -0.52, -0.51, -0.5, -0.49, -0.48, -0.47, -0.46, -0.45, -0.44, -0.43, -0.42, -0.41, -0.4, -0.396, -0.392, -0.388, -0.384, -0.38, -0.376, -0.372, -0.368, -0.364, -0.36, -0.356, -0.352, -0.348, -0.344, -0.34, -0.336, -0.332, -0.328, -0.324, -0.32, -0.316, -0.312, -0.308, -0.304, -0.3, -0.296, -0.292, -0.288, -0.284, -0.28, -0.276, -0.272, -0.268, -0.264, -0.26, -0.256, -0.252, -0.248, -0.244, -0.24, -0.236, -0.232, -0.228, -0.224, -0.22, -0.216, -0.212, -0.208, -0.204, -0.2, -0.198, -0.196, -0.194, -0.192, -0.19, -0.188, -0.186, -0.184, -0.182, -0.18, -0.178, -0.176, -0.174, -0.172, -0.17, -0.168, -0.166, -0.164, -0.162, -0.16, -0.158, -0.156, -0.154, -0.152, -0.15, -0.148, -0.146, -0.144, -0.142, -0.14, -0.138, -0.136, -0.134, -0.132, -0.13, -0.128, -0.126, -0.124, -0.122, -0.12, -0.118, -0.116, -0.114, -0.112, -0.11, -0.108, -0.106, -0.104, -0.102, -0.1, -0.099, -0.098, -0.097, -0.096, -0.095, -0.094, -0.093, -0.092, -0.091, -0.09, -0.089, -0.088, -0.087, -0.086, -0.085, -0.084, -0.083, -0.082, -0.081, -0.08, -0.079, -0.078, -0.077, -0.076, -0.075, -0.074, -0.073, -0.072, -0.071, -0.07, -0.069, -0.068, -0.067, -0.066, -0.065, -0.064, -0.063, -0.062, -0.061, -0.06, -0.059, -0.058, -0.057, -0.056, -0.055, -0.054, -0.053, -0.052, -0.051, -0.05, -0.049, -0.048, -0.047, -0.046, -0.045, -0.044, -0.043, -0.042, -0.041, -0.04, -0.039, -0.038, -0.037, -0.036, -0.035, -0.034, -0.033, -0.032, -0.031, -0.03, -0.029, -0.028, -0.027, -0.026, -0.025, -0.024, -0.023, -0.022, -0.021, -0.02, -0.019, -0.018, -0.017, -0.016, -0.015, -0.014, -0.013, -0.012, -0.011, -0.01, -0.009, -0.008, -0.007, -0.006, -0.005, -0.004, -0.003, -0.002, -0.001, -0.0, 0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01, 0.011, 0.012, 0.013, 0.014, 0.015, 0.016, 0.017, 0.018, 0.019, 0.02, 0.021, 0.022, 0.023, 0.024, 0.025, 0.026, 0.027, 0.028, 0.029, 0.03, 0.031, 0.032, 0.033, 0.034, 0.035, 0.036, 0.037, 0.038, 0.039, 0.04, 0.041, 0.042, 0.043, 0.044, 0.045, 0.046, 0.047, 0.048, 0.049, 0.05, 0.051, 0.052, 0.053, 0.054, 0.055, 0.056, 0.057, 0.058, 0.059, 0.06, 0.061, 0.062, 0.063, 0.064, 0.065, 0.066, 0.067, 0.068, 0.069, 0.07, 0.071, 0.072, 0.073, 0.074, 0.075, 0.076, 0.077, 0.078, 0.079, 0.08, 0.081, 0.082, 0.083, 0.084, 0.085, 0.086, 0.087, 0.088, 0.089, 0.09, 0.091, 0.092, 0.093, 0.094, 0.095, 0.096, 0.097, 0.098, 0.099, 0.1, 0.102, 0.104, 0.106, 0.108, 0.11, 0.112, 0.114, 0.116, 0.118, 0.12, 0.122, 0.124, 0.126, 0.128, 0.13, 0.132, 0.134, 0.136, 0.138, 0.14, 0.142, 0.144, 0.146, 0.148, 0.15, 0.152, 0.154, 0.156, 0.158, 0.16, 0.162, 0.164, 0.166, 0.168, 0.17, 0.172, 0.174, 0.176, 0.178, 0.18, 0.182, 0.184, 0.186, 0.188, 0.19, 0.192, 0.194, 0.196, 0.198, 0.2, 0.204, 0.208, 0.212, 0.216, 0.22, 0.224, 0.228, 0.232, 0.236, 0.24, 0.244, 0.248, 0.252, 0.256, 0.26, 0.264, 0.268, 0.272, 0.276, 0.28, 0.284, 0.288, 0.292, 0.296, 0.3, 0.304, 0.308, 0.312, 0.316, 0.32, 0.324, 0.328, 0.332, 0.336, 0.34, 0.344, 0.348, 0.352, 0.356, 0.36, 0.364, 0.368, 0.372, 0.376, 0.38, 0.384, 0.388, 0.392, 0.396, 0.4, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.5, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.6, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.7, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.8, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.9, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.0, 1.025, 1.05, 1.075, 1.1, 1.125, 1.15, 1.175, 1.2, 1.225, 1.25, 1.275, 1.3, 1.325, 1.35, 1.375, 1.4, 1.425, 1.45, 1.475, 1.5, 1.525, 1.55, 1.575, 1.6, 1.625, 1.65, 1.675, 1.7, 1.725, 1.75, 1.775, 1.8, 1.825, 1.85, 1.875, 1.9, 1.925, 1.95, 1.975, 2.0, 2.05, 2.1, 2.15, 2.2, 2.25, 2.3, 2.35, 2.4, 2.45, 2.5, 2.55, 2.6, 2.65, 2.7, 2.75, 2.8, 2.85, 2.9, 2.95, 3.0}, "Binning of DCA xy and z axis"}; - ConfigurableAxis binsMultiplicity{"binsMultiplicity", {100, 0, 100}, "Binning for multiplicity"}; - ConfigurableAxis binsPercentile{"binsPercentile", {100, 0, 100}, "Binning for percentiles"}; - ConfigurableAxis binsImpactParam{"binsImpactParam", {2500, 0, 25}, "Binning for impact parameter"}; - Configurable multiplicityEstimator{"multiplicityEstimator", 0, "Flag to use a multiplicity estimator: 0 no multiplicity, 1 MultFV0M, 2 MultFT0M, 3 MultFDDM, 4 MultTracklets, 5 MultTPC, 6 MultNTracksPV, 7 MultNTracksPVeta1, 8 CentralityFT0C, 9 CentralityFT0M, 10 CentralityFV0A"}; + struct : ConfigurableGroup { + ConfigurableAxis binsPt{"binsPt", {VARIABLE_WIDTH, 0.0, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8, 5.0}, "Binning of the pT axis"}; + ConfigurableAxis binsEta{"binsEta", {100, -1, 1}, "Binning of the eta axis"}; + ConfigurableAxis binsnsigmaTPC{"binsnsigmaTPC", {200, -10, 10}, "Binning of the nsigmaTPC axis"}; + ConfigurableAxis binsnsigmaTOF{"binsnsigmaTOF", {200, -10, 10}, "Binning of the nsigmaTOF axis"}; + ConfigurableAxis binsdeltaTPC{"binsdeltaTPC", {500, -1000, 1000}, "Binning of the nsigmaTPC axis"}; + ConfigurableAxis binsdeltaTOF{"binsdeltaTOF", {500, -1000, 1000}, "Binning of the nsigmaTOF axis"}; + ConfigurableAxis binsDca{"binsDca", {VARIABLE_WIDTH, -3.0, -2.95, -2.9, -2.85, -2.8, -2.75, -2.7, -2.65, -2.6, -2.55, -2.5, -2.45, -2.4, -2.35, -2.3, -2.25, -2.2, -2.15, -2.1, -2.05, -2.0, -1.975, -1.95, -1.925, -1.9, -1.875, -1.85, -1.825, -1.8, -1.775, -1.75, -1.725, -1.7, -1.675, -1.65, -1.625, -1.6, -1.575, -1.55, -1.525, -1.5, -1.475, -1.45, -1.425, -1.4, -1.375, -1.35, -1.325, -1.3, -1.275, -1.25, -1.225, -1.2, -1.175, -1.15, -1.125, -1.1, -1.075, -1.05, -1.025, -1.0, -0.99, -0.98, -0.97, -0.96, -0.95, -0.94, -0.93, -0.92, -0.91, -0.9, -0.89, -0.88, -0.87, -0.86, -0.85, -0.84, -0.83, -0.82, -0.81, -0.8, -0.79, -0.78, -0.77, -0.76, -0.75, -0.74, -0.73, -0.72, -0.71, -0.7, -0.69, -0.68, -0.67, -0.66, -0.65, -0.64, -0.63, -0.62, -0.61, -0.6, -0.59, -0.58, -0.57, -0.56, -0.55, -0.54, -0.53, -0.52, -0.51, -0.5, -0.49, -0.48, -0.47, -0.46, -0.45, -0.44, -0.43, -0.42, -0.41, -0.4, -0.396, -0.392, -0.388, -0.384, -0.38, -0.376, -0.372, -0.368, -0.364, -0.36, -0.356, -0.352, -0.348, -0.344, -0.34, -0.336, -0.332, -0.328, -0.324, -0.32, -0.316, -0.312, -0.308, -0.304, -0.3, -0.296, -0.292, -0.288, -0.284, -0.28, -0.276, -0.272, -0.268, -0.264, -0.26, -0.256, -0.252, -0.248, -0.244, -0.24, -0.236, -0.232, -0.228, -0.224, -0.22, -0.216, -0.212, -0.208, -0.204, -0.2, -0.198, -0.196, -0.194, -0.192, -0.19, -0.188, -0.186, -0.184, -0.182, -0.18, -0.178, -0.176, -0.174, -0.172, -0.17, -0.168, -0.166, -0.164, -0.162, -0.16, -0.158, -0.156, -0.154, -0.152, -0.15, -0.148, -0.146, -0.144, -0.142, -0.14, -0.138, -0.136, -0.134, -0.132, -0.13, -0.128, -0.126, -0.124, -0.122, -0.12, -0.118, -0.116, -0.114, -0.112, -0.11, -0.108, -0.106, -0.104, -0.102, -0.1, -0.099, -0.098, -0.097, -0.096, -0.095, -0.094, -0.093, -0.092, -0.091, -0.09, -0.089, -0.088, -0.087, -0.086, -0.085, -0.084, -0.083, -0.082, -0.081, -0.08, -0.079, -0.078, -0.077, -0.076, -0.075, -0.074, -0.073, -0.072, -0.071, -0.07, -0.069, -0.068, -0.067, -0.066, -0.065, -0.064, -0.063, -0.062, -0.061, -0.06, -0.059, -0.058, -0.057, -0.056, -0.055, -0.054, -0.053, -0.052, -0.051, -0.05, -0.049, -0.048, -0.047, -0.046, -0.045, -0.044, -0.043, -0.042, -0.041, -0.04, -0.039, -0.038, -0.037, -0.036, -0.035, -0.034, -0.033, -0.032, -0.031, -0.03, -0.029, -0.028, -0.027, -0.026, -0.025, -0.024, -0.023, -0.022, -0.021, -0.02, -0.019, -0.018, -0.017, -0.016, -0.015, -0.014, -0.013, -0.012, -0.011, -0.01, -0.009, -0.008, -0.007, -0.006, -0.005, -0.004, -0.003, -0.002, -0.001, -0.0, 0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01, 0.011, 0.012, 0.013, 0.014, 0.015, 0.016, 0.017, 0.018, 0.019, 0.02, 0.021, 0.022, 0.023, 0.024, 0.025, 0.026, 0.027, 0.028, 0.029, 0.03, 0.031, 0.032, 0.033, 0.034, 0.035, 0.036, 0.037, 0.038, 0.039, 0.04, 0.041, 0.042, 0.043, 0.044, 0.045, 0.046, 0.047, 0.048, 0.049, 0.05, 0.051, 0.052, 0.053, 0.054, 0.055, 0.056, 0.057, 0.058, 0.059, 0.06, 0.061, 0.062, 0.063, 0.064, 0.065, 0.066, 0.067, 0.068, 0.069, 0.07, 0.071, 0.072, 0.073, 0.074, 0.075, 0.076, 0.077, 0.078, 0.079, 0.08, 0.081, 0.082, 0.083, 0.084, 0.085, 0.086, 0.087, 0.088, 0.089, 0.09, 0.091, 0.092, 0.093, 0.094, 0.095, 0.096, 0.097, 0.098, 0.099, 0.1, 0.102, 0.104, 0.106, 0.108, 0.11, 0.112, 0.114, 0.116, 0.118, 0.12, 0.122, 0.124, 0.126, 0.128, 0.13, 0.132, 0.134, 0.136, 0.138, 0.14, 0.142, 0.144, 0.146, 0.148, 0.15, 0.152, 0.154, 0.156, 0.158, 0.16, 0.162, 0.164, 0.166, 0.168, 0.17, 0.172, 0.174, 0.176, 0.178, 0.18, 0.182, 0.184, 0.186, 0.188, 0.19, 0.192, 0.194, 0.196, 0.198, 0.2, 0.204, 0.208, 0.212, 0.216, 0.22, 0.224, 0.228, 0.232, 0.236, 0.24, 0.244, 0.248, 0.252, 0.256, 0.26, 0.264, 0.268, 0.272, 0.276, 0.28, 0.284, 0.288, 0.292, 0.296, 0.3, 0.304, 0.308, 0.312, 0.316, 0.32, 0.324, 0.328, 0.332, 0.336, 0.34, 0.344, 0.348, 0.352, 0.356, 0.36, 0.364, 0.368, 0.372, 0.376, 0.38, 0.384, 0.388, 0.392, 0.396, 0.4, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.5, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.6, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.7, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.8, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.9, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.0, 1.025, 1.05, 1.075, 1.1, 1.125, 1.15, 1.175, 1.2, 1.225, 1.25, 1.275, 1.3, 1.325, 1.35, 1.375, 1.4, 1.425, 1.45, 1.475, 1.5, 1.525, 1.55, 1.575, 1.6, 1.625, 1.65, 1.675, 1.7, 1.725, 1.75, 1.775, 1.8, 1.825, 1.85, 1.875, 1.9, 1.925, 1.95, 1.975, 2.0, 2.05, 2.1, 2.15, 2.2, 2.25, 2.3, 2.35, 2.4, 2.45, 2.5, 2.55, 2.6, 2.65, 2.7, 2.75, 2.8, 2.85, 2.9, 2.95, 3.0}, "Binning of DCA xy and z axis"}; + ConfigurableAxis binsMultiplicity{"binsMultiplicity", {100, 0, 100}, "Binning for multiplicity"}; + ConfigurableAxis binsPercentile{"binsPercentile", {100, 0, 100}, "Binning for percentiles"}; + } binsOptions; + Configurable multiplicityEstimator{"multiplicityEstimator", 0, "Flag to use a multiplicity estimator: 0 no multiplicity, 1 MultFV0M, 2 MultFT0M, 3 MultFDDM, 4 MultTracklets, 5 MultTPC, 6 MultNTracksPV, 7 MultNTracksPVeta1, 8 CentralityFT0C, 9 CentralityFT0M, 10 CentralityFV0A"}; // Custom track cuts for the cut variation study TrackSelection customTrackCuts; Configurable kaonIsPvContrib{"kaonIsPvContrib", false, "Flag to ckeck if kaon tracks are from pv"}; @@ -109,7 +111,7 @@ struct tofSpectra { Configurable makeTHnSparseChoice{"makeTHnSparseChoice", false, "choose if produce thnsparse"}; // RD Configurable enableTPCTOFvsEtaHistograms{"enableTPCTOFvsEtaHistograms", false, "choose if produce TPC tof vs Eta"}; Configurable includeCentralityMC{"includeCentralityMC", true, "choose if include Centrality to MC"}; - Configurable tpctofVsMult{"tpctofVsMult", false, "Produce TPC-TOF plots vs multiplicity"}; + Configurable enableTPCTOFVsMult{"enableTPCTOFVsMult", false, "Produce TPC-TOF plots vs multiplicity"}; // Histograms HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -205,10 +207,9 @@ struct tofSpectra { } // Histograms const AxisSpec vtxZAxis{100, -20, 20, "Vtx_{z} (cm)"}; - const AxisSpec pAxis{binsPt, "#it{p} (GeV/#it{c})"}; - const AxisSpec ptAxis{binsPt, "#it{p}_{T} (GeV/#it{c})"}; - const AxisSpec etaAxis{binsEta, "#eta"}; - const AxisSpec impParamAxis{binsImpactParam, "Impact parameter"}; + const AxisSpec pAxis{binsOptions.binsPt, "#it{p} (GeV/#it{c})"}; + const AxisSpec ptAxis{binsOptions.binsPt, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec etaAxis{binsOptions.binsEta, "#eta"}; histos.add("event/vertexz", "", HistType::kTH1D, {vtxZAxis}); auto h = histos.add("evsel", "evsel", HistType::kTH1D, {{20, 0.5, 20.5}}); @@ -245,31 +246,31 @@ struct tofSpectra { h->GetXaxis()->SetBinLabel(9, "EvTimeT0AC (selected)"); h->GetXaxis()->SetBinLabel(10, "EvTimeTOFT0AC (selected)"); - histos.add("Centrality/FV0A", "FV0A", HistType::kTH1D, {{binsPercentile, "Centrality FV0A"}}); - histos.add("Centrality/FT0M", "FT0M", HistType::kTH1D, {{binsPercentile, "Centrality FT0M"}}); - histos.add("Centrality/FT0A", "FT0A", HistType::kTH1D, {{binsPercentile, "Centrality FT0A"}}); - histos.add("Centrality/FT0C", "FT0C", HistType::kTH1D, {{binsPercentile, "Centrality FT0C"}}); - histos.add("Centrality/FDDM", "FDDM", HistType::kTH1D, {{binsPercentile, "Centrality FDDM"}}); - histos.add("Centrality/NTPV", "NTPV", HistType::kTH1D, {{binsPercentile, "Centrality NTPV"}}); + histos.add("Centrality/FV0A", "FV0A", HistType::kTH1D, {{binsOptions.binsPercentile, "Centrality FV0A"}}); + histos.add("Centrality/FT0M", "FT0M", HistType::kTH1D, {{binsOptions.binsPercentile, "Centrality FT0M"}}); + histos.add("Centrality/FT0A", "FT0A", HistType::kTH1D, {{binsOptions.binsPercentile, "Centrality FT0A"}}); + histos.add("Centrality/FT0C", "FT0C", HistType::kTH1D, {{binsOptions.binsPercentile, "Centrality FT0C"}}); + histos.add("Centrality/FDDM", "FDDM", HistType::kTH1D, {{binsOptions.binsPercentile, "Centrality FDDM"}}); + histos.add("Centrality/NTPV", "NTPV", HistType::kTH1D, {{binsOptions.binsPercentile, "Centrality NTPV"}}); - histos.add("Mult/FV0M", "MultFV0M", HistType::kTH1D, {{binsMultiplicity, "MultFV0M"}}); - histos.add("Mult/FT0M", "MultFT0M", HistType::kTH1D, {{binsMultiplicity, "MultFT0M"}}); - histos.add("Mult/FDDM", "MultFDDM", HistType::kTH1D, {{binsMultiplicity, "MultFDDM"}}); + histos.add("Mult/FV0M", "MultFV0M", HistType::kTH1D, {{binsOptions.binsMultiplicity, "MultFV0M"}}); + histos.add("Mult/FT0M", "MultFT0M", HistType::kTH1D, {{binsOptions.binsMultiplicity, "MultFT0M"}}); + histos.add("Mult/FDDM", "MultFDDM", HistType::kTH1D, {{binsOptions.binsMultiplicity, "MultFDDM"}}); - // histos.add("Mult/Tracklets", "MultTracklets", HistType::kTH1D, {{binsMultiplicity, "MultTracklets"}}); - histos.add("Mult/TPC", "MultTPC", HistType::kTH1D, {{binsMultiplicity, "MultTPC"}}); - histos.add("Mult/NTracksPV", "MultNTracksPV", HistType::kTH1D, {{binsMultiplicity, "MultNTracksPV"}}); - histos.add("Mult/NTracksPVeta1", "MultNTracksPVeta1", HistType::kTH1D, {{binsMultiplicity, "MultNTracksPVeta1"}}); + // histos.add("Mult/Tracklets", "MultTracklets", HistType::kTH1D, {{binsOptions.binsMultiplicity, "MultTracklets"}}); + histos.add("Mult/TPC", "MultTPC", HistType::kTH1D, {{binsOptions.binsMultiplicity, "MultTPC"}}); + histos.add("Mult/NTracksPV", "MultNTracksPV", HistType::kTH1D, {{binsOptions.binsMultiplicity, "MultNTracksPV"}}); + histos.add("Mult/NTracksPVeta1", "MultNTracksPVeta1", HistType::kTH1D, {{binsOptions.binsMultiplicity, "MultNTracksPVeta1"}}); - const AxisSpec dcaXyAxis{binsDca, "DCA_{xy} (cm)"}; + const AxisSpec dcaXyAxis{binsOptions.binsDca, "DCA_{xy} (cm)"}; const AxisSpec phiAxis{200, 0, 7, "#it{#varphi} (rad)"}; - const AxisSpec dcaZAxis{binsDca, "DCA_{z} (cm)"}; + const AxisSpec dcaZAxis{binsOptions.binsDca, "DCA_{z} (cm)"}; const AxisSpec lengthAxis{100, 0, 600, "Track length (cm)"}; if (enableTrackCutHistograms) { const AxisSpec chargeAxis{2, -2.f, 2.f, "Charge"}; - histos.add("track/pos/Eta", "Eta Positive tracks", HistType::kTH1D, {{binsEta, "#eta tracks"}}); - histos.add("track/neg/Eta", "Eta Negative tracks", HistType::kTH1D, {{binsEta, "#eta tracks"}}); + histos.add("track/pos/Eta", "Eta Positive tracks", HistType::kTH1D, {{binsOptions.binsEta, "#eta tracks"}}); + histos.add("track/neg/Eta", "Eta Negative tracks", HistType::kTH1D, {{binsOptions.binsEta, "#eta tracks"}}); // its histograms histos.add("track/ITS/itsNCls", "number of found ITS clusters;# clusters ITS", kTH2D, {{8, -0.5, 7.5}, chargeAxis}); histos.add("track/ITS/itsChi2NCl", "chi2 per ITS cluster;chi2 / cluster ITS", kTH2D, {{100, 0, 40}, chargeAxis}); @@ -282,8 +283,6 @@ struct tofSpectra { histos.add("track/TPC/tpcFractionSharedCls", "fraction of shared TPC clusters;fraction shared clusters TPC", kTH2D, {{100, 0., 1.}, chargeAxis}); histos.add("track/TPC/tpcCrossedRowsOverFindableCls", "crossed TPC rows over findable clusters;crossed rows / findable clusters TPC", kTH2D, {{60, 0.7, 1.3}, chargeAxis}); histos.add("track/TPC/tpcChi2NCl", "chi2 per cluster in TPC;chi2 / cluster TPC", kTH2D, {{100, 0, 10}, chargeAxis}); - histos.add("Vertex/histGenVtxMC", "MC generated vertex z position", HistType::kTH1F, {{400, -40., +40., "z position (cm)"}}); - histos.add("Centrality/ImpParm", "Centrality", HistType::kTH1F, {impParamAxis}); histos.addClone("track/ITS/itsNCls", "track/selected/ITS/itsNCls"); histos.addClone("track/ITS/itsChi2NCl", "track/selected/ITS/itsChi2NCl"); @@ -348,14 +347,6 @@ struct tofSpectra { histos.add("MC/fake/neg", "Fake negative tracks", kTH1D, {ptAxis}); histos.add("MC/no_collision/pos", "No collision pos track", kTH1D, {ptAxis}); histos.add("MC/no_collision/neg", "No collision neg track", kTH1D, {ptAxis}); - if (doprocessMCgen) { - histos.add("MC/test/pi/pos/prm/pt/den", "generated MC #pi^{+}", kTHnSparseD, {ptAxis, impParamAxis}); - histos.add("MC/test/pi/neg/prm/pt/den", "generated MC #pi^{-}", kTHnSparseD, {ptAxis, impParamAxis}); - histos.add("MC/test/ka/pos/prm/pt/den", "generated MC K^{+}", kTHnSparseD, {ptAxis, impParamAxis}); - histos.add("MC/test/ka/neg/prm/pt/den", "generated MC K^{-}", kTHnSparseD, {ptAxis, impParamAxis}); - histos.add("MC/test/pr/pos/prm/pt/den", "generated MC p", kTHnSparseD, {ptAxis, impParamAxis}); - histos.add("MC/test/pr/neg/prm/pt/den", "generated MC #bar{p}", kTHnSparseD, {ptAxis, impParamAxis}); - } auto hh = histos.add("MC/GenRecoCollisions", "Generated and Reconstructed MC Collisions", kTH1D, {{10, 0.5, 10.5}}); hh->GetXaxis()->SetBinLabel(1, "Collisions generated"); hh->GetXaxis()->SetBinLabel(2, "Collisions reconstructed"); @@ -364,6 +355,46 @@ struct tofSpectra { hh->GetXaxis()->SetBinLabel(5, "hasParticleInFT0C && hasParticleInFT0A"); } + AxisSpec multAxis{binsOptions.binsMultiplicity, "Undefined multiplicity estimator"}; + switch (multiplicityEstimator) { + case MultCodes::kNoMultiplicity: // No multiplicity + break; + case MultCodes::kMultFV0M: // MultFV0M + multAxis.name = "MultFV0M"; + break; + case MultCodes::kMultFT0M: // MultFT0M + multAxis.name = "MultFT0M"; + break; + case MultCodes::kMultFDDM: // MultFDDM + multAxis.name = "MultFDDM"; + break; + case MultCodes::kMultTracklets: // MultTracklets + multAxis.name = "MultTracklets"; + break; + case MultCodes::kMultTPC: // MultTPC + multAxis.name = "MultTPC"; + break; + case MultCodes::kMultNTracksPV: // MultNTracksPV + multAxis.name = "MultNTracksPV"; + break; + case MultCodes::kMultNTracksPVeta1: // MultNTracksPVeta1 + multAxis.name = "MultNTracksPVeta1"; + break; + case MultCodes::kCentralityFT0C: // Centrality FT0C + multAxis = {binsOptions.binsPercentile, "Centrality FT0C"}; + break; + case MultCodes::kCentralityFT0M: // Centrality FT0M + multAxis = {binsOptions.binsPercentile, "Centrality FT0M"}; + break; + case MultCodes::kCentralityFV0A: // Centrality FV0A + multAxis = {binsOptions.binsPercentile, "Centrality FV0A"}; + break; + default: + LOG(fatal) << "Unrecognized option for multiplicity " << multiplicityEstimator; + } + + hMultiplicityvsPercentile = histos.add("Mult/vsPercentile", "Multiplicity vs percentile", HistType::kTH2D, {{150, 0, 150}, {100, 0, 100, "Track multiplicity"}}); + for (int i = 0; i < NpCharge; i++) { switch (i) { case 0: @@ -422,48 +453,10 @@ struct tofSpectra { break; } - const AxisSpec nsigmaTPCAxis{binsnsigmaTPC, Form("N_{#sigma}^{TPC}(%s)", pTCharge[i])}; - const AxisSpec nsigmaTOFAxis{binsnsigmaTOF, Form("N_{#sigma}^{TOF}(%s)", pTCharge[i])}; - const AxisSpec deltaTPCAxis{binsdeltaTPC, Form("#Delta^{TPC}(%s)", pTCharge[i])}; - const AxisSpec deltaTOFAxis{binsdeltaTOF, Form("#Delta^{TOF}(%s)", pTCharge[i])}; - AxisSpec multAxis{binsMultiplicity, "Undefined multiplicity estimator"}; - - switch (multiplicityEstimator) { - case MultCodes::kNoMultiplicity: // No multiplicity - break; - case MultCodes::kMultFV0M: // MultFV0M - multAxis.name = "MultFV0M"; - break; - case MultCodes::kMultFT0M: // MultFT0M - multAxis.name = "MultFT0M"; - break; - case MultCodes::kMultFDDM: // MultFDDM - multAxis.name = "MultFDDM"; - break; - case MultCodes::kMultTracklets: // MultTracklets - multAxis.name = "MultTracklets"; - break; - case MultCodes::kMultTPC: // MultTPC - multAxis.name = "MultTPC"; - break; - case MultCodes::kMultNTracksPV: // MultNTracksPV - multAxis.name = "MultNTracksPV"; - break; - case MultCodes::kMultNTracksPVeta1: // MultNTracksPVeta1 - multAxis.name = "MultNTracksPVeta1"; - break; - case MultCodes::kCentralityFT0C: // Centrality FT0C - multAxis = {binsPercentile, "Centrality FT0C"}; - break; - case MultCodes::kCentralityFT0M: // Centrality FT0M - multAxis = {binsPercentile, "Centrality FT0M"}; - break; - case MultCodes::kCentralityFV0A: // Centrality FV0A - multAxis = {binsPercentile, "Centrality FV0A"}; - break; - default: - LOG(fatal) << "Unrecognized option for multiplicity " << multiplicityEstimator; - } + const AxisSpec nsigmaTPCAxis{binsOptions.binsnsigmaTPC, Form("N_{#sigma}^{TPC}(%s)", pTCharge[i])}; + const AxisSpec nsigmaTOFAxis{binsOptions.binsnsigmaTOF, Form("N_{#sigma}^{TOF}(%s)", pTCharge[i])}; + const AxisSpec deltaTPCAxis{binsOptions.binsdeltaTPC, Form("#Delta^{TPC}(%s)", pTCharge[i])}; + const AxisSpec deltaTOFAxis{binsOptions.binsdeltaTOF, Form("#Delta^{TOF}(%s)", pTCharge[i])}; if (multiplicityEstimator == MultCodes::kNoMultiplicity) { histos.add(hnsigmatof[i].data(), pTCharge[i], kTH2D, {ptAxis, nsigmaTOFAxis}); histos.add(hnsigmatpc[i].data(), pTCharge[i], kTH2D, {ptAxis, nsigmaTPCAxis}); @@ -491,7 +484,7 @@ struct tofSpectra { histos.add(hdeltatpc[i].data(), pTCharge[i], kTH3D, {ptAxis, deltaTPCAxis, multAxis}); } if (enableTPCTOFHistograms) { - if (tpctofVsMult) { + if (enableTPCTOFVsMult) { if (enableTPCTOFvsEtaHistograms) { histos.add(hnsigmatpctof[i].data(), pTCharge[i], kTHnSparseD, {ptAxis, etaAxis, nsigmaTPCAxis, nsigmaTOFAxis, multAxis}); } else { @@ -760,7 +753,7 @@ struct tofSpectra { } if (enableTPCTOFHistograms) { - if (tpctofVsMult) { + if (enableTPCTOFVsMult) { if (enableTPCTOFvsEtaHistograms) { if (track.sign() > 0) { histos.fill(HIST(hnsigmatpctof[id]), track.pt(), track.eta(), nsigmaTPC, nsigmaTOF, multiplicity); @@ -1205,6 +1198,7 @@ struct tofSpectra { if (!isEventSelected(collision)) { return; } + hMultiplicityvsPercentile->Fill(getMultiplicity(collision), collision.multNTracksPV()); for (const auto& track : tracks) { if (!isTrackSelected(track)) { continue; @@ -1316,7 +1310,7 @@ struct tofSpectra { return collision.centFT0C(); break; case MultCodes::kCentralityFT0M: // Centrality FT0M - return collision.centFT0M(); // collision.centFT0A() + return collision.centFT0A(); // collision.centFT0A() break; default: LOG(fatal) << "Unknown multiplicity estimator: " << multiplicityEstimator; @@ -1324,74 +1318,61 @@ struct tofSpectra { } } - using CollisionCandidateMC = soa::Join; // RD + template + bool isParticleEnabled() + { + if constexpr (id == 0 || id == Np) { + if (doprocessFullEl == true || doprocessLfFullEl == true) { + return true; + } + } else if constexpr (id == 1 || id == Np + 1) { + if (doprocessFullMu == true || doprocessLfFullMu == true) { + return true; + } + } else if constexpr (id == 2 || id == Np + 2) { + if (doprocessFullPi == true || doprocessLfFullPi == true) { + return true; + } + } else if constexpr (id == 2 || id == Np + 2) { + if (doprocessFullKa == true || doprocessLfFullKa == true) { + return true; + } + } else if constexpr (id == 4 || id == Np + 4) { + if (doprocessFullPr == true || doprocessLfFullPr == true) { + return true; + } + } else if constexpr (id == 5 || id == Np + 5) { + if (doprocessFullDe == true || doprocessLfFullDe == true) { + return true; + } + } else if constexpr (id == 6 || id == Np + 6) { + if (doprocessFullTr == true || doprocessLfFullTr == true) { + return true; + } + } else if constexpr (id == 7 || id == Np + 7) { + if (doprocessFullHe == true || doprocessLfFullHe == true) { + return true; + } + } else if constexpr (id == 8 || id == Np + 8) { + if (doprocessFullAl == true || doprocessLfFullAl == true) { + return true; + } + } else { + LOG(fatal) << "Unknown particle id: " << id; + } + return false; + } + + using CollisionCandidateMC = soa::Join; // RD template void fillTrackHistograms_MC(TrackType const& track, ParticleType const& mcParticle, CollisionCandidateMC::iterator const& collision) { - - switch (i) { - case 0: - case Np: - if (doprocessFullEl == false && doprocessLfFullEl == false) { - return; - } - break; - case 1: - case Np + 1: - if (doprocessFullMu == false && doprocessLfFullMu == false) { - return; - } - break; - case 2: - case Np + 2: - if (doprocessFullPi == false && doprocessLfFullPi == false) { - return; - } - break; - case 3: - case Np + 3: - if (doprocessFullKa == false && doprocessLfFullKa == false) { - return; - } - break; - case 4: - case Np + 4: - if (doprocessFullPr == false && doprocessLfFullPr == false) { - return; - } - break; - case 5: - case Np + 5: - if (doprocessFullDe == false && doprocessLfFullDe == false) { - return; - } - break; - case 6: - case Np + 6: - if (doprocessFullTr == false && doprocessLfFullTr == false) { - return; - } - break; - case 7: - case Np + 7: - if (doprocessFullHe == false && doprocessLfFullHe == false) { - return; - } - break; - case 8: - case Np + 8: - if (doprocessFullAl == false && doprocessLfFullAl == false) { - return; - } - break; + if (!isParticleEnabled()) { // Check if the particle is enabled + return; } //************************************RD************************************************** - const auto& mcCollision = collision.mcCollision(); - float multiplicity = getMultiplicity(collision); - if (includeCentralityMC) { - multiplicity = mcCollision.impactParameter(); - } + const float multiplicity = getMultiplicity(collision); //************************************RD************************************************** if (mcParticle.pdgCode() != PDGs[i]) { @@ -1516,71 +1497,16 @@ struct tofSpectra { } template - void fillParticleHistograms_MC(CollisionCandidateMC::iterator const& collision, ParticleType const& mcParticle) + void fillParticleHistograms_MC(const float multiplicity, ParticleType const& mcParticle) { - - switch (i) { - case 0: - case Np: - if (doprocessFullEl == false && doprocessLfFullEl == false) { - return; - } - break; - case 1: - case Np + 1: - if (doprocessFullMu == false && doprocessLfFullMu == false) { - return; - } - break; - case 2: - case Np + 2: - if (doprocessFullPi == false && doprocessLfFullPi == false) { - return; - } - break; - case 3: - case Np + 3: - if (doprocessFullKa == false && doprocessLfFullKa == false) { - return; - } - break; - case 4: - case Np + 4: - if (doprocessFullPr == false && doprocessLfFullPr == false) { - return; - } - break; - case 5: - case Np + 5: - if (doprocessFullDe == false && doprocessLfFullDe == false) { - return; - } - break; - case 6: - case Np + 6: - if (doprocessFullTr == false && doprocessLfFullTr == false) { - return; - } - break; - case 7: - case Np + 7: - if (doprocessFullHe == false && doprocessLfFullHe == false) { - return; - } - break; - case 8: - case Np + 8: - if (doprocessFullAl == false && doprocessLfFullAl == false) { - return; - } - break; + if (!isParticleEnabled()) { // Check if the particle is enabled + return; } if (mcParticle.pdgCode() != PDGs[i]) { return; } - const float multiplicity = getMultiplicity(collision); if (!mcParticle.isPhysicalPrimary()) { if (mcParticle.getProcess() == 4) { if (includeCentralityMC) { @@ -1607,62 +1533,8 @@ struct tofSpectra { template void fillParticleHistograms_MCRecoEvs(ParticleType const& mcParticle, CollisionCandidateMC::iterator const& collision) { - - switch (i) { - case 0: - case Np: - if (doprocessFullEl == false && doprocessLfFullEl == false) { - return; - } - break; - case 1: - case Np + 1: - if (doprocessFullMu == false && doprocessLfFullMu == false) { - return; - } - break; - case 2: - case Np + 2: - if (doprocessFullPi == false && doprocessLfFullPi == false) { - return; - } - break; - case 3: - case Np + 3: - if (doprocessFullKa == false && doprocessLfFullKa == false) { - return; - } - break; - case 4: - case Np + 4: - if (doprocessFullPr == false && doprocessLfFullPr == false) { - return; - } - break; - case 5: - case Np + 5: - if (doprocessFullDe == false && doprocessLfFullDe == false) { - return; - } - break; - case 6: - case Np + 6: - if (doprocessFullTr == false && doprocessLfFullTr == false) { - return; - } - break; - case 7: - case Np + 7: - if (doprocessFullHe == false && doprocessLfFullHe == false) { - return; - } - break; - case 8: - case Np + 8: - if (doprocessFullAl == false && doprocessLfFullAl == false) { - return; - } - break; + if (!isParticleEnabled()) { // Check if the particle is enabled + return; } if (mcParticle.pdgCode() != PDGs[i]) { @@ -1716,64 +1588,11 @@ struct tofSpectra { } template - void fillParticleHistograms_MCGenEvs(ParticleType const& mcParticle, aod::McCollision const& mcCollision) + void fillParticleHistograms_MCGenEvs(ParticleType const& mcParticle, soa::Join::iterator const& mcCollision) { - switch (i) { - case 0: - case Np: - if (doprocessFullEl == false && doprocessLfFullEl == false) { - return; - } - break; - case 1: - case Np + 1: - if (doprocessFullMu == false && doprocessLfFullMu == false) { - return; - } - break; - case 2: - case Np + 2: - if (doprocessFullPi == false && doprocessLfFullPi == false) { - return; - } - break; - case 3: - case Np + 3: - if (doprocessFullKa == false && doprocessLfFullKa == false) { - return; - } - break; - case 4: - case Np + 4: - if (doprocessFullPr == false && doprocessLfFullPr == false) { - return; - } - break; - case 5: - case Np + 5: - if (doprocessFullDe == false && doprocessLfFullDe == false) { - return; - } - break; - case 6: - case Np + 6: - if (doprocessFullTr == false && doprocessLfFullTr == false) { - return; - } - break; - case 7: - case Np + 7: - if (doprocessFullHe == false && doprocessLfFullHe == false) { - return; - } - break; - case 8: - case Np + 8: - if (doprocessFullAl == false && doprocessLfFullAl == false) { - return; - } - break; + if (!isParticleEnabled()) { // Check if the particle is enabled + return; } if (mcParticle.pdgCode() != PDGs[i]) { @@ -1791,32 +1610,28 @@ struct tofSpectra { Service pdgDB; - // Event selection template - bool isTrueINELgt0(TMcParticles particles) + uint16_t GetGenNchInFT0Mregion(TMcParticles particles) { - int nPart = 0; - for (const auto& particle : particles) { - if (particle.isPhysicalPrimary() == 0) - continue; // consider only primaries - - const auto& pdgInfo = pdgDB->GetParticle(particle.pdgCode()); + // Particle counting in FITFT0: -3.3<η<-2.1; 3.5<η<4.9 + uint16_t nchFT0 = 0; + for (auto& mcParticle : particles) { + if (!mcParticle.isPhysicalPrimary()) { + continue; + } + const auto& pdgInfo = pdgDB->GetParticle(mcParticle.pdgCode()); if (!pdgInfo) { continue; } - if (TMath::Abs(pdgInfo->Charge()) < 0.001) { - continue; // consider only charged particles + if (pdgInfo->Charge() == 0) { + continue; } - - if (particle.eta() < -1.0 || particle.eta() > 1.0) - continue; // consider only particles in |eta| < 1 - - nPart++; + if (mcParticle.eta() < -3.3 || mcParticle.eta() > 4.9 || (mcParticle.eta() > -2.1 && mcParticle.eta() < 3.5)) { + continue; // select on T0M Nch region + } + nchFT0++; // increment } - if (nPart > 0) - return true; - else - return false; + return nchFT0; } Preslice perMCCol = aod::mcparticle::mcCollisionId; @@ -1826,7 +1641,7 @@ struct tofSpectra { aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr, aod::TrackSelection> const& tracks, aod::McParticles const& mcParticles, - aod::McCollisions const& mcCollisions, + soa::Join const& mcCollisions, CollisionCandidateMC const& collisions) { // Fill number of generated and reconstructed collisions for normalization @@ -1867,30 +1682,28 @@ struct tofSpectra { if (!collision.has_mcCollision()) { continue; } - const auto& particlesInCollision = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, collision.mcCollision().globalIndex(), cache); + const auto& mcCollision = collision.mcCollision_as>(); + const auto& particlesInCollision = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); + const float multiplicity = getMultiplicity(collision); + for (const auto& mcParticle : particlesInCollision) { if (std::abs(mcParticle.y()) > trkselOptions.cfgCutY) { continue; } static_for<0, 17>([&](auto i) { - fillParticleHistograms_MC(collision, mcParticle); + fillParticleHistograms_MC(multiplicity, mcParticle); }); } } } else { - for (const auto& collision : collisions) { - for (const auto& mcParticle : mcParticles) { - // if (std::abs(mcParticle.eta()) > cfgCutEta) { - // continue; - // } - if (std::abs(mcParticle.y()) > trkselOptions.cfgCutY) { - continue; - } - static_for<0, 17>([&](auto i) { - fillParticleHistograms_MC(collision, mcParticle); - }); + for (const auto& mcParticle : mcParticles) { + if (std::abs(mcParticle.y()) > trkselOptions.cfgCutY) { + continue; } + static_for<0, 17>([&](auto i) { + fillParticleHistograms_MC(50., mcParticle); + }); } } // Loop on reconstructed collisions @@ -1898,7 +1711,8 @@ struct tofSpectra { if (!collision.has_mcCollision()) { continue; } - const auto& particlesInCollision = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, collision.mcCollision().globalIndex(), cache); + const auto& mcCollision = collision.mcCollision_as>(); + const auto& particlesInCollision = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); for (const auto& mcParticle : particlesInCollision) { if (std::abs(mcParticle.y()) > trkselOptions.cfgCutY) { continue; @@ -1915,25 +1729,19 @@ struct tofSpectra { bool hasParticleInFT0C = false; bool hasParticleInFT0A = false; if (evselOptions.cfgINELCut.value == 1) { - if (!isTrueINELgt0(particlesInCollision)) { + if (!o2::pwglf::isINELgt0mc(particlesInCollision, pdgDB)) { continue; } } - - int nInelPart = 0; - for (const auto& mcParticle : particlesInCollision) { - if (mcParticle.isPhysicalPrimary()) { - if (mcParticle.eta() >= -3.4f && mcParticle.eta() <= -2.3f) { // Acceptance of the FT0C - hasParticleInFT0C = true; - } - if (mcParticle.eta() >= 3.8f && mcParticle.eta() <= 5.0f) { // Acceptance of the FT0A - hasParticleInFT0A = true; - } - if (std::abs(mcParticle.eta()) < 1.f) { - nInelPart++; - } + if (evselOptions.cfgINELCut.value == 0) { + if (!o2::pwglf::isINELgt1mc(particlesInCollision, pdgDB)) { + continue; } + } + + const auto nInelPart = GetGenNchInFT0Mregion(particlesInCollision); + for (const auto& mcParticle : particlesInCollision) { if (std::abs(mcParticle.y()) > trkselOptions.cfgCutY) { continue; } @@ -1953,50 +1761,6 @@ struct tofSpectra { } } PROCESS_SWITCH(tofSpectra, processMC, "Process MC", false); - - void processMCgen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles) - { - histos.fill(HIST("Vertex/histGenVtxMC"), mcCollision.posZ()); - histos.fill(HIST("Centrality/ImpParm"), mcCollision.impactParameter()); - const float multiplicity = mcCollision.impactParameter(); - for (const auto& mcParticleGen : mcParticles) { - if (!mcParticleGen.isPhysicalPrimary()) - continue; - int pdgCode = mcParticleGen.pdgCode(); - float pt = mcParticleGen.pt(); - float absY = std::abs(mcParticleGen.y()); - // Apply rapidity cut - if (absY > trkselOptions.cfgCutY) { - continue; - } - - // Fill histograms based on particle type - switch (pdgCode) { - case 2212: - histos.fill(HIST("MC/test/pr/pos/prm/pt/den"), pt, multiplicity); - break; - case -2212: - histos.fill(HIST("MC/test/pr/neg/prm/pt/den"), pt, multiplicity); - break; - case 211: - histos.fill(HIST("MC/test/pi/pos/prm/pt/den"), pt, multiplicity); - break; - case -211: - histos.fill(HIST("MC/test/pi/neg/prm/pt/den"), pt, multiplicity); - break; - case 321: - histos.fill(HIST("MC/test/ka/pos/prm/pt/den"), pt, multiplicity); - break; - case -321: - histos.fill(HIST("MC/test/ka/neg/prm/pt/den"), pt, multiplicity); - break; - default: - break; - } - } - } - PROCESS_SWITCH(tofSpectra, processMCgen, "process generated MC", false); - }; // end of spectra task WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 6a10c8d5eff812abea74620a44f73012ddf58f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Fri, 7 Jun 2024 18:27:04 +0200 Subject: [PATCH 2/6] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 63 ++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index caf9fa915ef..bdcf5707c6a 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -90,9 +90,11 @@ struct tofSpectra { ConfigurableAxis binsDca{"binsDca", {VARIABLE_WIDTH, -3.0, -2.95, -2.9, -2.85, -2.8, -2.75, -2.7, -2.65, -2.6, -2.55, -2.5, -2.45, -2.4, -2.35, -2.3, -2.25, -2.2, -2.15, -2.1, -2.05, -2.0, -1.975, -1.95, -1.925, -1.9, -1.875, -1.85, -1.825, -1.8, -1.775, -1.75, -1.725, -1.7, -1.675, -1.65, -1.625, -1.6, -1.575, -1.55, -1.525, -1.5, -1.475, -1.45, -1.425, -1.4, -1.375, -1.35, -1.325, -1.3, -1.275, -1.25, -1.225, -1.2, -1.175, -1.15, -1.125, -1.1, -1.075, -1.05, -1.025, -1.0, -0.99, -0.98, -0.97, -0.96, -0.95, -0.94, -0.93, -0.92, -0.91, -0.9, -0.89, -0.88, -0.87, -0.86, -0.85, -0.84, -0.83, -0.82, -0.81, -0.8, -0.79, -0.78, -0.77, -0.76, -0.75, -0.74, -0.73, -0.72, -0.71, -0.7, -0.69, -0.68, -0.67, -0.66, -0.65, -0.64, -0.63, -0.62, -0.61, -0.6, -0.59, -0.58, -0.57, -0.56, -0.55, -0.54, -0.53, -0.52, -0.51, -0.5, -0.49, -0.48, -0.47, -0.46, -0.45, -0.44, -0.43, -0.42, -0.41, -0.4, -0.396, -0.392, -0.388, -0.384, -0.38, -0.376, -0.372, -0.368, -0.364, -0.36, -0.356, -0.352, -0.348, -0.344, -0.34, -0.336, -0.332, -0.328, -0.324, -0.32, -0.316, -0.312, -0.308, -0.304, -0.3, -0.296, -0.292, -0.288, -0.284, -0.28, -0.276, -0.272, -0.268, -0.264, -0.26, -0.256, -0.252, -0.248, -0.244, -0.24, -0.236, -0.232, -0.228, -0.224, -0.22, -0.216, -0.212, -0.208, -0.204, -0.2, -0.198, -0.196, -0.194, -0.192, -0.19, -0.188, -0.186, -0.184, -0.182, -0.18, -0.178, -0.176, -0.174, -0.172, -0.17, -0.168, -0.166, -0.164, -0.162, -0.16, -0.158, -0.156, -0.154, -0.152, -0.15, -0.148, -0.146, -0.144, -0.142, -0.14, -0.138, -0.136, -0.134, -0.132, -0.13, -0.128, -0.126, -0.124, -0.122, -0.12, -0.118, -0.116, -0.114, -0.112, -0.11, -0.108, -0.106, -0.104, -0.102, -0.1, -0.099, -0.098, -0.097, -0.096, -0.095, -0.094, -0.093, -0.092, -0.091, -0.09, -0.089, -0.088, -0.087, -0.086, -0.085, -0.084, -0.083, -0.082, -0.081, -0.08, -0.079, -0.078, -0.077, -0.076, -0.075, -0.074, -0.073, -0.072, -0.071, -0.07, -0.069, -0.068, -0.067, -0.066, -0.065, -0.064, -0.063, -0.062, -0.061, -0.06, -0.059, -0.058, -0.057, -0.056, -0.055, -0.054, -0.053, -0.052, -0.051, -0.05, -0.049, -0.048, -0.047, -0.046, -0.045, -0.044, -0.043, -0.042, -0.041, -0.04, -0.039, -0.038, -0.037, -0.036, -0.035, -0.034, -0.033, -0.032, -0.031, -0.03, -0.029, -0.028, -0.027, -0.026, -0.025, -0.024, -0.023, -0.022, -0.021, -0.02, -0.019, -0.018, -0.017, -0.016, -0.015, -0.014, -0.013, -0.012, -0.011, -0.01, -0.009, -0.008, -0.007, -0.006, -0.005, -0.004, -0.003, -0.002, -0.001, -0.0, 0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01, 0.011, 0.012, 0.013, 0.014, 0.015, 0.016, 0.017, 0.018, 0.019, 0.02, 0.021, 0.022, 0.023, 0.024, 0.025, 0.026, 0.027, 0.028, 0.029, 0.03, 0.031, 0.032, 0.033, 0.034, 0.035, 0.036, 0.037, 0.038, 0.039, 0.04, 0.041, 0.042, 0.043, 0.044, 0.045, 0.046, 0.047, 0.048, 0.049, 0.05, 0.051, 0.052, 0.053, 0.054, 0.055, 0.056, 0.057, 0.058, 0.059, 0.06, 0.061, 0.062, 0.063, 0.064, 0.065, 0.066, 0.067, 0.068, 0.069, 0.07, 0.071, 0.072, 0.073, 0.074, 0.075, 0.076, 0.077, 0.078, 0.079, 0.08, 0.081, 0.082, 0.083, 0.084, 0.085, 0.086, 0.087, 0.088, 0.089, 0.09, 0.091, 0.092, 0.093, 0.094, 0.095, 0.096, 0.097, 0.098, 0.099, 0.1, 0.102, 0.104, 0.106, 0.108, 0.11, 0.112, 0.114, 0.116, 0.118, 0.12, 0.122, 0.124, 0.126, 0.128, 0.13, 0.132, 0.134, 0.136, 0.138, 0.14, 0.142, 0.144, 0.146, 0.148, 0.15, 0.152, 0.154, 0.156, 0.158, 0.16, 0.162, 0.164, 0.166, 0.168, 0.17, 0.172, 0.174, 0.176, 0.178, 0.18, 0.182, 0.184, 0.186, 0.188, 0.19, 0.192, 0.194, 0.196, 0.198, 0.2, 0.204, 0.208, 0.212, 0.216, 0.22, 0.224, 0.228, 0.232, 0.236, 0.24, 0.244, 0.248, 0.252, 0.256, 0.26, 0.264, 0.268, 0.272, 0.276, 0.28, 0.284, 0.288, 0.292, 0.296, 0.3, 0.304, 0.308, 0.312, 0.316, 0.32, 0.324, 0.328, 0.332, 0.336, 0.34, 0.344, 0.348, 0.352, 0.356, 0.36, 0.364, 0.368, 0.372, 0.376, 0.38, 0.384, 0.388, 0.392, 0.396, 0.4, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.5, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.6, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.7, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.8, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.9, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.0, 1.025, 1.05, 1.075, 1.1, 1.125, 1.15, 1.175, 1.2, 1.225, 1.25, 1.275, 1.3, 1.325, 1.35, 1.375, 1.4, 1.425, 1.45, 1.475, 1.5, 1.525, 1.55, 1.575, 1.6, 1.625, 1.65, 1.675, 1.7, 1.725, 1.75, 1.775, 1.8, 1.825, 1.85, 1.875, 1.9, 1.925, 1.95, 1.975, 2.0, 2.05, 2.1, 2.15, 2.2, 2.25, 2.3, 2.35, 2.4, 2.45, 2.5, 2.55, 2.6, 2.65, 2.7, 2.75, 2.8, 2.85, 2.9, 2.95, 3.0}, "Binning of DCA xy and z axis"}; ConfigurableAxis binsMultiplicity{"binsMultiplicity", {100, 0, 100}, "Binning for multiplicity"}; ConfigurableAxis binsPercentile{"binsPercentile", {100, 0, 100}, "Binning for percentiles"}; + ConfigurableAxis binsImpactParam{"binsImpactParam", {2500, 0, 25}, "Binning for impact parameter"}; } binsOptions; Configurable multiplicityEstimator{"multiplicityEstimator", 0, "Flag to use a multiplicity estimator: 0 no multiplicity, 1 MultFV0M, 2 MultFT0M, 3 MultFDDM, 4 MultTracklets, 5 MultTPC, 6 MultNTracksPV, 7 MultNTracksPVeta1, 8 CentralityFT0C, 9 CentralityFT0M, 10 CentralityFV0A"}; + // Custom track cuts for the cut variation study TrackSelection customTrackCuts; Configurable kaonIsPvContrib{"kaonIsPvContrib", false, "Flag to ckeck if kaon tracks are from pv"}; @@ -210,6 +212,7 @@ struct tofSpectra { const AxisSpec pAxis{binsOptions.binsPt, "#it{p} (GeV/#it{c})"}; const AxisSpec ptAxis{binsOptions.binsPt, "#it{p}_{T} (GeV/#it{c})"}; const AxisSpec etaAxis{binsOptions.binsEta, "#eta"}; + const AxisSpec impParamAxis{binsOptions.binsImpactParam, "Impact parameter"}; histos.add("event/vertexz", "", HistType::kTH1D, {vtxZAxis}); auto h = histos.add("evsel", "evsel", HistType::kTH1D, {{20, 0.5, 20.5}}); @@ -283,6 +286,8 @@ struct tofSpectra { histos.add("track/TPC/tpcFractionSharedCls", "fraction of shared TPC clusters;fraction shared clusters TPC", kTH2D, {{100, 0., 1.}, chargeAxis}); histos.add("track/TPC/tpcCrossedRowsOverFindableCls", "crossed TPC rows over findable clusters;crossed rows / findable clusters TPC", kTH2D, {{60, 0.7, 1.3}, chargeAxis}); histos.add("track/TPC/tpcChi2NCl", "chi2 per cluster in TPC;chi2 / cluster TPC", kTH2D, {{100, 0, 10}, chargeAxis}); + histos.add("Vertex/histGenVtxMC", "MC generated vertex z position", HistType::kTH1F, {{400, -40., +40., "z position (cm)"}}); + histos.add("Centrality/ImpParm", "Centrality", HistType::kTH1F, {impParamAxis}); histos.addClone("track/ITS/itsNCls", "track/selected/ITS/itsNCls"); histos.addClone("track/ITS/itsChi2NCl", "track/selected/ITS/itsChi2NCl"); @@ -347,6 +352,14 @@ struct tofSpectra { histos.add("MC/fake/neg", "Fake negative tracks", kTH1D, {ptAxis}); histos.add("MC/no_collision/pos", "No collision pos track", kTH1D, {ptAxis}); histos.add("MC/no_collision/neg", "No collision neg track", kTH1D, {ptAxis}); + if (doprocessMCgen) { + histos.add("MC/test/pi/pos/prm/pt/den", "generated MC #pi^{+}", kTHnSparseD, {ptAxis, impParamAxis}); + histos.add("MC/test/pi/neg/prm/pt/den", "generated MC #pi^{-}", kTHnSparseD, {ptAxis, impParamAxis}); + histos.add("MC/test/ka/pos/prm/pt/den", "generated MC K^{+}", kTHnSparseD, {ptAxis, impParamAxis}); + histos.add("MC/test/ka/neg/prm/pt/den", "generated MC K^{-}", kTHnSparseD, {ptAxis, impParamAxis}); + histos.add("MC/test/pr/pos/prm/pt/den", "generated MC p", kTHnSparseD, {ptAxis, impParamAxis}); + histos.add("MC/test/pr/neg/prm/pt/den", "generated MC #bar{p}", kTHnSparseD, {ptAxis, impParamAxis}); + } auto hh = histos.add("MC/GenRecoCollisions", "Generated and Reconstructed MC Collisions", kTH1D, {{10, 0.5, 10.5}}); hh->GetXaxis()->SetBinLabel(1, "Collisions generated"); hh->GetXaxis()->SetBinLabel(2, "Collisions reconstructed"); @@ -1372,7 +1385,11 @@ struct tofSpectra { } //************************************RD************************************************** - const float multiplicity = getMultiplicity(collision); + const auto& mcCollision = collision.mcCollision(); + float multiplicity = getMultiplicity(collision); + if (includeCentralityMC) { + multiplicity = mcCollision.impactParameter(); + } //************************************RD************************************************** if (mcParticle.pdgCode() != PDGs[i]) { @@ -1761,6 +1778,50 @@ struct tofSpectra { } } PROCESS_SWITCH(tofSpectra, processMC, "Process MC", false); + + void processMCgen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles) + { + histos.fill(HIST("Vertex/histGenVtxMC"), mcCollision.posZ()); + histos.fill(HIST("Centrality/ImpParm"), mcCollision.impactParameter()); + const float multiplicity = mcCollision.impactParameter(); + for (const auto& mcParticleGen : mcParticles) { + if (!mcParticleGen.isPhysicalPrimary()) + continue; + int pdgCode = mcParticleGen.pdgCode(); + float pt = mcParticleGen.pt(); + float absY = std::abs(mcParticleGen.y()); + // Apply rapidity cut + if (absY > trkselOptions.cfgCutY) { + continue; + } + + // Fill histograms based on particle type + switch (pdgCode) { + case 2212: + histos.fill(HIST("MC/test/pr/pos/prm/pt/den"), pt, multiplicity); + break; + case -2212: + histos.fill(HIST("MC/test/pr/neg/prm/pt/den"), pt, multiplicity); + break; + case 211: + histos.fill(HIST("MC/test/pi/pos/prm/pt/den"), pt, multiplicity); + break; + case -211: + histos.fill(HIST("MC/test/pi/neg/prm/pt/den"), pt, multiplicity); + break; + case 321: + histos.fill(HIST("MC/test/ka/pos/prm/pt/den"), pt, multiplicity); + break; + case -321: + histos.fill(HIST("MC/test/ka/neg/prm/pt/den"), pt, multiplicity); + break; + default: + break; + } + } + } + PROCESS_SWITCH(tofSpectra, processMCgen, "process generated MC", false); + }; // end of spectra task WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From b0c8a62f068a9501aaee453e76dbf2377ffafbdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Sat, 8 Jun 2024 11:14:50 +0200 Subject: [PATCH 3/6] Update spectraTOF.cxx --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index bdcf5707c6a..39c10c31e0f 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -516,11 +516,7 @@ struct tofSpectra { histos.add(hdcaxyphi[i].data(), Form("%s -- 0.9 < #it{p}_{T} < 1.1 GeV/#it{c}", pTCharge[i]), kTH3D, {phiAxis, dcaXyAxis, dcaZAxis}); } if (enableDCAxyzHistograms) { - if (i < Np) { - hDcaXYZ[i] = histos.add(Form("dca/pos/%s", pN[i]), pTCharge[i], kTH3D, {ptAxis, dcaXyAxis, dcaZAxis}); - } else { - hDcaXYZ[i] = histos.add(Form("dca/neg/%s", pN[i]), pTCharge[i], kTH3D, {ptAxis, dcaXyAxis, dcaZAxis}); - } + hDcaXYZ[i] = histos.add(Form("dca/%s/%s", (i < Np) ? "pos" : "neg", pN[i % Np]), pTCharge[i], kTH3D, {ptAxis, dcaXyAxis, dcaZAxis}); } else { histos.add(hdcaxy[i].data(), pTCharge[i], kTH2D, {ptAxis, dcaXyAxis}); histos.add(hdcaz[i].data(), pTCharge[i], kTH2D, {ptAxis, dcaZAxis}); @@ -570,15 +566,9 @@ struct tofSpectra { histos.add(hpt_den_prm_mcgoodev[i].data(), pTCharge[i], kTH1D, {ptAxis}); histos.add(hpt_den_prm_mcbadev[i].data(), pTCharge[i], kTH1D, {ptAxis}); if (enableDCAxyzHistograms) { - if (i < Np) { - hDcaXYZPrm[i] = histos.add(Form("dcaprm/pos/%s", pN[i]), pTCharge[i], kTH3D, {ptAxis, dcaXyAxis, dcaZAxis}); - hDcaXYZStr[i] = histos.add(Form("dcastr/pos/%s", pN[i]), pTCharge[i], kTH3D, {ptAxis, dcaXyAxis, dcaZAxis}); - hDcaXYZMat[i] = histos.add(Form("dcamat/pos/%s", pN[i]), pTCharge[i], kTH3D, {ptAxis, dcaXyAxis, dcaZAxis}); - } else { - hDcaXYZPrm[i] = histos.add(Form("dcaprm/neg/%s", pN[i]), pTCharge[i], kTH3D, {ptAxis, dcaXyAxis, dcaZAxis}); - hDcaXYZStr[i] = histos.add(Form("dcastr/neg/%s", pN[i]), pTCharge[i], kTH3D, {ptAxis, dcaXyAxis, dcaZAxis}); - hDcaXYZMat[i] = histos.add(Form("dcamat/neg/%s", pN[i]), pTCharge[i], kTH3D, {ptAxis, dcaXyAxis, dcaZAxis}); - } + hDcaXYZPrm[i] = histos.add(Form("dcaprm/%s/%s", (i < Np) ? "pos" : "neg", pN[i % Np]), pTCharge[i], kTH3D, {ptAxis, dcaXyAxis, dcaZAxis}); + hDcaXYZStr[i] = histos.add(Form("dcastr/%s/%s", (i < Np) ? "pos" : "neg", pN[i % Np]), pTCharge[i], kTH3D, {ptAxis, dcaXyAxis, dcaZAxis}); + hDcaXYZMat[i] = histos.add(Form("dcamat/%s/%s", (i < Np) ? "pos" : "neg", pN[i % Np]), pTCharge[i], kTH3D, {ptAxis, dcaXyAxis, dcaZAxis}); if (enableDcaGoodEvents) { histos.add(hdcaxyprmgoodevs[i].data(), pTCharge[i], kTH3D, {ptAxis, dcaXyAxis, dcaZAxis}); } @@ -755,7 +745,7 @@ struct tofSpectra { histos.fill(HIST(hnsigmatof[id]), track.pt(), nsigmaTOF, multiplicity, track.dcaXY(), track.dcaZ(), track.eta()); // RD } else { // RD histos.fill(HIST(hnsigmatof[id + Np]), track.pt(), nsigmaTOF, multiplicity, track.dcaXY(), track.dcaZ(), track.eta()); // RD - } // RD + } // RD } else { if (track.sign() > 0) { histos.fill(HIST(hnsigmatof[id]), track.pt(), nsigmaTOF, multiplicity); From 99eebef24f51560b6466b773c0292732299e8366 Mon Sep 17 00:00:00 2001 From: ALICE Builder Date: Sat, 8 Jun 2024 11:15:40 +0200 Subject: [PATCH 4/6] Please consider the following formatting changes (#6431) --- PWGLF/Tasks/Nuspex/spectraTOF.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Nuspex/spectraTOF.cxx b/PWGLF/Tasks/Nuspex/spectraTOF.cxx index 39c10c31e0f..8eaa68d65cd 100644 --- a/PWGLF/Tasks/Nuspex/spectraTOF.cxx +++ b/PWGLF/Tasks/Nuspex/spectraTOF.cxx @@ -745,7 +745,7 @@ struct tofSpectra { histos.fill(HIST(hnsigmatof[id]), track.pt(), nsigmaTOF, multiplicity, track.dcaXY(), track.dcaZ(), track.eta()); // RD } else { // RD histos.fill(HIST(hnsigmatof[id + Np]), track.pt(), nsigmaTOF, multiplicity, track.dcaXY(), track.dcaZ(), track.eta()); // RD - } // RD + } // RD } else { if (track.sign() > 0) { histos.fill(HIST(hnsigmatof[id]), track.pt(), nsigmaTOF, multiplicity); From c7652fe40a8b46524b7bc73cca1961b6ac8dce9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Sat, 8 Jun 2024 11:56:05 +0200 Subject: [PATCH 5/6] Update spectraTOF.h --- PWGLF/DataModel/spectraTOF.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGLF/DataModel/spectraTOF.h b/PWGLF/DataModel/spectraTOF.h index 4e8f3d20155..68c76ec3831 100644 --- a/PWGLF/DataModel/spectraTOF.h +++ b/PWGLF/DataModel/spectraTOF.h @@ -48,12 +48,13 @@ static constexpr int NCharges = 2; static constexpr PID::ID NpCharge = Np * NCharges; static constexpr const char* pT[Np] = {"e", "#mu", "#pi", "K", "p", "d", "t", "{}^{3}He", "#alpha"}; static constexpr const char* pN[Np] = {"el", "mu", "pi", "ka", "pr", "de", "tr", "he", "al"}; -static constexpr const char* cN[Np] = {"pos", "neg"}; +static constexpr const char* cN[NCharges] = {"pos", "neg"}; static constexpr const char* pTCharge[NpCharge] = {"e^{-}", "#mu^{-}", "#pi^{+}", "K^{+}", "p", "d", "t", "{}^{3}He", "#alpha", "e^{+}", "#mu^{+}", "#pi^{-}", "K^{-}", "#bar{p}", "#bar{d}", "#bar{t}", "{}^{3}#bar{He}", "#bar{#alpha}"}; static constexpr int PDGs[NpCharge] = {kElectron, kMuonMinus, kPiPlus, kKPlus, kProton, 1000010020, 1000010030, 1000020030, 1000020040, -kElectron, -kMuonMinus, -kPiPlus, -kKPlus, -kProton, -1000010020, -1000010030, -1000020030, -1000020040}; +std::shared_ptr hMultiplicityvsPercentile; static constexpr std::string_view hnsigmatpctof[NpCharge] = {"nsigmatpctof/pos/el", "nsigmatpctof/pos/mu", "nsigmatpctof/pos/pi", "nsigmatpctof/pos/ka", "nsigmatpctof/pos/pr", "nsigmatpctof/pos/de", "nsigmatpctof/pos/tr", "nsigmatpctof/pos/he", "nsigmatpctof/pos/al", From 615a9bd8dd01bb5e958e9ed43c8f5ef2e2e1bab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Sat, 8 Jun 2024 12:00:50 +0200 Subject: [PATCH 6/6] Update spectraTOF.h --- PWGLF/DataModel/spectraTOF.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGLF/DataModel/spectraTOF.h b/PWGLF/DataModel/spectraTOF.h index 68c76ec3831..959a7f41fa4 100644 --- a/PWGLF/DataModel/spectraTOF.h +++ b/PWGLF/DataModel/spectraTOF.h @@ -19,6 +19,8 @@ #ifndef PWGLF_DATAMODEL_SPECTRATOF_H_ #define PWGLF_DATAMODEL_SPECTRATOF_H_ +#include + // O2 includes #include "ReconstructionDataFormats/Track.h" #include "Framework/runDataProcessing.h"