Skip to content

Commit

Permalink
Removal of hardcoded testing L1T tag
Browse files Browse the repository at this point in the history
  • Loading branch information
tvami committed Dec 8, 2021
1 parent b5b1719 commit f0bb5f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 46 deletions.
35 changes: 2 additions & 33 deletions L1Trigger/L1TCalorimeter/plugins/L1TStage2Layer2Producer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ class L1TStage2Layer2Producer : public edm::stream::EDProducer<> {

// the processor
std::shared_ptr<Stage2MainProcessor> m_processor;

// use static config for fw testing
bool m_useStaticConfig;
};

L1TStage2Layer2Producer::L1TStage2Layer2Producer(const edm::ParameterSet& ps) {
Expand All @@ -123,12 +120,6 @@ L1TStage2Layer2Producer::L1TStage2Layer2Producer(const edm::ParameterSet& ps) {
// set firmware version from python config for now
m_fwv = ps.getParameter<int>("firmware");

// get static config flag
m_useStaticConfig = ps.getParameter<bool>("useStaticConfig");
if (!m_useStaticConfig) {
m_o2oProtoToken = esConsumes<CaloParams, L1TCaloParamsO2ORcd, edm::Transition::BeginRun>();
}

//initialize
m_paramsCacheId = 0;
}
Expand Down Expand Up @@ -263,30 +254,8 @@ void L1TStage2Layer2Producer::beginRun(edm::Run const& iRun, edm::EventSetup con
edm::ESHandle<CaloParams> candidateHandle = iSetup.getHandle(m_candidateToken);
std::unique_ptr<l1t::CaloParams> candidate(new l1t::CaloParams(*candidateHandle.product()));

if (!m_useStaticConfig) {
// fetch the latest greatest prototype (equivalent of static payload)
edm::ESHandle<CaloParams> o2oProtoHandle = iSetup.getHandle(m_o2oProtoToken);
std::unique_ptr<l1t::CaloParams> prototype(new l1t::CaloParams(*o2oProtoHandle.product()));

// prepare to set the emulator's configuration
// and then replace our local copy of the parameters with a new one using placement new
m_params->~CaloParamsHelper();

// compare the candidate payload misses some of the pnodes compared to the prototype,
// if this is the case - the candidate is an old payload that'll crash the Stage2 emulator
// and we better use the prototype for the emulator's configuration
if (((CaloParamsHelper*)candidate.get())->getNodes().size() <
((CaloParamsHelper*)prototype.get())->getNodes().size())
m_params = new (m_params) CaloParamsHelper(*o2oProtoHandle.product());
else
m_params = new (m_params) CaloParamsHelper(*candidateHandle.product());
// KK: the nifty tricks above (placement new) work as long as current definition of
// CaloParams takes more space than the one obtained from the record

} else {
m_params->~CaloParamsHelper();
m_params = new (m_params) CaloParamsHelper(*candidateHandle.product());
}
m_params->~CaloParamsHelper();
m_params = new (m_params) CaloParamsHelper(*candidateHandle.product());

LogDebug("L1TDebug") << *m_params << std::endl;

Expand Down
13 changes: 0 additions & 13 deletions L1Trigger/L1TCalorimeter/python/simDigis_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,3 @@
from L1Trigger.L1TCalorimeter.simCaloStage2Digis_cfi import simCaloStage2Digis
stage2L1Trigger.toReplaceWith(SimL1TCalorimeterTask, cms.Task( simCaloStage2Layer1Digis, simCaloStage2Digis ))

def _modifyStage2L1TriggerCaloParams(process):
from CondCore.CondDB.CondDB_cfi import CondDB
CondDB.connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS")
process.l1conddb = cms.ESSource("PoolDBESSource",
CondDB,
toGet = cms.VPSet(
cms.PSet(
record = cms.string('L1TCaloParamsO2ORcd'),
tag = cms.string("L1TCaloParams_static_CMSSW_9_2_10_2017_v1_8_2_updateHFSF_v6MET")
)
)
)
modifySimDigis_stage2L1TriggerCaloPArams = stage2L1Trigger.makeProcessModifier(_modifyStage2L1TriggerCaloParams)

0 comments on commit f0bb5f6

Please sign in to comment.