-
Notifications
You must be signed in to change notification settings - Fork 2
02 Premade Configuration 2 Filters and OutputModules
The file test_WToMuNuMET150.py is similar, but it also includes some more advanced features and a cut on the missing ET.
- The
process.load("somewhere")is roughly equivalent to
from somewhere import *
process.a = a # for everything that we just imported
So, the lines
process.load("Configuration.StandardSequences.SimulationRandomNumberGeneratorSeeds_cff")
process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
load the RandomNumberGenerator service and all seeds related to simulation. It also loads the Pythia ParticleDataTable to be available for modules inside the event.
- The lines
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import *
import common settings for Pythia8 and the CUEP8M1 tune (see the previous example).
-
We changed the Pythia8GeneratorFilter process to allow for high pthat.
-
This block
process.genENeutrinos = cms.EDFilter(
"PythiaFilter",
Status=cms.untracked.int32(1),
MaxEta=cms.untracked.double(1000.0),
MinEta=cms.untracked.double(-1000.0),
MinPt=cms.untracked.double(150),
ParticleID=cms.untracked.int32(12, 14, 16),
)
is an EDFilter. It gives a true/false answer, according to conditions described in the configuration and in the module code. If an event fails a filter, the Path is interrupted (processing stops) for that event. There are filters for all kinds of produces: genParticles, tracks, generic "particle candidates"... Here, this module acts on the HepMC product itself, and selects particles with a given ID, status and kinematics. We are selecting on neutrinos, and asking that they have pt > 150 GeV.
-
The processing path has changed to
process.p = cms.Path(process.generator * process.genENeutrinos)such that we actually filter for events containing high-pt neutrinos. -
This block
process.out = cms.OutputModule(
"PoolOutputModule", fileName=cms.untracked.string("output.root")
)
is an OutputModule, and it saves the events in a ROOT file. The following block
process.outMET150 = process.out.clone(
fileName=cms.untracked.string("outputMET150.root"),
SelectEvents=cms.untracked.PSet(SelectEvents=cms.vstring("p")),
)
does the same, but in another file and selecting only those events which go successfully through the Path p. Since the Path p has a filter, that means that only events that filter will be output to the file.
- Finally, there are two EndPaths
process.ep = cms.EndPath(process.out)
process.ep150 = cms.EndPath(process.outMET150)
which just run the aforementioned OutputModules separately. EndPaths are special Paths that are guaranteed to run after all other Paths.
If you run the test_WToMuNu_MET150.py configuration, you should get two files: output.root and outputMET150.root. Those two files should have the same content (inspect them with the edmDumpEventContent command), but one should have the total 100 events and the other only around 50 events. Inspect them with edmFileUtil file:output.root.
The ability to run processing paths in parallel, stop processing when a condition is met and write out only events which go successfully through a path is the kernel of the CMS High-Level Trigger system.
More information:
- https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideFrameWork
- https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideAboutPythonConfigFile
- https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideEDMParametersForModules
- https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideEDMPathsAndTriggerBits
- https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuidePoolInputSources
- https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideSelectingBranchesForOutput