Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:06:44

0001 import FWCore.ParameterSet.Config as cms
0002 import FWCore.ParameterSet.VarParsing as VarParsing
0003 
0004 process = cms.Process("OccupancyPlotsTest")
0005 
0006 #prepare options
0007 
0008 options = VarParsing.VarParsing("analysis")
0009 
0010 options.register ('globalTag',
0011                   "DONOTEXIST",
0012                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0013                   VarParsing.VarParsing.varType.string,          # string, int, or float
0014                   "GlobalTag")
0015 options.register ('HLTprocess',
0016                   "HLT",
0017                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0018                   VarParsing.VarParsing.varType.string,          # string, int, or float
0019                   "HLTProcess")
0020 options.register ('triggerPath',
0021                   "HLT_*",
0022                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0023                   VarParsing.VarParsing.varType.string,          # string, int, or float
0024                   "list of HLT paths")
0025 
0026 options.parseArguments()
0027 
0028 #
0029 
0030 process.options = cms.untracked.PSet(
0031     wantSummary = cms.untracked.bool(True),
0032     fileMode = cms.untracked.string("FULLMERGE")
0033     )
0034 
0035 process.load("FWCore.MessageService.MessageLogger_cfi")
0036 
0037 process.MessageLogger.cout.enable = cms.untracked.bool(True)
0038 process.MessageLogger.cout.threshold = cms.untracked.string("WARNING")
0039 process.MessageLogger.cout.default = cms.untracked.PSet(
0040     limit = cms.untracked.int32(10000000)
0041     )
0042 process.MessageLogger.cout.FwkReport = cms.untracked.PSet(
0043     reportEvery = cms.untracked.int32(10000)
0044     )
0045 
0046 process.MessageLogger.cerr.enable = cms.untracked.bool(True)
0047 process.MessageLogger.cerr.threshold = cms.untracked.string("WARNING")
0048 process.MessageLogger.cerr.default = cms.untracked.PSet(
0049     limit = cms.untracked.int32(10000000)
0050     )
0051 process.MessageLogger.cerr.FwkReport = cms.untracked.PSet(
0052     reportEvery = cms.untracked.int32(100000)
0053     )
0054 
0055 #------------------------------------------------------------------
0056 
0057 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
0058 
0059 process.source = cms.Source("PoolSource",
0060                     fileNames = cms.untracked.vstring(options.inputFiles),
0061 #                    skipBadFiles = cms.untracked.bool(True),
0062                     inputCommands = cms.untracked.vstring("keep *", "drop *_MEtoEDMConverter_*_*")
0063                     )
0064 
0065 # HLT Selection ------------------------------------------------------------
0066 process.load("HLTrigger.HLTfilters.triggerResultsFilter_cfi")
0067 process.triggerResultsFilter.triggerConditions = cms.vstring(options.triggerPath)
0068 process.triggerResultsFilter.hltResults = cms.InputTag( "TriggerResults", "", options.HLTprocess )
0069 process.triggerResultsFilter.l1tResults = cms.InputTag( "" )
0070 process.triggerResultsFilter.throw = cms.bool(False)
0071 
0072 process.seqHLTSelection = cms.Sequence(process.triggerResultsFilter)
0073 
0074 
0075 #--------------------------------------
0076 #from DPGAnalysis.SiStripTools.occupancyplotsselections_cff import *
0077 from DPGAnalysis.SiStripTools.occupancyplotsselections_simplified_cff import *
0078 
0079 process.ssclusmultprod = cms.EDProducer("SiStripClusterMultiplicityProducer",
0080                                         clusterdigiCollection = cms.InputTag("siStripClusters"),
0081                                         wantedSubDets = cms.VPSet()
0082                                         )
0083 process.ssclusmultprod.wantedSubDets.extend(OccupancyPlotsStripWantedSubDets)
0084 
0085 process.ssclusoccuprod = cms.EDProducer("SiStripClusterMultiplicityProducer",
0086                                         clusterdigiCollection = cms.InputTag("siStripClusters"),
0087                                         withClusterSize = cms.untracked.bool(True),
0088                                         wantedSubDets = cms.VPSet()
0089                                         )
0090 process.ssclusoccuprod.wantedSubDets.extend(OccupancyPlotsStripWantedSubDets)
0091 
0092 process.spclusmultprod = cms.EDProducer("SiPixelClusterMultiplicityProducer",
0093                                         clusterdigiCollection = cms.InputTag("siPixelClusters"),
0094                                         wantedSubDets = cms.VPSet()
0095                                         )
0096 process.spclusmultprod.wantedSubDets.extend(OccupancyPlotsPixelWantedSubDets)
0097 process.spclusmultprod.wantedSubDets.extend(cms.VPSet(
0098     cms.PSet(detSelection = cms.uint32(0),detLabel = cms.string("Pixel")),
0099     cms.PSet(detSelection = cms.uint32(1),detLabel = cms.string("BPIX")),
0100     cms.PSet(detSelection = cms.uint32(2),detLabel = cms.string("FPIX")),
0101     cms.PSet(detSelection=cms.uint32(11),detLabel=cms.string("BPIX_L1"),selection=cms.untracked.vstring("0x1e0f0000-0x12010000")),
0102     cms.PSet(detSelection=cms.uint32(12),detLabel=cms.string("BPIX_L2"),selection=cms.untracked.vstring("0x1e0f0000-0x12020000")),
0103     cms.PSet(detSelection=cms.uint32(13),detLabel=cms.string("BPIX_L3"),selection=cms.untracked.vstring("0x1e0f0000-0x12030000")),
0104     cms.PSet(detSelection=cms.uint32(21),detLabel=cms.string("FPIX_m"),selection=cms.untracked.vstring("0x1f800000-0x14800000")),
0105     cms.PSet(detSelection=cms.uint32(22),detLabel=cms.string("FPIX_p"),selection=cms.untracked.vstring("0x1f800000-0x15000000")),
0106     cms.PSet(detSelection=cms.uint32(99),detLabel=cms.string("Lumi"),selection=cms.untracked.vstring("0x1e0f0000-0x12020000",
0107                                                                                                      "0x1e0f0000-0x12030000",
0108                                                                                                      "0x1f800000-0x14800000",
0109                                                                                                      "0x1f800000-0x15000000"))
0110 ))
0111 
0112 process.spclusoccuprod = cms.EDProducer("SiPixelClusterMultiplicityProducer",
0113                                         clusterdigiCollection = cms.InputTag("siPixelClusters"),
0114                                         withClusterSize = cms.untracked.bool(True),
0115                                         wantedSubDets = cms.VPSet()
0116                                         )
0117 process.spclusoccuprod.wantedSubDets.extend(OccupancyPlotsPixelWantedSubDets)
0118 
0119 process.seqMultProd = cms.Sequence(process.ssclusmultprod + process.ssclusoccuprod +
0120                                    process.spclusmultprod + process.spclusoccuprod)
0121 
0122 process.load("DPGAnalysis.SiStripTools.occupancyplots_cfi")
0123 process.occupancyplots.wantedSubDets = OccupancyPlotsStripWantedSubDets
0124 
0125 process.pixeloccupancyplots = process.occupancyplots.clone()
0126 process.pixeloccupancyplots.wantedSubDets = cms.VPSet()
0127 process.pixeloccupancyplots.wantedSubDets.extend(OccupancyPlotsPixelWantedSubDets)
0128 process.pixeloccupancyplots.multiplicityMaps = cms.VInputTag(cms.InputTag("spclusmultprod"))
0129 process.pixeloccupancyplots.occupancyMaps = cms.VInputTag(cms.InputTag("spclusoccuprod"))
0130 
0131 process.alloccupancyplots = process.occupancyplots.clone()
0132 process.alloccupancyplots.wantedSubDets = cms.VPSet()
0133 process.alloccupancyplots.wantedSubDets.extend(OccupancyPlotsPixelWantedSubDets)
0134 process.alloccupancyplots.wantedSubDets.extend(OccupancyPlotsStripWantedSubDets)
0135 process.alloccupancyplots.multiplicityMaps = cms.VInputTag(cms.InputTag("spclusmultprod"),cms.InputTag("ssclusmultprod"))
0136 process.alloccupancyplots.occupancyMaps = cms.VInputTag(cms.InputTag("spclusoccuprod"),cms.InputTag("ssclusoccuprod"))
0137 
0138 process.load("DPGAnalysis.SiStripTools.spclusmultvtxposcorr_cfi")
0139 process.spclusmultvtxposcorr.multiplicityMap = cms.InputTag("spclusmultprod")
0140 process.spclusmultvtxposcorr.digiVtxPosCorrConfig.wantedSubDets = cms.untracked.VPSet(    
0141     cms.PSet(detSelection = cms.uint32(0),detLabel = cms.string("Pixel"), binMax = cms.int32(200000)),
0142     cms.PSet(detSelection = cms.uint32(1),detLabel = cms.string("BPIX"), binMax = cms.int32(200000)),
0143     cms.PSet(detSelection = cms.uint32(11),detLabel = cms.string("BPIX_L1"), binMax = cms.int32(200000)),
0144     cms.PSet(detSelection = cms.uint32(12),detLabel = cms.string("BPIX_L2"), binMax = cms.int32(200000)),
0145     cms.PSet(detSelection = cms.uint32(13),detLabel = cms.string("BPIX_L3"), binMax = cms.int32(200000)),
0146     cms.PSet(detSelection = cms.uint32(2),detLabel = cms.string("FPIX"), binMax = cms.int32(200000)),
0147     cms.PSet(detSelection = cms.uint32(21),detLabel = cms.string("FPIX_m"), binMax = cms.int32(200000)),
0148     cms.PSet(detSelection = cms.uint32(22),detLabel = cms.string("FPIX_p"), binMax = cms.int32(200000)),
0149     cms.PSet(detSelection = cms.uint32(99),detLabel = cms.string("Lumi"), binMax = cms.int32(200000)),
0150     cms.PSet(detSelection = cms.uint32(111),detLabel = cms.string("BPIX_L1_mod_1"), binMax = cms.int32(200000)),
0151     cms.PSet(detSelection = cms.uint32(112),detLabel = cms.string("BPIX_L1_mod_2"), binMax = cms.int32(200000)),
0152     cms.PSet(detSelection = cms.uint32(113),detLabel = cms.string("BPIX_L1_mod_3"), binMax = cms.int32(200000)),
0153     cms.PSet(detSelection = cms.uint32(114),detLabel = cms.string("BPIX_L1_mod_4"), binMax = cms.int32(200000)),
0154     cms.PSet(detSelection = cms.uint32(115),detLabel = cms.string("BPIX_L1_mod_5"), binMax = cms.int32(200000)),
0155     cms.PSet(detSelection = cms.uint32(116),detLabel = cms.string("BPIX_L1_mod_6"), binMax = cms.int32(200000)),
0156     cms.PSet(detSelection = cms.uint32(117),detLabel = cms.string("BPIX_L1_mod_7"), binMax = cms.int32(200000)),
0157     cms.PSet(detSelection = cms.uint32(118),detLabel = cms.string("BPIX_L1_mod_8"), binMax = cms.int32(200000))
0158     )
0159 
0160 
0161 process.load("TrackingPFG.Utilities.bxlumianalyzer_cfi")
0162 process.load("Validation.RecoVertex.mcverticesanalyzer_cfi")
0163 
0164 process.goodVertices = cms.EDFilter("VertexSelector",
0165    src = cms.InputTag("offlinePrimaryVertices"),
0166    cut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.Rho <= 2"),  
0167    filter = cms.bool(False),   # otherwise it won't filter the events, just produce an empty vertex collection.
0168 )
0169 
0170 process.load("Validation.RecoVertex.anotherprimaryvertexanalyzer_cfi")
0171 process.primaryvertexanalyzer.pvCollection=cms.InputTag("goodVertices")
0172 process.primaryvertexanalyzer.vHistogramMakerPSet.runHisto=cms.untracked.bool(False)
0173 process.primaryvertexanalyzer.vHistogramMakerPSet.runHistoProfile=cms.untracked.bool(False)
0174 process.primaryvertexanalyzer.vHistogramMakerPSet.runHistoBXProfile=cms.untracked.bool(False)
0175 
0176 process.seqAnalyzers = cms.Sequence(process.bxlumianalyzer + process.goodVertices + process.primaryvertexanalyzer +
0177                                     process.occupancyplots + process.pixeloccupancyplots + process.alloccupancyplots +
0178                                     process.spclusmultvtxposcorr + process.mcverticesanalyzer ) 
0179 
0180 #-------------------------------------------------------------------------------------------
0181 
0182 process.seqProducers = cms.Sequence(process.seqMultProd)
0183 
0184 process.p0 = cms.Path(
0185     process.seqHLTSelection +
0186     process.seqProducers +
0187     process.seqAnalyzers
0188     )
0189 
0190 #----GlobalTag ------------------------
0191 
0192 process.load("Configuration.StandardSequences.GeometryDB_cff")
0193 process.load("Configuration.StandardSequences.Reconstruction_cff")
0194 
0195 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0196 from Configuration.AlCa.GlobalTag import GlobalTag
0197 process.GlobalTag = GlobalTag(process.GlobalTag, options.globalTag, '')
0198 
0199 
0200 
0201 process.siStripQualityESProducer.ListOfRecordToMerge=cms.VPSet(
0202 #    cms.PSet( record = cms.string("SiStripDetVOffRcd"),    tag    = cms.string("") ),
0203     cms.PSet( record = cms.string("SiStripDetCablingRcd"), tag    = cms.string("") ),
0204     cms.PSet( record = cms.string("RunInfoRcd"),           tag    = cms.string("") ),
0205     cms.PSet( record = cms.string("SiStripBadChannelRcd"), tag    = cms.string("") ),
0206     cms.PSet( record = cms.string("SiStripBadFiberRcd"),   tag    = cms.string("") ),
0207     cms.PSet( record = cms.string("SiStripBadModuleRcd"),  tag    = cms.string("") )
0208 )
0209 
0210 process.TFileService = cms.Service('TFileService',
0211 #                                   fileName = cms.string('OccupancyPlotsTest_newschema.root')
0212                                    fileName = cms.string('OccupancyPlotsTest_vtxpos.root')
0213                                    )
0214 
0215 
0216 #print process.dumpPython()