Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:09:12

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 import FWCore.ParameterSet.VarParsing as VarParsing
0004 
0005 process = cms.Process("MultiplicityMonitor")
0006 
0007 #prepare options
0008 
0009 options = VarParsing.VarParsing("analysis")
0010 
0011 options.register ('globalTag',
0012                   "DONOTEXIST",
0013                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0014                   VarParsing.VarParsing.varType.string,          # string, int, or float
0015                   "GlobalTag")
0016 options.register ('fromRAW',
0017                   "0",
0018                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0019                   VarParsing.VarParsing.varType.int,          # string, int, or float
0020                   "=1 if from RAW")
0021 options.register ('testTag',
0022                   "0",
0023                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0024                   VarParsing.VarParsing.varType.int,          # string, int, or float
0025                   "=1 if test tag to be used")
0026 
0027 options.parseArguments()
0028 
0029 #
0030 
0031 process.options = cms.untracked.PSet(
0032     wantSummary = cms.untracked.bool(True),
0033     fileMode = cms.untracked.string("FULLMERGE")
0034     )
0035 
0036 process.load("FWCore.MessageService.MessageLogger_cfi")
0037 
0038 process.MessageLogger.cout.enable = cms.untracked.bool(True)
0039 process.MessageLogger.cout.threshold = cms.untracked.string("INFO")
0040 process.MessageLogger.cout.default = cms.untracked.PSet(
0041     limit = cms.untracked.int32(10000000)
0042     )
0043 process.MessageLogger.cout.FwkReport = cms.untracked.PSet(
0044     reportEvery = cms.untracked.int32(10000)
0045     )
0046 
0047 process.MessageLogger.cerr.enable = cms.untracked.bool(True)
0048 process.MessageLogger.cerr.threshold = cms.untracked.string("WARNING")
0049 process.MessageLogger.cerr.default = cms.untracked.PSet(
0050     limit = cms.untracked.int32(10000000)
0051     )
0052 process.MessageLogger.cerr.FwkReport = cms.untracked.PSet(
0053     reportEvery = cms.untracked.int32(100000)
0054     )
0055 
0056 #------------------------------------------------------------------
0057 
0058 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents) )
0059 
0060 process.source = cms.Source("PoolSource",
0061                     fileNames = cms.untracked.vstring(options.inputFiles),
0062 #                    skipBadFiles = cms.untracked.bool(True),
0063                     inputCommands = cms.untracked.vstring("keep *", "drop *_MEtoEDMConverter_*_*")
0064                     )
0065 
0066 #--------------------------------------
0067 process.seqRECO = cms.Sequence()
0068 
0069 if options.fromRAW == 1:
0070     process.load("Configuration.StandardSequences.RawToDigi_Data_cff")
0071     process.load("Configuration.StandardSequences.MagneticField_cff")
0072     process.load("Configuration.StandardSequences.GeometryDB_cff")
0073     process.load("Configuration.StandardSequences.Reconstruction_cff")
0074     process.load("Configuration.StandardSequences.L1Reco_cff")
0075     process.seqRECO = cms.Sequence(process.gtEvmDigis + process.L1Reco
0076                                    + process.siStripDigis + process.siStripZeroSuppression + process.siStripClusters
0077                                    + process.siPixelDigis + process.siPixelClusters )
0078 
0079 
0080 #
0081 
0082 process.load("DPGAnalysis.SiStripTools.sipixelclustermultiplicityprod_cfi")
0083 process.load("DPGAnalysis.SiStripTools.sistripclustermultiplicityprod_cfi")
0084 
0085 #process.spclustermultprod.wantedSubDets.append = cms.VPSet(    
0086 #    cms.PSet(detSelection = cms.uint32(101),detLabel = cms.string("BPIX"),selection=cms.untracked.vstring("0x1e000000-0x12000000")),
0087 #    cms.PSet(detSelection = cms.uint32(102),detLabel = cms.string("FPIX"),selection=cms.untracked.vstring("0x1e000000-0x14000000"))
0088 #)
0089 
0090 #process.ssclustermultprod.wantedSubDets.append = cms.VPSet(    
0091 #    cms.PSet(detSelection = cms.uint32(103),detLabel = cms.string("TIB"),selection=cms.untracked.vstring("0x1e000000-0x16000000")),
0092 #    cms.PSet(detSelection = cms.uint32(105),detLabel = cms.string("TOB"),selection=cms.untracked.vstring("0x1e000000-0x1a000000")),
0093 #    cms.PSet(detSelection = cms.uint32(114),detLabel = cms.string("TIDm"),selection=cms.untracked.vstring("0x1e006000-0x18002000")),
0094 #    cms.PSet(detSelection = cms.uint32(124),detLabel = cms.string("TIDp"),selection=cms.untracked.vstring("0x1e006000-0x18004000")),
0095 #    cms.PSet(detSelection = cms.uint32(116),detLabel = cms.string("TECm"),selection=cms.untracked.vstring("0x1e0c0000-0x1c040000")),
0096 #    cms.PSet(detSelection = cms.uint32(126),detLabel = cms.string("TECp"),selection=cms.untracked.vstring("0x1e0c0000-0x1c080000"))
0097 #)
0098 
0099 
0100 
0101 process.seqMultProd = cms.Sequence(process.spclustermultprod+process.ssclustermultprod)
0102 
0103 process.goodVertices = cms.EDFilter("VertexSelector",
0104    src = cms.InputTag("offlinePrimaryVertices"),
0105    cut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.Rho <= 2"),  
0106    filter = cms.bool(False),   # otherwise it won't filter the events, just produce an empty vertex collection.
0107 )
0108 
0109 
0110 
0111 process.seqProducers = cms.Sequence(process.seqRECO + process.seqMultProd)
0112                                     #+process.goodVertices)
0113 
0114 from HLTrigger.HLTfilters.triggerResultsFilter_cfi import *
0115 process.hltSelection = triggerResultsFilter.clone(
0116                                           triggerConditions = cms.vstring("HLT_ZeroBias_*"),
0117                                           hltResults = cms.InputTag( "TriggerResults", "", "HLT" ),
0118                                           l1tResults = cms.InputTag( "" ),
0119                                           throw = cms.bool(False)
0120                                           )
0121 
0122 process.manypixelclus = cms.EDFilter('BySiPixelClusterVsSiStripClusterMultiplicityEventFilter',
0123                                      multiplicityConfig = cms.PSet(
0124     firstMultiplicityConfig = cms.PSet(
0125     collectionName = cms.InputTag("siPixelClusters"),
0126     moduleThreshold = cms.untracked.int32(-1),
0127     useQuality = cms.untracked.bool(False),
0128     qualityLabel = cms.untracked.string("")
0129     ),
0130     secondMultiplicityConfig = cms.PSet(
0131     collectionName = cms.InputTag("siStripClusters"),
0132     moduleThreshold = cms.untracked.int32(-1),
0133     useQuality = cms.untracked.bool(False),
0134     qualityLabel = cms.untracked.string("")
0135     )
0136     ),
0137                                      cut = cms.string("( mult1 > 5000+0.1*mult2)")
0138                                      )
0139 
0140 process.load("DPGAnalysis.SiStripTools.ssclusmultinvestigator_cfi")
0141 
0142 process.ssclusmultinvestigator.scaleFactor=cms.untracked.int32(1)
0143 
0144 process.ssclusmultinvestigator.runHisto = cms.untracked.bool(True)
0145 #process.ssclusmultinvestigator.wantedSubDets.append = cms.untracked.VPSet(    
0146 #    cms.PSet(detSelection = cms.uint32(103),detLabel = cms.string("TIB"), binMax = cms.int32(1787904/32)),
0147 #    cms.PSet(detSelection = cms.uint32(105),detLabel = cms.string("TOB"), binMax = cms.int32(1787904/32)),
0148 #    cms.PSet(detSelection = cms.uint32(114),detLabel = cms.string("TIDm"), binMax = cms.int32(565248/32)),
0149 #    cms.PSet(detSelection = cms.uint32(124),detLabel = cms.string("TIDp"), binMax = cms.int32(565248/32)),
0150 #    cms.PSet(detSelection = cms.uint32(116),detLabel = cms.string("TECm"), binMax = cms.int32(3866624/64)),
0151 #    cms.PSet(detSelection = cms.uint32(126),detLabel = cms.string("TECp"), binMax = cms.int32(3866624/64))
0152 #    )
0153 
0154 process.load("DPGAnalysis.SiStripTools.spclusmultinvestigator_cfi")
0155 process.spclusmultinvestigator.scaleFactor=cms.untracked.int32(5)
0156 
0157 #process.spclusmultinvestigator.wantedSubDets.append = cms.untracked.VPSet(    
0158 #    cms.PSet(detSelection = cms.uint32(101),detLabel = cms.string("BPIX"), binMax = cms.int32(100000)),
0159 #    cms.PSet(detSelection = cms.uint32(102),detLabel = cms.string("FPIX"), binMax = cms.int32(100000))
0160 #    )
0161 
0162 process.load("DPGAnalysis.SiStripTools.multiplicitycorr_cfi")
0163 process.multiplicitycorr.correlationConfigurations = cms.VPSet(
0164    cms.PSet(xMultiplicityMap = cms.InputTag("spclustermultprod"),
0165             xDetSelection = cms.uint32(0), xDetLabel = cms.string("Pixel"), xBins = cms.uint32(2000), xMax=cms.double(50000), 
0166             yMultiplicityMap = cms.InputTag("ssclustermultprod"),
0167             yDetSelection = cms.uint32(0), yDetLabel = cms.string("Tracker"), yBins = cms.uint32(2000), yMax=cms.double(500000),
0168             rBins = cms.uint32(200), scaleFactor = cms.untracked.double(.25),
0169             runHisto=cms.bool(False),runHistoBXProfile=cms.bool(False),runHistoBX=cms.bool(False),runHisto2D=cms.bool(False)),
0170    cms.PSet(xMultiplicityMap = cms.InputTag("spclustermultprod"),
0171             xDetSelection = cms.uint32(0), xDetLabel = cms.string("Pixel"), xBins = cms.uint32(2000), xMax=cms.double(50000), 
0172             yMultiplicityMap = cms.InputTag("ssclustermultprod"),
0173             yDetSelection = cms.uint32(3), yDetLabel = cms.string("TIB"), yBins = cms.uint32(2000), yMax=cms.double(500000),
0174             rBins = cms.uint32(200), scaleFactor = cms.untracked.double(.25),
0175             runHisto=cms.bool(False),runHistoBXProfile=cms.bool(False),runHistoBX=cms.bool(False),runHisto2D=cms.bool(False)),
0176    cms.PSet(xMultiplicityMap = cms.InputTag("spclustermultprod"),
0177             xDetSelection = cms.uint32(0), xDetLabel = cms.string("Pixel"), xBins = cms.uint32(2000), xMax=cms.double(50000), 
0178             yMultiplicityMap = cms.InputTag("ssclustermultprod"),
0179             yDetSelection = cms.uint32(5), yDetLabel = cms.string("TOB"), yBins = cms.uint32(2000), yMax=cms.double(500000),
0180             rBins = cms.uint32(200), scaleFactor = cms.untracked.double(.25),
0181             runHisto=cms.bool(False),runHistoBXProfile=cms.bool(False),runHistoBX=cms.bool(False),runHisto2D=cms.bool(False)),
0182    )
0183 
0184 process.multcorrmanypixel = process.multiplicitycorr.clone()
0185 
0186 process.seqClusMultInvest = cms.Sequence(process.ssclusmultinvestigator +process.spclusmultinvestigator + process.multiplicitycorr)
0187 
0188 
0189 
0190 
0191 process.p0 = cms.Path(
0192     #    process.hltSelection +
0193     process.seqProducers +
0194     process.seqClusMultInvest + 
0195     process.manypixelclus +
0196     process.multcorrmanypixel)
0197 
0198 #----GlobalTag ------------------------
0199 
0200 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0201 from Configuration.AlCa.GlobalTag import GlobalTag
0202 process.GlobalTag = GlobalTag(process.GlobalTag, options.globalTag, '')
0203 
0204 
0205 process.TFileService = cms.Service('TFileService',
0206                                    fileName = cms.string('MultiplicityMonitor.root')
0207                                    )
0208 
0209 print(process.dumpPython())