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
import FWCore.ParameterSet.Config as cms

process = cms.Process("ProcessOne")
process.load("CondCore.CondDB.CondDB_cfi")
process.CondDB.connect = 'sqlite_file:EcalSRSettings_beam2016_option1_v1_mc.db'
#process.load("CondCore.DBCommon.CondDBCommon_cfi")
#process.CondDBCommon.connect = 'sqlite_file:EcalSRSettings_beam2015_option1_v00_mc.db'
#process.CondDBCommon.DBParameters.authenticationPath = '/afs/cern.ch/cms/DB/conddb'

process.MessageLogger = cms.Service("MessageLogger",
    cerr = cms.untracked.PSet(
        enable = cms.untracked.bool(False)
    ),
    cout = cms.untracked.PSet(
        enable = cms.untracked.bool(True)
    ),
    debugModules = cms.untracked.vstring('*')
)

process.source = cms.Source("EmptyIOVSource",
                                firstValue = cms.uint64(1),
                                lastValue = cms.uint64(1),
                                timetype = cms.string('runnumber'),
                                interval = cms.uint64(1)
                            )

process.PoolDBOutputService = cms.Service("PoolDBOutputService",
    process.CondDB,
#    process.CondDBCommon,
    toPut = cms.VPSet(cms.PSet(
        record = cms.string('EcalSRSettingsRcd'),
        tag = cms.string('EcalSRSettings_beam2016_option1_v1_mc')
    ))
)

process.writeInDB = cms.EDAnalyzer("EcalSRCondTools",
#   mode = cms.string("combine_config"), #Gets config from EcalSRCondTools module parameters,
                                         #use values from onlineSrpConfigFile for the configuration
                                         #not defined as module parameters. Values from module parameters
                                         #take the precedence.
                                   
    mode = cms.string("python_config"), #configuration read from EcalSRCondTools module parameters (e.g. to produce MC config.)

#    mode = cms.string("online_config"), #import online SRP config from onlineSrpConfigFile file and bxGlobalOffset,
                                         #automaticSrpSelect, automaticMasks parameters


    onlineSrpConfigFile = cms.string("srp.cfg"),
                                 
    # Neighbour eta range, neighborhood: (2*deltaEta+1)*(2*deltaPhi+1)
    deltaEta = cms.int32(1),

    # Neighbouring eta range, neighborhood: (2*deltaEta+1)*(2*deltaPhi+1)
    deltaPhi = cms.int32(1),

    # Index of time sample (staring from 1) the first DCC weights is implied
    ecalDccZs1stSample = cms.int32(2),

    # ADC to GeV conversion factor used in ZS filter for EB
    ebDccAdcToGeV = cms.double(0.035),

    # ADC to GeV conversion factor used in ZS filter for EE
    eeDccAdcToGeV = cms.double(0.06),

    #DCC ZS FIR weights: weights are rounded in such way that in Hw
    #representation (weigth*1024 rounded to nearest integer) the sum is null:
    dccNormalizedWeights = cms.vdouble(-0.374, -0.374, -0.3629, 0.2721, 0.4681, 
        0.3707),

    # Switch to use a symetric zero suppression (cut on absolute value). For
    # studies only, for time being it is not supported by the hardware.
    symetricZS = cms.bool(False),

    # ZS energy threshold in GeV to apply to low interest channels of barrel
    srpBarrelLowInterestChannelZS = cms.double(0.1),

    # ZS energy threshold in GeV to apply to low interest channels of endcap
    srpEndcapLowInterestChannelZS = cms.double(0.3),

    # ZS energy threshold in GeV to apply to high interest channels of barrel
    srpBarrelHighInterestChannelZS = cms.double(-1.e9),

    # ZS energy threshold in GeV to apply to high interest channels of endcap
    srpEndcapHighInterestChannelZS = cms.double(-1.e9),

    #switch to run w/o trigger primitive. For debug use only
    trigPrimBypass = cms.bool(False),

    # Mode selection for "Trig bypass" mode
    # 0: TT thresholds applied on sum of crystal Et's
    # 1: TT thresholds applies on compressed Et from Trigger primitive
    # @ee trigPrimByPass_ switch
    trigPrimBypassMode = cms.int32(0),
                              
    #for debug mode only:
    trigPrimBypassLTH = cms.double(1.0),

    #for debug mode only:
    trigPrimBypassHTH = cms.double(1.0),

    #for debug mode only
    trigPrimBypassWithPeakFinder = cms.bool(True),
                              
    #Trigger Tower Flag to use when a flag is not found from the input
    #Trigger Primitive collection. Must be one of the following values:
    # 0: low interest, 1: mid interest, 3: high interest
    # 4: forced low interest, 5: forced mid interest, 7: forced high interest
    defaultTtf = cms.int32(4),

    # SR->action flag map
    actions = cms.vint32(1, 3, 3, 3, 5, 7, 7, 7),

    #Bx offset common to every SRP card. used in both write mdes
    #called SRP0BUNCHADJUSTPOSITION in online configuration database
    bxGlobalOffset = cms.int32(3447),

    #Switch for selecion of SRP board to controls base on
    #the list of ECAL FEDs included in the run (online specific parameter) 
    automaticSrpSelect = cms.int32(1),

    #Switch for automatic masking TCC input channels of SRP boards
    #if the correcponding ECAL FED is excluded from the run (online specific parameter)
    automaticMasks = cms.int32(1)
)


## Changes settings to 2009 and 2010 beam ones:
##
## DCC ZS FIR weights.
#process.writeInDB.dccNormalizedWeights = cms.vdouble(-1.1865, 0.0195, 0.2900, 0.3477, 0.3008, 0.2266)
#
## Index of time sample (starting from 1) the first DCC weights is implied
#process.writeInDB.ecalDccZs1stSample = cms.int32(3)
#
## ZS energy threshold in GeV to apply to low interest channels of barrel
#process.writeInDB.ebDccAdcToGeV = cms.double(0.035)
#process.writeInDB.srpBarrelLowInterestChannelZS = cms.double(2.25*0.035)
#
## ZS energy threshold in GeV to apply to low interest channels of endcap
#process.writeInDB.eeDccAdcToGeV = cms.double(0.06)
#process.writeInDB.srpEndcapLowInterestChannelZS = cms.double(3.75*0.06)


## Changes settings to 2011 beam ones:
## Index of time sample (starting from 1) the first DCC weights is implied
#process.writeInDB.ecalDccZs1stSample = cms.int32(2)
#
## ZS energy threshold in GeV to apply to low interest channels of barrel
#process.writeInDB.ebDccAdcToGeV = cms.double(0.035)
#process.writeInDB.srpBarrelLowInterestChannelZS = cms.double(2.25*0.035)
#
## ZS energy threshold in GeV to apply to low interest channels of endcap
#process.writeInDB.eeDccAdcToGeV = cms.double(0.06)
#process.writeInDB.srpEndcapLowInterestChannelZS = cms.double(3.75*0.06)


## Changes settings to 2012 beam ones:
## Index of time sample (starting from 1) the first DCC weights is implied
#process.writeInDB.ecalDccZs1stSample = cms.int32(2)
#
## ZS energy threshold in GeV to apply to low interest channels of barrel
#process.writeInDB.ebDccAdcToGeV = cms.double(0.035)
#process.writeInDB.srpBarrelLowInterestChannelZS = cms.double(2.75*0.035)
#
## ZS energy threshold in GeV to apply to low interest channels of endcap
#process.writeInDB.eeDccAdcToGeV = cms.double(0.06)
#process.writeInDB.srpEndcapLowInterestChannelZS = cms.double(6*0.06)

# Changes settings to 2015 beam ones:
# Index of time sample (starting from 1) the first DCC weights is implied
#process.writeInDB.ecalDccZs1stSample = cms.int32(3)

# ZS energy threshold in GeV to apply to low interest channels of barrel
process.writeInDB.ebDccAdcToGeV = cms.double(0.035)
process.writeInDB.srpBarrelLowInterestChannelZS = cms.double(0.1575)
# 3.278 = noise increase vs ADC count = 1.1 , so in this case noise = 3.6 ADC counts
# ZS energy threshold in GeV to apply to low interest channels of endcap
process.writeInDB.eeDccAdcToGeV = cms.double(0.06)
process.writeInDB.srpEndcapLowInterestChannelZS = cms.double(0.39)

process.p = cms.Path(process.writeInDB)