Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:55:14

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 from Configuration.Eras.Modifier_phase2_hgcalV10_cff import phase2_hgcalV10
0004 from Configuration.Eras.Modifier_phase2_hgcalV11_cff import phase2_hgcalV11
0005 
0006 inputs_small = ['cl3d_firstlayer', 'cl3d_coreshowerlength', 'cl3d_maxlayer', 'cl3d_srrmean']
0007 inputs_large = ['cl3d_coreshowerlength', 'cl3d_showerlength', 'cl3d_firstlayer', 'cl3d_maxlayer', 'cl3d_szz', 'cl3d_srrmean', 'cl3d_srrtot', 'cl3d_seetot', 'cl3d_spptot']
0008 
0009 class Category:
0010     def __init__(self, eta_min, eta_max, pt_min, pt_max):
0011         self.eta_min = eta_min
0012         self.eta_max = eta_max
0013         self.pt_min = pt_min
0014         self.pt_max = pt_max
0015 
0016 
0017 categories = [
0018         # Low eta
0019         Category(eta_min=1.5, eta_max=2.7, pt_min=0., pt_max=1e6),
0020         # High eta
0021         Category(eta_min=2.7, eta_max=3.0, pt_min=0., pt_max=1e6),
0022         ]
0023 
0024 # Identification for dRNN 2D clustering and cone 3D clustering
0025 bdt_weights_drnn_cone = [
0026         # Low eta
0027         'L1Trigger/L1THGCal/data/egamma_id_drnn_cone_loweta_v0.xml',
0028         # High eta
0029         'L1Trigger/L1THGCal/data/egamma_id_drnn_cone_higheta_v0.xml',
0030         ]
0031 
0032 working_points_drnn_cone = [
0033         # Low eta
0034         {
0035         '900':0.14057436,
0036         '950':0.05661769,
0037         '975':-0.01481255,
0038         '995':-0.19656579,
0039         },
0040         # High eta
0041         {
0042         '900':0.05995301,
0043         '950':-0.02947988,
0044         '975':-0.10577436,
0045         '995':-0.26401181,
0046         },
0047         ]
0048 
0049 
0050 # Identification for dRNN 2D clustering and DBSCAN 3D clustering
0051 bdt_weights_drnn_dbscan = [
0052         # Low eta
0053         'L1Trigger/L1THGCal/data/egamma_id_drnn_dbscan_loweta_v0.xml',
0054         # High eta
0055         'L1Trigger/L1THGCal/data/egamma_id_drnn_dbscan_higheta_v0.xml',
0056         ]
0057 
0058 working_points_drnn_dbscan = [
0059         # Low eta
0060         {
0061         '900':0.08421164,
0062         '950':0.06436077,
0063         '975':-0.04547527,
0064         '995':-0.23717142,
0065         },
0066         # High eta
0067         {
0068         '900':0.05559443,
0069         '950':-0.0171725,
0070         '975':-0.10630798,
0071         '995':-0.27290947,
0072         },
0073         ]
0074 
0075 # Identification for 3D HistoMax clustering: switch between configurations for v8 and v9 geometry
0076 input_features_histomax = {
0077         "v8_352":inputs_small,
0078         "v9_370":inputs_large,
0079         "v9_394":inputs_large,
0080         "v10_3151":inputs_large
0081         }
0082 
0083 bdt_weights_histomax = {
0084         "v8_352":[ #trained using TPG software version 3.5.2
0085                 # Low eta
0086                 'L1Trigger/L1THGCal/data/egamma_id_histomax_352_loweta_v0.xml',
0087                 # High eta
0088                 'L1Trigger/L1THGCal/data/egamma_id_histomax_352_higheta_v0.xml'
0089                 ],
0090         "v9_370":[ #trained using TPG software version 3.7.0
0091                 # Low eta
0092                 'L1Trigger/L1THGCal/data/egamma_id_histomax_370_loweta_v0.xml',
0093                 # High eta
0094                 'L1Trigger/L1THGCal/data/egamma_id_histomax_370_higheta_v0.xml'
0095                 ],
0096         "v9_394":[ #trained using TPG software version 3.9.4
0097                 # Low eta
0098                 'L1Trigger/L1THGCal/data/egamma_id_histomax_394_loweta_v0.xml',
0099                 # High eta
0100                 'L1Trigger/L1THGCal/data/egamma_id_histomax_394_higheta_v0.xml'
0101                 ],
0102         "v10_3151":[ #trained using TPG software version 3.15.1
0103                 # Low eta
0104                 'L1Trigger/L1THGCal/data/egamma_id_histomax_3151_loweta_v0.xml',
0105                 # High eta
0106                 'L1Trigger/L1THGCal/data/egamma_id_histomax_3151_higheta_v0.xml'
0107                 ]
0108         }
0109 
0110 working_points_histomax = {
0111         "v8_352":[
0112                 # Low eta
0113                 {
0114                 '900':0.19146989,
0115                 '950':0.1379665,
0116                 '975':0.03496629,
0117                 '995':-0.24383164,
0118                 },
0119                 # High eta
0120                 {
0121                 '900':0.13347613,
0122                 '950':0.04267797,
0123                 '975':-0.03698097,
0124                 '995':-0.23077505,
0125                 }
0126              ],
0127         "v9_370":[
0128                 # Low eta
0129                 {
0130                 '900':0.8815851, # epsilon_b = 2.5%
0131                 '950':0.5587649, # epsilon_b = 4.0%
0132                 '975':-0.1937952, # epsilon_b = 5.5%
0133                 '995':-0.9394884, # epsilon_b = 10.1%
0134                 },
0135                 # High eta
0136                 {
0137                 '900':0.7078400, #epsilon_b = 3.5%
0138                 '950':-0.0239623, #epsilon_b = 6.9%
0139                 '975':-0.7045071, #epsilon_b = 11.6%
0140                 '995':-0.9811426, #epsilon_b = 26.1%
0141                 }
0142              ],
0143         "v9_394":[
0144                 # Low eta
0145                 {
0146                 '900':0.9794103, # epsilon_b = 1.9%
0147                 '950':0.9052764, # epsilon_b = 3.9%
0148                 '975':0.5276631, # epsilon_b = 6.6%
0149                 '995':-0.9153535, # epsilon_b = 20.4%
0150                 },
0151                 # High eta
0152                 {
0153                 '900':0.8825340, #epsilon_b = 1.0%
0154                 '950':0.2856039, #epsilon_b = 1.7%
0155                 '975':-0.5274948, #epsilon_b = 2.8%
0156                 '995':-0.9864445, #epsilon_b = 7.6%
0157                 }
0158              ],
0159         "v10_3151": [
0160                 # Low eta
0161                 {
0162                  '900': 0.9903189,
0163                  '950': 0.9646683,
0164                  '975': 0.8292287,
0165                  '995': -0.7099538,
0166                 },
0167                 # High eta
0168                 {
0169                  '900': 0.9932326,
0170                  '950': 0.9611762,
0171                  '975': 0.7616282,
0172                  '995': -0.9163715,
0173                 }
0174              ]
0175         }
0176 
0177 tight_wp = ['975', '900']
0178 loose_wp = ['995', '950']
0179 
0180 
0181 egamma_identification_drnn_cone = cms.PSet(
0182         Inputs=cms.vstring(inputs_small),
0183         CategoriesEtaMin=cms.vdouble([cat.eta_min for cat in categories]),
0184         CategoriesEtaMax=cms.vdouble([cat.eta_max for cat in categories]),
0185         CategoriesPtMin=cms.vdouble([cat.pt_min for cat in categories]),
0186         CategoriesPtMax=cms.vdouble([cat.pt_max for cat in categories]),
0187         Weights=cms.vstring(bdt_weights_drnn_cone),
0188         WorkingPoints=cms.vdouble([wps[eff] for wps,eff in zip(working_points_drnn_cone,tight_wp)]),
0189         )
0190 
0191 egamma_identification_drnn_dbscan = cms.PSet(
0192         Inputs=cms.vstring(inputs_small),
0193         CategoriesEtaMin=cms.vdouble([cat.eta_min for cat in categories]),
0194         CategoriesEtaMax=cms.vdouble([cat.eta_max for cat in categories]),
0195         CategoriesPtMin=cms.vdouble([cat.pt_min for cat in categories]),
0196         CategoriesPtMax=cms.vdouble([cat.pt_max for cat in categories]),
0197         Weights=cms.vstring(bdt_weights_drnn_dbscan),
0198         WorkingPoints=cms.vdouble([wps[eff] for wps,eff in zip(working_points_drnn_dbscan,tight_wp)]),
0199         )
0200 
0201 egamma_identification_histomax = cms.PSet(
0202         Inputs=cms.vstring(input_features_histomax['v10_3151']),
0203         CategoriesEtaMin=cms.vdouble([cat.eta_min for cat in categories]),
0204         CategoriesEtaMax=cms.vdouble([cat.eta_max for cat in categories]),
0205         CategoriesPtMin=cms.vdouble([cat.pt_min for cat in categories]),
0206         CategoriesPtMax=cms.vdouble([cat.pt_max for cat in categories]),
0207         Weights=cms.vstring(bdt_weights_histomax['v10_3151']),
0208         WorkingPoints=cms.VPSet([
0209             cms.PSet(
0210                 Name=cms.string('tight'),
0211                 WorkingPoint=cms.vdouble([wps[eff] for wps,eff in zip(working_points_histomax['v10_3151'],tight_wp)])
0212             ),
0213             cms.PSet(
0214                 Name=cms.string('loose'),
0215                 WorkingPoint=cms.vdouble([wps[eff] for wps,eff in zip(working_points_histomax['v10_3151'],loose_wp)])
0216             ),
0217             ])
0218         )
0219 
0220 phase2_hgcalV10.toModify(egamma_identification_histomax,
0221         Inputs=cms.vstring(input_features_histomax['v10_3151']),
0222         Weights=cms.vstring(bdt_weights_histomax['v10_3151']),
0223         WorkingPoints=cms.VPSet([
0224             cms.PSet(
0225                 Name=cms.string('tight'),
0226                 WorkingPoint=cms.vdouble([wps[eff] for wps,eff in zip(working_points_histomax['v10_3151'],tight_wp)])
0227             ),
0228             cms.PSet(
0229                 Name=cms.string('loose'),
0230                 WorkingPoint=cms.vdouble([wps[eff] for wps,eff in zip(working_points_histomax['v10_3151'],loose_wp)])
0231             ),
0232             ])
0233         )
0234 
0235 phase2_hgcalV11.toModify(egamma_identification_histomax,
0236         Inputs=cms.vstring(input_features_histomax['v10_3151']),
0237         Weights=cms.vstring(bdt_weights_histomax['v10_3151']),
0238         WorkingPoints=cms.VPSet([
0239             cms.PSet(
0240                 Name=cms.string('tight'),
0241                 WorkingPoint=cms.vdouble([wps[eff] for wps,eff in zip(working_points_histomax['v10_3151'],tight_wp)])
0242             ),
0243             cms.PSet(
0244                 Name=cms.string('loose'),
0245                 WorkingPoint=cms.vdouble([wps[eff] for wps,eff in zip(working_points_histomax['v10_3151'],loose_wp)])
0246             ),
0247             ])
0248         )