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

process = cms.Process("CALIB")

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

process.source = cms.Source("EmptyIOVSource",
    timetype = cms.string('runnumber'),
    firstValue = cms.uint64(1), # Specify the first run number for which the masking should be done
    lastValue = cms.uint64(1),  # Specify the first run number for which the masking should be done
    interval = cms.uint64(1)
)

process.maxEvents = cms.untracked.PSet(
    input = cms.untracked.int32(1)
)

#Populate ES
process.load("CalibTracker.SiStripESProducers.fake.SiStripBadModuleConfigurableFakeESSource_cfi")
from CalibTracker.SiStripESProducers.fake.SiStripBadModuleConfigurableFakeESSource_cfi import siStripBadModuleConfigurableFakeESSource
siStripBadModuleConfigurableFakeESSource.BadComponentList = cms.untracked.VPSet(   cms.PSet(
### To mask TOB:
##     SubDet = cms.string('TOB'),
##     layer = cms.uint32(3),    ## SELECTION: layer = 1..6, 0(ALL)	       
##     bkw_frw = cms.uint32(0),  ## bkw_frw = 1(TOB-) 2(TOB+) 0(everything)     
##     rod = cms.uint32(0),      ## rod = 1..N, 0(ALL)			       
##     detid = cms.uint32(0),    ## detid number = 0 (ALL),  specific number 
##     ster = cms.uint32(0)      ## ster = 1(stereo), 2 (nonstereo), 0(ALL)

### To mask TIB:
##     SubDet = cms.string('TIB'),  
##     layer = cms.uint32(2),      ## SELECTION: layer = 1..4, 0(ALL)		    
##     bkw_frw = cms.uint32(0),    ## bkw_frw = 1(TIB-), 2(TIB+) 0(ALL)	    
##     int_ext = cms.uint32(0),    ## int_ext = 1 (internal), 2(external), 0(ALL)  
##     ster = cms.uint32(0),       ## ster = 1(stereo), 2 (nonstereo), 0(ALL)	    
##     string_ = cms.uint32(0),    ## string = 1..N, 0(ALL)			    
##     detid = cms.uint32(0)       ## detid number = 0 (ALL),  specific number 

### To mask TID:
##     SubDet = cms.string('TID'), 
##     side = cms.uint32(0),       ## SELECTION: side = 1(back, Z-), 2(front, Z+), 0(ALL)	 
##     wheel = cms.uint32(2),      ## wheel = 1..3, 0(ALL)					 
##     ring = cms.uint32(0),       ## ring  = 1..3, 0(ALL)					 
##     ster = cms.uint32(0),       ## ster = 1(stereo), 2 (nonstereo), 0(ALL)		 
##     detid = cms.uint32(0)       ## detid number = 0 (ALL),  specific number

### To mask TEC:
    SubDet = cms.string('TEC'), 
    side = cms.uint32(1),          ## SELECTION: side = 1(back, Z-), 2(front, Z+), 0(ALL)	 
    wheel = cms.uint32(0),         ## wheel = 1..9, 0(ALL)					 
    ring = cms.uint32(0),          ## ring  = 1..7, 0(ALL)
    petal_bkw_frw = cms.uint32(0), ## petal_bkw_frw = 1(backward) 2(forward) 0(all)
    petal = cms.uint32(7),         ## petal = 1..8, 0(ALL)
    ster = cms.uint32(0),          ## ster = 1(stereo), 2 (nonstereo), 0(ALL)		 
    detid = cms.uint32(0),         ## detid number = 0 (ALL),  specific number

    # This list is independent on all the rest. Any module appearing here will be masked.
    detidList = cms.untracked.vuint32(402666125,
                            402666126,
                            402666129,
                            402666130,
                            402666133,
                            402666134,
                            402666137,
                            402666138,
                            402666141,
                            402666142,
                            402666145,
                            402666146,
                            402666257,
                            402666258,
                            402666261,
                            402666262,
                            402666265,
                            402666266,
                            402666269,
                            402666270,
                            402666273,
                            402666274,
                            402666277,
                            402666278,
                            402666629,
                            402666630,
                            402666633,
                            402666634,
                            402666637,
                            402666638,
                            402666641,
                            402666642,
                            402666669,
                            402666670,
                            402666673,
                            402666674,
                            402666777,
                            402666778,
                            402666781,
                            402666782,
                            402666785,
                            402666786,
                            402666789,
                            402666790,
                            402666793,
                            402666794,
                            402666797,
                            402666798
                            )
    )
)
#Write on DB
process.load("CalibTracker.SiStripESProducers.DBWriter.SiStripBadModuleDummyDBWriter_cfi")
process.siStripBadModuleDummyDBWriter.OpenIovAt = cms.untracked.string("currentTime")

process.PoolDBOutputService = cms.Service("PoolDBOutputService",
    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'),
    toPut = cms.VPSet(cms.PSet(
        record = cms.string('SiStripBadStrip'),
        tag = cms.string('SiStripBadComponents_TECminus')
        ))
)


###### Quality ESProducer                                                                       
process.load("CalibTracker.SiStripESProducers.SiStripQualityESProducer_cfi")
process.siStripQualityESProducer.ListOfRecordToMerge = cms.VPSet(
     cms.PSet( record = cms.string("SiStripBadModuleRcd"),  tag    = cms.string("") )
     )

#### Add these lines to produce a tracker map
# load TrackerTopology (needed for TkDetMap and TkHistoMap)
process.load("Configuration.Geometry.GeometryExtended2017_cff")
process.load("Geometry.TrackerGeometryBuilder.trackerParameters_cfi")
process.TrackerTopologyEP = cms.ESProducer("TrackerTopologyEP")
process.load("DQM.SiStripCommon.TkHistoMap_cff")
####

from CalibTracker.SiStripQuality.siStripQualityStatistics_cfi import siStripQualityStatistics
process.reader = siStripQualityStatistics.clone(
        TkMapFileName = cms.untracked.string("TkMapBadComponents_byHand.png")
        )

process.siStripBadModuleDummyDBWriter.record=process.PoolDBOutputService.toPut[0].record
process.p = cms.Path(process.reader*process.siStripBadModuleDummyDBWriter)