Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:56

0001 import os
0002 import FWCore.ParameterSet.Config as cms
0003 from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
0004 
0005 process = cms.Process("TEST")
0006 
0007 ### RANDOM setting (change last digit(s) to make runs different !)
0008 process.load("Configuration.StandardSequences.SimulationRandomNumberGeneratorSeeds_cff")
0009 #process.RandomNumberGeneratorService.generator.initialSeed = 12345XXXX
0010 
0011 
0012 process.load("Configuration.StandardSequences.Simulation_cff")
0013 process.load("SimGeneral.MixingModule.mixNoPU_cfi")
0014 process.load("Configuration.StandardSequences.Reconstruction_cff")
0015 process.load('Configuration/StandardSequences/DigiToRaw_cff')
0016 process.load('Configuration/StandardSequences/RawToDigi_cff')
0017 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0018 from Configuration.AlCa.autoCond import autoCond
0019 process.GlobalTag.globaltag = autoCond['mc']
0020 
0021 process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi")
0022 process.load("Configuration.StandardSequences.GeometryECALHCAL_cff")
0023 process.load("Configuration.StandardSequences.MagneticField_cff")
0024 process.g4SimHits.UseMagneticField = False
0025 
0026 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0027 process.MessageLogger.cerr.FwkReport.reportEvery = 100
0028 
0029 process.load("DQMServices.Core.DQM_cfg")
0030 process.DQM.collectorHost = ''
0031 
0032 process.options = cms.untracked.PSet(
0033     Rethrow = cms.untracked.vstring('ProductNotFound')
0034 )
0035 
0036 # Input source
0037 process.source = cms.Source("PoolSource",
0038     firstEvent = cms.untracked.uint32(1),
0039     noEventSort = cms.untracked.bool(True), 
0040     duplicateCheckMode = cms.untracked.string("noDuplicateCheck"),
0041     fileNames = cms.untracked.vstring(
0042 'file:/afs/cern.ch/cms/data/CMSSW/Validation/HcalHits/data/3_1_X/mc_nue.root'
0043     )
0044 )
0045 
0046 process.maxEvents = cms.untracked.PSet(
0047     input = cms.untracked.int32(1000)
0048 )
0049 
0050 process.FEVT = cms.OutputModule("PoolOutputModule",
0051      outputCommands = cms.untracked.vstring('drop *', 'keep *_MEtoEDMConverter_*_*'),
0052      fileName = cms.untracked.string("HcalValHarvestingEDM.root")
0053 )
0054 
0055 #-----------------------------------------------------------------------------
0056 #                     Ananlyser + slient -> DQM
0057 #-----------------------------------------------------------------------------
0058 process.load('Configuration/StandardSequences/EDMtoMEAtRunEnd_cff')
0059 process.dqmSaver.referenceHandling = cms.untracked.string('all')
0060 
0061 cmssw_version = os.environ.get('CMSSW_VERSION','CMSSW_X_Y_Z')
0062 Workflow = '/HcalValidation/'+'Harvesting/'+str(cmssw_version)
0063 process.dqmSaver.workflow = Workflow
0064 
0065 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
0066 process.hcalRecoAnalyzer = DQMEDAnalyzer('HcalRecHitsValidation',
0067     outputFile = cms.untracked.string('HcalRecHitsValidation_ZS.root'),
0068     HBHERecHitCollectionLabel = cms.untracked.InputTag("hbhereco"),
0069     HFRecHitCollectionLabel   = cms.untracked.InputTag("hfreco"),
0070     HORecHitCollectionLabel   = cms.untracked.InputTag("horeco"),
0071     eventype = cms.untracked.string('single'),
0072     mc = cms.untracked.string('yes'),
0073     sign = cms.untracked.string('*'),
0074     hcalselector = cms.untracked.string('noise'),
0075     ecalselector = cms.untracked.string('no'),
0076 )
0077 process.hcalrechitsClient = DQMEDHarvester("HcalRecHitsClient", 
0078      outputFile = cms.untracked.string('HcalRecHitsHarvestingME.root'),
0079      DQMDirName = cms.string("/") # root directory
0080 )
0081 
0082 
0083 #------------------------------------
0084 
0085 process.simHcalDigis.HBlevel = -1000
0086 process.simHcalDigis.HElevel = -1000
0087 process.simHcalDigis.HOlevel = -1000
0088 process.simHcalDigis.HFlevel = -1000
0089 process.simHcalDigis.useConfigZSvalues = 1
0090 
0091 process.VtxSmeared.SigmaX = 0.00001
0092 process.VtxSmeared.SigmaY = 0.00001
0093 process.VtxSmeared.SigmaZ = 0.00001
0094 
0095 
0096 ### Special - CaloOnly ------------------------------------
0097 
0098 #--- comes from DigiToRaw_cff.py
0099 process.ecalPacker.Label = 'simEcalDigis'
0100 process.ecalPacker.InstanceEB = 'ebDigis'
0101 process.ecalPacker.InstanceEE = 'eeDigis'
0102 process.ecalPacker.labelEBSRFlags = "simEcalDigis:ebSrFlags"
0103 process.ecalPacker.labelEESRFlags = "simEcalDigis:eeSrFlags"
0104 #
0105 #- hcalRawData (EventFilter/HcalRawToDigi/python/HcalDigiToRaw_cfi.py
0106 #                 uses simHcalDigis by default...
0107 
0108 #--- to force RAW->Digi 
0109 process.ecalDigis.InputLabel = 'rawDataCollector'
0110 process.hcalDigis.InputLabel = 'rawDataCollector'
0111 process.ecalPreshowerDigis.sourceTag = 'rawDataCollector'
0112 
0113 #--- Just a reminder : calolocalreco = cms.Sequence(ecalLocalRecoSequence+hcalLocalRecoSequence)
0114 # RecoLocalCalo.Configuration.ecalLocalRecoSequence_cff
0115 # RecoLocalCalo.Configuration.hcalLocalReco_cff
0116 #--- but hcalLocalRecoSequence produces only hpheprereco!
0117 
0118 #--- To cope with JP Chou pre-reco introduction to bring back hbhe RecHits collection to CaloTowers
0119 #--- but better to include hcalGlobalRecoSequence in front of CaloTowers to bring hbherereco->hbhereco!
0120 delattr(process,"hbhereco")
0121 process.hbhereco = process.hbheprereco.clone()
0122 process.hcalLocalRecoSequence.replace(process.hbheprereco,process.hbhereco)
0123 
0124 #--- Special to exclude CASTOR 
0125 
0126 process.mix.mixObjects.mixCH.mixCaloHits = cms.PSet(
0127     input = cms.VInputTag(cms.InputTag("g4SimHits","CaloHitsTk"), 
0128         cms.InputTag("g4SimHits","EcalHitsEB"), cms.InputTag("g4SimHits","EcalHitsEE"), cms.InputTag("g4SimHits","EcalHitsES"), cms.InputTag("g4SimHits","EcalTBH4BeamHits"), cms.InputTag("g4SimHits","HcalHits"), 
0129         cms.InputTag("g4SimHits","ZDCHITS")),
0130     type = cms.string('PCaloHit'),
0131     subdets = cms.vstring('CaloHitsTk', 
0132         'EcalHitsEB', 
0133         'EcalHitsEE', 
0134         'EcalHitsES', 
0135         'HcalHits', 
0136         'ZDCHITS')
0137 )
0138 
0139 
0140 process.g4SimHits.Generator.HepMCProductLabel = 'VtxSmeared'
0141 process.p = cms.Path(
0142  process.VtxSmeared * process.g4SimHits * process.mix *
0143  process.ecalDigiSequence * process.hcalDigiSequence *
0144  process.ecalPacker *
0145  process.esDigiToRaw *
0146  process.hcalRawData *
0147  process.rawDataCollector *
0148  process.ecalDigis * 
0149  process.ecalPreshowerDigis * 
0150  process.hcalDigis *
0151  process.calolocalreco *
0152  process.hcalRecoAnalyzer *
0153  process.hcalrechitsClient * 
0154  process.dqmSaver)