|
4 | 4 | # Various set of customise functions needed for embedding |
5 | 5 | import FWCore.ParameterSet.Config as cms |
6 | 6 | from Configuration.Eras.Modifier_run2_common_cff import run2_common |
| 7 | +from Configuration.Eras.Modifier_run3_common_cff import run3_common |
7 | 8 | from PhysicsTools.NanoAOD.common_cff import ExtVar |
8 | 9 |
|
9 | 10 | ################################ Customizer for skimming ########################### |
@@ -236,7 +237,11 @@ def __init__( |
236 | 237 | ) |
237 | 238 |
|
238 | 239 | # add some collections for run2 |
239 | | -run2_common.toModify( |
| 240 | +# The era Modifier/ModifierChain is specified with the cmsDriver `--era` option or the cms.Process('NAME', era=...) constructor in the python config. |
| 241 | +# The `Modifier.toModify` method is executed if the Modifier is in the ModifierChain. (see https://github.com/cms-sw/cmssw/blob/master/FWCore/ParameterSet/python/Config.py#L1831) |
| 242 | +# The Run3 ModifierChain is based on the Run2 ModifierChain. Therefore the `run2_common` Modifier is included in both ModifierChains. |
| 243 | +# Those Modifiers allow bool operators to combine them. With `(run2_common & ~run3_common)` the `toModify` function is only executed if the era ModifierChain contains `run2_common` but not `run3_common`. |
| 244 | +(run2_common & ~run3_common).toModify( |
240 | 245 | to_bemanipulate, |
241 | 246 | lambda l: l.extend( |
242 | 247 | [ |
@@ -587,10 +592,7 @@ def customiseGenerator_preHLT(process, changeProcessname=True, reselect=False): |
587 | 592 |
|
588 | 593 | #### Disable noise simulation #### |
589 | 594 | # Castor was a detector in CMS till 2018. |
590 | | - for i in to_bemanipulate: |
591 | | - print(i.module_name) |
592 | | - run2_common.toModify(process, lambda x: print("DAS ######################################", to_bemanipulate)) |
593 | | - run2_common.toModify(process, lambda p: setattr(p.mix.digitizers.castor, "doNoise", cms.bool(False))) |
| 595 | + (run2_common & ~run3_common).toModify(process, lambda p: setattr(p.mix.digitizers.castor, "doNoise", cms.bool(False))) |
594 | 596 | process.mix.digitizers.ecal.doESNoise = cms.bool(False) |
595 | 597 | process.mix.digitizers.ecal.doENoise = cms.bool(False) |
596 | 598 |
|
|
0 commit comments