from FWCore.ParameterSet.Config import Config # Create a new configuration object config = Config() # Add a parameter to the configuration config.some_parameter = "some value" # Add a nested parameter config.some_dict = {"key": "value"} # Write the configuration to a file with open("config.py", "w") as f: f.write(str(config))
from FWCore.ParameterSet.Config import EventRange # Define an EventRange object for events 10-20 event_range = EventRange("10:20") # Iterate over the events in the range for event in event_range: print(event)This example demonstrates how to define an EventRange object and iterate over the events in the range. The EventRange module provides additional tools for working with ranges of events, such as specifying ranges with a step size and merging multiple ranges.