CMS 3D CMS Logo

MilleSetup.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 
4 def setup(process, input_files, collection,
5  json_file = "",
6  cosmics_zero_tesla = False,
7  cosmics_deco_mode = True,
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  # Track selection and refitting
30  # --------------------------------------------------------------------------
31  import Alignment.CommonAlignment.tools.trackselectionRefitting as trackRefitter
32  kwargs = {"cosmicsDecoMode": cosmics_deco_mode,
33  "cosmicsZeroTesla": cosmics_zero_tesla}
34  if TTRHBuilder is not None: kwargs["TTRHBuilder"] = TTRHBuilder
35  process.TrackRefittingSequence \
36  = trackRefitter.getSequence(process, collection, **kwargs)
37 
38 
39  # Ensure the correct APV mode for cosmics
40  # --------------------------------------------------------------------------
41  if collection in ("ALCARECOTkAlCosmicsCTF0T",
42  "ALCARECOTkAlCosmicsInCollisions"):
43  process.load("Alignment.CommonAlignment.apvModeFilter_cfi")
44  process.apvModeFilter.apvMode = "deco" if cosmics_deco_mode else "peak"
45  import helper
46  helper.add_filter(process, process.apvModeFilter)
47 
48 
49  # Configure the input data
50  # --------------------------------------------------------------------------
51  process.source = cms.Source("PoolSource", fileNames = input_files)
52 
53  # Set Luminosity-Blockrange from json-file if given
54  if (json_file != "") and (json_file != "placeholder_json"):
55  import FWCore.PythonUtilities.LumiList as LumiList
56  lumi_list = LumiList.LumiList(filename = json_file).getVLuminosityBlockRange()
57  process.source.lumisToProcess = lumi_list
58 
59 
60  # The executed path
61  # --------------------------------------------------------------------------
62  process.p = cms.Path(process.TrackRefittingSequence*
63  process.AlignmentProducer)
64  if hasattr(process, "mps_filters"): process.p.insert(0, process.mps_filters)
def add_filter(process, ed_filter)
Definition: helper.py:47
def setup(process, input_files, collection, json_file="", cosmics_zero_tesla=False, cosmics_deco_mode=True, TTRHBuilder=None)
Definition: MilleSetup.py:8