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 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
import FWCore.ParameterSet.Config as cms

bxBins = [1]

bxStepSizes = [9, 50, 100, 300]
bxMaxVals = [101, 1501, 2401, 3601]
runningMinVal = 1

for stepCounter in range(len(bxStepSizes)):
    runningMinVal = bxBins[-1]
    bxStepSize = bxStepSizes[stepCounter]
    bxMaxVal = bxMaxVals[stepCounter]
    bxBins += list(range(runningMinVal + bxStepSize, bxMaxVal, bxStepSize))

bxBinLabels = [str(bxBins[0])]
for bxBinCounter in range(0, -1+len(bxBins)):
    bxBinLabels += [str(1+bxBins[bxBinCounter]) + "-->" + str(bxBins[bxBinCounter+1])]

nBXBins = len(bxBins)

bxBinsFine = [i for i in range(1, 3601)]
bxBinLabelsFine = [str(i) for i in range(1, 3601)]
nBXBinsFine = len(bxBinsFine)

EaxisEdges = []
for i in range(50) :
    EaxisEdges.append(pow(10., -0.5 + 2.5 / 50. * i))

chi2ThresholdEE = 50.
chi2ThresholdEB = 16.
energyThresholdEE = 4.6
energyThresholdEEFwd = 12.
energyThresholdEB = 2.02
timingVsBXThreshold = energyThresholdEB
timeErrorThreshold = 3.
timeWindow = 12.5
summaryTimeWindow = 7.

ecalTimingTask = cms.untracked.PSet(
    params = cms.untracked.PSet(
        bxBins = cms.untracked.vint32(bxBins),
        bxBinsFine = cms.untracked.vint32(bxBinsFine),
        chi2ThresholdEE = cms.untracked.double(chi2ThresholdEE),
        chi2ThresholdEB = cms.untracked.double(chi2ThresholdEB),
        energyThresholdEE = cms.untracked.double(energyThresholdEE),
        energyThresholdEEFwd = cms.untracked.double(energyThresholdEEFwd),
        energyThresholdEB = cms.untracked.double(energyThresholdEB),
        timingVsBXThreshold = cms.untracked.double(timingVsBXThreshold),
        timeErrorThreshold = cms.untracked.double(timeErrorThreshold),
        splashSwitch = cms.untracked.bool(False)
    ),
    MEs = cms.untracked.PSet(
        TimeMap = cms.untracked.PSet(
            path = cms.untracked.string('%(subdet)s/%(prefix)sTimingTask/%(prefix)sTMT timing %(sm)s'),
            kind = cms.untracked.string('TProfile2D'),
            zaxis = cms.untracked.PSet(
                high = cms.untracked.double(timeWindow),
                low = cms.untracked.double(-timeWindow),
                title = cms.untracked.string('time (ns)')
            ),
            otype = cms.untracked.string('SM'),
            btype = cms.untracked.string('Crystal'),
            description = cms.untracked.string('2D distribution of the mean rec hit timing. Only hits with GOOD or OUT_OF_TIME reconstruction flags and energy above threshold are used. Hits with |t| > ' + str(timeWindow) + ' ns are discarded. The energy thresholds are ' + ('%f and %f' % (energyThresholdEB, energyThresholdEE)) + ' for EB and EE respectively.')
        ),
        TimeMapByLS = cms.untracked.PSet(
            path = cms.untracked.string('%(subdet)s/%(prefix)sTimingTask/%(prefix)sTMT timing by LS %(sm)s'),
            kind = cms.untracked.string('TProfile2D'),
            zaxis = cms.untracked.PSet(
                high = cms.untracked.double(timeWindow),
                low = cms.untracked.double(-timeWindow),
                title = cms.untracked.string('time (ns)')
            ),
            otype = cms.untracked.string('SM'),
            btype = cms.untracked.string('Crystal'),
            description = cms.untracked.string('2D distribution of the mean rec hit timing. Only hits with GOOD or OUT_OF_TIME reconstruction flags and energy above threshold are used. Hits with |t| > ' + str(timeWindow) + ' ns are discarded. The energy thresholds are ' + ('%f and %f' % (energyThresholdEB, energyThresholdEE)) + ' for EB and EE respectively.')
        ),
        TimeAll = cms.untracked.PSet(
            path = cms.untracked.string('%(subdet)s/%(prefix)sTimingTask/%(prefix)sTMT timing 1D summary%(suffix)s'),
            kind = cms.untracked.string('TH1F'),
            otype = cms.untracked.string('Ecal3P'),
            xaxis = cms.untracked.PSet(
                high = cms.untracked.double(timeWindow),
                nbins = cms.untracked.int32(100),
                low = cms.untracked.double(-timeWindow),
                title = cms.untracked.string('time (ns)')
            ),
            btype = cms.untracked.string('User'),
            description = cms.untracked.string('Distribution of the mean rec hit timing. Only hits with GOOD or OUT_OF_TIME reconstruction flags and energy above threshold are used. The energy thresholds are ' + ('%f and %f' % (energyThresholdEB, energyThresholdEE)) + ' for EB and EE respectively.')
        ),
        TimeAllMap = cms.untracked.PSet(
            path = cms.untracked.string('%(subdet)s/%(prefix)sTimingTask/%(prefix)sTMT timing map%(suffix)s'),
            kind = cms.untracked.string('TProfile2D'),
            zaxis = cms.untracked.PSet(
                high = cms.untracked.double(summaryTimeWindow),
                low = cms.untracked.double(-summaryTimeWindow),
                title = cms.untracked.string('time (ns)')
            ),
            otype = cms.untracked.string('Ecal3P'),
            btype = cms.untracked.string('SuperCrystal'),
            description = cms.untracked.string('2D distribution of the mean rec hit timing. Only hits with GOOD or OUT_OF_TIME reconstruction flags and energy above threshold are used. Hits with |t| > ' + str(summaryTimeWindow) + ' ns are discarded. The energy thresholds are ' + ('%f and %f' % (energyThresholdEB, energyThresholdEE)) + ' for EB and EE respectively.')
        ),
        TimeAmpAll = cms.untracked.PSet(
            kind = cms.untracked.string('TH2F'),
            yaxis = cms.untracked.PSet(
                high = cms.untracked.double(50.0),
                nbins = cms.untracked.int32(200),
                low = cms.untracked.double(-50.0),
                title = cms.untracked.string('time (ns)')
            ),
            otype = cms.untracked.string('Ecal3P'),
            xaxis = cms.untracked.PSet(
                edges = cms.untracked.vdouble(EaxisEdges),
                title = cms.untracked.string('energy (GeV)')
            ),
            btype = cms.untracked.string('User'),
            path = cms.untracked.string('%(subdet)s/%(prefix)sTimingTask/%(prefix)sTMT timing vs amplitude summary%(suffix)s'),
            description = cms.untracked.string('Correlation between hit timing and energy. Only hits with GOOD or OUT_OF_TIME reconstruction flags are used.')
        ),
        TimeAmp = cms.untracked.PSet(
            kind = cms.untracked.string('TH2F'),
            yaxis = cms.untracked.PSet(
                high = cms.untracked.double(50.0),
                nbins = cms.untracked.int32(200),
                low = cms.untracked.double(-50.0),
                title = cms.untracked.string('time (ns)')
            ),
            otype = cms.untracked.string('SM'),
            xaxis = cms.untracked.PSet(
                edges = cms.untracked.vdouble(EaxisEdges),
                title = cms.untracked.string('energy (GeV)')
            ),
            btype = cms.untracked.string('User'),
            path = cms.untracked.string('%(subdet)s/%(prefix)sTimingTask/%(prefix)sTMT timing vs amplitude %(sm)s'),
            description = cms.untracked.string('Correlation between hit timing and energy. Only hits with GOOD or OUT_OF_TIME reconstruction flags are used.')
        ),
        BarrelTimingVsBX = cms.untracked.PSet(
            path = cms.untracked.string('EcalBarrel/EBTimingTask/EBTMT Timing vs BX'),
            kind = cms.untracked.string('TProfile'),
            otype = cms.untracked.string('EB'),
            xaxis = cms.untracked.PSet(
                high = cms.untracked.double(1.0*nBXBins),
                nbins = cms.untracked.int32(nBXBins),
                low = cms.untracked.double(0.0),
                title = cms.untracked.string('BX Id'),
                labels = cms.untracked.vstring(bxBinLabels)
            ),
            yaxis = cms.untracked.PSet(
                title = cms.untracked.string('Timing (ns)')
            ),
            btype = cms.untracked.string('User'),
            description = cms.untracked.string('Average hit timing in EB as a function of BX number. BX ids start at 1. Only events with energy above 2.02 GeV and chi2 less than 16 are used.')
        ),
        BarrelTimingVsBXFineBinned = cms.untracked.PSet(
            path = cms.untracked.string('EcalBarrel/EBTimingTask/EBTMT Timing vs Finely Binned BX'),
            kind = cms.untracked.string('TProfile'),
            otype = cms.untracked.string('EB'),
            xaxis = cms.untracked.PSet(
                high = cms.untracked.double(1.0*nBXBinsFine),
                nbins = cms.untracked.int32(nBXBinsFine),
                low = cms.untracked.double(0.0),
                title = cms.untracked.string('BX Id'),
                labels = cms.untracked.vstring(bxBinLabelsFine)
            ),
            yaxis = cms.untracked.PSet(
                title = cms.untracked.string('Timing (ns)')
            ),
            btype = cms.untracked.string('User'),
            description = cms.untracked.string('Average hit timing in EB as a finely binned function of BX number. BX ids start at 1. Only events with energy above 2.02 GeV and chi2 less than 16 are used. The Customize button can be used to zoom in.')
        ),
        TimeAmpBXm = cms.untracked.PSet(
            kind = cms.untracked.string('TH2F'),
            yaxis = cms.untracked.PSet(
                high = cms.untracked.double(100.0),
                nbins = cms.untracked.int32(100),
                low = cms.untracked.double(0.0),
                title = cms.untracked.string('Amplitude BX-1 [ADC]')
            ),
            otype = cms.untracked.string('Ecal3P'),
            xaxis = cms.untracked.PSet(
                high = cms.untracked.double(1000.0),
                nbins = cms.untracked.int32(250),
                low = cms.untracked.double(0.0),
                title = cms.untracked.string('In-time amplitude [ADC]')
            ),
            btype = cms.untracked.string('User'),
            path = cms.untracked.string('%(subdet)s/%(prefix)sTimingTask/%(prefix)sTMT in-time vs BX-1 amplitude%(suffix)s'),
            description = cms.untracked.string('Correlation between in-time amplitude and BX-1 out-of-time amplitude. Only events with kGood reconstruction flag set, energy > ( ' + ('EB:%f, EE:%f' % (energyThresholdEB*20., energyThresholdEE*5.)) + ' ) GeV, and chi2 < ( ' + ('EB:%f, EE:%f' % (chi2ThresholdEB, chi2ThresholdEE)) + ' ) are used.')
        ),
        TimeAmpBXp = cms.untracked.PSet(
            kind = cms.untracked.string('TH2F'),
            yaxis = cms.untracked.PSet(
                high = cms.untracked.double(100.0),
                nbins = cms.untracked.int32(100),
                low = cms.untracked.double(0.0),
                title = cms.untracked.string('Amplitude BX+1 [ADC]')
            ),
            otype = cms.untracked.string('Ecal3P'),
            xaxis = cms.untracked.PSet(
                high = cms.untracked.double(1000.0),
                nbins = cms.untracked.int32(250),
                low = cms.untracked.double(0.0),
                title = cms.untracked.string('In-time amplitude [ADC]')
            ),
            btype = cms.untracked.string('User'),
            path = cms.untracked.string('%(subdet)s/%(prefix)sTimingTask/%(prefix)sTMT in-time vs BX+1 amplitude%(suffix)s'),
            description = cms.untracked.string('Correlation between in-time amplitude and BX+1 out-of-time amplitude. Only events with kGood reconstruction flag set, energy > ( ' + ('EB:%f, EE:%f' % (energyThresholdEB*20., energyThresholdEE*5.)) + ' ) GeV, and chi2 < ( ' + ('EB:%f, EE:%f' % (chi2ThresholdEB, chi2ThresholdEE)) + ' ) are used.')
        ),
        Time1D = cms.untracked.PSet(
            path = cms.untracked.string('%(subdet)s/%(prefix)sTimingTask/%(prefix)sTMT timing 1D %(sm)s'),
            kind = cms.untracked.string('TH1F'),
            otype = cms.untracked.string('SM'),
            xaxis = cms.untracked.PSet(
                high = cms.untracked.double(timeWindow),
                nbins = cms.untracked.int32(100),
                low = cms.untracked.double(-timeWindow),
                title = cms.untracked.string('time (ns)')
            ),
            btype = cms.untracked.string('User'),
            description = cms.untracked.string('Distribution of the mean rec hit timing. Only hits with GOOD or OUT_OF_TIME reconstruction flags and energy above threshold are used. The energy thresholds are ' + ('%f and %f' % (energyThresholdEB, energyThresholdEE)) + ' for EB and EE respectively.')
        ),
        Chi2 = cms.untracked.PSet(
            path = cms.untracked.string("%(subdet)s/%(prefix)sTimingTask/%(prefix)sTMT %(subdetshortsig)s Chi2"),
            kind = cms.untracked.string('TH1F'),
            otype = cms.untracked.string('Ecal3P'),
            btype = cms.untracked.string('User'),
            xaxis = cms.untracked.PSet(
                high = cms.untracked.double(100.),
                low = cms.untracked.double(0.),
                nbins = cms.untracked.int32(100)
            ),
            description = cms.untracked.string('Chi2 of the pulse reconstruction.')
        )
    )
)