Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:58:07

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.simpleProtonTrackFlatTableProducer_cfi import simpleProtonTrackFlatTableProducer
0005 
0006 singleRPProtons = True
0007 
0008 protonTable = cms.EDProducer("ProtonProducer",
0009                              tagRecoProtonsSingle = cms.InputTag("ctppsProtons", "singleRP"),
0010                              tagRecoProtonsMulti  = cms.InputTag("ctppsProtons", "multiRP"),
0011                              tagTrackLite         = cms.InputTag("ctppsLocalTrackLiteProducer"),
0012                              storeSingleRPProtons = cms.bool(singleRPProtons)
0013 )
0014 
0015 multiRPTable = simpleProtonTrackFlatTableProducer.clone(
0016     src = cms.InputTag("ctppsProtons","multiRP"),
0017     name = cms.string("Proton_multiRP"),
0018     doc  = cms.string("bon"),
0019     skipNonExistingSrc = cms.bool(True),#is this safe?
0020     variables = cms.PSet(
0021         xi = Var("xi",float,doc="xi or dp/p",precision=12),
0022         thetaX = Var("thetaX",float,doc="theta x",precision=13),
0023         thetaY = Var("thetaY",float,doc="theta y",precision=13),
0024         t = Var("t",float,doc="Mandelstam variable t",precision=13),
0025         time = Var("time()",float,doc="time",precision=16),
0026         timeUnc = Var("timeError",float,doc="time uncertainty",precision=13),
0027     ),
0028     externalVariables = cms.PSet(
0029         arm = ExtVar("protonTable:arm", "uint8", doc="0 = sector45, 1 = sector56"),
0030     ),
0031 )
0032 
0033 singleRPTable = simpleProtonTrackFlatTableProducer.clone(
0034     src = cms.InputTag("ctppsProtons","singleRP"),
0035     name = cms.string("Proton_singleRP"),
0036     doc  = cms.string("bon"),
0037     skipNonExistingSrc = cms.bool(True),#is this safe?
0038     variables = cms.PSet(
0039         xi = Var("xi",float,doc="xi or dp/p",precision=12),
0040         thetaY = Var("thetaY",float,doc="th y",precision=10),
0041     ),
0042     externalVariables = cms.PSet(
0043         decRPId = ExtVar("protonTable:protonRPId", "int16",doc="Detector ID"),
0044     ),
0045 )
0046 
0047 protonTablesTask = cms.Task(protonTable,multiRPTable)
0048 if singleRPProtons: protonTablesTask.add(singleRPTable)
0049 
0050 # GEN-level signal/PU protons collection
0051 genProtonTable = _genproton.clone(
0052     cut = cms.string('(pdgId == 2212) && (abs(pz) > 5200) && (abs(pz) < 6467.5)') # xi in [0.015, 0.2]
0053 )
0054 
0055 genProtonTablesTask = cms.Task(genProtonTable)