test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 = "", cosmics_zero_tesla = False, cosmics_deco_mode = True):
6  """Mille-specific setup.
7 
8  Arguments:
9  - `process`: cms.Process object
10  - `input_files`: input file list -> cms.untracked.vstring()
11  - `collection`: track collection to be used
12  - `cosmics_zero_tesla`: triggers the corresponding track selection
13  - `cosmics_deco_mode`: triggers the corresponding track selection
14  """
15 
16  # no database output in the mille step:
17  # --------------------------------------------------------------------------
18  process.AlignmentProducer.saveToDB = False
19  process.AlignmentProducer.saveApeToDB = False
20  process.AlignmentProducer.saveDeformationsToDB = False
21 
22 
23  # Track selection and refitting
24  # --------------------------------------------------------------------------
25  process.load("RecoVertex.BeamSpotProducer.BeamSpot_cfi")
26 
27  import Alignment.CommonAlignment.tools.trackselectionRefitting as trackRefitter
28  process.TrackRefittingSequence = trackRefitter.getSequence(
29  process,
30  collection,
31  cosmicsDecoMode = cosmics_deco_mode,
32  cosmicsZeroTesla = cosmics_zero_tesla)
33 
34  # Overwrite Track-Selector filter options from unified sequence to 'False'
35  process.AlignmentTrackSelector.filter = False
36  if collection not in ("ALCARECOTkAlCosmicsCTF0T",
37  "ALCARECOTkAlCosmicsInCollisions"):
38  # there is no HighPurity selector for cosmics
39  process.HighPurityTrackSelector.filter = False
40 
41 
42  # Configure the input data
43  # --------------------------------------------------------------------------
44  process.source = cms.Source("PoolSource", fileNames = input_files)
45 
46  # Set Luminosity-Blockrange from json-file if given
47  if (json_file != "") and (json_file != "placeholder_json"):
48  import FWCore.PythonUtilities.LumiList as LumiList
49  lumi_list = LumiList.LumiList(filename = json_file).getVLuminosityBlockRange()
50  process.source.lumisToProcess = lumi_list
51 
52 
53  # The executed path
54  # --------------------------------------------------------------------------
55  process.p = cms.Path(process.offlineBeamSpot*process.TrackRefittingSequence)
def setup
Definition: MilleSetup.py:5