Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #################################################################
0002 # Remaking HCAL RecHits and CaloTowers from RAW for validation  #
0003 #################################################################
0004 
0005 import os
0006 import FWCore.ParameterSet.Config as cms
0007 from DQMServices.Core.DQMEDHarvester import DQMEDHarvester
0008 
0009 process = cms.Process("RelValValidation")
0010 process.load("Configuration.StandardSequences.GeometryDB_cff")
0011 process.load('Configuration.StandardSequences.RawToDigi_cff')
0012 process.load("Configuration.StandardSequences.Reconstruction_cff")
0013 
0014 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0015 #--- automatic GlobalTag setting -------------------------------------------
0016 #--- to set it manually: - comment the following 2 lines
0017 #--- and uncomment the 3d one with the actual tag to be set properly
0018 from Configuration.AlCa.autoCond import autoCond
0019 process.GlobalTag.globaltag = autoCond['startup']
0020 
0021 process.load("DQMServices.Core.DQM_cfg")
0022 process.DQM.collectorHost = ''
0023 
0024 process.load("DQMServices.Components.MEtoEDMConverter_cfi")
0025 
0026 process.maxEvents = cms.untracked.PSet(
0027     input = cms.untracked.int32(-1)
0028 )
0029 
0030 #######################################################################
0031 #--- TWO-file approach, as both RAW  (for HCAL re-reco)    and
0032 #                               RECO (for unchanged ECAL)  are required 
0033 #######################################################################
0034 process.source = cms.Source("PoolSource",
0035 noEventSort = cms.untracked.bool(True),
0036 duplicateCheckMode = cms.untracked.string('noDuplicateCheck'),   
0037     #--- full set of GEN-SIM-RECO RelVal files ----------------------------
0038     fileNames = cms.untracked.vstring(
0039 
0040      ),
0041     #--- full set of GEN-SIM-DIGI-RAW(-HLTDEBUG) RelVal files -------------
0042     secondaryFileNames = cms.untracked.vstring(   
0043 
0044      ),
0045     inputCommands = cms.untracked.vstring('keep *', 'drop *_MEtoEDMConverter_*_*')
0046 )
0047 
0048 process.FEVT = cms.OutputModule("PoolOutputModule",
0049      outputCommands = cms.untracked.vstring('drop *', 'keep *_MEtoEDMConverter_*_*'),
0050      fileName = cms.untracked.string("HcalValHarvestingEDM.root")
0051 )
0052 
0053 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
0054 process.hcalTowerAnalyzer = DQMEDAnalyzer('CaloTowersValidation',
0055     outputFile               = cms.untracked.string('CaloTowersValidationRelVal.root'),
0056 
0057     CaloTowerCollectionLabel = cms.untracked.InputTag('newtowerMaker'),
0058     hcalselector             = cms.untracked.string('all'),
0059 
0060     mc                       = cms.untracked.string('no'),
0061     useAllHistos             = cms.untracked.bool(False)                         
0062 )
0063 
0064 process.hcalNoiseRates = DQMEDHarvester('NoiseRates',
0065     outputFile   = cms.untracked.string('NoiseRatesRelVal.root'),
0066 
0067     rbxCollName  = cms.untracked.InputTag('newhcalnoise'),
0068     minRBXEnergy = cms.untracked.double(20.0),
0069     minHitEnergy = cms.untracked.double(1.5),
0070 
0071     useAllHistos = cms.untracked.bool(False)                         
0072 )
0073 
0074 process.hcalRecoAnalyzer = DQMEDAnalyzer('HcalRecHitsValidation',
0075     outputFile                = cms.untracked.string('HcalRecHitValidationRelVal.root'),
0076 
0077     HBHERecHitCollectionLabel = cms.untracked.InputTag("newhbhereco"),
0078     HFRecHitCollectionLabel   = cms.untracked.InputTag("newhfreco"),
0079     HORecHitCollectionLabel   = cms.untracked.InputTag("newhoreco"),
0080 
0081     eventype                  = cms.untracked.string('multi'),
0082     ecalselector              = cms.untracked.string('yes'),
0083     hcalselector              = cms.untracked.string('all'),
0084 
0085     mc                        = cms.untracked.string('no'),
0086 )
0087 
0088 #-----------------------------------------------------------------------------
0089 #                        HCAL re-reco 4-step procedure preparation
0090 #-----------------------------------------------------------------------------
0091 #--- In case of DATA (re-reco) 
0092 #--- one might need to add some parameters replacements
0093 #--- similar to what is in the reference RECO config
0094 #--- used for the original reconstruction !
0095 
0096 
0097 #(1) -------------------------- to get hcalDigis (on the fly) from existing RAW
0098 #
0099 from EventFilter.HcalRawToDigi.HcalRawToDigi_cfi import *
0100 
0101 #(2) -------------------------- to get (NEW) HCAL RecHits 
0102 #
0103 from RecoLocalCalo.HcalRecProducers.HBHEIsolatedNoiseReflagger_cfi import *
0104 from RecoLocalCalo.HcalRecProducers.HcalHitReconstructor_hbhe_cfi import *
0105 from RecoLocalCalo.HcalRecProducers.HcalHitReconstructor_ho_cfi import *
0106 from RecoLocalCalo.HcalRecProducers.HcalHitReconstructor_hf_cfi import *
0107 process.newhbheprereco = hbheprereco.clone()
0108 process.newhbhereco    = hbhereco.clone()
0109 process.newhoreco      = horeco.clone()
0110 process.newhfreco      = hfreco.clone()
0111 process.newhbhereco.hbheInput    = "newhbheprereco"
0112 process.newhcalLocalRecoSequence = cms.Sequence(process.newhbheprereco+process.newhbhereco+process.newhfreco+process.newhoreco)
0113 
0114 #(3) -------------------------- to get (NEW) CaloTowers 
0115 #
0116 from RecoLocalCalo.CaloTowersCreator.calotowermaker_cfi import *
0117 process.newtowerMaker = calotowermaker.clone()
0118 process.newtowerMaker.hfInput = cms.InputTag("newhfreco")
0119 process.newtowerMaker.hbheInput = cms.InputTag("newhbhereco")
0120 process.newtowerMaker.hoInput = cms.InputTag("newhoreco")
0121 
0122 #(4) -------------------------  to get (NEW) RBX noise 
0123 # 
0124 from RecoMET.METProducers.hcalnoiseinfoproducer_cfi import *
0125 process.newhcalnoise = hcalnoise.clone()
0126 process.newhcalnoise.recHitCollName = "newhbhereco"
0127 process.newhcalnoise.caloTowerCollName = "newtowerMaker"
0128 
0129 #Extra step: adding client post-processing
0130 process.load('Configuration/StandardSequences/EDMtoMEAtRunEnd_cff')
0131 process.dqmSaver.referenceHandling = cms.untracked.string('all')
0132 
0133 cmssw_version = os.environ.get('CMSSW_VERSION','CMSSW_X_Y_Z')
0134 Workflow = '/HcalValidation/'+'Harvesting/'+str(cmssw_version)
0135 process.dqmSaver.workflow = Workflow
0136 
0137 process.calotowersClient = DQMEDHarvester("CaloTowersClient", 
0138      outputFile = cms.untracked.string('CaloTowersHarvestingME.root'),
0139      DQMDirName = cms.string("/") # root directory
0140 )
0141 
0142 process.noiseratesClient = DQMEDHarvester("NoiseRatesClient", 
0143      outputFile = cms.untracked.string('NoiseRatesHarvestingME.root'),
0144      DQMDirName = cms.string("/") # root directory
0145 )
0146 
0147 process.hcalrechitsClient = DQMEDHarvester("HcalRecHitsClient", 
0148      outputFile = cms.untracked.string('HcalRecHitsHarvestingME.root'),
0149      DQMDirName = cms.string("/") # root directory
0150 )
0151 
0152 
0153 #--- Making re-reco and analysing
0154 #--- first 4 producers: HCAL+CaloTowers(+RBX noise) re-reco. 
0155 #
0156 process.p = cms.Path(
0157 process.hcalDigis *
0158 process.newhcalLocalRecoSequence *
0159 process.newtowerMaker *
0160 process.newhcalnoise *
0161 #--- analysis
0162 process.hcalTowerAnalyzer * 
0163 process.hcalNoiseRates * 
0164 process.hcalRecoAnalyzer *
0165 #--- post processing
0166 process.calotowersClient *
0167 process.noiseratesClient *
0168 process.hcalrechitsClient *
0169 process.dqmSaver
0170 )