Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 import FWCore.ParameterSet.VarParsing as VarParsing
0003 
0004 from PhysicsTools.PatAlgos.tools.helpers import cloneProcessingSnippet
0005 
0006 process = cms.Process("OccupancyPlotsTest")
0007 
0008 #prepare options
0009 
0010 options = VarParsing.VarParsing("analysis")
0011 
0012 options.register ('globalTag',
0013                   "DONOTEXIST",
0014                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0015                   VarParsing.VarParsing.varType.string,          # string, int, or float
0016                   "GlobalTag")
0017 options.register ('fromRAW',
0018                   "0",
0019                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0020                   VarParsing.VarParsing.varType.int,          # string, int, or float
0021                   "=1 if from RAW")
0022 options.register ('withTracks',
0023                   "0",
0024                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0025                   VarParsing.VarParsing.varType.int,          # string, int, or float
0026                   "=1 if analysis of on-track clusters has to be done")
0027 options.register ('HLTprocess',
0028                   "HLT",
0029                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0030                   VarParsing.VarParsing.varType.string,          # string, int, or float
0031                   "HLTProcess")
0032 options.register ('triggerPath',
0033                   "HLT_*",
0034                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0035                   VarParsing.VarParsing.varType.string,          # string, int, or float
0036                   "list of HLT paths")
0037 options.register ('trackCollection',
0038                   "generalTracks",
0039                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0040                   VarParsing.VarParsing.varType.string,          # string, int, or float
0041                   "Track collection to use")
0042 
0043 
0044 options.parseArguments()
0045 
0046 #
0047 
0048 process.options = cms.untracked.PSet(
0049     wantSummary = cms.untracked.bool(True),
0050     fileMode = cms.untracked.string("FULLMERGE")
0051     )
0052 
0053 process.load("FWCore.MessageService.MessageLogger_cfi")
0054 
0055 process.MessageLogger.cout.enable = True
0056 process.MessageLogger.cout.threshold = cms.untracked.string("INFO")
0057 #process.MessageLogger.cout.threshold = cms.untracked.string("WARNING")
0058 #process.MessageLogger.debugModules = cms.untracked.vstring("*")
0059 process.MessageLogger.cout.default = cms.untracked.PSet(
0060     limit = cms.untracked.int32(0)
0061     )
0062 process.MessageLogger.files =dict(detids = cms.untracked.PSet( 
0063     default = cms.untracked.PSet(
0064         limit = cms.untracked.int32(0)
0065         ),
0066     BuildingTrackerDetId = cms.untracked.PSet(
0067         limit = cms.untracked.int32(100000000)
0068         ),
0069     GeometricDetBuilding = cms.untracked.PSet(
0070         limit = cms.untracked.int32(100000000)
0071         ),
0072     SubDetectorGeometricDetType = cms.untracked.PSet(
0073         limit = cms.untracked.int32(100000000)
0074         ),
0075     BuildingGeomDetUnits = cms.untracked.PSet(
0076         limit = cms.untracked.int32(100000000)
0077         ),
0078     LookingForFirstStrip = cms.untracked.PSet(
0079         limit = cms.untracked.int32(100000000)
0080         ),
0081     BuildingSubDetTypeMap = cms.untracked.PSet(
0082         limit = cms.untracked.int32(100000000)
0083         ),
0084     SubDetTypeMapContent = cms.untracked.PSet(
0085         limit = cms.untracked.int32(100000000)
0086         ),
0087     NumberOfLayers = cms.untracked.PSet(
0088         limit = cms.untracked.int32(100000000)
0089         ),
0090     IsThereTest = cms.untracked.PSet(
0091         limit = cms.untracked.int32(100000000)
0092         ),
0093     threshold = cms.untracked.string("DEBUG")
0094     )
0095 )    
0096 process.MessageLogger.cout.DuplicateHitFinder = cms.untracked.PSet(
0097     limit = cms.untracked.int32(100000000)
0098     )
0099 process.MessageLogger.cout.FwkSummary = cms.untracked.PSet(
0100     limit = cms.untracked.int32(100000000)
0101     )
0102 process.MessageLogger.cout.FwkReport = cms.untracked.PSet(
0103     reportEvery = cms.untracked.int32(10000)
0104     )
0105 
0106 process.MessageLogger.cerr.threshold = cms.untracked.string("WARNING")
0107 process.MessageLogger.cerr.default = cms.untracked.PSet(
0108     limit = cms.untracked.int32(10000000)
0109     )
0110 process.MessageLogger.cerr.FwkReport = cms.untracked.PSet(
0111     reportEvery = cms.untracked.int32(100000)
0112     )
0113 
0114 #------------------------------------------------------------------
0115 
0116 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents) )
0117 
0118 process.source = cms.Source("PoolSource",
0119                     fileNames = cms.untracked.vstring(options.inputFiles),
0120 #                    skipBadFiles = cms.untracked.bool(True),
0121                     inputCommands = cms.untracked.vstring("keep *", "drop *_MEtoEDMConverter_*_*")
0122                     )
0123 
0124 # HLT Selection ------------------------------------------------------------
0125 process.load("HLTrigger.HLTfilters.triggerResultsFilter_cfi")
0126 process.triggerResultsFilter.triggerConditions = cms.vstring(options.triggerPath)
0127 process.triggerResultsFilter.hltResults = cms.InputTag( "TriggerResults", "", options.HLTprocess )
0128 process.triggerResultsFilter.l1tResults = cms.InputTag( "" )
0129 process.triggerResultsFilter.throw = cms.bool(False)
0130 
0131 process.seqHLTSelection = cms.Sequence(process.triggerResultsFilter)
0132 if options.triggerPath=="*":
0133     process.seqHLTSelection = cms.Sequence()
0134 
0135 
0136 #--------------------------------------
0137 process.load('Configuration.Geometry.GeometryExtended2015Reco_cff')
0138 process.load('Configuration.StandardSequences.MagneticField_cff')
0139 process.load("Configuration.StandardSequences.Reconstruction_cff")
0140 
0141 process.seqRECO = cms.Sequence()
0142 
0143 if options.fromRAW == 1:
0144     process.load("Configuration.StandardSequences.RawToDigi_Data_cff")
0145     process.load("Configuration.StandardSequences.L1Reco_cff")
0146     process.siPixelClusters = process.siPixelClustersPreSplitting.clone()
0147     process.seqRECO = cms.Sequence(process.scalersRawToDigi +
0148                                    process.siStripDigis + process.siStripZeroSuppression + process.siStripClusters
0149                                    + process.siPixelDigis + process.siPixelClusters )
0150 
0151 
0152 #
0153 
0154 process.froml1abcHEs = cms.EDProducer("EventWithHistoryProducerFromL1ABC",
0155                                       l1ABCCollection=cms.InputTag("scalersRawToDigi")
0156                                       )
0157 process.load("DPGAnalysis.SiStripTools.apvcyclephaseproducerfroml1tsDB_cfi")
0158 process.load("DPGAnalysis.SiStripTools.eventtimedistribution_cfi")
0159 process.eventtimedistribution.historyProduct = cms.InputTag("froml1abcHEs")
0160 
0161 process.seqEventHistoryReco = cms.Sequence(process.froml1abcHEs + process.APVPhases)
0162 process.seqEventHistory = cms.Sequence(process.eventtimedistribution)
0163 
0164 #from DPGAnalysis.SiStripTools.occupancyplotsselections_cff import *
0165 from DPGAnalysis.SiStripTools.occupancyplotsselections_simplified_cff import *
0166 
0167 process.ssclusmultprod = cms.EDProducer("SiStripClusterMultiplicityProducer",
0168                                         clusterdigiCollection = cms.InputTag("siStripClusters"),
0169                                         wantedSubDets = cms.VPSet(
0170         cms.PSet(detSelection = cms.uint32(0),detLabel = cms.string("TK")),
0171         cms.PSet(detSelection = cms.uint32(3),detLabel = cms.string("TIB")),
0172         cms.PSet(detSelection = cms.uint32(4),detLabel = cms.string("TID")),
0173         cms.PSet(detSelection = cms.uint32(5),detLabel = cms.string("TOB")),
0174         cms.PSet(detSelection = cms.uint32(6),detLabel = cms.string("TEC"))
0175         )
0176                                         )
0177 process.ssclusmultprod.wantedSubDets.extend(OccupancyPlotsStripWantedSubDets)
0178 process.ssclusmultprodontrack=process.ssclusmultprod.clone(clusterdigiCollection = cms.InputTag("AlignmentTrackSelector"))
0179 
0180 process.ssclusoccuprod = cms.EDProducer("SiStripClusterMultiplicityProducer",
0181                                         clusterdigiCollection = cms.InputTag("siStripClusters"),
0182                                         withClusterSize = cms.untracked.bool(True),
0183                                         wantedSubDets = cms.VPSet()
0184                                         )
0185 process.ssclusoccuprod.wantedSubDets.extend(OccupancyPlotsStripWantedSubDets)
0186 process.ssclusoccuprodontrack=process.ssclusoccuprod.clone(clusterdigiCollection = cms.InputTag("AlignmentTrackSelector"))
0187 
0188 process.spclusmultprod = cms.EDProducer("SiPixelClusterMultiplicityProducer",
0189                                         clusterdigiCollection = cms.InputTag("siPixelClusters"),
0190                                         wantedSubDets = cms.VPSet(
0191         cms.PSet(detSelection = cms.uint32(0),detLabel = cms.string("Pixel")),
0192         cms.PSet(detSelection = cms.uint32(1),detLabel = cms.string("BPIX")),
0193         cms.PSet(detSelection = cms.uint32(2),detLabel = cms.string("FPIX"))
0194         )
0195                                         )
0196 process.spclusmultprod.wantedSubDets.extend(OccupancyPlotsPixelWantedSubDets)
0197 process.spclusmultprodontrack=process.spclusmultprod.clone(clusterdigiCollection = cms.InputTag("AlignmentTrackSelector"))
0198 
0199 process.spclusoccuprod = cms.EDProducer("SiPixelClusterMultiplicityProducer",
0200                                         clusterdigiCollection = cms.InputTag("siPixelClusters"),
0201                                         withClusterSize = cms.untracked.bool(True),
0202                                         wantedSubDets = cms.VPSet()
0203                                         )
0204 process.spclusoccuprod.wantedSubDets.extend(OccupancyPlotsPixelWantedSubDets)
0205 process.spclusoccuprodontrack=process.spclusoccuprod.clone(clusterdigiCollection = cms.InputTag("AlignmentTrackSelector"))
0206 
0207 process.seqMultProd = cms.Sequence(process.ssclusmultprod + process.ssclusoccuprod +
0208                                    process.spclusmultprod + process.spclusoccuprod)
0209 
0210 if options.withTracks == 1:
0211     process.seqMultProd = cms.Sequence(process.ssclusmultprod + process.ssclusoccuprod +
0212                                        process.spclusmultprod + process.spclusoccuprod +
0213                                        process.ssclusmultprodontrack + process.ssclusoccuprodontrack +
0214                                        process.spclusmultprodontrack + process.spclusoccuprodontrack )
0215 
0216 
0217 process.load("DPGAnalysis.SiStripTools.ssclusmultinvestigator_cfi")
0218 process.ssclusmultinvestigator.multiplicityMap=cms.InputTag("ssclusmultprod")
0219 process.ssclusmultinvestigator.scaleFactor=cms.untracked.int32(1)
0220 process.load("DPGAnalysis.SiStripTools.spclusmultinvestigator_cfi")
0221 process.spclusmultinvestigator.multiplicityMap=cms.InputTag("spclusmultprod")
0222 process.spclusmultinvestigator.scaleFactor=cms.untracked.int32(10)
0223 
0224 
0225 process.load("DPGAnalysis.SiStripTools.occupancyplots_cfi")
0226 process.occupancyplots.wantedSubDets = process.ssclusoccuprod.wantedSubDets
0227 
0228 process.occupancyplotsontrack = process.occupancyplots.clone()
0229 process.occupancyplotsontrack.wantedSubDets = process.ssclusoccuprodontrack.wantedSubDets
0230 process.occupancyplotsontrack.multiplicityMaps = cms.VInputTag(cms.InputTag("ssclusmultprodontrack"))
0231 process.occupancyplotsontrack.occupancyMaps = cms.VInputTag(cms.InputTag("ssclusoccuprodontrack"))
0232 
0233 process.pixeloccupancyplots = process.occupancyplots.clone()
0234 process.pixeloccupancyplots.wantedSubDets = process.spclusoccuprod.wantedSubDets
0235 process.pixeloccupancyplots.multiplicityMaps = cms.VInputTag(cms.InputTag("spclusmultprod"))
0236 process.pixeloccupancyplots.occupancyMaps = cms.VInputTag(cms.InputTag("spclusoccuprod"))
0237 
0238 process.pixeloccupancyplotsontrack = process.occupancyplots.clone()
0239 process.pixeloccupancyplotsontrack.wantedSubDets = process.spclusoccuprodontrack.wantedSubDets
0240 process.pixeloccupancyplotsontrack.multiplicityMaps = cms.VInputTag(cms.InputTag("spclusmultprodontrack"))
0241 process.pixeloccupancyplotsontrack.occupancyMaps = cms.VInputTag(cms.InputTag("spclusoccuprodontrack"))
0242 
0243 process.alloccupancyplots = process.occupancyplots.clone()
0244 process.alloccupancyplots.wantedSubDets = cms.VPSet()
0245 process.alloccupancyplots.wantedSubDets.extend(OccupancyPlotsPixelWantedSubDets)
0246 process.alloccupancyplots.wantedSubDets.extend(OccupancyPlotsStripWantedSubDets)
0247 process.alloccupancyplots.multiplicityMaps = cms.VInputTag(cms.InputTag("spclusmultprod"),cms.InputTag("ssclusmultprod"))
0248 process.alloccupancyplots.occupancyMaps = cms.VInputTag(cms.InputTag("spclusoccuprod"),cms.InputTag("ssclusoccuprod"))
0249 
0250 process.alloccupancyplotsontrack = process.occupancyplots.clone()
0251 process.alloccupancyplotsontrack.wantedSubDets = cms.VPSet()
0252 process.alloccupancyplotsontrack.wantedSubDets.extend(OccupancyPlotsPixelWantedSubDets)
0253 process.alloccupancyplotsontrack.wantedSubDets.extend(OccupancyPlotsStripWantedSubDets)
0254 process.alloccupancyplotsontrack.multiplicityMaps = cms.VInputTag(cms.InputTag("spclusmultprodontrack"),cms.InputTag("ssclusmultprodontrack"))
0255 process.alloccupancyplotsontrack.occupancyMaps = cms.VInputTag(cms.InputTag("spclusoccuprodontrack"),cms.InputTag("ssclusoccuprodontrack"))
0256 
0257 #process.layersoccupancyplots = process.occupancyplots.clone()
0258 #process.layersoccupancyplots.wantedSubDets = cms.VPSet()
0259 #process.layersoccupancyplots.wantedSubDets.extend(OccupancyPlotsPixelWantedLayers)
0260 #process.layersoccupancyplots.wantedSubDets.extend(OccupancyPlotsStripWantedLayers)
0261 #process.layersoccupancyplots.multiplicityMaps = cms.VInputTag(cms.InputTag("spclusmultprodontrack"),cms.InputTag("ssclusmultprodontrack"))
0262 #process.layersoccupancyplots.occupancyMaps = cms.VInputTag(cms.InputTag("spclusoccuprodontrack"),cms.InputTag("ssclusoccuprodontrack"))
0263 
0264 #process.layersoccupancyplotsontrack = process.occupancyplots.clone()
0265 #process.layersoccupancyplotsontrack.wantedSubDets = cms.VPSet()
0266 #process.layersoccupancyplotsontrack.wantedSubDets.extend(OccupancyPlotsPixelWantedLayers)
0267 #process.layersoccupancyplotsontrack.wantedSubDets.extend(OccupancyPlotsStripWantedLayers)
0268 #process.layersoccupancyplotsontrack.multiplicityMaps = cms.VInputTag(cms.InputTag("spclusmultprod"),cms.InputTag("ssclusmultprod"))
0269 #process.layersoccupancyplotsontrack.occupancyMaps = cms.VInputTag(cms.InputTag("spclusoccuprod"),cms.InputTag("ssclusoccuprod"))
0270 
0271 
0272 #process.load("TrackingPFG.Utilities.bxlumianalyzer_cfi")
0273 
0274 process.goodVertices = cms.EDFilter("VertexSelector",
0275    src = cms.InputTag("offlinePrimaryVertices"),
0276    cut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.Rho <= 2"),  
0277    filter = cms.bool(False),   # otherwise it won't filter the events, just produce an empty vertex collection.
0278 )
0279 
0280 process.load("Validation.RecoVertex.anotherprimaryvertexanalyzer_cfi")
0281 process.primaryvertexanalyzer.pvCollection=cms.InputTag("goodVertices")
0282 process.primaryvertexanalyzer.vHistogramMakerPSet.runHisto=cms.untracked.bool(False)
0283 process.primaryvertexanalyzer.vHistogramMakerPSet.runHistoProfile=cms.untracked.bool(False)
0284 process.primaryvertexanalyzer.vHistogramMakerPSet.runHistoBXProfile=cms.untracked.bool(False)
0285 
0286 process.load("DPGAnalysis.SiStripTools.trackcount_cfi")
0287 process.trackcount.trackCollection = cms.InputTag(options.trackCollection)
0288 
0289 process.load("DPGAnalysis.SiStripTools.duplicaterechits_cfi")
0290 process.duplicaterechits.trackCollection = cms.InputTag(options.trackCollection)
0291 
0292 process.seqAnalyzers = cms.Sequence(
0293     process.seqEventHistory +
0294     process.spclusmultinvestigator + process.ssclusmultinvestigator +
0295     process.occupancyplots +
0296     process.pixeloccupancyplots +
0297     process.alloccupancyplots)
0298 
0299 if options.withTracks == 1:
0300     process.seqAnalyzers = cms.Sequence(
0301         process.seqEventHistory +
0302         #process.bxlumianalyzer + 
0303         process.primaryvertexanalyzer +
0304         process.spclusmultinvestigator + process.ssclusmultinvestigator +
0305         process.occupancyplots +     process.occupancyplotsontrack + 
0306         process.pixeloccupancyplots +     process.pixeloccupancyplotsontrack + 
0307         process.alloccupancyplots +     process.alloccupancyplotsontrack +
0308         process.trackcount 
0309         # + process.duplicaterechits
0310 ) 
0311 
0312 #-------------------------------------------------------------------------------------------
0313 
0314 process.load("Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi")
0315 
0316 process.seqProducers = cms.Sequence(process.seqEventHistoryReco + process.seqMultProd)
0317 
0318 if options.withTracks == 1:
0319     process.seqProducers = cms.Sequence(process.seqEventHistoryReco + 
0320                                         process.AlignmentTrackSelector + 
0321                                         process.goodVertices +
0322                                         process.seqMultProd)
0323 
0324 #----GlobalTag ------------------------
0325 
0326 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0327 from Configuration.AlCa.GlobalTag import GlobalTag
0328 process.GlobalTag = GlobalTag(process.GlobalTag, options.globalTag, '')
0329 
0330 
0331 process.siStripQualityESProducer.ListOfRecordToMerge=cms.VPSet(
0332 #    cms.PSet( record = cms.string("SiStripDetVOffRcd"),    tag    = cms.string("") ),
0333     cms.PSet( record = cms.string("SiStripDetCablingRcd"), tag    = cms.string("") ),
0334     cms.PSet( record = cms.string("RunInfoRcd"),           tag    = cms.string("") ),
0335     cms.PSet( record = cms.string("SiStripBadChannelRcd"), tag    = cms.string("") ),
0336     cms.PSet( record = cms.string("SiStripBadFiberRcd"),   tag    = cms.string("") ),
0337     cms.PSet( record = cms.string("SiStripBadModuleRcd"),  tag    = cms.string("") )
0338 )
0339 
0340 process.TFileService = cms.Service('TFileService',
0341                                    fileName = cms.string('OccupancyPlotsTest_'+options.tag+'.root')
0342                                    )
0343 
0344 cloneProcessingSnippet(process,process.seqAnalyzers,"All")
0345 
0346 process.p0 = cms.Path(
0347     process.seqRECO +
0348     process.seqProducers +
0349     process.seqAnalyzersAll +
0350     process.seqHLTSelection +
0351     process.seqAnalyzers
0352 )
0353 
0354 
0355 #print process.dumpPython()