CMS 3D CMS Logo

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

Functions

def setup
 

Function Documentation

def MilleSetup.setup (   process,
  input_files,
  collection,
  json_file = "",
  cosmics_zero_tesla = False,
  cosmics_deco_mode = True,
  TTRHBuilder = None 
)
Mille-specific setup.

Arguments:
- `process`: cms.Process object
- `input_files`: input file list -> cms.untracked.vstring()
- `collection`: track collection to be used
- `cosmics_zero_tesla`: triggers the corresponding track selection
- `cosmics_deco_mode`: triggers the corresponding track selection
- `TTRHBuilder`: TransientTrackingRecHitBuilder used in the track selection
                 and refitting sequence;
                 defaults to the default of the above-mentioned sequence

Definition at line 9 of file MilleSetup.py.

References helper.add_filter().

9 
10  TTRHBuilder = None):
11  """Mille-specific setup.
12 
13  Arguments:
14  - `process`: cms.Process object
15  - `input_files`: input file list -> cms.untracked.vstring()
16  - `collection`: track collection to be used
17  - `cosmics_zero_tesla`: triggers the corresponding track selection
18  - `cosmics_deco_mode`: triggers the corresponding track selection
19  - `TTRHBuilder`: TransientTrackingRecHitBuilder used in the track selection
20  and refitting sequence;
21  defaults to the default of the above-mentioned sequence
22  """
23 
24  # no database output in the mille step:
25  # --------------------------------------------------------------------------
26  process.AlignmentProducer.saveToDB = False
27  process.AlignmentProducer.saveApeToDB = False
28  process.AlignmentProducer.saveDeformationsToDB = False
29 
30 
31  # align calibrations to general settings
32  # --------------------------------------------------------------------------
33  for calib in process.AlignmentProducer.calibrations:
34  calib.saveToDB = process.AlignmentProducer.saveToDB
35  calib.treeFile = process.AlignmentProducer.algoConfig.treeFile
36  calib.mergeTreeFiles = process.AlignmentProducer.algoConfig.mergeTreeFiles
37 
38 
39  # Track selection and refitting
40  # --------------------------------------------------------------------------
41  import Alignment.CommonAlignment.tools.trackselectionRefitting as trackRefitter
42  kwargs = {"cosmicsDecoMode": cosmics_deco_mode,
43  "cosmicsZeroTesla": cosmics_zero_tesla}
44  if TTRHBuilder is not None: kwargs["TTRHBuilder"] = TTRHBuilder
45  process.TrackRefittingSequence \
46  = trackRefitter.getSequence(process, collection, **kwargs)
47 
48 
49  # Ensure the correct APV mode for cosmics
50  # --------------------------------------------------------------------------
51  if collection in ("ALCARECOTkAlCosmicsCTF0T",
52  "ALCARECOTkAlCosmicsInCollisions"):
53  process.load("Alignment.CommonAlignment.apvModeFilter_cfi")
54  process.apvModeFilter.apvMode = "deco" if cosmics_deco_mode else "peak"
55  from . import helper
56  helper.add_filter(process, process.apvModeFilter)
57 
58 
59  # Configure the input data
60  # --------------------------------------------------------------------------
61  process.source = cms.Source("PoolSource", fileNames = input_files)
62 
63  # Set Luminosity-Blockrange from json-file if given
64  if (json_file != "") and (json_file != "placeholder_json"):
65  import FWCore.PythonUtilities.LumiList as LumiList
66  lumi_list = LumiList.LumiList(filename = json_file).getVLuminosityBlockRange()
67  process.source.lumisToProcess = lumi_list
68 
69 
70  # The executed path
71  # --------------------------------------------------------------------------
72  process.p = cms.Path(process.TrackRefittingSequence*
73  process.AlignmentProducer)
74  if hasattr(process, "mps_filters"): process.p.insert(0, process.mps_filters)
def add_filter
Definition: helper.py:48