CMS 3D CMS Logo

Functions
MilleSetup Namespace Reference

Functions

def setup (process, input_files, collection, json_file="", cosmics_zero_tesla=False, cosmics_deco_mode=True, TTRHBuilder=None)
 

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 8 of file MilleSetup.py.

References helper.add_filter().

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