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
# The following comments couldn't be translated into the new config version:

# upload to database 

#string timetype = "timestamp"    

import FWCore.ParameterSet.Config as cms

process = cms.Process("Reader")

# Use this to have also debug info (WARNING: the resulting file is > 200MB.
process.MessageLogger = cms.Service("MessageLogger",
    cerr = cms.untracked.PSet(
        enable = cms.untracked.bool(False)
    ),
    debugModules = cms.untracked.vstring('*'),
    files = cms.untracked.PSet(
        GainReaderDebug = cms.untracked.PSet(
            threshold = cms.untracked.string('DEBUG')
        ),
        GainReaderSummary = cms.untracked.PSet(
            threshold = cms.untracked.string('INFO')
        )
    )
)

# How to use the EmptyIOVSource:
# the EmptyIOVSource will generate N events with a given interval.
# the N events must be specified in the maxEvents as usual but the
# first value, last value, timetype (runnumber, timestamp or lumiid) must be specified
# in the EmptyIOVSource configuration block. It will then generate events with the given
# interval.
# To generate one event per run in a given range of runs you should then use:
# - first - last value as the run range
# - interval == 1 (means move of one run unit at a time)
# - maxEvents = lastValue - firstValue (so that there is one event per run
# otherwise it will stop before completing the range or it will go beyond (to infinity).

process.maxEvents = cms.untracked.PSet(
    input = cms.untracked.int32(5)
)
process.source = cms.Source("EmptyIOVSource",
    timetype   = cms.string('runnumber'),
    firstValue = cms.uint64(97),
    lastValue  = cms.uint64(102),
    interval = cms.uint64(1)
)

process.load("CalibTracker.SiStripESProducers.SiStripGainESProducer_cfi")

# Need to specify the Record for each ApvGain.
# Optionally the Label associated to the tag can also be specified (default = "").
process.siStripGainESProducer.APVGain = cms.VPSet(
   cms.PSet(
       Record = cms.string('SiStripApvGainRcd'),
       Label = cms.untracked.string('SiStripApvGain_test_1')
   ),
   # cms.PSet(
   #     Record = cms.string('SiStripApvGain2Rcd'),
   #     Label = cms.untracked.string('SiStripApvGain_test_2')
   cms.PSet(
       Record = cms.string('SiStripApvGain2Rcd'),
   ),
)

# process.siStripGainESProducer.APVGain[0].Label = "SiStripApvGain_test_1"

# From CondCore/ESSources V09-00-06 it is possible to use a single ESSource.
# For earlier versions the two tags to go in the same record must be loaded by two different PoolDBESSources.
process.poolDBESSource = cms.ESSource(
    "PoolDBESSource",
    BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService'),
    DBParameters = cms.PSet(
        messageLevel = cms.untracked.int32(2),
        authenticationPath = cms.untracked.string('/afs/cern.ch/cms/DB/conddb')
    ),
    timetype = cms.untracked.string('runnumber'),
    connect = cms.string('sqlite_file:dbfile.db'),
    toGet = cms.VPSet(
        cms.PSet(
            record = cms.string('SiStripApvGainRcd'),
            tag = cms.string('SiStripApvGain_test_1'),
            label = cms.untracked.string('SiStripApvGain_test_1')
        ),
#        cms.PSet(
#            record = cms.string('SiStripApvGainRcd'),
#            tag = cms.string('SiStripApvGain_test_2'),
#            label = cms.untracked.string('SiStripApvGain_test_2')
#        )
    )
)

process.poolDBESSource2 = cms.ESSource("PoolDBESSource",
   DBParameters = cms.PSet(
       messageLevel = cms.untracked.int32(2),
       authenticationPath = cms.untracked.string('/afs/cern.ch/cms/DB/conddb')
   ),
   connect = cms.string('sqlite_file:dbfile.db'),
   toGet = cms.VPSet(cms.PSet(
       record = cms.string('SiStripApvGain2Rcd'),
       # tag = cms.string('SiStripApvGain_test_2'),
       # label = cms.untracked.string('SiStripApvGain_test_2')
       tag = cms.string('SiStripApvGain_Ideal_31X'),
       # label = cms.untracked.string('')
   ))
)

process.reader = cms.EDFilter("SiStripGainDummyPrinter")
                              
process.p1 = cms.Path(process.reader)