CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GeneralSetup.py
Go to the documentation of this file.
1 from __future__ import print_function
2 def setup(process, global_tag, zero_tesla = False):
3  """General setup of an alignment process.
4 
5  Arguments:
6  - `process`: cms.Process object
7  - `global_tag`: global tag to be used
8  - `zero_tesla`: if 'True' the B-field map for 0T is enforced
9  """
10 
11  # MessageLogger for convenient output
12  # --------------------------------------------------------------------------
13  process.load('Alignment.MillePedeAlignmentAlgorithm.alignmentsetup.myMessageLogger_cff')
14 
15  # Load the conditions
16  # --------------------------------------------------------------------------
17  if zero_tesla:
18  # actually only needed for 0T MC samples, but does not harm for 0T data:
19  process.load("Configuration.StandardSequences.MagneticField_0T_cff")
20  else:
21  process.load('Configuration.StandardSequences.MagneticField_cff')
22  process.load('Configuration.Geometry.GeometryRecoDB_cff')
23  process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
24 
25  from Configuration.AlCa.GlobalTag import GlobalTag
26  process.GlobalTag = GlobalTag(process.GlobalTag, global_tag)
27  print("Using Global Tag:", process.GlobalTag.globaltag._value)
28 
29  return process # not required because the cms.Process is modified in place
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47