Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
import FWCore.ParameterSet.Config as cms
from PhysicsTools.NanoAOD.common_cff import *
from PhysicsTools.NanoAOD.nano_cff import nanoMetadata
from Configuration.ProcessModifiers.ticl_v5_cff import ticl_v5

hltUpgradeNanoTask = cms.Task(nanoMetadata)

hltTiclCandidateTable = cms.EDProducer(
    "TICLCandidateTableProducer",
    skipNonExistingSrc=cms.bool(True),
    src=cms.InputTag("hltTiclTrackstersMerge"),
    cut=cms.string(""),
    name=cms.string("hltTICLCandidates"),
    doc=cms.string("TICLCandidates"),
    singleton=cms.bool(False),  # the number of entries is variable
    variables=cms.PSet(
        raw_energy=Var("rawEnergy", "float",
                       doc="Raw Energy of the TICLCandidate [GeV]"),
        pt=Var(
            "pt", "float", doc="TICLCandidate pT, computed from trackster raw energy and direction or from associated track [GeV]"),
        p=Var(
            "p", "float", doc="TICLCandidate momentum magnitude, computed from trackster raw energy and direction or from associated track [GeV]"),
        px=Var(
            "px", "float", doc="TICLCandidate x component of mementum, computed from trackster raw energy and direction or from associated track [GeV]"),
        py=Var(
            "py", "float", doc="TICLCandidate y component of mementum, computed from trackster raw energy and direction or from associated track [GeV]"),
        pz=Var(
            "pz", "float", doc="TICLCandidate z component of mementum, computed from trackster raw energy and direction or from associated track [GeV]"),
        energy=Var("energy", "float",
                             doc="Energy of the TICLCandidate, computed from the raw energy of the associated Trackster or from the associated track"),
        eta=Var(
            "eta", "float", doc="TICLCandidate pseudorapidity, derived from p4 built from associated Tracksters or from associated Track"),
        phi=Var(
            "phi", "float", doc="TICLCandidate phi, derived from p4 built from associated Tracksters or from associated Track"),
        mass=Var(
            "mass", "float", doc="TICLCandidate mass"),
        pdgID=Var(
            "pdgId", "int", doc="TICLCandidate assigned pdgID"),
        charge=Var(
            "charge", "int", doc="TICLCandidate assigned charge"),
        time=Var("time", "float", doc="TICLCandidate time, obtained from combination HGCAL and MTD time (offline) or HGCAL only (HLT)"),
        timeError=Var("timeError", "float",
                      doc="Trackster HGCAL time error"),
        MTDtime=Var("MTDtime", "float",
                    doc="TICLCandidate associated MTDTime, meaningful only for offline reconstruction"),
        MTDtimeError=Var("MTDtimeError", "float",
                         doc="Trackster associated MTD time error, meaningful only for offline reconstruction"),
        trackIdx=Var("trackPtr().key", "int",
                     doc="Index of hltGeneralTrack associated with TICLCandidate")
    ),
)


hltSimTiclCandidateTable = cms.EDProducer(
    "TICLCandidateTableProducer",
    skipNonExistingSrc=cms.bool(True),
    src=cms.InputTag("hltTiclSimTracksters"),
    cut=cms.string(""),
    name=cms.string("hltSimTICLCandidates"),
    doc=cms.string("SimTICLCandidates"),
    singleton=cms.bool(False),  # the number of entries is variable
    variables=cms.PSet(
        raw_energy=Var("rawEnergy", "float",
                       doc="Raw Energy of the TICLCandidate [GeV]"),
        pt=Var(
            "pt", "float", doc="TICLCandidate pT, computed from trackster raw energy and direction or from associated track [GeV]"),
        p=Var(
            "p", "float", doc="TICLCandidate momentum magnitude, computed from trackster raw energy and direction or from associated track [GeV]"),
        px=Var(
            "px", "float", doc="TICLCandidate x component of mementum, computed from trackster raw energy and direction or from associated track [GeV]"),
        py=Var(
            "py", "float", doc="TICLCandidate y component of mementum, computed from trackster raw energy and direction or from associated track [GeV]"),
        pz=Var(
            "pz", "float", doc="TICLCandidate z component of mementum, computed from trackster raw energy and direction or from associated track [GeV]"),
        energy=Var("energy", "float",
                             doc="Energy of the TICLCandidate, computed from the raw energy of the associated Trackster or from the associated track"),
        eta=Var(
            "eta", "float", doc="TICLCandidate pseudorapidity, derived from p4 built from associated Tracksters or from associated Track"),
        phi=Var(
            "phi", "float", doc="TICLCandidate phi, derived from p4 built from associated Tracksters or from associated Track"),
        mass=Var(
            "mass", "float", doc="TICLCandidate mass"),
        pdgID=Var(
            "pdgId", "int", doc="TICLCandidate assigned pdgID"),
        charge=Var(
            "charge", "int", doc="TICLCandidate assigned charge"),
        time=Var("time", "float", doc="TICLCandidate time, obtained from combination HGCAL and MTD time (offline) or HGCAL only (HLT)"),
        timeError=Var("timeError", "float",
                      doc="Trackster HGCAL time error"),
        MTDtime=Var("MTDtime", "float",
                    doc="TICLCandidate associated MTDTime, meaningful only for offline reconstruction"),
        MTDtimeError=Var("MTDtimeError", "float",
                         doc="Trackster associated MTD time error, meaningful only for offline reconstruction"),
        trackIdx=Var("trackPtr().key", "int",
                     doc="Index of hltGeneralTrack associated with TICLCandidate")
    ),
)
hltTiclCandidateExtraTable = cms.EDProducer(
    "TICLCandidateExtraTableProducer",
    src = cms.InputTag("hltTiclTrackstersMerge"),
    name = cms.string("Candidate2Tracksters"),
    doc = cms.string("TICLCandidates extra table with linked Tracksters"),
    collectionVariables = cms.PSet(
        tracksters = cms.PSet(
            name = cms.string("Candidate2TrackstersIndices"),
            doc = cms.string("Tracksters linked to TICLCandidates"),
            useCount = cms.bool(True),
            useOffset = cms.bool(False),
            variables = cms.PSet() 
        ),
    ),
)

hltSimTiclCandidateExtraTable = cms.EDProducer(
    "TICLCandidateExtraTableProducer",
    src = cms.InputTag("hltTiclSimTracksters"),
    name = cms.string("SimCandidate2Tracksters"),
    doc = cms.string("TICLCandidates extra table with linked Tracksters"),
    collectionVariables = cms.PSet(
        tracksters = cms.PSet(
            name = cms.string("SimCandidate2TrackstersIndices"),
            doc = cms.string("Tracksters linked to SimTICLCandidates"),
            useCount = cms.bool(True),
            useOffset = cms.bool(False),
            variables = cms.PSet() 
        ),
    ),
)

ticl_v5.toModify(hltTiclCandidateTable, src = cms.InputTag('hltTiclCandidate'))
ticl_v5.toModify(hltTiclCandidateExtraTable, src = cms.InputTag('hltTiclCandidate'))