Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-04-17 02:42:27

0001 
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 process = cms.Process("CastorProducts")
0005 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0006 
0007 # specify the correct database tags which contain the updated gains and channelquality flags
0008 process.load("CondCore.DBCommon.CondDBSetup_cfi")
0009 process.CastorDbProducer = cms.ESProducer("CastorDbProducer")
0010 process.es_pool = cms.ESSource(
0011    "PoolDBESSource",
0012    process.CondDBSetup,
0013    connect = cms.string('frontier://cmsfrontier.cern.ch:8000/FrontierProd/CMS_COND_31X_HCAL'),
0014    toGet = cms.VPSet(
0015        cms.PSet(
0016            record = cms.string('CastorPedestalsRcd'),
0017            tag = cms.string('CastorPedestals_v2.0_offline')
0018            ),
0019        cms.PSet(
0020            record = cms.string('CastorPedestalWidthsRcd'),
0021            tag = cms.string('CastorPedestalWidths_v2.0_offline')
0022            ),
0023        cms.PSet(
0024            record = cms.string('CastorGainsRcd'),
0025            tag = cms.string('CastorGains_v2.0_offline')
0026            ),
0027        cms.PSet(
0028            record = cms.string('CastorGainWidthsRcd'),
0029        tag = cms.string('CastorGainWidths_v2.0_offline')
0030            ),
0031        cms.PSet(
0032            record = cms.string('CastorQIEDataRcd'),
0033        tag = cms.string('CastorQIEData_v2.0_offline')
0034            ),
0035        cms.PSet(
0036            record = cms.string('CastorChannelQualityRcd'),
0037            tag = cms.string('CastorChannelQuality_v2.0_offline')
0038            ),
0039        cms.PSet(
0040            record = cms.string('CastorElectronicsMapRcd'),
0041            tag = cms.string('CastorElectronicsMap_v2.0_offline')
0042            )
0043    )
0044 )
0045 # end of Db configuration
0046 
0047 process.maxEvents = cms.untracked.PSet(
0048     input = cms.untracked.int32(-1)
0049 )
0050 
0051 process.source = cms.Source("PoolSource",
0052 duplicateCheckMode = cms.untracked.string("noDuplicateCheck"),
0053     fileNames = cms.untracked.vstring(
0054         'file:data_RAW2DIGI_L1Reco_RECO.root' # choose your input file here
0055     )
0056 )
0057 
0058 # load CASTOR default reco chain (from towers on)
0059 process.load('RecoLocalCalo.Castor.Castor_cff')
0060 
0061 # construct the module which executes the RechitCorrector for data reconstructed in releases < 4.2.X
0062 process.rechitcorrector = cms.EDProducer("RecHitCorrector",
0063     rechitLabel = cms.InputTag("castorreco","","RECO"), # choose the original RecHit collection
0064     revertFactor = cms.double(62.5), # this is the factor to go back to the original fC: 1/0.016
0065     doInterCalib = cms.bool(True) # do intercalibration
0066 )
0067 
0068 # construct the module which executes the RechitCorrector for data reconstructed in releases >= 4.2.X
0069 process.rechitcorrector42 = cms.EDProducer("RecHitCorrector",
0070         rechitLabel = cms.InputTag("castorreco","","RECO"), # choose the original RecHit collection
0071         revertFactor = cms.double(1), # this is the factor to go back to the original fC - not needed when data is already intercalibrated
0072         doInterCalib = cms.bool(False) # don't do intercalibration, RecHitCorrector will only correct the EM response and remove BAD channels
0073 )
0074 
0075 
0076 # tell to the CastorCell reconstruction that he should use the new corrected rechits for releases < 4.2.X
0077 #process.CastorCellReco.inputprocess = "rechitcorrector"
0078 
0079 # tell to the CastorTower reconstruction that he should use the new corrected rechits for releases >= 4.2.X
0080 process.CastorTowerReco.inputprocess = "rechitcorrector"
0081 
0082 
0083 process.MyOutputModule = cms.OutputModule("PoolOutputModule",
0084     fileName = cms.untracked.string('rechitcorrector_output.root') # choose your output file
0085 )
0086 
0087 # execute the rechitcorrector and afterwards do the reco chain again (towers -> jets)
0088 process.producer = cms.Path(process.rechitcorrector*process.CastorFullReco)
0089 process.end = cms.EndPath(process.MyOutputModule)
0090