CMS 3D CMS Logo

protons_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from PhysicsTools.NanoAOD.common_cff import Var,ExtVar
3 from PhysicsTools.NanoAOD.genProtonTable_cfi import genProtonTable as _genproton
6 
7 singleRPProtons = True
8 
9 filteredProtons = ppsFilteredProtonProducer.clone(
10  protons_single_rp = cms.PSet(
11  include = cms.bool(singleRPProtons)
12  )
13 )
14 
15 protonTable = cms.EDProducer("ProtonProducer",
16  tagRecoProtonsMulti = cms.InputTag("filteredProtons", "multiRP"),
17  tagTrackLite = cms.InputTag("ctppsLocalTrackLiteProducer"),
18  storeSingleRPProtons = cms.bool(singleRPProtons)
19 )
20 protonTable.tagRecoProtonsSingle = cms.InputTag("filteredProtons" if singleRPProtons else "ctppsProtons","singleRP")
21 
22 
23 multiRPTable = cms.EDProducer("SimpleProtonTrackFlatTableProducer",
24  src = cms.InputTag("filteredProtons","multiRP"),
25  cut = cms.string(""),
26  name = cms.string("Proton_multiRP"),
27  doc = cms.string("bon"),
28  singleton = cms.bool(False),
29  extension = cms.bool(False),
30  skipNonExistingSrc = cms.bool(True),
31  variables = cms.PSet(
32  xi = Var("xi",float,doc="xi or dp/p",precision=12),
33  thetaX = Var("thetaX",float,doc="theta x",precision=13),
34  thetaY = Var("thetaY",float,doc="theta y",precision=13),
35  t = Var("t",float,doc="Mandelstam variable t",precision=13),
36  time = Var("time()",float,doc="time",precision=16),
37  timeUnc = Var("timeError",float,doc="time uncertainty",precision=13),
38  ),
39  externalVariables = cms.PSet(
40  arm = ExtVar("protonTable:arm",int,doc="0 = sector45, 1 = sector56"),
41  ),
42 )
43 
44 singleRPTable = cms.EDProducer("SimpleProtonTrackFlatTableProducer",
45  src = cms.InputTag("filteredProtons","singleRP"),
46  cut = cms.string(""),
47  name = cms.string("Proton_singleRP"),
48  doc = cms.string("bon"),
49  singleton = cms.bool(False),
50  extension = cms.bool(False),
51  skipNonExistingSrc = cms.bool(True),
52  variables = cms.PSet(
53  xi = Var("xi",float,doc="xi or dp/p",precision=12),
54  thetaY = Var("thetaY",float,doc="th y",precision=10),
55  ),
56  externalVariables = cms.PSet(
57  decRPId = ExtVar("protonTable:protonRPId",int,doc="Detector ID",precision=8),
58  ),
59 )
60 
61 protonTablesTask = cms.Task(filteredProtons,protonTable,multiRPTable)
62 if singleRPProtons: protonTablesTask.add(singleRPTable)
63 
64 # GEN-level signal/PU protons collection
65 genProtonTable = _genproton.clone(
66  cut = cms.string('(pdgId == 2212) && (abs(pz) > 5200) && (abs(pz) < 6467.5)') # xi in [0.015, 0.2]
67 )
68 
69 genProtonTablesTask = cms.Task(genProtonTable)
def ExtVar(tag, valtype, doc=None, precision=-1)
Definition: common_cff.py:27
def Var(expr, valtype, doc=None, precision=-1)
Definition: common_cff.py:16