Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222
import FWCore.ParameterSet.Config as cms

process = cms.Process("Alignment")

################################################################################
# Variables edited by mps_alisetup.py. Used in functions below.
# You can change them manually as well.
# ------------------------------------------------------------------------------
setupGlobaltag = "122X_dataRun3_Prompt_v3"
setupCollection = "ALCARECOTkAlCosmicsCosmicTF0T"
setupCosmicsDecoMode = True
setupCosmicsZeroTesla = False
setupPrimaryWidth     = -1.0
setupRecoGeometry     = "" # empty string defaults to DB
setupJson             = "placeholder_json"
setupRunStartGeometry = 348908

################################################################################
# Variables edited by MPS (mps_setup and mps_merge). Be careful.
# ------------------------------------------------------------------------------
# Default is "mille". Gets changed to "pede" by mps_merge.
setupAlgoMode = "pede"

# MPS looks specifically for the string "001" so don't change this.
setupMonitorFile      = "millePedeMonitor001.root"
setupBinaryFile       = "milleBinary001.dat"

# Input files. Edited by mps_splice.py
readFiles = cms.untracked.vstring()
readFiles.extend([
    '/store/data/Commissioning2022/Cosmics/ALCARECO/TkAlCosmics0T-PromptReco-v1/000/348/268/00000/863844bd-0350-4131-8ef0-bc2fc1c6cb85.root'])
################################################################################


################################################################################
# General setup
# ------------------------------------------------------------------------------
import Alignment.MillePedeAlignmentAlgorithm.alignmentsetup.GeneralSetup as generalSetup
generalSetup.setup(process, setupGlobaltag, setupCosmicsZeroTesla, setupRecoGeometry)

################################################################################
# setup alignment producer
# ------------------------------------------------------------------------------
import Alignment.MillePedeAlignmentAlgorithm.alignmentsetup.ConfigureAlignmentProducer as confAliProducer

confAliProducer.setConfiguration(process,
    collection   = setupCollection,
    mode         = setupAlgoMode,
    monitorFile  = setupMonitorFile,
    binaryFile   = setupBinaryFile,
    primaryWidth = setupPrimaryWidth,
    cosmicsZeroTesla = setupCosmicsZeroTesla)

################################################################################
# Overwrite some conditions in global tag
# ------------------------------------------------------------------------------
import Alignment.MillePedeAlignmentAlgorithm.alignmentsetup.SetCondition as tagwriter

#######################
## insert Alignables ##
#######################

# # to run a high-level alignment on real data (including TOB centering; use
# # pixel-barrel centering for MC) of the whole tracker you can use the
# # following configuration:
##
process.AlignmentProducer.ParameterBuilder.parameterTypes = [
    "SelectorRigid,RigidBody"
    ]
#
# # Define the high-level structure alignables
from align_params_cff import _alignParams
process.AlignmentProducer.ParameterBuilder.SelectorRigid = _alignParams

#########################
## insert Pedesettings ##
#########################
import Alignment.MillePedeAlignmentAlgorithm.alignmentsetup.helper as helper
helper.set_pede_option(process, "entries 100 10 2")
# helper.set_pede_option(process, "compress", drop = True)

import Alignment.MillePedeAlignmentAlgorithm.alignmentsetup.helper as helper
helper.set_pede_option(process, "skipemptycons")

################################################################################
# Mille-procedure
# ------------------------------------------------------------------------------
if setupAlgoMode == "mille":
    import Alignment.MillePedeAlignmentAlgorithm.alignmentsetup.MilleSetup as mille
    mille.setup(process,
                input_files        = readFiles,
                collection         = setupCollection,
                json_file          = setupJson,
                cosmics_zero_tesla = setupCosmicsZeroTesla,
                cosmics_deco_mode  = setupCosmicsDecoMode)

################################################################################
# Pede-procedure
# ------------------------------------------------------------------------------
else:
    # placeholers get replaced by mps_merge.py, which is called in mps_setup.pl
    merge_binary_files = [
        'milleBinary055.dat',
        'milleBinary056.dat',
        'milleBinary057.dat',
        'milleBinary058.dat',
        'milleBinary059.dat',
        'milleBinary076.dat',
        'milleBinary077.dat',
        'milleBinary078.dat',
        'milleBinary079.dat',
        'milleBinary096.dat',
        'milleBinary098.dat',
        'milleBinary099.dat',
        'milleBinary100.dat',
        'milleBinary101.dat',
        'milleBinary134.dat',
        'milleBinary135.dat',
        'milleBinary136.dat',
        'milleBinary137.dat',
        'milleBinary138.dat',
        'milleBinary139.dat',
        'milleBinary140.dat',
        'milleBinary141.dat',
        'milleBinary142.dat',
        'milleBinary143.dat',
        'milleBinary144.dat',
        'milleBinary145.dat',
        'milleBinary146.dat',
        'milleBinary147.dat',
        'milleBinary149.dat',
        'milleBinary150.dat',
        'milleBinary151.dat',
        'milleBinary152.dat',
        'milleBinary153.dat',
        'milleBinary154.dat',
        'milleBinary163.dat',
        'milleBinary164.dat',
        'milleBinary165.dat',
        'milleBinary166.dat',
        'milleBinary167.dat',
        'milleBinary168.dat',
        'milleBinary177.dat',
        'milleBinary180.dat',
        'milleBinary182.dat',
        'milleBinary183.dat',
        'milleBinary184.dat',
        'milleBinary185.dat',
        'milleBinary186.dat',
        'milleBinary187.dat']
    merge_tree_files = [
        'treeFile055.dat',
        'treeFile056.dat',
        'treeFile057.dat',
        'treeFile058.dat',
        'treeFile059.dat',
        'treeFile076.dat',
        'treeFile077.dat',
        'treeFile078.dat',
        'treeFile079.dat',
        'treeFile096.dat',
        'treeFile098.dat',
        'treeFile099.dat',
        'treeFile100.dat',
        'treeFile101.dat',
        'treeFile134.dat',
        'treeFile135.dat',
        'treeFile136.dat',
        'treeFile137.dat',
        'treeFile138.dat',
        'treeFile139.dat',
        'treeFile140.dat',
        'treeFile141.dat',
        'treeFile142.dat',
        'treeFile143.dat',
        'treeFile144.dat',
        'treeFile145.dat',
        'treeFile146.dat',
        'treeFile147.dat',
        'treeFile149.dat',
        'treeFile150.dat',
        'treeFile151.dat',
        'treeFile152.dat',
        'treeFile153.dat',
        'treeFile154.dat',
        'treeFile163.dat',
        'treeFile164.dat',
        'treeFile165.dat',
        'treeFile166.dat',
        'treeFile167.dat',
        'treeFile168.dat',
        'treeFile177.dat',
        'treeFile180.dat',
        'treeFile182.dat',
        'treeFile183.dat',
        'treeFile184.dat',
        'treeFile185.dat',
        'treeFile186.dat',
        'treeFile187.dat']

    import Alignment.MillePedeAlignmentAlgorithm.alignmentsetup.PedeSetup as pede
    pede.setup(process,
               binary_files = merge_binary_files,
               tree_files = merge_tree_files,
               run_start_geometry = setupRunStartGeometry)

import Alignment.MillePedeAlignmentAlgorithm.alignmentsetup.SetCondition as tagwriter

tagwriter.setCondition(process,
       connect = "sqlite_file:alignment_input.db",
       record = "TrackerAlignmentRcd",
       tag = "TrackerAlignment_PCL_byRun_v2_express_348155")

tagwriter.setCondition(process,
       connect = "sqlite_file:alignment_input.db",
       record = "TrackerSurfaceDeformationRcd",
       tag = "TrackerSurafceDeformations_v1_express_299685")

tagwriter.setCondition(process,
       connect = "sqlite_file:alignment_input.db",
       record = "TrackerAlignmentErrorExtendedRcd",
       tag = "TrackerAlignmentExtendedErr_2009_v2_express_IOVs_347303")