CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
PedeSetup Namespace Reference

Functions

def setup
 

Function Documentation

def PedeSetup.setup (   process,
  binary_files,
  tree_files,
  run_start_geometry 
)
Pede-specific setup.

Arguments:
- `process`: cms.Process object
- `binary_files`: list of binary files to be read by pede
- `tree_files`: list of ROOT files created in the mille step
- `run_start_geometry`: run ID to pick the start geometry

Definition at line 5 of file PedeSetup.py.

5 
6 def setup(process, binary_files, tree_files, run_start_geometry):
7  """Pede-specific setup.
8 
9  Arguments:
10  - `process`: cms.Process object
11  - `binary_files`: list of binary files to be read by pede
12  - `tree_files`: list of ROOT files created in the mille step
13  - `run_start_geometry`: run ID to pick the start geometry
14  """
15 
16  # write alignments, APEs, and surface deformations to DB by default
17  # --------------------------------------------------------------------------
18  process.AlignmentProducer.saveToDB = True
19  process.AlignmentProducer.saveApeToDB = True
20  process.AlignmentProducer.saveDeformationsToDB = True
21 
22  # setup database output module
23  # --------------------------------------------------------------------------
24  from CondCore.CondDB.CondDB_cfi import CondDB
25  process.PoolDBOutputService = cms.Service("PoolDBOutputService",
26  CondDB.clone(connect = "sqlite_file:alignments_MP.db"),
27  timetype = cms.untracked.string("runnumber"),
28  toPut = cms.VPSet(
29  cms.PSet(
30  record = cms.string("TrackerAlignmentRcd"),
31  tag = cms.string("Alignments")),
32  cms.PSet(
33  record = cms.string("TrackerAlignmentErrorExtendedRcd"),
34  tag = cms.string("AlignmentErrorsExtended")),
35  cms.PSet(
36  record = cms.string("TrackerSurfaceDeformationRcd"),
37  tag = cms.string("Deformations")),
38  cms.PSet(
39  record = cms.string("SiStripLorentzAngleRcd_peak"),
40  tag = cms.string("SiStripLorentzAngle_peak")),
41  cms.PSet(
42  record = cms.string("SiStripLorentzAngleRcd_deco"),
43  tag = cms.string("SiStripLorentzAngle_deco")),
44  cms.PSet(
45  record = cms.string("SiPixelLorentzAngleRcd"),
46  tag = cms.string("SiPixelLorentzAngle")),
47  cms.PSet(
48  record = cms.string("SiStripBackPlaneCorrectionRcd"),
49  tag = cms.string("SiStripBackPlaneCorrection"))
50  )
51  )
52 
53 
54  # Reconfigure parts of the algorithm configuration
55  # --------------------------------------------------------------------------
56  process.AlignmentProducer.algoConfig.mergeBinaryFiles = binary_files
57  process.AlignmentProducer.algoConfig.mergeTreeFiles = tree_files
58 
59 
60  # align calibrations to general settings
61  # --------------------------------------------------------------------------
62  for calib in process.AlignmentProducer.calibrations:
63  calib.saveToDB = process.AlignmentProducer.saveToDB
64  calib.treeFile = process.AlignmentProducer.algoConfig.treeFile
65  calib.mergeTreeFiles = process.AlignmentProducer.algoConfig.mergeTreeFiles
66 
67 
68  # Configure the empty source to include all needed runs
69  # --------------------------------------------------------------------------
70  iovs = mps_tools.make_unique_runranges(process.AlignmentProducer)
71  number_of_events = iovs[-1] - iovs[0] + 1
72 
73  process.maxEvents = cms.untracked.PSet(
74  input = cms.untracked.int32(number_of_events))
75  process.source = cms.Source(
76  "EmptySource",
77  firstRun = cms.untracked.uint32(run_start_geometry),
78  numberEventsInRun = cms.untracked.uint32(1))
79 
80  # Define the executed path
81  # --------------------------------------------------------------------------
82  process.p = cms.Path(process.AlignmentProducer)
def setup
Definition: PedeSetup.py:5