Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-18 08:23:43

0001 import FWCore.ParameterSet.Config as cms
0002 from PhysicsTools.NanoAOD.common_cff import *
0003 from PhysicsTools.NanoAOD.genProtonTable_cfi import genProtonTable as _genproton
0004 from PhysicsTools.NanoAOD.nano_eras_cff import *
0005 from RecoPPS.ProtonReconstruction.ppsFilteredProtonProducer_cfi import *
0006 
0007 singleRPProtons = True
0008 
0009 filteredProtons = ppsFilteredProtonProducer.clone(
0010     protons_single_rp = cms.PSet(
0011         include = cms.bool(singleRPProtons)
0012     )
0013 )
0014 
0015 protonTable = cms.EDProducer("ProtonProducer",
0016                              tagRecoProtonsMulti  = cms.InputTag("filteredProtons", "multiRP"),
0017                              tagTrackLite         = cms.InputTag("ctppsLocalTrackLiteProducer"),
0018                              storeSingleRPProtons = cms.bool(singleRPProtons)
0019 )
0020 protonTable.tagRecoProtonsSingle = cms.InputTag("filteredProtons" if singleRPProtons else "ctppsProtons","singleRP")
0021 
0022 
0023 multiRPTable = cms.EDProducer("SimpleProtonTrackFlatTableProducer",
0024     src = cms.InputTag("filteredProtons","multiRP"),
0025     cut = cms.string(""),
0026     name = cms.string("Proton_multiRP"),
0027     doc  = cms.string("bon"),
0028     singleton = cms.bool(False),
0029     extension = cms.bool(False),
0030     skipNonExistingSrc = cms.bool(True),
0031     variables = cms.PSet(
0032         xi = Var("xi",float,doc="xi or dp/p",precision=12),
0033         thetaX = Var("thetaX",float,doc="theta x",precision=13),
0034         thetaY = Var("thetaY",float,doc="theta y",precision=13),
0035         t = Var("t",float,doc="Mandelstam variable t",precision=13),
0036         time = Var("time()",float,doc="time",precision=16),
0037         timeUnc = Var("timeError",float,doc="time uncertainty",precision=13),
0038     ),
0039     externalVariables = cms.PSet(
0040         arm = ExtVar("protonTable:arm",int,doc="0 = sector45, 1 = sector56"),
0041     ),
0042 )
0043 
0044 singleRPTable = cms.EDProducer("SimpleProtonTrackFlatTableProducer",
0045     src = cms.InputTag("filteredProtons","singleRP"),
0046     cut = cms.string(""),
0047     name = cms.string("Proton_singleRP"),
0048     doc  = cms.string("bon"),
0049     singleton = cms.bool(False),
0050     extension = cms.bool(False),
0051     skipNonExistingSrc = cms.bool(True),
0052     variables = cms.PSet(
0053         xi = Var("xi",float,doc="xi or dp/p",precision=12),
0054         thetaY = Var("thetaY",float,doc="th y",precision=10),
0055     ),
0056     externalVariables = cms.PSet(
0057         decRPId = ExtVar("protonTable:protonRPId",int,doc="Detector ID",precision=8),
0058     ),
0059 )
0060 
0061 protonTablesTask = cms.Task(filteredProtons,protonTable,multiRPTable)
0062 if singleRPProtons: protonTablesTask.add(singleRPTable)
0063 
0064 # GEN-level signal/PU protons collection
0065 genProtonTable = _genproton.clone(
0066     cut = cms.string('(pdgId == 2212) && (abs(pz) > 5200) && (abs(pz) < 6467.5)') # xi in [0.015, 0.2]
0067 )
0068 
0069 genProtonTablesTask = cms.Task(genProtonTable)
0070 
0071 for modifier in run2_miniAOD_80XLegacy, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_94X2016, run2_nanoAOD_102Xv1:
0072     modifier.toReplaceWith(protonTablesTask, cms.Task())
0073     # input GEN-level PU protons collection only introduced for UL and 12_X_Y
0074     modifier.toReplaceWith(genProtonTablesTask, cms.Task())