CMS 3D CMS Logo

Functions
SetCondition Namespace Reference

Functions

def setCondition (process, connect="frontier://FrontierProd/CMS_CONDITIONS", record=None, tag=None, label=None)
 

Function Documentation

◆ setCondition()

def SetCondition.setCondition (   process,
  connect = "frontier://FrontierProd/CMS_CONDITIONS",
  record = None,
  tag = None,
  label = None 
)
Overrides a condition in startgeometry from globaltag.

Definition at line 3 of file SetCondition.py.

3 def setCondition(process,
4  connect = "frontier://FrontierProd/CMS_CONDITIONS", record = None,
5  tag = None,
6  label = None):
7  """
8  Overrides a condition in startgeometry from globaltag.
9  """
10 
11  if record is None or tag is None:
12  raise ValueError("A 'record' and a 'tag' have to be provided to 'setCondition'.")
13 
14  if not hasattr(process, "GlobalTag"):
15  process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
16 
17  args = {"connect": cms.string(connect),
18  "record": cms.string(record),
19  "tag": cms.string(tag)}
20  if label is not None:
21  args["label"] = cms.untracked.string(label)
22 
23  process.GlobalTag.toGet \
24  = cms.VPSet([x for x in process.GlobalTag.toGet.value() if x.record.value() != record])
25  process.GlobalTag.toGet.append(cms.PSet(**args))
26 
SetCondition.setCondition
def setCondition(process, connect="frontier://FrontierProd/CMS_CONDITIONS", record=None, tag=None, label=None)
Definition: SetCondition.py:3