def configureVeloHalfAlignment(): TAlignment().WriteCondSubDetList += ['Velo'] # define the alignment elements elements = Alignables() elements.Velo("None") elements.VeloRight("TxTyTzRxRyRz") elements.VeloLeft("TxTyTzRxRyRz") TAlignment().ElementsToAlign = list(elements) # make sure that the velo stays where it was TAlignment().Constraints = constraints = [] constraints.append( "VeloHalfAverage : Velo/Velo(Left|Right) : Tx Ty Tz Rx Ry Rz") # tweak the survey a little bit to fix the z-scale to survey surveyconstraints = SurveyConstraints() surveyconstraints.All()
def configureMuonAlignment(surveyVer='latest'): TAlignment().WriteCondSubDetList += ['Muon'] # change convergence criteria updatetool = Al__AlignUpdateTool("Al::AlignUpdateTool") updatetool.MaxDeltaChi2PDofForConvergence = 2 updatetool.MaxModeDeltaChi2ForConvergence = 10 # define the alignment elements elements = Alignables() elements.MuonHalfStations("TxTy") TAlignment().ElementsToAlign = list(elements) # make sure that the velo stays where it was constraints = [] 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) """
def configureVeloModuleAlignment(): ''' Align Modues only for only the main degrees of freedom Tx Ty Rz Constrain two modules in each half ''' TAlignment().WriteCondSubDetList += ['Velo'] elements = Alignables() elements.Velo("None") elements.VeloRight("None") elements.VeloLeft("None") elements.VeloModules("TxTyRz") elements.VeloPhiSensors("None") elements.VeloRSensors("None") TAlignment().ElementsToAlign += list(elements) # Constraints surveyconstraints = SurveyConstraints() surveyconstraints.All() constraints = [] # Fix 2 modules constraints.append("VeloFixModule10 : Velo/VeloLeft/Module10: Tx Ty Rz") constraints.append("VeloFixModule11 : Velo/VeloRight/Module11: Tx Ty Rz") constraints.append("VeloFixModule32 : Velo/VeloLeft/Module32: Tx Ty Rz") constraints.append("VeloFixModule33 : Velo/VeloRight/Module33: Tx Ty Rz") constraints.append( "VeloFixSensors10 : Velo/VeloLeft/Module10/RPhiPair10/.*: Tx Ty Rz") constraints.append( "VeloFixSensors11 : Velo/VeloRight/Module11/RPhiPair11/.*: Tx Ty Rz") constraints.append( "VeloFixSensors32 : Velo/VeloLeft/Module32/RPhiPair32/.*: Tx Ty Rz") constraints.append( "VeloFixSensors33 : Velo/VeloRight/Module33/RPhiPair33/.*: Tx Ty Rz") # Constrain average # constraints.append("VeloAInternal : Velo/VeloRight/Module..: Tx Ty Rz Szx Szy") # constraints.append("VeloCInternal : Velo/VeloLeft/Module..: Tx Ty Rz Szx Szy") TAlignment().Constraints = constraints
def configureVeloSensorAlignment(): TAlignment().WriteCondSubDetList += ['Velo'] # To align at the sensor level, we align 'modules' and #'phi-sensors'. The R-sensor is always equal to the modules. (We #keep its 'deltas' equal to zero.) However, because of a feature #in the way we keep track of mother-daughter relations, it is #important to create alignables for the R-sensors as well: use #"None" to specify an alignable without active degrees of #freedom. # Note also that it doesn't make sense to align R modules for # rotations around the z-axis. Rather than aligning the phi sensor # for this rotation, we put the rotation at the module level. elements = Alignables() elements.Velo("None") elements.VeloRight("TxTyTzRxRyRz") elements.VeloLeft("TxTyTzRxRyRz") elements.VeloModules("TxTyTzRxRyRz") elements.VeloPhiSensors("TxTy") elements.VeloRSensors("None") TAlignment().ElementsToAlign += list(elements) # make sure that the velo stays where it was. Important note: the # dofs here must match the ones that we actually align for. If you # specify too many, things will go rather wrong. TAlignment().Constraints.append( "VeloHalfAverage : Velo/Velo(Left|Right) : Tx Ty Tz Rx Ry Rz") # now constrain the total shearing and z-scale in each Velo half # to get the z-axis nominal. we'll do this by tightening the # survey errors. # we need to align the relative twist of the two halves. the # C-side (minus X, Right) is known to have a corkscrew ('twist') # in the base plate. so, for the right half we don't fix the Rz rotation: surveyconstraints = SurveyConstraints() surveyconstraints.All()
Escher().PrintFreq = 100 TrackSys().ExpertTracking += ["simplifiedGeometry"] TrackSys().TrackExtraInfoAlgorithms = [''] RecSysConf().RecoSequence = [ "Decoding", "VELO", "TT", "IT", "OT", "Tr", "Vertex", "CALO", "MUON" ] Escher().MoniSequence = ["Tr", "OT", "ST"] from Configurables import MagneticFieldSvc MagneticFieldSvc().OutputLevel = 1 from Configurables import TAlignment from TAlignment.Alignables import * from TAlignment.SurveyConstraints import * elements = Alignables() 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")
TrackSys().TrackExtraInfoAlgorithms = [''] #TrackSys().TrackPatRecAlgorithms = ["Velo","Forward","PatSeed","PatMatch","Downstream","VeloTT"] TrackSys().TrackPatRecAlgorithms = ["Velo", "Forward", "PatSeed", "PatMatch"] TrackSys().TrackPatRecAlgorithms = ["Velo", "PatSeed", "PatMatch"] #TrackSys().TrackPatRecAlgorithms = ["Velo","TsaSeed","PatMatch"] TrackSys().TrackPatRecAlgorithms = ["Velo", "TsaSeed", "Match"] #RecSysConf().RecoSequence = ["VELO","TT","IT","OT","Tr","Vertex"] #RecSysConf().RecoSequence = ["VELO","TT","IT","OT","Tr"] RecSysConf().RecoSequence = ["CALO", "VELO", "TT", "IT", "OT", "Tr", "Vertex"] Escher().MoniSequence = ["VELO", "Tr", "OT", "ST"] from Configurables import TAlignment from TAlignment.Alignables import * from TAlignment.SurveyConstraints import SurveyConstraints elements = Alignables() constraints = [] surveyconstraints = SurveyConstraints() elements.Velo("Rx") #elements.Velo("None") elements.VeloRight("Ry") #elements.VeloLeft("RxRy") elements.TT("TxTyTz") elements.TTBoxes("Tx") elements.TTHalfLayers("Tx") #elements.TTHalfModules("Tx") #elements.IT("TxTy") #elements.ITLayers("Tx") #elements.T("Ty") elements.ITBoxes("TxTyTzRzRy")
RecSysConf().RecoSequence = ["TT", "IT", "OT", "Tr"] # load a special database #from Configurables import ( CondDB, CondDBAccessSvc ) #otGeom = CondDBAccessSvc( 'OTGeom' ) #otGeom.ConnectionString = 'sqlite_file:/afs/cern.ch/user/j/janos/dbase/OTDDDBCroissant.db/DDDB' #CondDB().addLayer( otGeom ) #otCond = CondDBAccessSvc( 'OTCond' ) #otCond.ConnectionString = 'sqlite_file:/afs/cern.ch/user/j/janos/dbase/LHCBCOND_changes.db/LHCBCOND' #CondDB().addLayer( otCond ) # configure the alignment from Configurables import TAlignment from TAlignment.Alignables import * elements = Alignables() elements.OTCFramesASide("TxTzRz") elements.OTCFramesCSide("TxTzRz") constraints = [ "OT/T1X1C : OT/T1X1UCSide : Tx Ty Tz Rz", "OT/T1X1A : OT/T1X1UASide : Tx Ty Tz Rz", "OT/T3X2C : OT/T3X1UCSide : Tx Ty Tz Rz", "OT/T3X2A : OT/T3X1UASide : Tx Ty Tz Rz" ] TAlignment().ElementsToAlign = list(elements) TAlignment().TrackLocation = "Rec/Track/AlignTracks" TAlignment().Constraints = constraints TAlignment().WriteCondSubDetList = ['OT'] from Configurables import (PatSeeding, PatSeedingTool) PatSeeding = PatSeeding("PatSeeding")
TrackSys().ExpertTracking += [ "simplifiedGeometry"] TrackSys().TrackExtraInfoAlgorithms = [''] RecSysConf().RecoSequence = ["Decoding","VELO","TT","IT","OT","Tr","Vertex"] Escher().MoniSequence = ["Tr","OT","ST"] from Configurables import MagneticFieldSvc MagneticFieldSvc().OutputLevel = 1 from Configurables import TAlignment from TAlignment.Alignables import * 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")
#surveyconstraints.ITBoxes() #surveyconstraints.OTCFrames() surveyconstraints.All() #elements.OTCFrames("TxTy") #surveyconstraints.append("/.*?/IT/.*?Layer.{1,2} : Tx : 0.02") #surveyconstraints.append("/.*?/IT/.*?Layer.{1,2} : Rz : 0.001") #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")
def configureVeloAlignment(fixMeanInHalf=True): ''' This should be the default alignment for the Automatic alignment procedure Align 2-halves for all degree of freedom and Modues only for only the main degrees of freedom Tx Ty Rz Constrain the global Velo position and two modules in each half ''' TAlignment().WriteCondSubDetList += ['Velo'] elements = Alignables() elements.Velo("None") elements.VeloRight("TxTyTzRxRyRz") elements.VeloLeft("TxTyTzRxRyRz") elements.VeloModules("TxTyRz") elements.VeloPhiSensors("None") elements.VeloRSensors("None") TAlignment().ElementsToAlign += list(elements) # Constraints surveyconstraints = SurveyConstraints() surveyconstraints.All() constraints = [] surveyconstraints.Constraints += [ "Velo : 0 0 0 -0.0001 0 -0.0001 : 0.2 0.2 0.2 0.0001 0.0001 0.001", "Velo/Velo(Right|Left) : 0 0 0 0 0 0 : 10 1 0.4 0.01 0.01 0.001" ] # make sure that the velo stays where it was. Important note: the # dofs here must match the ones that we actually align for. If you # specify too many, things will go rather wrong. constraints.append( "VeloHalfAverage : Velo/Velo(Left|Right) : Tx Ty Tz Rx Ry Rz") if fixMeanInHalf: # Constrain average constraints.append( "VeloAInternal : Velo/VeloRight/Module..: Tx Ty Rz Szx Szy") constraints.append( "VeloCInternal : Velo/VeloLeft/Module..: Tx Ty Rz Szx Szy") else: # Fix 2 modules constraints.append( "VeloFixModule10 : Velo/VeloLeft/Module10: Tx Ty Rz") constraints.append( "VeloFixModule11 : Velo/VeloRight/Module11: Tx Ty Rz") constraints.append( "VeloFixModule32 : Velo/VeloLeft/Module32: Tx Ty Rz") constraints.append( "VeloFixModule33 : Velo/VeloRight/Module33: Tx Ty Rz") constraints.append( "VeloFixSensors10 : Velo/VeloLeft/Module10/RPhiPair10/.*: Tx Ty Rz" ) constraints.append( "VeloFixSensors11 : Velo/VeloRight/Module11/RPhiPair11/.*: Tx Ty Rz" ) constraints.append( "VeloFixSensors32 : Velo/VeloLeft/Module32/RPhiPair32/.*: Tx Ty Rz" ) constraints.append( "VeloFixSensors33 : Velo/VeloRight/Module33/RPhiPair33/.*: Tx Ty Rz" ) TAlignment().Constraints = constraints
outputlevel = INFO #DEBUG #INFO newNNET = True maskNoise = True # per eliminare i canali rumorosi dof = 'TxTy' #nameCond = 'Cosmics_MuonOT_TxTy_newNNET_0.05_cutChi2_wouter1' # job 47 (no XTalk) nameCond = 'prova' # matching ntuple MuonMatching = True #selezione delle tracce con MuonNNet e richiesta di match con OT/Calo OTMuonMatching = True #selezione delle tracce con MuonNNet e richiesta di match con OT/Calo OTMuon_ntuple = False #True # configure for half-Stations from TAlignment.Alignables import * elements = Alignables() #elements.Muon('Tx') ; #elements.MuonHalfStations(dof) ; elements.MuonHalfStationsCside(dof) elements.MuonHalfStationsAside(dof) # Go past this line only when you know what you are doing ############################################################################################################################ ## File to setup Alignment from Configurables import TAlignment, GetElementsToBeAligned TAlignment().ElementsToAlign = list(elements) TAlignment().TrackLocation = "Rec/Track/AlignTracks" TAlignment().Constraints = constraints
def configure2012DataAlignment(fixQOverPBias=False, surveyVer='latest'): TAlignment().WriteCondSubDetList += ['Velo', 'TT', 'IT', 'OT', 'Muon'] # 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 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") 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" ]
#Escher().DDDBtag = "default" #Escher().CondDBtag = "default" #Escher().Detectors = ["Velo","OT"] Escher().Kalman = True Escher().Millepede = False Escher( ).TrackContainer = "Rec/Track/Best" # Velo, VeloR, Long, Upstream, Downstream, Ttrack, Muon or Calo Escher().EvtMax = 100 TrackSys().ExpertTracking += ["kalmanSmoother"] TrackSys().TrackExtraInfoAlgorithms = [''] RecSysConf().RecoSequence = ["VELO", "TT", "IT", "OT", "Tr", "Vertex"] from Configurables import TAlignment from TAlignment.Alignables import * elements = Alignables() elements.VeloLeft("TxTyTzRzRxRy") constraints = [] #elements.VeloRight("TxTyTzRz") #constraints = ["Tz","Tx","Ty","Rz"] print "aligning elements ", elements TAlignment().ElementsToAlign = list(elements) TAlignment().TrackLocation = "Rec/Track/AlignTracks" TAlignment().VertexLocation = "Rec/Vertex/Primary" TAlignment().Constraints = constraints TAlignment().WriteCondSubDetList = ['Velo'] #TAlignment().UpdateInFinalize = False # still set up a track selection
hvpseq = GaudiSequencer("VPSeq") prLHCbID2mc = PrLHCbID2MCParticle() prPixTr = PrPixelTracking() prPixStCl = PrPixelStoreClusters() hvpseq.Members += [prPixStCl, prPixTr, prLHCbID2mc] from Configurables import TAlignment from TAlignment.Alignables import * from TAlignment.TrackSelections import * from Configurables import AlignAlgorithm AlignAlgorithm("Alignment").ForcedInitialTime = 1 elements = Alignables() print dir(elements) elements.VPModules("TxTyTzRxRyRz") #elements.VPLeft("TxTy") #elements.VPRight("TxTyRz") #constraints = ["Ty","Tx","Rz","Ry","Rx","Szx","Szy","SRz"] constraints = ["Tx", "Ty", "Tz", "Szx", "Szy"] #constraints = [] constraints.append( "VPFixModule00 : VP/VPLeft/Module00WithSupport: Tx Ty Tz Rx Ry Rz") constraints.append( "VPFixModule01 : VP/VPRight/Module01WithSupport: Tx Ty Tz Rx Ry Rz") constraints.append( "VPFixModule40 : VP/VPLeft/Module40WithSupport: Tx Ty Tz Rx Ry Rz") constraints.append( "VPFixModule41 : VP/VPRight/Module41WithSupport: Tx Ty Tz Rx Ry Rz")
import Gaudi import GaudiKernel.ProcessJobOptions from Gaudi.Configuration import * from Configurables import TAlignment from TAlignment import * from TAlignment import Alignables nEvents = 100 nIter = 3 #alignlevel = 'sensors' alignlevel = 'halves' #alignlevel = 'all' computeVertexCorrelations = False #elements = Alignables("/dd/Structure/LHCb/BeforeMagnetRegion/Velo/Velo(Right|Left)/Module..", "TxTyTz") elements = Alignables.Alignables() if alignlevel == 'sensors': elements = elements.VeloRSensors("TxTyRxRy") elements = elements.VeloPhiSensors("TxTyRxRyRz") # constraints = ["Tx","Ty","Tz","Szz","Szx","Szy"] # elements.VeloRSensors("Tz") # elements.VeloPhiSensors("Tz") constraints = ["Tz", "Ty", "Tx"] conddepths = [] condname = "Detectors.xml" elif alignlevel == 'halves': print "Going for VELO HALVES!" # elements.VeloLeft("TxTyRxRy") # elements.VeloRight("TxTyRxRy") # constraints = ["Tx","Ty","Rx","Ry"]
from Gaudi.Configuration import * uselocalframe = True chisqconstraints = [] # un numero in corrispondenza di ogni constraint constraints = [] dof = 'TxTy' outputlevel = ERROR #INFO#ERROR# INFO maskNoise = True # to mask Noisy Channels nameCond = 'ResidualsM1' Write_Ntuple = False # if True writes an Ntuple for debugging purposes from TAlignment.Alignables import * elements = Alignables() elements.MuonHalfStationsA(dof) # configure for Muon half-Stations elements.MuonHalfStationsC(dof) # configure for Muon half-Stations data = [] localVetoLIST = [ "1122.52", "3222.132", "3222.133", "3222.134", "3222.135", "3222.136", "3222.137", "3222.138", "3222.139", "3311.4", "3311.5", "3311.6", "3311.8", "3311.36", "3311.37", "3311.38", "3311.40", "3332.144", "4332.82", "4332.83", "4332.84", "4332.85", "4332.86", "4332.88", "4332.89", "4332.90", "4332.92" ] tileVetoLIST = [ 140518139, 146889741, 146889757, 146889773, 146889789, 146889805,
#Escher().CondDBtag = "default" #Escher().Detectors = ["Velo","OT"] Escher().InputType = "DIGI" Escher().Kalman = True Escher().Millepede = False Escher().TrackContainer = "Rec/Track/Best" # Velo, VeloR, Long, Upstream, Downstream, Ttrack, Muon or Calo Escher().EvtMax = 1000 TrackSys().ExpertTracking += [ "kalmanSmoother","simplifiedGeometry" ] TrackSys().TrackExtraInfoAlgorithms = [''] RecSysConf().RecoSequence = ["VELO","TT","IT","OT","Tr","Vertex"] from Configurables import TAlignment from TAlignment.Alignables import * elements = Alignables() #elements.VeloRSensors("TxTy") #elements.VeloPhiSensors("TxTy") #elements.VeloModules("TzRxRyRz") #let's do modules only, for now: #elements.VeloModules("TxTyTzRxRyRz") elements.VeloRSensors("TxTyTzRxRy") elements.VeloPhiSensors("TxTyTzRxRyRz") constraints = ["Tz","Ty","Tx","Rz","Ry","Rx","Szz","Szx","Szy","SRz"] print "aligning elements ", elements TAlignment().ElementsToAlign = list(elements) TAlignment().TrackLocation = "Rec/Track/AlignTracks" TAlignment().VertexLocation = "Rec/Vertex/Primary"