Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Configuration/ProcessModifiers/python/fastSimPU_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import FWCore.ParameterSet.Config as cms

fastSimPU = cms.Modifier()
2 changes: 2 additions & 0 deletions Configuration/PyReleaseValidation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ The offsets currently in use are:
* 0.634: ECAL phase2 Trigger Primitive + component-method based digis
* 0.635: ECAL phase2 Trigger Primitive + component-method based finely-sampled waveforms
* 0.91: Track DNN modifier
* 0.95: Hybrid PU (FullSim signal + FastSim PU) stage2
* 0.96: Hybrid PU (FullSim signal + FastSim PU) stage1+stage2
* 0.97: Premixing stage1
* 0.98: Premixing stage2
* 0.99: Premixing stage1+stage2
Expand Down
8 changes: 5 additions & 3 deletions Configuration/PyReleaseValidation/python/WorkFlowRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,9 @@ def closeCmd(i,ID):
if self.noRun:
cmd +=' --no_exec'
# in case previous step used DAS query (either filelist of das:)
# not to be applied for premixing stage1 to allow combiend stage1+stage2 workflow
if inFile and not 'premix_stage1' in cmd:
# not to be applied for premixing stage1 to allow combined stage1+stage2 workflow
# & similar for HybridPU combined workflow
if inFile and not 'premix_stage1' in cmd and not 'FASTSIM' in cmd:
cmd += ' --filein '+inFile
inFile=None
if lumiRangeFile: #DAS query can also restrict lumi range
Expand All @@ -246,12 +247,13 @@ def closeCmd(i,ID):
else:
# Disable input for premix stage1 to allow combined stage1+stage2 workflow
# Disable input for premix stage2 in FastSim to allow combined stage1+stage2 workflow (in FS, stage2 does also GEN)
# & similar for HybridPU combined workflow
# Ugly hack but works
extension = '.root'
if '--rntuple_out' in cmd:
extension = '.rntpl'
outputExtensionForStep[istep] = extension
if istep!=1 and not '--filein' in cmd and not 'premix_stage1' in cmd and not ("--fast" in cmd and "premix_stage2" in cmd):
if istep!=1 and not '--filein' in cmd and not 'premix_stage1' in cmd and not ("--fast" in cmd and "premix_stage2" in cmd) and not 'FASTSIM' in cmd:
steps = cmd.split("-s ")[1].split(" ")[0] ## relying on the syntax: cmsDriver -s STEPS --otherFlags
if "ALCA" not in steps:
cmd+=' --filein file:step%s%s '%(istep-1,outputExtensionForStep[istep-1])
Expand Down
8 changes: 8 additions & 0 deletions Configuration/PyReleaseValidation/python/relval_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -5233,6 +5233,14 @@ def gen2024HiMix(fragment,howMuch):
steps[k+'INPUT']={'INPUT':InputInfo(dataSet='/RelVal'+info.dataset+'/%s/GEN-SIM'%(baseDataSetReleaseBetter[s],),location='STD')}
else: #For FastSim to recycle GEN
steps[k+'INPUT']={'INPUT':InputInfo(dataSet='/RelVal'+info.dataset+'/%s/GEN'%(baseDataSetReleaseBetter[s],),location='STD')}
# this condition is checked here to avoid skipping the creation of default steps for other fragments
if 'HybridPU' in step:
# minbias fastsim for PU mixing
if not 'MinBias_14TeV' in frag:
continue
stepKey = 'HYBRID_'+key+'_'+step
howMuch = Kby(100,100)
steps[stepKey]=merge([ {'--evt_type':frag},howMuch,upgradeStepDict[step][key]])
else:
for key in [key for year in upgradeKeys for key in upgradeKeys[year]]:
k=step+'_'+key
Expand Down
8 changes: 8 additions & 0 deletions Configuration/PyReleaseValidation/python/relval_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ def notForGenOnly(key,specialType):
if 'S2' in specialType: stepList[specialType].append(stepMade)
# replace for s1
else: stepList[specialType][-1] = stepMade
# similar hack for fastpu
if 'HybridPU' in specialType:
if 'GenSim' in step:
s = step.replace('GenSim','GenSimFS')+'PU' # later processing requires to have PU here
if step in specialWF.PU:
stepMade = stepMaker(key,'HYBRID',s,specialWF.suffix)
# append for combined
if 'S2' in specialType: stepList[specialType].append(stepMade)
else:
stepList[specialType].append(stepMaker(key,frag[:-4],step,''))
for specialType,specialWF in upgradeWFs.items():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3171,6 +3171,82 @@ def condition(self, fragment, stepList, key, hasHarvest):
offset = 0.9921,
)

class UpgradeWorkflowHybridPU(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
# just copy steps
stepDict[stepName][k] = merge([stepDict[step][k]])
def setupPU_(self, step, stepName, stepDict, k, properties):
# make new step for S1
# this gets inserted in relval_upgrade.py
if "GenSim" in stepName:
# go back to non-PU step version
d = merge([stepDict[self.getStepName(step)][k]])
stepNameS1 = stepName.replace('GenSim','GenSimFS')
if not stepNameS1 in stepDict: stepDict[stepNameS1] = {}
stepDict[stepNameS1][k] = merge([{
'--fast': '',
'--era': stepDict[stepName][k]['--era']+'_FastSim',
'--eventcontent': 'FASTPU',
'--processName': 'FASTSIM',
}, d])
else:
# include modifier in all subsequent steps in case any of them use PU replay
if "--procModifiers" in stepDict[stepName][k]:
stepDict[stepName][k]["--procModifiers"] += ",fastSimPU"
else:
stepDict[stepName][k]["--procModifiers"] = "fastSimPU"

if "Digi" in stepName:
stepDict[stepName][k] = merge([digiPremixLocalPileup, stepDict[stepName][k]])
elif 'S1S2' in self.suffix:
# increment inputs for subsequent steps in combined case
# also reset pileup input
digiPremixLocalPileupTmp = deepcopy(digiPremixLocalPileup)
filein = stepDict[stepName][k].get("--filein","")
m = re.search("step(?P<ind>\\d+)", filein)
if m:
digiPremixLocalPileupTmp['--filein'] = filein.replace(m.group(), "step%d"%(int(m.group("ind"))+1))
else:
digiPremixLocalPileupTmp.pop('--filein')
stepDict[stepName][k] = merge([digiPremixLocalPileupTmp, stepDict[stepName][k]])
def condition(self, fragment, stepList, key, hasHarvest):
return (fragment=='TTbar_14TeV' and 'PU' in key and key.startswith('202') and not 'FS' in key)
# stage1 is just FastSim MinBias, no separate workflow needed
# HybridPU stage2
upgradeWFs['HybridPUS2'] = UpgradeWorkflowHybridPU(
steps = [],
PU = [
'Digi',
'DigiTrigger',
],
suffix = '_HybridPUS2',
offset = 0.95,
)
# HybridPU combined stage1+stage2
upgradeWFs['HybridPUS1S2'] = UpgradeWorkflowHybridPU(
steps = [],
PU = [
'GenSim',
'GenSimHLBeamSpot',
'GenSimHLBeamSpot14',
'Digi',
'DigiTrigger',
'RecoLocal',
'Reco',
'RecoFakeHLT',
'RecoGlobal',
'RecoGlobalFakeHLT',
'RecoNano',
'RecoNanoFakeHLT',
'Nano',
'HARVESTNano',
'HARVESTNanoFakeHLT',
'ALCA',
],
suffix = '_HybridPUS1S2',
offset = 0.96,
)

class UpgradeWorkflow_Run3FStrackingOnly(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
if 'HARVESTFastRun3' in step:
Expand Down
20 changes: 10 additions & 10 deletions SimCalorimetry/EcalSimProducers/interface/EcalDigiProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
#include "SimDataFormats/CaloHit/interface/PCaloHit.h"
#include <vector>

typedef EcalTDigitizer<EBDigitizerTraits> EBDigitizer;
typedef EcalTDigitizer<EEDigitizerTraits> EEDigitizer;
typedef CaloTDigitizer<ESOldDigitizerTraits> ESOldDigitizer;
using EBDigitizer = EcalTDigitizer<EBDigitizerTraits>;
using EEDigitizer = EcalTDigitizer<EEDigitizerTraits>;
using ESOldDigitizer = CaloTDigitizer<ESOldDigitizerTraits>;

class ESDigitizer;

Expand Down Expand Up @@ -99,7 +99,7 @@ class EcalDigiProducer : public DigiAccumulatorMixMod {
virtual void cacheEBDigis(const EBDigiCollection *ebDigiPtr) const {}
virtual void cacheEEDigis(const EEDigiCollection *eeDigiPtr) const {}

typedef edm::Handle<std::vector<PCaloHit>> HitsHandle;
using HitsHandle = edm::Handle<std::vector<PCaloHit>>;
void accumulateCaloHits(HitsHandle const &ebHandle,
HitsHandle const &eeHandle,
HitsHandle const &esHandle,
Expand All @@ -121,10 +121,10 @@ class EcalDigiProducer : public DigiAccumulatorMixMod {
const std::string m_EEdigiCollection;
const std::string m_ESdigiCollection;
const std::string m_hitsProducerTag;

const edm::EDGetTokenT<std::vector<PCaloHit>> m_HitsEBToken_;
const edm::EDGetTokenT<std::vector<PCaloHit>> m_HitsEEToken_;
const edm::EDGetTokenT<std::vector<PCaloHit>> m_HitsESToken_;
const std::string m_hitsProducerTagPU;
edm::EDGetTokenT<std::vector<PCaloHit>> m_HitsEBToken_;
edm::EDGetTokenT<std::vector<PCaloHit>> m_HitsEEToken_;
edm::EDGetTokenT<std::vector<PCaloHit>> m_HitsESToken_;

const edm::ESGetToken<EcalPedestals, EcalPedestalsRcd> m_pedestalsToken;
const edm::ESGetToken<EcalIntercalibConstantsMC, EcalIntercalibConstantsMCRcd> m_icalToken;
Expand Down Expand Up @@ -188,9 +188,9 @@ class EcalDigiProducer : public DigiAccumulatorMixMod {
std::unique_ptr<EBDigitizer> m_BarrelDigitizer;
std::unique_ptr<EEDigitizer> m_EndcapDigitizer;

typedef CaloTSamples<float, 10> EcalSamples;
using EcalSamples = CaloTSamples<float, 10>;

typedef EcalElectronicsSim<EcalCoder, EcalSamples, EcalDataFrame> EcalElectronicsSim_Ph1;
using EcalElectronicsSim_Ph1 = EcalElectronicsSim<EcalCoder, EcalSamples, EcalDataFrame>;
std::unique_ptr<EcalElectronicsSim_Ph1> m_ElectronicsSim;
std::unique_ptr<EcalCoder> m_Coder;

Expand Down
Loading