Reconstructing and binning centrality in heavy-ion events

Introduction

On this page the instructions for using the centrality object are summarized.

For questions please connect to the centrality meetings on Wednesday 2 pm (Geneva time): GlobalObservables2018

For experts and developers: SWGuideHeavyIonCentralityExpert

Links

Twiki

Documents

  • pPb 5.02 TeV : AN-13-060
  • PbPb 5.02 TeV : AN-15-080
  • pPb 8.12 TeV : AN-16-416
  • XeXe 5.44 TeV : AN-17-305
  • PbPb 5.02 TeV taken in 2018 : AN-18-287

Ncoll/Npart 5TeV

  • Link to the numbers, on S3: pdf
  • Find Ncoll in a hiBin ([0,199]), ( example: .x findNcoll.C(1) ):
float findNcoll(int hiBin) {
   const int nbins = 200;
   const float Ncoll[nbins] = {1976.95, 1944.02, 1927.29, 1891.9, 1845.3, 1807.2, 1760.45, 1729.18, 1674.8, 1630.3, 1590.52, 1561.72, 1516.1, 1486.5, 1444.68, 1410.88, 1376.4, 1347.32, 1309.71, 1279.98, 1255.31, 1219.89, 1195.13, 1165.96, 1138.92, 1113.37, 1082.26, 1062.42, 1030.6, 1009.96, 980.229, 955.443, 936.501, 915.97, 892.063, 871.289, 847.364, 825.127, 806.584, 789.163, 765.42, 751.187, 733.001, 708.31, 690.972, 677.711, 660.682, 640.431, 623.839, 607.456, 593.307, 576.364, 560.967, 548.909, 530.475, 519.575, 505.105, 490.027, 478.133, 462.372, 451.115, 442.642, 425.76, 416.364, 405.154, 392.688, 380.565, 371.167, 360.28, 348.239, 340.587, 328.746, 320.268, 311.752, 300.742, 292.172, 281.361, 274.249, 267.025, 258.625, 249.931, 240.497, 235.423, 228.63, 219.854, 214.004, 205.425, 199.114, 193.618, 185.644, 180.923, 174.289, 169.641, 161.016, 157.398, 152.151, 147.425, 140.933, 135.924, 132.365, 127.017, 122.127, 117.817, 113.076, 109.055, 105.16, 101.323, 98.098, 95.0548, 90.729, 87.6495, 84.0899, 80.2237, 77.2201, 74.8848, 71.3554, 68.7745, 65.9911, 63.4136, 61.3859, 58.1903, 56.4155, 53.8486, 52.0196, 49.2921, 47.0735, 45.4345, 43.8434, 41.7181, 39.8988, 38.2262, 36.4435, 34.8984, 33.4664, 31.8056, 30.351, 29.2074, 27.6924, 26.7754, 25.4965, 24.2802, 22.9651, 22.0059, 21.0915, 19.9129, 19.1041, 18.1487, 17.3218, 16.5957, 15.5323, 14.8035, 14.2514, 13.3782, 12.8667, 12.2891, 11.61, 11.0026, 10.3747, 9.90294, 9.42648, 8.85324, 8.50121, 7.89834, 7.65197, 7.22768, 6.7755, 6.34855, 5.98336, 5.76555, 5.38056, 5.11024, 4.7748, 4.59117, 4.23247, 4.00814, 3.79607, 3.68702, 3.3767, 3.16309, 2.98282, 2.8095, 2.65875, 2.50561, 2.32516, 2.16357, 2.03235, 1.84061, 1.72628, 1.62305, 1.48916, 1.38784, 1.28366, 1.24693, 1.18552, 1.16085, 1.12596, 1.09298, 1.07402, 1.06105, 1.02954};
   return Ncoll[hiBin];
}
  • Find Npart in a hiBin ([0,199]), ( example: .x findNpart.C(1) ):
float findNpart(int hiBin) {
   const int nbins = 200;
   const float Npart[nbins] = {401.99, 398.783, 396.936, 392.71, 387.901, 383.593, 377.914, 374.546, 367.507, 361.252, 356.05, 352.43, 345.701, 341.584, 335.148, 330.581, 325.135, 320.777, 315.074, 310.679, 306.687, 301.189, 296.769, 291.795, 287.516, 283.163, 277.818, 274.293, 269.29, 265.911, 260.574, 256.586, 252.732, 249.194, 245.011, 241.292, 236.715, 232.55, 229.322, 225.328, 221.263, 218.604, 214.728, 210.554, 206.878, 203.924, 200.84, 196.572, 193.288, 189.969, 186.894, 183.232, 180.24, 177.36, 174.008, 171.222, 168.296, 165.319, 162.013, 158.495, 156.05, 154.218, 150.559, 148.455, 145.471, 142.496, 139.715, 137.395, 134.469, 131.926, 129.817, 127.045, 124.467, 122.427, 119.698, 117.607, 114.543, 112.662, 110.696, 108.294, 105.777, 103.544, 101.736, 99.943, 97.4951, 95.4291, 93.2148, 91.2133, 89.5108, 87.2103, 85.7498, 83.5134, 81.9687, 79.7456, 78.1684, 76.4873, 74.7635, 72.761, 71.0948, 69.6102, 67.7806, 66.2215, 64.5813, 63.0269, 61.4325, 59.8065, 58.2423, 57.2432, 55.8296, 54.2171, 52.8809, 51.3254, 49.9902, 48.6927, 47.5565, 46.136, 44.8382, 43.6345, 42.3964, 41.4211, 39.9681, 39.178, 37.9341, 36.9268, 35.5626, 34.5382, 33.6912, 32.8156, 31.6695, 30.6552, 29.7015, 28.8655, 27.9609, 27.0857, 26.105, 25.3163, 24.4872, 23.6394, 23.0484, 22.2774, 21.4877, 20.5556, 19.9736, 19.3296, 18.5628, 17.916, 17.2928, 16.6546, 16.1131, 15.4013, 14.8264, 14.3973, 13.7262, 13.2853, 12.8253, 12.2874, 11.7558, 11.2723, 10.8829, 10.4652, 9.96477, 9.6368, 9.09316, 8.84175, 8.48084, 8.05694, 7.64559, 7.29709, 7.07981, 6.70294, 6.45736, 6.10284, 5.91788, 5.5441, 5.33311, 5.06641, 4.96415, 4.6286, 4.38214, 4.2076, 4.01099, 3.81054, 3.63854, 3.43403, 3.23244, 3.08666, 2.86953, 2.74334, 2.62787, 2.48354, 2.38115, 2.26822, 2.23137, 2.1665, 2.14264, 2.10636, 2.07358, 2.05422, 2.04126, 2.00954};
   return Npart[hiBin];
}
  • Find average Ncoll in a range of hiBin([0,199]), ( example: .x findNcollAverage.C(0, 10) will give the <Ncoll> in 0-5%) :
float findNcollAverage(int hiBinLow, int hiBinHigh) {
   float w=0;
   const int nbins = 200;
   const float Ncoll[nbins] = {1976.95, 1944.02, 1927.29, 1891.9, 1845.3, 1807.2, 1760.45, 1729.18, 1674.8, 1630.3, 1590.52, 1561.72, 1516.1, 1486.5, 1444.68, 1410.88, 1376.4, 1347.32, 1309.71, 1279.98, 1255.31, 1219.89, 1195.13, 1165.96, 1138.92, 1113.37, 1082.26, 1062.42, 1030.6, 1009.96, 980.229, 955.443, 936.501, 915.97, 892.063, 871.289, 847.364, 825.127, 806.584, 789.163, 765.42, 751.187, 733.001, 708.31, 690.972, 677.711, 660.682, 640.431, 623.839, 607.456, 593.307, 576.364, 560.967, 548.909, 530.475, 519.575, 505.105, 490.027, 478.133, 462.372, 451.115, 442.642, 425.76, 416.364, 405.154, 392.688, 380.565, 371.167, 360.28, 348.239, 340.587, 328.746, 320.268, 311.752, 300.742, 292.172, 281.361, 274.249, 267.025, 258.625, 249.931, 240.497, 235.423, 228.63, 219.854, 214.004, 205.425, 199.114, 193.618, 185.644, 180.923, 174.289, 169.641, 161.016, 157.398, 152.151, 147.425, 140.933, 135.924, 132.365, 127.017, 122.127, 117.817, 113.076, 109.055, 105.16, 101.323, 98.098, 95.0548, 90.729, 87.6495, 84.0899, 80.2237, 77.2201, 74.8848, 71.3554, 68.7745, 65.9911, 63.4136, 61.3859, 58.1903, 56.4155, 53.8486, 52.0196, 49.2921, 47.0735, 45.4345, 43.8434, 41.7181, 39.8988, 38.2262, 36.4435, 34.8984, 33.4664, 31.8056, 30.351, 29.2074, 27.6924, 26.7754, 25.4965, 24.2802, 22.9651, 22.0059, 21.0915, 19.9129, 19.1041, 18.1487, 17.3218, 16.5957, 15.5323, 14.8035, 14.2514, 13.3782, 12.8667, 12.2891, 11.61, 11.0026, 10.3747, 9.90294, 9.42648, 8.85324, 8.50121, 7.89834, 7.65197, 7.22768, 6.7755, 6.34855, 5.98336, 5.76555, 5.38056, 5.11024, 4.7748, 4.59117, 4.23247, 4.00814, 3.79607, 3.68702, 3.3767, 3.16309, 2.98282, 2.8095, 2.65875, 2.50561, 2.32516, 2.16357, 2.03235, 1.84061, 1.72628, 1.62305, 1.48916, 1.38784, 1.28366, 1.24693, 1.18552, 1.16085, 1.12596, 1.09298, 1.07402, 1.06105, 1.02954};
   for(int i=hiBinLow; i<hiBinHigh; i++)  w+=Ncoll[i]/(hiBinHigh-hiBinLow);
   return w;
}
  • Find average Npart in a range of hiBin([0,199]), ( example: .x findNpartAverage.C(0, 10) will give the <Npart> in 0-5% ) :
float findNpartAverage(int hiBinLow, int hiBinHigh) {
   float w=0;
   const int nbins = 200;
   const float Npart[nbins] = {401.99, 398.783, 396.936, 392.71, 387.901, 383.593, 377.914, 374.546, 367.507, 361.252, 356.05, 352.43, 345.701, 341.584, 335.148, 330.581, 325.135, 320.777, 315.074, 310.679, 306.687, 301.189, 296.769, 291.795, 287.516, 283.163, 277.818, 274.293, 269.29, 265.911, 260.574, 256.586, 252.732, 249.194, 245.011, 241.292, 236.715, 232.55, 229.322, 225.328, 221.263, 218.604, 214.728, 210.554, 206.878, 203.924, 200.84, 196.572, 193.288, 189.969, 186.894, 183.232, 180.24, 177.36, 174.008, 171.222, 168.296, 165.319, 162.013, 158.495, 156.05, 154.218, 150.559, 148.455, 145.471, 142.496, 139.715, 137.395, 134.469, 131.926, 129.817, 127.045, 124.467, 122.427, 119.698, 117.607, 114.543, 112.662, 110.696, 108.294, 105.777, 103.544, 101.736, 99.943, 97.4951, 95.4291, 93.2148, 91.2133, 89.5108, 87.2103, 85.7498, 83.5134, 81.9687, 79.7456, 78.1684, 76.4873, 74.7635, 72.761, 71.0948, 69.6102, 67.7806, 66.2215, 64.5813, 63.0269, 61.4325, 59.8065, 58.2423, 57.2432, 55.8296, 54.2171, 52.8809, 51.3254, 49.9902, 48.6927, 47.5565, 46.136, 44.8382, 43.6345, 42.3964, 41.4211, 39.9681, 39.178, 37.9341, 36.9268, 35.5626, 34.5382, 33.6912, 32.8156, 31.6695, 30.6552, 29.7015, 28.8655, 27.9609, 27.0857, 26.105, 25.3163, 24.4872, 23.6394, 23.0484, 22.2774, 21.4877, 20.5556, 19.9736, 19.3296, 18.5628, 17.916, 17.2928, 16.6546, 16.1131, 15.4013, 14.8264, 14.3973, 13.7262, 13.2853, 12.8253, 12.2874, 11.7558, 11.2723, 10.8829, 10.4652, 9.96477, 9.6368, 9.09316, 8.84175, 8.48084, 8.05694, 7.64559, 7.29709, 7.07981, 6.70294, 6.45736, 6.10284, 5.91788, 5.5441, 5.33311, 5.06641, 4.96415, 4.6286, 4.38214, 4.2076, 4.01099, 3.81054, 3.63854, 3.43403, 3.23244, 3.08666, 2.86953, 2.74334, 2.62787, 2.48354, 2.38115, 2.26822, 2.23137, 2.1665, 2.14264, 2.10636, 2.07358, 2.05422, 2.04126, 2.00954};
   for(int i=hiBinLow; i<hiBinHigh; i++)  w+=Npart[i]/(hiBinHigh-hiBinLow);
   return w;
}
  • These numbers and systematic errors will be discussed in the analysis note: CMS AN-2015/080

Number of minimum bias (Nmb)

PbPb Data 2018

  • Number of MB events "in 0-90%" are obtained taking the average of MB PD0-5 with removing EM contamination in peripheral events.
  • Note 90-100% is not removed. Events in differential centrality classes should be corrected for 90% e.g. # of MB events in 0-20% = N_MB x 0.2/0.9
  • Nominal Unc. from EM contamination Unc. from centrality calibration Total Unc.
    Golden JSON 11775759052 1.103% 0.611% 1.261%


  • Nominal Unc. from EM contamination Unc. from centrality calibration Total Unc.
    Muon JSON 11968044281 1.103% 0.611% 1.261%


  • 70-80% 80-90%
    EM contribution 3.898% 6.033%


Event selection

PbPb Data 2018

  • Event selection in forest : pprimaryVertexFilter && phfCoincFilter2Th4 && pclusterCompatibilityFilter
  • The instruction is below
    - Please refer to here for the detailed instruction about the new primary vertex filter

    Setup

    cmsrel CMSSW_10_3_1_patch2
    cd CMSSW_10_3_1_patch2/src
    cmsenv
    git cms-merge-topic -u CmsHI:forest_CMSSW_10_3_1
    scram b -j4


    In config file

process.load("RecoVertex.PrimaryVertexProducer.OfflinePrimaryVerticesRecovery_cfi")

process.ana_step = cms.Path(
process.offlinePrimaryVerticesRecovery +
process.HiForest + ...

process.load('HeavyIonsAnalysis.EventAnalysis.skimanalysis_cfi')
process.load('HeavyIonsAnalysis.Configuration.collisionEventSelection_cff')
process.pclusterCompatibilityFilter = cms.Path(process.clusterCompatibilityFilter)
process.pprimaryVertexFilter = cms.Path(process.primaryVertexFilter)
process.collisionEventSelectionAOD = cms.Path(process.collisionEventSelectionAOD)
process.collisionEventSelectionAODv2 = cms.Path(process.collisionEventSelectionAODv2)
 
process.load('HeavyIonsAnalysis.Configuration.hfCoincFilter_cff')
process.phfCoincFilter3Th3 = cms.Path(process.hfCoincFilter3Th3)
process.phfCoincFilter2Th4 = cms.Path(process.hfCoincFilter2Th4)
 
process.pAna = cms.EndPath(process.skimanalysis)

and put the below three lines at the very last of the config.

from HLTrigger.Configuration.CustomConfigs import MassReplaceInputTag
process = MassReplaceInputTag(process,"offlinePrimaryVertices","offlinePrimaryVerticesRecovery")
process.offlinePrimaryVerticesRecovery.oldVertexLabel = "offlinePrimaryVertices"
  • Event Selection Efficiency+Contamination = 97.5 % (+1.0 % -0.5 %)

XeXe Data

  • FINAL event selection: HLT_HIL1MinimumBiasHF_OR_SinglePixelTrack_part* && pPAprimaryVertexFilter && pBeamScrapingFilter && phfCoincFilter3

pPb Data

pp Data (same as 2015 and 2017)

Instructions for 10_X_Y

PbPb Data (103X)

Centrality tables

Nominal

hiHF bin edges: {0, 10.5072, 11.2099, 11.8364, 12.478, 13.1194, 13.7623, 14.4081, 15.0709, 15.7532, 16.4673, 17.1881, 17.923, 18.673, 19.4865, 20.3033, 21.1536, 22.0086, 22.9046, 23.8196, 24.7924, 25.8082, 26.8714, 27.9481, 29.0828, 30.2757, 31.5043, 32.8044, 34.1572, 35.6142, 37.1211, 38.6798, 40.3116, 42.0398, 43.8572, 45.6977, 47.6312, 49.6899, 51.815, 54.028, 56.3037, 58.7091, 61.2024, 63.8353, 66.5926, 69.3617, 72.2068, 75.2459, 78.3873, 81.5916, 84.9419, 88.498, 92.1789, 95.9582, 99.8431, 103.739, 107.78, 111.97, 116.312, 120.806, 125.46, 130.269, 135.247, 140.389, 145.713, 151.212, 156.871, 162.729, 168.762, 174.998, 181.424, 188.063, 194.907, 201.942, 209.19, 216.683, 224.37, 232.291, 240.43, 248.807, 257.416, 266.256, 275.348, 284.668, 294.216, 304.053, 314.142, 324.488, 335.101, 345.974, 357.116, 368.547, 380.283, 392.29, 404.564, 417.122, 429.968, 443.116, 456.577, 470.357, 484.422, 498.78, 513.473, 528.479, 543.813, 559.445, 575.411, 591.724, 608.352, 625.344, 642.686, 660.361, 678.371, 696.749, 715.485, 734.608, 754.068, 773.846, 794.046, 814.649, 835.608, 856.972, 878.719, 900.887, 923.409, 946.374, 969.674, 993.435, 1017.62, 1042.21, 1067.28, 1092.72, 1118.64, 1144.96, 1171.71, 1198.98, 1226.67, 1254.82, 1283.46, 1312.65, 1342.21, 1372.27, 1402.85, 1433.93, 1465.49, 1497.62, 1530.29, 1563.49, 1597.22, 1631.49, 1666.37, 1701.8, 1737.75, 1774.35, 1811.51, 1849.29, 1887.75, 1926.79, 1966.6, 2006.97, 2047.99, 2089.71, 2132.1, 2175.23, 2219.17, 2263.72, 2309.2, 2355.43, 2402.47, 2450.33, 2499.05, 2548.66, 2599.16, 2650.59, 2703.03, 2756.32, 2810.75, 2866.27, 2922.91, 2980.54, 3039.47, 3099.53, 3160.98, 3223.66, 3287.71, 3353.18, 3420.34, 3489.13, 3559.72, 3632.06, 3706.18, 3782.42, 3860.78, 3941.42, 4024.52, 4110.27, 4199.4, 4292.8, 4394.49, 4519.52, 5199.95}

Systematics (Down)

hiHF bin edges for sysDown: {0, 10.5071, 11.2094, 11.8357, 12.4763, 13.117, 13.7597, 14.4049, 15.0671, 15.7491, 16.4622, 17.1812, 17.9144, 18.6674, 19.4797, 20.2963, 21.1435, 21.9974, 22.8928, 23.8068, 24.7805, 25.7931, 26.8556, 27.9308, 29.0638, 30.2582, 31.4795, 32.7816, 34.1349, 35.5834, 37.0941, 38.6474, 40.2782, 42.0035, 43.8112, 45.6576, 47.5758, 49.6381, 51.6667, 53.7353, 55.8903, 58.1259, 60.4528, 62.8712, 65.3859, 67.9968, 70.7065, 73.5231, 76.4519, 79.4922, 82.6461, 85.9264, 89.3269, 92.8562, 96.5212, 100.322, 104.262, 108.344, 112.585, 116.971, 121.521, 126.225, 131.09, 136.127, 141.328, 146.721, 152.284, 158.014, 163.935, 170.054, 176.372, 182.878, 189.602, 196.532, 203.653, 211.017, 218.599, 226.387, 234.418, 242.667, 251.16, 259.886, 268.852, 278.071, 287.498, 297.2, 307.184, 317.409, 327.894, 338.66, 349.686, 360.996, 372.607, 384.508, 396.669, 409.133, 421.86, 434.906, 448.258, 461.916, 475.906, 490.16, 504.74, 519.663, 534.911, 550.453, 566.322, 582.525, 599.08, 615.968, 633.211, 650.805, 668.76, 687.048, 705.707, 724.774, 744.163, 763.9, 783.999, 804.528, 825.432, 846.746, 868.429, 890.523, 913.007, 935.952, 959.211, 982.919, 1007.08, 1031.63, 1056.62, 1082.08, 1107.96, 1134.24, 1160.99, 1188.22, 1215.91, 1244.06, 1272.69, 1301.85, 1331.45, 1361.51, 1392.07, 1423.18, 1454.77, 1486.93, 1519.57, 1552.81, 1586.55, 1620.87, 1655.79, 1691.26, 1727.27, 1763.93, 1801.12, 1838.97, 1877.47, 1916.61, 1956.45, 1996.89, 2038.04, 2079.84, 2122.35, 2165.52, 2209.53, 2254.24, 2299.83, 2346.19, 2393.31, 2441.28, 2490.16, 2539.86, 2590.57, 2642.16, 2694.74, 2748.23, 2802.81, 2858.47, 2915.33, 2973.2, 3032.28, 3092.56, 3154.24, 3217.19, 3281.45, 3347.18, 3414.6, 3483.65, 3554.56, 3627.2, 3701.66, 3778.25, 3856.97, 3937.98, 4021.48, 4107.62, 4197.21, 4291.05, 4393.19, 4518.6, 5199.95}

Systematics (Up)

hiHF bin edges for sysUp: {0, 10.5075, 11.2107, 11.838, 12.4797, 13.1213, 13.7641, 14.4124, 15.0745, 15.7577, 16.473, 17.1939, 17.9297, 18.6812, 19.4958, 20.3143, 21.1648, 22.0218, 22.9159, 23.8328, 24.8059, 25.8204, 26.89, 27.9702, 29.1042, 30.3022, 31.528, 32.8347, 34.1896, 35.6439, 37.1542, 38.7172, 40.3518, 42.091, 43.9053, 45.7415, 47.6853, 49.7457, 51.8755, 54.0983, 56.3594, 58.7848, 61.2861, 63.9228, 66.6825, 69.4421, 72.297, 75.3547, 78.4967, 81.6977, 85.0755, 88.6211, 92.3058, 96.1071, 99.9975, 104.065, 108.272, 112.512, 116.906, 121.601, 126.465, 131.482, 136.866, 142.229, 147.786, 153.546, 159.571, 165.586, 171.902, 178.419, 185.063, 191.856, 199.055, 206.261, 213.999, 221.719, 229.671, 237.84, 246.088, 254.828, 263.883, 272.907, 282.236, 291.925, 301.519, 311.477, 321.691, 332.153, 342.892, 353.878, 365.161, 376.742, 388.577, 400.684, 413.075, 425.746, 438.711, 451.989, 465.556, 479.45, 493.608, 508.077, 522.891, 538.003, 553.415, 569.151, 585.216, 601.601, 618.354, 635.422, 652.84, 670.599, 688.699, 707.161, 726.014, 745.185, 764.687, 784.557, 804.838, 825.489, 846.537, 867.951, 889.752, 911.955, 934.588, 957.52, 980.912, 1004.73, 1028.94, 1053.57, 1078.67, 1104.17, 1130.07, 1156.39, 1183.2, 1210.47, 1238.17, 1266.38, 1295.02, 1324.16, 1353.71, 1383.77, 1414.35, 1445.41, 1477, 1509.09, 1541.74, 1574.88, 1608.59, 1642.83, 1677.66, 1713.07, 1748.98, 1785.47, 1822.63, 1860.33, 1898.72, 1937.73, 1977.42, 2017.71, 2058.62, 2100.25, 2142.57, 2185.56, 2229.38, 2273.91, 2319.2, 2365.33, 2412.22, 2459.94, 2508.52, 2557.98, 2608.35, 2659.61, 2711.86, 2765, 2819.23, 2874.58, 2930.97, 2988.46, 3047.12, 3106.95, 3168.15, 3230.6, 3294.37, 3359.58, 3426.47, 3494.95, 3565.21, 3637.21, 3711.03, 3786.91, 3864.85, 3945.11, 4027.8, 4113.06, 4201.73, 4294.72, 4395.9, 4520.5, 5199.95}

Instructions

In the forest
  • using an extension of the global tag: In config file change the global tag
    "CentralityTable_HFtowers200_DataPbPb_periHYDJETshape_run2v1033p1x01_offline" for nominal,
    "CentralityTable_HFtowers200_DataPbPb_periHYDJETshape_run2v1033p1x01_sysDown_offline" for sysDown,
    "CentralityTable_HFtowers200_DataPbPb_periHYDJETshape_run2v1033p1x01_sysUp_offline" for sysUp
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, '103X_dataRun2_Prompt_v2', '')
process.HiForest.GlobalTagLabel = process.GlobalTag.globaltag

print('\n\033[31m~*~ USING CENTRALITY TABLE FOR PbPb 2018 DATA ~*~\033[0m\n')
process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")
process.GlobalTag.toGet.extend([
    cms.PSet(record = cms.string("HeavyIonRcd"),
        tag = cms.string("CentralityTable_HFtowers200_DataPbPb_periHYDJETshape_run2v1033p1x01_offline"),
        connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS"),
        label = cms.untracked.string("HFtowers")
        ),
    ])

from HeavyIonsAnalysis.Configuration.CommonFunctions_cff import overrideJEC_PbPb5020
process = overrideJEC_PbPb5020(process)

process.load("RecoHI.HiCentralityAlgos.CentralityBin_cfi")
process.centralityBin.Centrality = cms.InputTag("hiCentrality")
process.centralityBin.centralityVariable = cms.string("HFtowers")

Using the hiHF tables

In your code instead of centBin = hiBin use the three tables mentioned above in the following way

const Int_t nBins = 200; // table of bin edges
const Double_t binTable[nBins+1] = {0, 10.5072, 11.2099, 11.8364, 12.478, 13.1194, 13.7623, 14.4081, 15.0709, 15.7532, 16.4673, 17.1881, 17.923, 18.673, 19.4865, 20.3033, 21.1536, 22.0086, 22.9046, 23.8196, 24.7924, 25.8082, 26.8714, 27.9481, 29.0828, 30.2757, 31.5043, 32.8044, 34.1572, 35.6142, 37.1211, 38.6798, 40.3116, 42.0398, 43.8572, 45.6977, 47.6312, 49.6899, 51.815, 54.028, 56.3037, 58.7091, 61.2024, 63.8353, 66.5926, 69.3617, 72.2068, 75.2459, 78.3873, 81.5916, 84.9419, 88.498, 92.1789, 95.9582, 99.8431, 103.739, 107.78, 111.97, 116.312, 120.806, 125.46, 130.269, 135.247, 140.389, 145.713, 151.212, 156.871, 162.729, 168.762, 174.998, 181.424, 188.063, 194.907, 201.942, 209.19, 216.683, 224.37, 232.291, 240.43, 248.807, 257.416, 266.256, 275.348, 284.668, 294.216, 304.053, 314.142, 324.488, 335.101, 345.974, 357.116, 368.547, 380.283, 392.29, 404.564, 417.122, 429.968, 443.116, 456.577, 470.357, 484.422, 498.78, 513.473, 528.479, 543.813, 559.445, 575.411, 591.724, 608.352, 625.344, 642.686, 660.361, 678.371, 696.749, 715.485, 734.608, 754.068, 773.846, 794.046, 814.649, 835.608, 856.972, 878.719, 900.887, 923.409, 946.374, 969.674, 993.435, 1017.62, 1042.21, 1067.28, 1092.72, 1118.64, 1144.96, 1171.71, 1198.98, 1226.67, 1254.82, 1283.46, 1312.65, 1342.21, 1372.27, 1402.85, 1433.93, 1465.49, 1497.62, 1530.29, 1563.49, 1597.22, 1631.49, 1666.37, 1701.8, 1737.75, 1774.35, 1811.51, 1849.29, 1887.75, 1926.79, 1966.6, 2006.97, 2047.99, 2089.71, 2132.1, 2175.23, 2219.17, 2263.72, 2309.2, 2355.43, 2402.47, 2450.33, 2499.05, 2548.66, 2599.16, 2650.59, 2703.03, 2756.32, 2810.75, 2866.27, 2922.91, 2980.54, 3039.47, 3099.53, 3160.98, 3223.66, 3287.71, 3353.18, 3420.34, 3489.13, 3559.72, 3632.06, 3706.18, 3782.42, 3860.78, 3941.42, 4024.52, 4110.27, 4199.4, 4292.8, 4394.49, 4519.52, 5199.95};

Int_t getHiBinFromhiHF(const Double_t hiHF)
{
  Int_t binPos = -1;
  for(int i = 0; i < nBins; ++i){
    if(hiHF >= binTable[i] && hiHF < binTable[i+1]){
      binPos = i;
      break;
    }
  }

  binPos = nBins - 1 - binPos;

  return (Int_t)(200*((Double_t)binPos)/((Double_t)nBins));
}

.....
.....
centBin = getHiBinFromhiHF(hiHF)

PbPb Hydjet MC

  • not yet in GT, follow instructions below:

Drum5F Tune

In config file

process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff')

from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2018_realistic_hi', '') 
process.HiForest.GlobalTagLabel = process.GlobalTag.globaltag
process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")
process.GlobalTag.toGet.extend([
   cms.PSet(record = cms.string("HeavyIonRcd"),
      tag = cms.string("CentralityTable_HFtowers200_HydjetDrum5F_v1032x02_mc"),
      connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS"),
      label = cms.untracked.string("HFtowers")
   ),
])

Phase II MC (CP5 Tune)

In config file

process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff')

from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2018_realistic', '') 
process.HiForest.GlobalTagLabel = process.GlobalTag.globaltag
process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")
process.GlobalTag.toGet.extend([
   cms.PSet(record = cms.string("HeavyIonRcd"),
      tag = cms.string("CentralityTable_HFtowers200_HydjetTuneCP5MTD_v1040mtd4x1_mc"),
      connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS"),
      label = cms.untracked.string("HFtowers")
   ),
])


Cymbal5Ev8 Tune

In config file

process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff')

from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2018_realistic', '') 
process.HiForest.GlobalTagLabel = process.GlobalTag.globaltag
process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")
process.GlobalTag.toGet.extend([
   cms.PSet(record = cms.string("HeavyIonRcd"),
      tag = cms.string("CentralityTable_HFtowers200_HydjetCymbal5Ev8_v1020x01_mc"),
      connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS"),
      label = cms.untracked.string("HFtowers")
   ),
])


Drum5Ev8 Tune

In config file

process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff')

from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2018_realistic', '') 
process.HiForest.GlobalTagLabel = process.GlobalTag.globaltag
process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")
process.GlobalTag.toGet.extend([
   cms.PSet(record = cms.string("HeavyIonRcd"),
      tag = cms.string("CentralityTable_HFtowers200_HydjetDrum5Ev8_v1030pre5x02_mc"),
      connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS"),
      label = cms.untracked.string("HFtowers")
   ),
])


Cymbal5F Tune

In config file

process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff')

from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2018_realistic', '') 
process.HiForest.GlobalTagLabel = process.GlobalTag.globaltag
process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")
process.GlobalTag.toGet.extend([
   cms.PSet(record = cms.string("HeavyIonRcd"),
      tag = cms.string("CentralityTable_HFtowers200_HydjetCymbal5F_v1020x01_mc"),
      connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS"),
      label = cms.untracked.string("HFtowers")
   ),
])


Drum5F Tune

In config file

process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff')

from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2018_realistic', '') 
process.HiForest.GlobalTagLabel = process.GlobalTag.globaltag
process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")
process.GlobalTag.toGet.extend([
   cms.PSet(record = cms.string("HeavyIonRcd"),
      tag = cms.string("CentralityTable_HFtowers200_HydjetDrum5F_v1020x01_mc"),
      connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS"),
      label = cms.untracked.string("HFtowers")
   ),
])

Instructions for 9_X_Y

The centrality binning is done for 200 bins. Bin 0 means most central 0-0.5% events and increasing goes to more peripheral.

XeXe Data (94X)

  • Tags:
    • Nominal (eff+contam = 95%): CentralityTable _HFtowers200_DataXeXe_eff95_run2v941x02_offline
    • Systematics 1 (eff+contam = 92%): CentralityTable _HFtowers200_DataXeXe_effstep92a25_run2v941x01_offline
    • Systematics 2 (eff+contam = 98%): CentralityTable _HFtowers200_DataXeXe_effstep98a25_run2v941x01_offline

  • Tables not yet in GT, follow instructions below:

    In config file
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff')

from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, '94X_dataRun2_ReReco_EOY17_v2', '')
process.HiForest.GlobalTagLabel = process.GlobalTag.globaltag
process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")
process.GlobalTag.toGet.extend([
   cms.PSet(record = cms.string("HeavyIonRcd"),
      tag = cms.string("CentralityTable_HFtowers200_DataXeXe_eff95_run2v941x02_offline"),
      connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS"),
      label = cms.untracked.string("HFtowersEPOSLHC")
   ),
])

...

process.load('RecoHI.HiCentralityAlgos.HiCentrality_cfi')
process.hiCentrality.produceHFhits = False
process.hiCentrality.produceHFtowers = False
process.hiCentrality.produceEcalhits = False
process.hiCentrality.produceZDChits = False
process.hiCentrality.produceETmidRapidity = False
process.hiCentrality.producePixelhits = False
process.hiCentrality.produceTracks = False
process.hiCentrality.producePixelTracks = False
process.hiCentrality.reUseCentrality = True
process.hiCentrality.srcReUse = cms.InputTag("hiCentrality","","RECO")
process.hiCentrality.srcTracks = cms.InputTag("generalTracks")
process.hiCentrality.srcVertex = cms.InputTag("offlinePrimaryVertices")

process.load("RecoHI.HiCentralityAlgos.CentralityBin_cfi")
process.centralityBin.Centrality = cms.InputTag("hiCentrality")
process.centralityBin.centralityVariable = cms.string("HFtowers")
process.centralityBin.nonDefaultGlauberModel = cms.string("EPOSLHC")

...
process.hiEvtAnalyzer.doCentrality = cms.bool(True)

...

process.ana_step = cms.Path(
...
                            process.hiCentrality *
                            process.centralityBin *
                            process.hiEvtAnalyzer *
...)

XeXe Data (92X)

  • Table not yet in GT, follow instructions below:

    In config file
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff')

from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, '92X_dataRun2_Prompt_Candidate_forXeXe_v1', '')
process.HiForest.GlobalTagLabel = process.GlobalTag.globaltag
process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")
process.GlobalTag.toGet.extend([
   cms.PSet(record = cms.string("HeavyIonRcd"),
      tag = cms.string("CentralityTable_HFtowers200_DataXeXe_eff942_run2v9313x02_offline"),
      connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS"),
      label = cms.untracked.string("HFtowersCymbal5Ev8")
   ),
])

...

process.load('RecoHI.HiCentralityAlgos.HiCentrality_cfi')
process.hiCentrality.produceHFhits = False
process.hiCentrality.produceHFtowers = True
process.hiCentrality.produceEcalhits = False
process.hiCentrality.produceZDChits = False
process.hiCentrality.produceETmidRapidity = True
process.hiCentrality.producePixelhits = False
process.hiCentrality.produceTracks = True
process.hiCentrality.producePixelTracks = False
process.hiCentrality.reUseCentrality = False
process.hiCentrality.srcTracks = cms.InputTag("generalTracks")
process.hiCentrality.srcVertex = cms.InputTag("offlinePrimaryVertices")

process.load("RecoHI.HiCentralityAlgos.CentralityBin_cfi")
process.centralityBin.Centrality = cms.InputTag("hiCentrality")
process.centralityBin.centralityVariable = cms.string("HFtowers")
process.centralityBin.nonDefaultGlauberModel = cms.string("Cymbal5Ev8")

...
process.hiEvtAnalyzer.doCentrality = cms.bool(True)

...

process.ana_step = cms.Path(
...
                            process.hiCentrality *
                            process.centralityBin *
                            process.hiEvtAnalyzer *
...)

XeXe Hydjet MC (92X)

  • (5.44 TeV Hydjet Cymbal5Ev8 tune) not yet in GT, follow instructions below:

    In config file
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff')

from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, '91X_mcRun2_HeavyIon_v3', '') #for now track GT manually, since centrality tables updated ex post facto
process.HiForest.GlobalTagLabel = process.GlobalTag.globaltag
process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")
process.GlobalTag.toGet.extend([
   cms.PSet(record = cms.string("HeavyIonRcd"),
      tag = cms.string("CentralityTable_HFtowers200_XeXeHydjetCymbalEv8_v9213x01_mc"),
      connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS"),
      label = cms.untracked.string("HFtowersCymbal5Ev8")
   ),
])

...

process.load("RecoHI.HiCentralityAlgos.CentralityBin_cfi")
process.centralityBin.Centrality = cms.InputTag("hiCentrality")
process.centralityBin.centralityVariable = cms.string("HFtowers")
process.centralityBin.nonDefaultGlauberModel = cms.string("Cymbal5Ev8")

...

process.load('HeavyIonsAnalysis.EventAnalysis.hievtanalyzer_mc_cfi')
process.hiEvtAnalyzer.doCentrality = cms.bool(True)
process.hiEvtAnalyzer.CentralitySrc = cms.InputTag("hiCentrality")
process.hiEvtAnalyzer.CentralityBinSrc = cms.InputTag("centralityBin","HFtowers")

...

process.ana_step = cms.Path(
...    
                            process.hiCentrality *
                            process.centralityBin *
                            process.hiEvtAnalyzer*
...)

XeXe Hydjet MC (94X)

  • (5.44 TeV Hydjet Cymbal5Ev8 tune) not yet in GT, follow instructions below:

    In config file
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff')

from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, '94X_mc2017_realistic_ForXeXe_v7', '') #for now track GT manually, since centrality tables updated ex post facto
process.HiForest.GlobalTagLabel = process.GlobalTag.globaltag
process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")
process.GlobalTag.toGet.extend([
   cms.PSet(record = cms.string("HeavyIonRcd"),
      tag = cms.string("CentralityTable_HFtowers200_XeXe5p44TeVHYDJET_v941x01_mc"),
      connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS"),
      label = cms.untracked.string("HFtowersHYDJET")
   ),
])

...

process.load('RecoHI.HiCentralityAlgos.HiCentrality_cfi')
process.hiCentrality.produceHFhits = False
process.hiCentrality.produceHFtowers = False
process.hiCentrality.produceEcalhits = False
process.hiCentrality.produceZDChits = False
process.hiCentrality.produceETmidRapidity = False
process.hiCentrality.producePixelhits = False
process.hiCentrality.produceTracks = False
process.hiCentrality.producePixelTracks = False
process.hiCentrality.reUseCentrality = True
process.hiCentrality.srcReUse = cms.InputTag("hiCentrality","","RECO")

...

process.load("RecoHI.HiCentralityAlgos.CentralityBin_cfi")
process.centralityBin.Centrality = cms.InputTag("hiCentrality")
process.centralityBin.centralityVariable = cms.string("HFtowers")
process.centralityBin.nonDefaultGlauberModel = cms.string("HYDJET")

...

process.load('HeavyIonsAnalysis.EventAnalysis.hievtanalyzer_mc_cfi')
process.hiEvtAnalyzer.doCentrality = cms.bool(True)
process.hiEvtAnalyzer.CentralitySrc = cms.InputTag("hiCentrality")
process.hiEvtAnalyzer.CentralityBinSrc = cms.InputTag("centralityBin","HFtowers")

...

process.ana_step = cms.Path(
...    
                            process.hiCentrality *
                            process.centralityBin *
                            process.hiEvtAnalyzer*
...)

XeXe EPOSLHC MC (94X)

  • (5.44 TeV Hydjet Cymbal5Ev8 tune) not yet in GT, follow instructions below:

    In config file
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff')

from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, '94X_mc2017_realistic_ForXeXe_v7', '') #for now track GT manually, since centrality tables updated ex post facto
process.HiForest.GlobalTagLabel = process.GlobalTag.globaltag
process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")
process.GlobalTag.toGet.extend([
   cms.PSet(record = cms.string("HeavyIonRcd"),
      tag = cms.string("CentralityTable_HFtowers200_XeXe5p44TeVEPOSLHC_v941x01_mc"),
      connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS"),
      label = cms.untracked.string("HFtowersEPOSLHC")
   ),
])

...

process.load('RecoHI.HiCentralityAlgos.HiCentrality_cfi')
process.hiCentrality.produceHFhits = False
process.hiCentrality.produceHFtowers = False
process.hiCentrality.produceEcalhits = False
process.hiCentrality.produceZDChits = False
process.hiCentrality.produceETmidRapidity = False
process.hiCentrality.producePixelhits = False
process.hiCentrality.produceTracks = False
process.hiCentrality.producePixelTracks = False
process.hiCentrality.reUseCentrality = True
process.hiCentrality.srcReUse = cms.InputTag("hiCentrality","","RECO")

...

process.load("RecoHI.HiCentralityAlgos.CentralityBin_cfi")
process.centralityBin.Centrality = cms.InputTag("hiCentrality")
process.centralityBin.centralityVariable = cms.string("HFtowers")
process.centralityBin.nonDefaultGlauberModel = cms.string("EPOSLHC")

...

process.load('HeavyIonsAnalysis.EventAnalysis.hievtanalyzer_mc_cfi')
process.hiEvtAnalyzer.doCentrality = cms.bool(True)
process.hiEvtAnalyzer.CentralitySrc = cms.InputTag("hiCentrality")
process.hiEvtAnalyzer.CentralityBinSrc = cms.InputTag("centralityBin","HFtowers")

...

process.ana_step = cms.Path(
...    
                            process.hiCentrality *
                            process.centralityBin *
                            process.hiEvtAnalyzer*
...)

Instructions for 8_0_X

The 2016 pPb trigger and event selection studies are not finished yet, therefore we don't have a good calibration and centrality table yet.

Some temporary studies were done in 2016 during the run comparing 2013 vs. 2016:

https://twiki.cern.ch/twiki/pub/CMS/PPbCentrality2016/JavierMARTIN_pPbCorresp2013CentBin2016HFplusEta4_2016_11_22.pdf

https://twiki.cern.ch/twiki/pub/CMS/PPbCentrality2016/JavierMARTIN_pPb20162013Scaling_2016_11_19.pdf

You can get 0-10% and 10-30% by selecting events on hiHFPlusEta4 with the boundaries in the slides.

Instructions for 7_X_Y

The centrality binning is done for 200 bins. Bin 0 means most central 0-0.5% events and increasing goes to more peripheral.

CMSSW_7_5_X Work in progress, under construction

EPOS LHC MC

  • Not yet in GT, follow instructions below:

    In config file
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff')

from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, '75X_mcRun2_HeavyIon_v14', '') #for now track GT manually, since centrality tables updated ex post facto
process.HiForest.GlobalTagLabel = process.GlobalTag.globaltag
process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")
process.GlobalTag.toGet.extend([
   cms.PSet(record = cms.string("HeavyIonRcd"),
      tag = cms.string("CentralityTable_HFtowers200_EPOSLHC_v758x01_mc"),
      connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS"),
      label = cms.untracked.string("HFtowersEPOSLHC")
   ),
])

...

process.load("RecoHI.HiCentralityAlgos.CentralityBin_cfi")
process.centralityBin.Centrality = cms.InputTag("hiCentrality")
process.centralityBin.centralityVariable = cms.string("HFtowers")
process.centralityBin.nonDefaultGlauberModel = cms.string("EPOSLHC")

...

process.load('HeavyIonsAnalysis.EventAnalysis.hievtanalyzer_mc_cfi')
process.hiEvtAnalyzer.doCentrality = cms.bool(True)
process.hiEvtAnalyzer.CentralitySrc = cms.InputTag("hiCentrality")
process.hiEvtAnalyzer.CentralityBinSrc = cms.InputTag("centralityBin","HFtowers")

...

process.ana_step = cms.Path(
...
                            process.centralityBin *
                            process.hiEvtAnalyzer*
...)

Hydjet MC

process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff')

from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, '75X_mcRun2_HeavyIon_v14', '') #for now track GT manually, since centrality tables updated ex post facto
process.HiForest.GlobalTagLabel = process.GlobalTag.globaltag
process.GlobalTag.snapshotTime = cms.string("9999-12-31 23:59:59.000")
process.GlobalTag.toGet.extend([
   cms.PSet(record = cms.string("HeavyIonRcd"),
      tag = cms.string("CentralityTable_HFtowers200_HydjetCymbal5Ev8_v758x03_mc"),
      connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS"),
      label = cms.untracked.string("HFtowersCymbal5Ev8")
   ),
])

...

process.load("RecoHI.HiCentralityAlgos.CentralityBin_cfi")
process.centralityBin.Centrality = cms.InputTag("hiCentrality")
process.centralityBin.centralityVariable = cms.string("HFtowers")
process.centralityBin.nonDefaultGlauberModel = cms.string("Cymbal5Ev8")

...

process.load('HeavyIonsAnalysis.EventAnalysis.hievtanalyzer_mc_cfi')
process.hiEvtAnalyzer.doCentrality = cms.bool(True)
process.hiEvtAnalyzer.CentralitySrc = cms.InputTag("hiCentrality")
process.hiEvtAnalyzer.CentralityBinSrc = cms.InputTag("centralityBin","HFtowers")

...

process.ana_step = cms.Path(
...
                            process.centralityBin *
                            process.hiEvtAnalyzer*
...)

DATA

Notes:

  • conddb v2 is default in 7_5_X
  • centrality tables are included in the global tag but instructions on how to test new tags are available here: SWGuideHeavyIonCentralityExpert
  • please remove overrideCentrality function from your config

    7_5_X global tags with centrality calibration for HFtowers with 200 bins
  • Run2 data (5 TeV) 75X_dataRun2_v6
  • Run1 data (2.76 TeV) 75X_dataRun1_v6
  • Later versions also working

    In config file
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, '75X_mcRun2_HeavyIon_v10', '') # or 75X_dataRun2_v6 for data
...
process.load("RecoHI.HiCentralityAlgos.CentralityBin_cfi")
...
    centralitySrc = cms.InputTag("hiCentrality"),
    centralityBinSrc = cms.InputTag("centralityBin","HFtowers"),
...
process.p= cms.Path(process.centralityBin * ...)

In analyzer to access the centrality object, the following lines are needed

#include "DataFormats/HeavyIonEvent/interface/Centrality.h"
...
edm::EDGetTokenT<reco::Centrality> centralityToken_;
edm::EDGetTokenT<int> centralityBinToken_;
...
centralityToken_ = consumes<reco::Centrality>(iConfig.getParameter<edm::InputTag>("centralitySrc"));
centralityBinToken_ = consumes<int>(iConfig.getParameter<edm::InputTag>("centralityBinSrc"));
...
edm::Handle<reco::Centrality> centrality;
iEvent.getByToken(centralityToken_, centrality);
edm::Handle<int> cbin;
iEvent.getByToken(centralityBinToken_, cbin);
hiBin_ = *cbin;
hiNtracks_ = centrality->Ntracks();
hiHF_ = centrality->EtHFtowerSum();
...

Example analyzer https://github.com/CmsHI/cmssw/blob/forest_CMSSW_7_5_8/HeavyIonsAnalysis/EventAnalysis/src/HiEvtAnalyzer.cc

CMSSW_7_4_X

In 7_4_X the centrality bin access is changing

  • CentralityProvider is removed and the bin can be produced as an integer with CentralityBinProducer
  • pull-request https://github.com/cms-sw/cmssw/pull/7346

    No need to checkout any RecoHI package for your analysis, tested for CMSSW_7_4_0_pre6. Example analyzer here with cfi and cfg files.

In the config file you have to add process.load("RecoHI.HiCentralityAlgos.CentralityBin_cfi") This loads the default parameters see here.

The parameters to be set in the config file

process.centralityBin.Centrality = cms.InputTag("hiCentrality")
process.centralityBin.centralityVariable = cms.string("HFtowers")
process.centralityBin.nonDefaultGlauberModel = cms.string("HydjetDrum5")

The centrality table for testing can be accessed by

process.GlobalTag.toGet.extend([
   cms.PSet(record = cms.string("HeavyIonRcd"),
      tag = cms.string("CentralityTable_HFtowers200_HydjetDrum5_v740x01_mc"),
      connect = cms.untracked.string("frontier://FrontierProd/CMS_COND_31X_PHYSICSTOOLS"),
      label = cms.untracked.string("HFtowersHydjetDrum5")
   ),
])

In the path you have to produce the bin integer process.p = cms.Path(process.centralityBin * ...)

For the analyzer you have to provide the centrality bin label in the config centralityBinLabel = cms.InputTag("centralityBin","HFtowers")

In the analyzer you read this label and then with getByToken you get the integer value for the bin In the class member data you declare

edm::Handle<int> cbin_;
edm::EDGetTokenT<int> tag_;

In the constructor you read the config file

tag_ = consumes<int>(iConfig.getParameter<edm::InputTag>("centralityBinLabel"));

In the analyze part you read the bin

iEvent.getByToken(tag_,cbin_);
int bin = *cbin_;


NEW Note that it is possible for the new software to access binning for different centrality variables by producing and reading multiple centralityBin objects. As of now there is only calibration available for HFtowers with 200 bins.

Instructions for 5_3_20

PbPb 2011 rereco in 5_3_20

The centrality object with label hiCentrality is available in the reconstructed data.

The release can be found in github: https://github.com/cms-sw/cmssw/tree/CMSSW_5_3_20. The centrality object is produced by RecoHI/HiCentralityAlgos/plugins/CentralityProducer.cc with settings given in RecoHI/HiCentralityAlgos/python/HiCentrality_cfi.py

The centrality table with 200 bins using HFtowers is available in the GlobalTag FT_R_53_LV9. For usage, please see (*) below the alternative setup.

Alternatively, to get the right configurations for event selection and centrality binning calibration (200 bins) you can check out some packages setup in the forest branch on github: here with

cmsrel CMSSW_5_3_20
cd CMSSW_5_3_20/src
cmsenv
git cms-merge-topic -u CmsHI:forest_CMSSW_5_3_20
scram b

No extra code is needed from the reconstruction packages because everything is in the release.

With this the HeavyIonsAnalysis/EventAnalyzer package is also checked out with an example config to test. More details needed to use the centrality object are given below.

(*) In the analyzer you need

#include "RecoHI/HiCentralityAlgos/interface/CentralityProvider.h"
...
CentralityProvider * centProvider = 0;
...
if (!centProvider) centProvider = new CentralityProvider(iSetup);
centProvider->newEvent(iEvent,iSetup);
const reco::Centrality* centrality = centProvider->raw();
hiBin = centProvider->getBin();

In the config file you need

process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.GlobalTag.globaltag = 'GR_R_53_LV6::All'

process.load('HeavyIonsAnalysis.Configuration.collisionEventSelection_cff')

from HeavyIonsAnalysis.Configuration.CommonFunctions_cff import *
overrideCentrality(process)

process.HeavyIonGlobalParameters = cms.PSet(
    centralityVariable = cms.string("HFtowers"),
    nonDefaultGlauberModel = cms.string(""),
    centralitySrc = cms.InputTag("hiCentrality")
    )

process.p = cms.Path(process.hltMinBiasHFOrBSC * process.collisionEventSelection * ...)

For MC config file the only difference is in the following parameters

process.GlobalTag.globaltag = '???::All'

  nonDefaultGlauberModel = cms.string("Hydjet_Drum"),

pPb 2013 in 5_3_20

The centrality object is NOT produced in the pp reconstruction so it has to be produced on the fly.

The release can be found in github: https://github.com/cms-sw/cmssw/tree/CMSSW_5_3_20. The centrality object can be produced by RecoHI/HiCentralityAlgos/plugins/CentralityProducer.cc with settings given in RecoHI/HiCentralityAlgos/python/pACentrality_cfi.py

To get the right configurations for event selection and centrality binning calibration (100 bins) you need to check out some packages setup in the centrality branch on github: here with

cmsrel CMSSW_5_3_20
cd CMSSW_5_3_20/src
cmsenv
git cms-addpkg RecoHI/HiCentralityAlgos
git cms-merge-topic -u CmsHI:forest_CMSSW_5_3_20
scram b

With this the HeavyIonsAnalysis/EventAnalyzer package is also checked out with an example config to test. More details needed to use the centrality object are given below.

In the analyzer you need

#include "RecoHI/HiCentralityAlgos/interface/CentralityProvider.h"
...
CentralityProvider * centProvider = 0;
...
if (!centProvider) centProvider = new CentralityProvider(iSetup);
centProvider->newEvent(iEvent,iSetup);
const reco::Centrality* centrality = centProvider->raw();
hiBin = centProvider->getBin();

In the config file you need

process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.GlobalTag.globaltag = 'GR_P_V43D::All'

process.load('HeavyIonsAnalysis.Configuration.collisionEventSelection_cff')

process.load('HeavyIonsAnalysis.VertexAnalysis.PAPileUpVertexFilter_cff')

from HeavyIonsAnalysis.Configuration.CommonFunctions_cff import *
overrideCentrality(process)

process.HeavyIonGlobalParameters = cms.PSet(
  centralityVariable = cms.string("HFtowersTrunc"), #or HFtowersPlusTrunc
  nonDefaultGlauberModel = cms.string(""),
  centralitySrc = cms.InputTag("pACentrality"),
  pPbRunFlip = cms.untracked.uint32(211313)
  )

process.p = cms.Path(process.hltZeroBiasSingleTrack * process.PAcollisionEventSelection * process.pileupVertexFilterCutGplus * process.siPixelRecHits * process.pACentrality * ...)

For MC config file the only difference is in the following parameters

process.GlobalTag.globaltag = 'STARTHI53_V27::All'

process.HeavyIonGlobalParameters = cms.PSet(
  centralityVariable = cms.string("HFtowersTrunc"), # or HFtowersPlusTrunc
  nonDefaultGlauberModel = cms.string("Hijing"),
  centralitySrc = cms.InputTag("pACentrality"),
  pPbRunFlip = cms.untracked.uint32(99999999)    # change to pPbRunFlip = cms.untracked.uint32(1) for Pbp MC sample
  )

Old instructions


Specific instructions for pPb 2013 data and MC

  • Check out the latest packages:

cvs co -r pPbProd_v05 DataFormats/HeavyIonEvent
cvs co -r pPbProd_v10 RecoHI/HiCentralityAlgos
cvs co -r pPbProd_v09 HeavyIonsAnalysis/Configuration
cvs co -r HiForest_V02_03 -d Appeltel/RpPbAnalysis UserCode/Appeltel/RpPbAnalysis

  • In the config file:

from HeavyIonsAnalysis.Configuration.CommonFunctions_cff import *
overrideCentrality(process)

process.HeavyIonGlobalParameters = cms.PSet(
  centralityVariable = cms.string("HFtowersTrunc"), #or HFtowersPlusTrunc
  nonDefaultGlauberModel = cms.string(""),
  centralitySrc = cms.InputTag("pACentrality"),
  pPbRunFlip = cms.untracked.uint32(211313)
  )

process.load('RecoHI.HiCentralityAlgos.HiCentrality_cfi')
process.load('HeavyIonsAnalysis.Configuration.collisionEventSelection_cff')
process.load('Appeltel.RpPbAnalysis.PAPileUpVertexFilter_cff')

process.p = cms.Path( * process.PAcollisionEventSelection * process.pileupVertexFilterCutGplus * process.pACentrality_step * ...)

  • Example config file here (creates hiEvtAnalyzer/HiTree)
  • The analyzers don't have to be changed but if you use histograms there are 100 bins instead of 40.

  • MC config file the only difference is in the following parameters

process.HeavyIonGlobalParameters = cms.PSet(
  centralityVariable = cms.string("HFtowersTrunc"), # or HFtowersPlusTrunc
  nonDefaultGlauberModel = cms.string("Hijing"),
  centralitySrc = cms.InputTag("pACentrality"),
  pPbRunFlip = cms.untracked.uint32(99999999)    # change to pPbRunFlip = cms.untracked.uint32(1) for Pbp MC sample
  )

Specific instructions for analysis of 2010 data

Due to continuous changes in centrality tables, we have a common python configuration that loads the latest tables from the database. The way to use it is:

from CmsHi.Analysis2010.CommonFunctions_cff import *
overrideCentrality(process)

When you see the title [Centrality UP] in the hn, please go to your Analysis2010 directory and do "cvs up".

Specific instructions for analysis of 2011 data

For the 2011 data analysis there is no need anymore for these two lines in your config file:

from CmsHi.Analysis2010.CommonFunctions_cff import *
overrideCentrality(process)

The HeavyIonGlobalParameters settings are

process.HeavyIonGlobalParameters = cms.PSet(
  centralityVariable = cms.string("HFtowers"),
  nonDefaultGlauberModel = cms.string(""),
  centralitySrc = cms.InputTag("hiCentrality")
  )

together with the global tag GR_R_44_V12::All (or GR_P_V27A::All?)

Specific instructions for analysis of 2011 MC Simulations

Always make sure you have an updated version of CmsHi/Analysis2010/. There are currently two HYDJET tunes used which require different settings of the HeavyIonGlobalParameters

HYDJET 1.6 (Bass tune)

If you are using the global tag STARTHI44_V7::All

from CmsHi.Analysis2010.CommonFunctions_cff import *
overrideCentrality(process)
process.HeavyIonGlobalParameters = cms.PSet(
 centralitySrc = cms.InputTag("hiCentrality"),
 centralityVariable = cms.string("HFtowers"),
 nonDefaultGlauberModel = cms.string("Hydjet_Bass")
 )

If you are using the global tag STARTHI44_V12::All

process.HeavyIonGlobalParameters = cms.PSet(
 centralitySrc = cms.InputTag("hiCentrality"),
 centralityVariable = cms.string("HFtowers"),
 nonDefaultGlauberModel = cms.string("Hydjet_Bass")
 )

HYDJET 1.8 (Drum tune)

If you are using the global tag STARTHI44_V7::All or STARTHI44_V12::All

from CmsHi.Analysis2010.CommonFunctions_cff import *
overrideCentrality(process)
process.HeavyIonGlobalParameters = cms.PSet(
 centralitySrc = cms.InputTag("hiCentrality"),
 centralityVariable = cms.string("HFtowers"),
 nonDefaultGlauberModel = cms.string("Hydjet_Drum")
 )

CentralityProvider

  • Tags needed:

cvs co CondFormats/HIObjects
cvs co DataFormats/HeavyIonEvent
cvs co RecoHI/HiCentralityAlgos
cvs co -d CmsHi/Analysis2010 UserCode/CmsHi/Analysis2010
scram b

  • Add in your analyzer:

    1) add
#include "DataFormats/HeavyIonEvent/interface/CentralityProvider.h"

2) declare

CentralityProvider * centrality_;

3) in the analyze() function

if(!centrality_) centrality_ = new CentralityProvider(iSetup);

   centrality_->newEvent(iEvent,iSetup); // make sure you do this first in every event
   double c = centrality_->centralityValue();
   int bin = centrality_->getBin();

4) set the pointer centrality_ = 0 explicitly in the constructor

  • Add in your cfg:

process.load('Configuration.StandardSequences.FrontierConditions_CMS.GlobalTag_cff')
process.GlobalTag.globaltag = 'MC_38Y_V13::All' # Make sure you have the right global tag (*)
process.HeavyIonGlobalParameters = cms.PSet(
    centralityVariable = cms.string("HFhits"),
    nonDefaultGlauberModel = cms.string("Hydjet_2760GeV"),
    centralitySrc = cms.InputTag("hiCentrality")
    )

(*) To see which table you are supposed to use with a specific release, please consult the page: https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions

CentralityBinProducer

This module determines the bin of the event, corresponding to a given table. See the instructions for specifying centrality table below.

process.load("RecoHI.HiCentralityAlgos.CentralityBin_cfi")
...
process.p = cms.Path(process.centralityBin)

  • Input The input for binning it the centrality object, by default with the label "hiCentrality". Also, make sure the centrality table is provided.

  • Output

    The output is an integer, corresponding to the bin number.
int_centralityBin__SKIM

What it means in percentage depends on how many bins were used. For example, if you use 40 bins:

Bin ID Bin
0 0-2.5%
1 2.5-5%
... ...
38 95-97.5%
39 97.5-100%
where 0-2.5% means the most central events (smallest impact parameter) and 97.5-100% is the most peripheral events.

Filtering on binned centrality in cmsRun

Please check out the head of the RecoHI /HiCentralityAlgos. Include the following in your cfg file:


process.load("RecoHI.HiCentralityAlgos.CentralityFilter_cfi")

process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.GlobalTag.globaltag = 'MC_38Y_V8::All'

process.GlobalTag.toGet = cms.VPSet(
    cms.PSet(record = cms.string("HeavyIonRcd"),
             tag = cms.string("CentralityTable_HFhits40_Hydjet2760GeV_v1_mc"),
             connect = cms.untracked.string("frontier://FrontierPrep/CMS_COND_PHYSICSTOOLS")
             )
    )

and add the filter in your path:


process.mypath = cms.Path(process.centralityFilter * .....)

By default the filter selects only the most central events of whatever tag (binning you've used). One can change which bins to be selected by doing:

process.centralityFilter.selectedBins = [2,3,4]

If you're using 20 centrality bins, this would select top 10-25%.

Using the CentralityBins object in FWLite / Bare ROOT:

If you're using EDAnalyzers in full framework, please use the CentralityProvider described above to take care of the bins for you. It internally uses a CentralityBins object, and details for experts can be found in the expert page.

1- One has to import the table from the main database, and save in a root file. Simply run the cfg: http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/RecoHI/HiCentralityAlgos/tools/makeTFileFromDB.py?hideattic=0&view=markup

or, you can just add the part:

process.makeCentralityTableTFile = cms.EDAnalyzer('CentralityTableProducer',
                                                  isMC = cms.untracked.bool(True),
                                                  makeDBFromTFile = cms.untracked.bool(False),
                                                  makeTFileFromDB = cms.untracked.bool(True)
                                                  )

to any cfg, like the one you're running your other analyzers. This will put the tables for all the runs into the output of the TFileService. Please note that, if there is a new global tag, for which you have to re-run your reconstruction and analysis, you will have to re-run to import the table as well.

2-In your root macro (whether it's FWLite of just root) add:

#include "DataFormats/HeavyIonEvent/interface/CentralityBins.h"
TFile* inf = new TFile("centralityfile.root");
CentralityBins::RunMap cmap = getCentralityFromFile(inf, "makeCentralityTableTFile", "HFhitsAMPT_2760GeV", 149500, 155000);
// FWLite
int run = ev.id().run();
// or, if you're using any other tree:
int run = myTreeVariableForRunNumber;
int bin = cmap[run]->getBin(hf);
double npartMean = cmap[run]->NpartMean(hf);
double npartSigma = cmap[run]->NpartSigma(hf);

However, even if you want to run in bare root, you need the following in your rootlogon:

{
  gSystem->Load("libDataFormatsHeavyIonEvent");
  gSystem->AddIncludePath("-I$CMSSW_BASE/src/");
  gSystem->AddIncludePath("-I$CMSSW_RELEASE_BASE/src/");
}

You can find example macros in ./macros/: http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/RecoHI/HiCentralityAlgos/macros/testCentralityFWLite.C?hideattic=0&view=markup http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/RecoHI/HiCentralityAlgos/macros/testCentralityBareRoot.C?hideattic=0&view=markup

  • You need to compile your macro in order to run successfully.

Links

Contact

Responsible: AnnaJuliaZsigmond
Edit | Attach | Watch | Print version | History: r149 < r148 < r147 < r146 < r145 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r149 - 2022-05-06 - HyunchulKIM
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback