def configureEarlyDataAlignment(fixQOverPBias=True): TAlignment().WriteCondSubDetList += ['Velo', 'TT', 'IT', 'OT', 'Muon'] # define the alignment elements elements = Alignables() elements.Velo("None") elements.VeloRight("Tx") elements.VeloLeft("Tx") elements.IT("None") elements.ITBoxes("TxTzRz") elements.ITLayers("TxTz") elements.OT("None") elements.OTCFrames("Tx") elements.OTCFrameLayers("Tz") elements.TT("None") elements.TTLayers("None") elements.TTModules("TxRz") elements.Tracker("None") TAlignment().ElementsToAlign = list(elements) # make sure that the velo stays where it was TAlignment().Constraints = constraints = [] constraints.append("VeloHalfAverage : Velo/Velo(Left|Right) : Tx ") # fix the q/p scale by not moving T in X. note that you do not # want to do this if you use D0 in the alignment if fixQOverPBias: constraints.append("OT3X : OT/T3X1U.Side : Tx") # tweak the survey a little bit to fix the z-scale to survey surveyconstraints = SurveyConstraints() surveyconstraints.All() # make sure we fix the z-scale surveyconstraints.XmlUncertainties += [ "OT/T3X1U : 0.5 0.5 0.00001 0.0001 0.0001 0.0001" ]
def configureTrackerAlignment(fixQOverPBias=False, surveyVer='latest'): TAlignment().WriteCondSubDetList += ['TT', 'IT', 'OT'] # define the alignment elements elements = Alignables() elements.Velo("None") elements.VeloRight("None") elements.VeloLeft("None") elements.IT("None") elements.ITBoxes("TxTzRz") elements.ITLayers("None") elements.OT("None") elements.OTCFrames("TxRz") elements.OTCFrameLayers("Tz") elements.OTModules("TxRz") elements.TT("None") elements.TTLayers("Tz") elements.TTModules("TxRz") elements.Tracker("None") TAlignment().ElementsToAlign = list(elements) # make sure that the velo stays where it was constraints = [] # fix the q/p scale by not moving T in X. note that you do not # want to do this if you use D0 in the alignment if fixQOverPBias: constraints.append("OT3X : OT/T3X1U.Side : Tx") TAlignment().Constraints = constraints if surveyVer == None: return # tweak the survey a little bit to fix the z-scale to survey surveyconstraints = SurveyConstraints() surveyconstraints.All(surveyVer) # make sure we fix the z-scale surveyconstraints.XmlUncertainties += [ "OT/T3X1U : 0.5 0.5 0.00001 0.0001 0.0001 0.0001" ]
elements.Velo("None") #elements.VeloRight("TxTyTzRxRy") #elements.VeloLeft("TxTyTzRxRy") elements.VeloLeft("None") elements.VeloRight("None") #elements.VeloModules("TxTyTzRz") #elements.VeloPhiSensors("TxTy") #elements.VeloRSensors("None") #elements.VeloRSensors("None") #elements.VeloPhiSensors("None") elements.VeloModules("None") elements.IT("None") elements.ITBoxes("TxTyTzRxRyRz") elements.ITLayers("TxTz") elements.ITLadders("TxRz") #elements.ITBoxes("Tx") elements.OT("None") elements.OTCFrames("Tx") elements.OTCFrameLayers("Tz") elements.OTModules("TxRz") elements.TT("None") elements.TTLayers("None") #elements.TTBoxes("Ry") #elements.TTHalfLayers("Tx") #elements.TTHalfModules("TxRz") elements.TTModules("TxRz") elements.Tracker("None") # let's try this:
from Configurables import TAlignment from TAlignment.Alignables import * from TAlignment.SurveyConstraints import * elements = Alignables() elements.Velo("None") elements.VeloRight("None") elements.VeloLeft("TxTy") #elements.VeloModules("TxTyTzRz") #elements.VeloPhiSensors("TxTy") #elements.VeloRSensors("None") elements.IT("None") elements.ITBoxes("TxTyTzRxRyRz") elements.ITLayers("TxTyTzRxRyRz") #elements.ITLadders("TxRz") elements.OT("None") elements.OTCFrames("Tx") elements.OTCFrameLayers("Tz") elements.OTModules("TxRz") elements.TT("None") elements.TTLayers("None") #elements.TTBoxes("Ry") #elements.TTHalfLayers("Tx") #elements.TTHalfModules("TxRz") elements.TTModules("TxRz") constraints = [] # we fix the OT x, until we have seen magnet-off data
from TAlignment.SurveyConstraints import * constraints = [] surveyconstraints = SurveyConstraints() surveyconstraints.All() elements = Alignables() elements.Velo("None") elements.VeloRight("TxTyTzRxRyRz") elements.VeloLeft("TxTyTzRxRyRz") elements.VeloModules("TxTyTzRz") elements.VeloPhiSensors("TxTy") elements.VeloRSensors("None") elements.ITBoxes("TxTyTzRzRyRx") elements.ITLayers("TxTzRx") elements.ITLadders("TxRz") elements.OTCFrames("TxTy") elements.OTCFrameLayers("Tz") elements.OTModules("Tx") elements.TT("TyTz") #elements.TTLayers("Tz") #elements.TTBoxes("Ry") elements.TTHalfLayers("TxTzRy") #elements.TTHalfModules("TxRz") elements.TTModules("TxRz") #constraints.append("TTHalfLayerAverage : TT..Layer.Side : Tx : total") # now constrain the total shearing in each Velo half to get the z-axis nominal constraints.append("VeloLeftFirst : Velo/VeloLeft/Module00 : Tx Ty : total")
#constraints.append("OTCSide : OT/T3VX2CSide : Tx") #constraints.append("OTASide : OT/T3VX2ASide : Tx") # make sure to constrain both q/P and a twist. does this work? #constraints.append("ITGlobal : T/IT : Tx Ty : total") elements = Alignables() constraints = [] #elements += ['/dd/Structure/LHCb/AfterMagnetRegion/T/IT/Station(1|2|3)/(CSide|ASide|Top|Bottom)Box:TxTyTzRz'] #elements += ['/dd/Structure/LHCb/AfterMagnetRegion/T/IT/Station(1|2|3)/(CSide|ASide|Top|Bottom)Box/Layer.{1,2}:TxTz'] elements.Velo("None") elements.VeloRight("None") elements.ITBoxes("TxTyTzRzRyRx") elements.ITLayers("Tx") elements.ITLadders("TxRz") elements.OTCFrames("Tx") elements.OTCFrameLayers("Tz") elements.OTModules("TxRz") elements.TT("TxTyTz") #elements.TTBoxes("Tx") #elements.TTHalfLayers("Tx") elements.TTHalfModules("TxRz") #constraints.append("TTHalfLayerAverage : TT..Layer.Side : Tx : total") #constraints.append("OT3Frames : OT/T3VX2.Side : Tx") #constraints.append("OT3 : OT/T3VX2 : Tx Ty Tz") constraints.append("IT3Top : IT/Station3/TopBox : Tx Ty Tz Rx Ry Rz") constraints.append("IT3Bottom : IT/Station3/BottomBox : Tx Ty Tz Rx Ry Rz") constraints.append("IT3A : IT/Station3/ASideBox : Ty Tz Rx Ry Rz") constraints.append("IT3C : IT/Station3/CSideBox : Ty Tz Rx Ry Rz")