HCAL Trigger Primitive Generator Offline Software
Complete:
Introduction
This page describes the offline software for HCAL TPG emulation.
List of Packages
HCALTPG-specific Packages:
Other packages including code used by HCAL-TPG:
List of Example Codes and Configurations
HCAL-TPG codes for DQM:
HCAL-TPG example codes:
Configuration
Snippet from example of the configuration file above
process.load('SimCalorimetry.HcalTrigPrimProducers.hcaltpdigi_cff')
process.debug = cms.EDAnalyzer('DebugTPExample',
dataLabel = cms.InputTag('hcalDigis'),
emulLabel = cms.InputTag('emulDigis')
)
process.emulDigis = process.simHcalTriggerPrimitiveDigis.clone()
process.emulDigis.inputLabel = cms.VInputTag('hcalDigis', 'hcalDigis')
process.HcalTPGCoderULUT.LUTGenerationMode = cms.bool(False)
process.p = cms.Path(
process.hcalDigis
+ process.emulDigis
+process.debug
)
Explanation:
-
- Access to LUTs in developing mode (not in Global Tag)
a) Access mode through python:
List of tags
process.es_pool2 = cms.ESSource("PoolDBESSource",
process.CondDBSetup,
timetype = cms.string('runnumber'),
toGet = cms.VPSet(
cms.PSet(
record = cms.string('HcalL1TriggerObjectsRcd'),
tag =
cms.string('HcalL1TriggerObjects_Physics2012v1a_offline')),
),
connect = cms.string('frontier://FrontierProd/CMS_COND_31X_HCAL'),
authenticationMethod = cms.untracked.uint32(0),
)
process.es_prefer_es_pool2 = cms.ESPrefer( "PoolDBESSource", "es_pool2")
b) In order to read the XML LUTs, add these two lines to your configuration file:
process.HcalTPGCoderULUT.read_XML_LUTs = cms.bool(True)
process.HcalTPGCoderULUT.inputLUTs = cms.FileInPath('Physics2012v1a.xml')
I suggested you download the XML LUTs from database and emulate TP based on specific set of LUTs as above. See the
instrunction on how to download XML LUTs. If you cannot download XML LUTs due to your limited priviledge to access DB, please find the XML LUTs in castor
/castor/cern.ch/user/t/tutanon/LUT_XML/Physics2012v1a.xml
-
- The HCAL trigger emulation is run by default during "digitization". The main driving configuration fragment included in hcaltpdigi_cfi.py
is below:
process.load('SimCalorimetry.HcalTrigPrimProducers.hcaltpdigi_cff')
-
- In order to run on HCAL suppressed digis (on real data) add the following lines to your cfg:
process.simHcalTriggerPrimitiveDigis.inputLabel =cms.VInputTag(cms.InputTag('hcalDigis'),cms.InputTag('hcalDigis'))
-
- In order to run the emulation, include the above line in your cfg and add this module to the path.
process.hcalTriggerPrimitiveDigis=cms.Path(process.simHcalTriggerPrimitiveDigis)
A full list of configurable parameters can be obtained from
hcaltpdigi_cfi.py
.
Example Code
To get the collections of emulated TP:
edm::Handle<HcalTrigPrimDigiCollection> emulTPs;
iEvent.getByLabel(emulLabel_, emulTPs);
Once you have the collections of emulTP, you can access, for instance, compressedEt() and other variables of interest. See
HcalTriggerPrimitiveDigi.h
Notes
This instruction has been tested with CMSSW_4_2_5 release and Global Tag GR_R_42_V8