You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PWGJE/TableProducer/emcalCorrectionTask.cxx
+31-27Lines changed: 31 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@
22
22
#include<string>
23
23
#include<tuple>
24
24
#include<vector>
25
+
#include<random>
25
26
26
27
#include"CCDB/BasicCCDBManager.h"
27
28
#include"Framework/runDataProcessing.h"
@@ -90,7 +91,7 @@ struct EmcalCorrectionTask {
90
91
Configurable<float> exoticCellInCrossMinAmplitude{"exoticCellInCrossMinAmplitude", 0.1, "Minimum energy of cells in cross, if lower not considered in cross"};
91
92
Configurable<bool> useWeightExotic{"useWeightExotic", false, "States if weights should be used for exotic cell cut"};
92
93
Configurable<bool> isMC{"isMC", false, "States if run over MC"};
93
-
Configurable<int> applyCellTimeShift{"applyCellTimeShift", 0, "apply shift to the cell time for data and MC; For data: 0 = off; non-zero = log function extracted from data - For MC: 0 = off; 1 = const shift; 2 = eta-dependent shift"};
94
+
Configurable<bool> applyCellTimeCorrection{"applyCellTimeCorrection", true, "apply a correction to the cell time for data and MC: Shift both average cell times to 0 and smear MC time distribution to fit data better"};
return -15.f; // roughly calculated by assuming particles travel with v=c (photons) and EMCal is 4.4m away from vertex
808
-
} elseif (applyCellTimeShift == 2) { // eta dependent shift ( as larger eta values are further away from collision point)
809
-
// Use distance between vertex and EMCal (at eta = 0) and distance on EMCal surface (cell size times column) to calculate distance to cell
810
-
// 0.2 is cell size in m (0.06) divided by the speed of light in m/ns (0.3)
811
-
// 47.5 is the "middle" of the EMCal (2*48 cells in one column)
812
-
float timeCol = 0.2f * (geometry->GlobalCol(cellID) - 47.5f); // calculate time to get to specific column
813
-
float time = -sqrt(215.f + timeCol * timeCol); // 215 is 14.67ns^2 (time it takes to get the cell at eta = 0)
814
-
LOG(debug) << "shift the cell time by " << time << " applyCellTimeShift " << applyCellTimeShift;
815
-
return time;
816
-
} else {
817
-
return0.f;
818
-
}
819
-
} else { // data
820
-
if (applyCellTimeShift != 0) {
821
-
if (cellEnergy < 0.3) // Cells with tless than 300 MeV cannot be the leading cell in the cluster, so their time does not require precise calibration
822
-
return0.f;
823
-
elseif (cellEnergy < 4.) // Low energy regime
824
-
return (0.57284 + 0.82194 * TMath::Log(1.30651 * cellEnergy)); // Parameters extracted from LHC22o (pp), but also usable for other periods
825
-
else// High energy regime
826
-
return (-0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy)); // Parameters extracted from LHC22o (pp), but also usable for other periods
827
-
} else { // Dont apply cell time shift if applyCellTimeShift == 0
828
-
return0.f;
829
-
}
818
+
// Shift the time to 0, as the TOF was simulated -> eta dependent shift (as larger eta values are further away from collision point)
819
+
// Use distance between vertex and EMCal (at eta = 0) and distance on EMCal surface (cell size times column) to calculate distance to cell
820
+
// 0.2 is cell size in m (0.06) divided by the speed of light in m/ns (0.3) - 47.5 is the "middle" of the EMCal (2*48 cells in one column)
821
+
float timeCol = 0.2f * (geometry->GlobalCol(cellID) - 47.5f); // calculate time to get to specific column
822
+
timeshift = -sqrt(215.f + timeCol * timeCol); // 215 is 14.67ns^2 (time it takes to get the cell at eta = 0)
823
+
// Also smear the time to account for the broader time resolution in data than in MC
824
+
timesmear = normalgaus(rdgen) * (1.6 + 9.5 * TMath::Exp(-3. * cellEnergy)); // Parameters extracted from LHC22o (pp), but also usable for other periods
825
+
} else { // data
826
+
if (cellEnergy < 0.3) // Cells with tless than 300 MeV cannot be the leading cell in the cluster, so their time does not require precise calibration
827
+
timeshift = 0.;
828
+
elseif (cellEnergy < 4.) // Low energy regime
829
+
timeshift = 0.57284 + 0.82194 * TMath::Log(1.30651 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods
830
+
else// High energy regime
831
+
timeshift = -0.05858 + 1.50593 * TMath::Log(0.97591 * cellEnergy); // Parameters extracted from LHC22o (pp), but also usable for other periods
830
832
}
833
+
LOG(debug) << "Shift the cell time by " << timeshift << " + " << timesmear << " ns";
0 commit comments