diff --git a/Calorimeter/CaloConditions/share/CaloConditions_jobOptions.py b/Calorimeter/CaloConditions/share/CaloConditions_jobOptions.py index fd180da7c3dc950d5cb878031cb8d371ce6ebde0..5c017783ff44fcafc789016c8f79cce0ec5f52e0 100755 --- a/Calorimeter/CaloConditions/share/CaloConditions_jobOptions.py +++ b/Calorimeter/CaloConditions/share/CaloConditions_jobOptions.py @@ -17,7 +17,7 @@ DGeo = jobproperties.Global.DetGeo() # LArTTCellMap (maintained by F. Ledroit) if (DGeo == "ctbh8"): - print " No trigger mapping needed for CTB simulation" + print(" No trigger mapping needed for CTB simulation") else: include( "CaloConditions/LArTTCellMap_ATLAS_jobOptions.py") # TT online-offline & online-attributes maps (maintained by D. Prieur) diff --git a/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredInDetSGDeletion.py b/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredInDetSGDeletion.py index 46ffe48e5b565f7b0db7ef831a0d2e3ac399d849..765cc8bb7fa78d0382e5cb04bd5599d88620a163 100644 --- a/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredInDetSGDeletion.py +++ b/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredInDetSGDeletion.py @@ -21,7 +21,7 @@ class InDetSGDeletionAlg: def deletionAlg(self, container, key): if not isinstance(key, str): - print "InDetSGDeletionAlg: WARNING Key is not a string, ignoring!" + print("InDetSGDeletionAlg: WARNING Key is not a string, ignoring!") return from InDetRecExample.InDetJobProperties import InDetFlags @@ -36,4 +36,4 @@ class InDetSGDeletionAlg: topSequence += InDetDelAlg if InDetFlags.doPrintConfigurables(): - print InDetDelAlg + print(InDetDelAlg) diff --git a/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredNewTrackingCuts.py b/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredNewTrackingCuts.py index 685d100c5c540805da0f692bcc2f4cb87520276e..7772e940fcb16c05ad72cd92132a1c12249b6f8f 100755 --- a/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredNewTrackingCuts.py +++ b/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredNewTrackingCuts.py @@ -24,7 +24,7 @@ class ConfiguredNewTrackingCuts : from AthenaCommon.DetFlags import DetFlags from AthenaCommon.BeamFlags import jobproperties from RecExConfig.RecFlags import rec - + # --- put defaults to run Pixel/SCT/TRT self.__usePixel = DetFlags.haveRIO.pixel_on() self.__useSCT = DetFlags.haveRIO.SCT_on() @@ -40,7 +40,7 @@ class ConfiguredNewTrackingCuts : self.__minSecondaryPt = 0.4 * Units.GeV # Pt cut for back tracking + segment finding for these self.__minTRTonlyPt = 0.4 * Units.GeV # Pt cut for TRT only - # --- first set kinematic defaults + # --- first set kinematic defaults self.__maxPT = None # off ! self.__minEta = -1 # off ! self.__maxEta = 2.7 @@ -49,7 +49,7 @@ class ConfiguredNewTrackingCuts : self.__minClusters = 7 # Igor 6, was 7 self.__minSiNotShared = 6 self.__maxShared = 1 # cut is now on number of shared modules - self.__minPixel = 0 + self.__minPixel = 0 self.__maxHoles = 3 # was 5 self.__maxPixelHoles = 2 # was 5 self.__maxSctHoles = 2 # was 5 @@ -70,7 +70,7 @@ class ConfiguredNewTrackingCuts : self.__Xi2maxNoAdd = 35.0 self.__nWeightedClustersMin = 6 - # --- seeding + # --- seeding self.__seedFilterLevel = 1 self.__maxdImpactPPSSeeds = 1.7 self.__maxdImpactSSSSeeds = 1000.0 @@ -83,12 +83,12 @@ class ConfiguredNewTrackingCuts : # --- Z Boundary Seeding self.__doZBoundary = False - + # -------------------------------------- # --- BACK TRACKING cuts # -------------------------------------- - - # --- settings for segment finder + + # --- settings for segment finder self.__TRTSegFinderPtBins = 70 self.__maxSegTRTShared = 0.7 self.__excludeUsedTRToutliers = False @@ -125,13 +125,13 @@ class ConfiguredNewTrackingCuts : # -------------------------------------- # --- TRT Only TRACKING cuts # -------------------------------------- - + # --- TRT only self.__minTRTonly = 15 self.__maxTRTonlyShared = 0.7 self.__useTRTonlyParamCuts = False self.__useTRTonlyOldLogic = True - + # # -------------------------------------- # --- now start tighening cuts level by level @@ -169,10 +169,10 @@ class ConfiguredNewTrackingCuts : if self.__indetflags.cutLevel() >= 7: # --- more BackTracking cuts self.__minSecondaryTRTonTrk = 15 # let's not allow for short overlap tracks - self.__maxSecondaryHoles = 1 # tighten hole cuts - self.__maxSecondaryPixelHoles = 1 # tighten hole cuts - self.__maxSecondarySCTHoles = 1 # tighten hole cuts - self.__maxSecondaryDoubleHoles = 0 # tighten hole cuts + self.__maxSecondaryHoles = 1 # tighten hole cuts + self.__maxSecondaryPixelHoles = 1 # tighten hole cuts + self.__maxSecondarySCTHoles = 1 # tighten hole cuts + self.__maxSecondaryDoubleHoles = 0 # tighten hole cuts self.__minSecondaryTRTPrecFrac = 0.3 # default for all tracking now, as well for BackTracking self.__rejectShortExtensions = True # fall back onto segment if TRT extension is short self.__SiExtensionCuts = True # use cuts from ambi scoring already early @@ -182,11 +182,11 @@ class ConfiguredNewTrackingCuts : # --- slightly tighen NewTracking cuts self.__maxHoles = 2 # was 3 self.__maxPixelHoles = 1 # was 2 - + if self.__indetflags.cutLevel() >= 9: # --- tighten maxZ for the IP parameter - self.__maxZImpact = 250 * Units.mm + self.__maxZImpact = 250 * Units.mm if self.__indetflags.cutLevel() >= 10: # --- turn on Z Boundary seeding @@ -198,7 +198,7 @@ class ConfiguredNewTrackingCuts : if self.__indetflags.cutLevel() >= 12: # --- Tighten track reconstruction criteria - self.__Xi2max = 9.0 # was 15 + self.__Xi2max = 9.0 # was 15 self.__Xi2maxNoAdd = 25.0 # was 35 self.__nHolesMax = 2 # was 3 self.__nHolesGapMax = 2 # was 3 @@ -211,20 +211,20 @@ class ConfiguredNewTrackingCuts : self.__minPT = 0.5 * Units.GeV if self.__indetflags.cutLevel() >= 15 : - self.__minClusters = 8 #based on studies by R.Jansky + self.__minClusters = 8 #based on studies by R.Jansky if self.__indetflags.cutLevel() >= 16 : self.__maxPrimaryImpact = 5.0 * Units.mm #based on studies by T.Strebler if self.__indetflags.cutLevel() >= 17: - print '--------> FATAL ERROR, cut level undefined, abort !' + print('--------> FATAL ERROR, cut level undefined, abort !') import sys sys.exit() - + # -------------------------------------- # --- now the overwrites for special setups # -------------------------------------- - + # --- do robust reconstruction if self.__indetflags.doRobustReco(): @@ -262,14 +262,14 @@ class ConfiguredNewTrackingCuts : # self.__maxSecondaryPixelHoles = 5 # self.__maxSecondarySCTHoles = 5 # self.__maxSecondaryDoubleHoles = 2 -# self.__SecondaryXi2max = 50.0 -# self.__SecondaryXi2maxNoAdd = 100.0 +# self.__SecondaryXi2max = 50.0 +# self.__SecondaryXi2maxNoAdd = 100.0 # --- SLHC setup if mode == "SLHC": self.__extension = "SLHC" # --- higher pt cut and impact parameter cut - self.__minPT = 0.9 * Units.GeV + self.__minPT = 0.9 * Units.GeV self.__maxPrimaryImpact = 2.0 * Units.mm # highlumi self.__maxZImpact = 250.0 * Units.mm @@ -281,7 +281,7 @@ class ConfiguredNewTrackingCuts : #self.__maxPixelHoles = D2 #self.__maxSctHoles = 2 #self.__maxDoubleHoles = 2 - # --- also tighten pattern cuts + # --- also tighten pattern cuts self.__radMax = 1000. * Units.mm #self.__seedFilterLevel = 1 #self.__nHolesMax = self.__maxHoles @@ -289,7 +289,7 @@ class ConfiguredNewTrackingCuts : #self.__Xi2max = 15.0 #self.__Xi2maxNoAdd = 35.0 #self.__nWeightedClustersMin = self.__minClusters-1 - + # --- IBL setup if mode == "IBL" : self.__extension = "IBL" @@ -307,7 +307,7 @@ class ConfiguredNewTrackingCuts : self.__maxPixelHoles = 0 # --- mode for min bias, commissioning or doRobustReco - if mode == 'MinBias' or self.__indetflags.doRobustReco(): + if mode == 'MinBias' or self.__indetflags.doRobustReco(): if self.__indetflags.doHIP300(): self.__minPT = 0.300 * Units.GeV else: @@ -322,7 +322,7 @@ class ConfiguredNewTrackingCuts : self.__maxSecondaryImpact = 100.0 * Units.mm # low lumi # --- mode for high-d0 tracks - if mode == "LargeD0": + if mode == "LargeD0": self.__extension = "LargeD0" # this runs parallel to NewTracking self.__maxPT = 1.0 * Units.TeV self.__minPT = 900 * Units.MeV @@ -334,19 +334,19 @@ class ConfiguredNewTrackingCuts : self.__minClusters = 7 self.__minSiNotShared = 5 self.__maxShared = 2 # cut is now on number of shared modules - self.__minPixel = 0 + self.__minPixel = 0 self.__maxHoles = 2 self.__maxPixelHoles = 1 self.__maxSctHoles = 2 self.__maxDoubleHoles = 1 self.__radMax = 600. * Units.mm self.__nHolesMax = self.__maxHoles - self.__nHolesGapMax = self.__maxHoles # not as tight as 2*maxDoubleHoles + self.__nHolesGapMax = self.__maxHoles # not as tight as 2*maxDoubleHoles self.__seedFilterLevel = 1 self.__maxTracksPerSharedPRD = 2 # --- mode for high-d0 tracks down to 100 MeV (minPT, minClusters, minSecondaryPt cuts loosened to MinBias level) - if mode == "LowPtLargeD0": + if mode == "LowPtLargeD0": self.__extension = "LowPtLargeD0" # this runs parallel to NewTracking self.__maxPT = 1.0 * Units.TeV self.__minPT = 100 * Units.MeV @@ -358,26 +358,26 @@ class ConfiguredNewTrackingCuts : self.__minClusters = 5 self.__minSiNotShared = 5 self.__maxShared = 2 # cut is now on number of shared modules - self.__minPixel = 0 + self.__minPixel = 0 self.__maxHoles = 2 self.__maxPixelHoles = 1 self.__maxSctHoles = 2 self.__maxDoubleHoles = 1 self.__radMax = 600. * Units.mm self.__nHolesMax = self.__maxHoles - self.__nHolesGapMax = self.__maxHoles # not as tight as 2*maxDoubleHoles + self.__nHolesGapMax = self.__maxHoles # not as tight as 2*maxDoubleHoles self.__seedFilterLevel = 1 self.__maxTracksPerSharedPRD = 2 - - # --- change defaults for low pt tracking - if mode == "LowPt": + + # --- change defaults for low pt tracking + if mode == "LowPt": self.__extension = "LowPt" # this runs parallel to NewTracking self.__maxPT = self.__minPT + 0.3 * Units.GeV # some overlap self.__minPT = 0.050 * Units.GeV self.__minClusters = 5 self.__minSiNotShared = 4 self.__maxShared = 1 # cut is now on number of shared modules - self.__minPixel = 2 # At least one pixel hit for low-pt (ass seeded on pixels!) + self.__minPixel = 2 # At least one pixel hit for low-pt (assoc. seeded on pixels!) self.__maxHoles = 2 self.__maxPixelHoles = 1 self.__maxSctHoles = 2 @@ -389,41 +389,41 @@ class ConfiguredNewTrackingCuts : if self.__indetflags.doMinBias(): self.__maxPT = 1000000 * Units.GeV # Won't accept None *NEEDS FIXING* self.__maxPrimaryImpact = 100.0 * Units.mm - + if mode == "SLHCConversionFinding": self.__extension = "SLHCConversionFinding" # this runs parallel to NewTracking self.__minPT = 0.9 * Units.GeV - self.__maxPrimaryImpact = 10.0 * Units.mm - self.__maxZImpact = 150.0 * Units.mm - self.__minClusters = 6 - self.__minSiNotShared = 4 - #self.__maxShared = 3 - self.__maxHoles = 0 + self.__maxPrimaryImpact = 10.0 * Units.mm + self.__maxZImpact = 150.0 * Units.mm + self.__minClusters = 6 + self.__minSiNotShared = 4 + #self.__maxShared = 3 + self.__maxHoles = 0 #self.__maxPixelHoles = D2 #self.__maxSctHoles = 2 #self.__maxDoubleHoles = 2 # --- also tighten pattern cuts - self.__radMax = 1000. * Units.mm - self.__radMin = 0. * Units.mm # not turn on this cut for now + self.__radMax = 1000. * Units.mm + self.__radMin = 0. * Units.mm # not turn on this cut for now #self.__seedFilterLevel = 1 #self.__nHolesMax = self.__maxHoles #self.__nHolesGapMax = self.__maxHoles #self.__Xi2max = 15.0 #self.__Xi2maxNoAdd = 35.0 #self.__nWeightedClustersMin = self.__minClusters-1 - # --- turn on Z Boundary seeding - self.__doZBoundary = False # + # --- turn on Z Boundary seeding + self.__doZBoundary = False # - # --- change defaults for very low pt tracking - if mode == "VeryLowPt": + # --- change defaults for very low pt tracking + if mode == "VeryLowPt": self.__extension = "VeryLowPt" # this runs parallel to NewTracking self.__maxPT = self.__minPT + 0.3 * Units.GeV # some overlap self.__minPT = 0.050 * Units.GeV self.__minClusters = 3 self.__minSiNotShared = 3 self.__maxShared = 1 # cut is now on number of shared modules - self.__minPixel = 3 # At least one pixel hit for low-pt (ass seeded on pixels!) + self.__minPixel = 3 # At least one pixel hit for low-pt (assoc. seeded on pixels!) self.__maxHoles = 1 self.__maxPixelHoles = 1 self.__maxSctHoles = 1 @@ -475,30 +475,30 @@ class ConfiguredNewTrackingCuts : self.__useTRT = False # no TRT for forward tracks - if mode == "VeryForwardSLHCTracks": - self.__extension = "VeryForwardSLHCTracks" # this runs parallel to NewTracking - self.__minEta = 2.4 # restrict to minimal eta - self.__maxEta = 4.0 - self.__minPT = 0.9 * Units.GeV - self.__minClusters = 5 - self.__minSiNotShared = 3 - self.__maxShared = 1 - self.__minPixel = 3 - self.__maxHoles = 1 - self.__maxPixelHoles = 1 - self.__maxSctHoles = 0 + if mode == "VeryForwardSLHCTracks": + self.__extension = "VeryForwardSLHCTracks" # this runs parallel to NewTracking + self.__minEta = 2.4 # restrict to minimal eta + self.__maxEta = 4.0 + self.__minPT = 0.9 * Units.GeV + self.__minClusters = 5 + self.__minSiNotShared = 3 + self.__maxShared = 1 + self.__minPixel = 3 + self.__maxHoles = 1 + self.__maxPixelHoles = 1 + self.__maxSctHoles = 0 self.__maxDoubleHoles = 0 self.__nHolesMax = self.__maxHoles self.__nHolesGapMax = self.__maxHoles self.__radMax = 600. * Units.mm self.__useTRT = False # no TRT for forward tracks - # --- change defauls for beam gas tracking + # --- change defauls for beam gas tracking if mode == "BeamGas": self.__extension = "BeamGas" # this runs parallel to NewTracking self.__minPT = 0.500 * Units.GeV - self.__maxPrimaryImpact = 300. * Units.mm - self.__maxZImpact = 2000. * Units.mm + self.__maxPrimaryImpact = 300. * Units.mm + self.__maxZImpact = 2000. * Units.mm self.__minClusters = 6 self.__maxHoles = 3 self.__maxPixelHoles = 3 @@ -534,8 +534,8 @@ class ConfiguredNewTrackingCuts : # --- changes for cosmics if mode == "Cosmics": self.__minPT = 0.500 * Units.GeV - self.__maxPrimaryImpact = 1000. * Units.mm - self.__maxZImpact = 10000. * Units.mm + self.__maxPrimaryImpact = 1000. * Units.mm + self.__maxZImpact = 10000. * Units.mm self.__minClusters = 4 self.__minSiNotShared = 4 self.__maxHoles = 3 @@ -554,7 +554,7 @@ class ConfiguredNewTrackingCuts : # --- changes for heavy ion if mode == "HeavyIon": - self.__maxZImpact = 200. * Units.mm + self.__maxZImpact = 200. * Units.mm self.__minPT = 0.500 * Units.GeV self.__minClusters = 9 self.__minSiNotShared = 7 @@ -564,8 +564,8 @@ class ConfiguredNewTrackingCuts : self.__maxSctHoles = 0 self.__maxDoubleHoles = 0 self.__nHolesMax = self.__maxHoles - self.__nHolesGapMax = self.__maxHoles - self.__Xi2max = 6. + self.__nHolesGapMax = self.__maxHoles + self.__Xi2max = 6. self.__Xi2maxNoAdd = 10. if self.__indetflags.cutLevel() == 1: self.__seedFilterLevel = 1 @@ -577,18 +577,18 @@ class ConfiguredNewTrackingCuts : self.__seedFilterLevel = 2 self.__maxdImpactSSSSeeds = 20.0 # apply cut on SSS seeds self.__useParameterizedTRTCuts = False #Make these false on all HI cut levels >=3, since standard cut levels set it true from levels >=3 - self.__useNewParameterizationTRT = False + self.__useNewParameterizationTRT = False elif self.__indetflags.cutLevel() == 4: # ==CutLevel 2 with loosened hole cuts and chi^2 cuts self.__seedFilterLevel = 2 self.__maxdImpactSSSSeeds = 20.0 # apply cut on SSS seeds self.__maxdImpactPPSSeeds = 1.7 #set this to 1.7 for all HI cut levels >=4, since standard cut levels set it to 2.0 from levels >=4. Not sure it has any effect, since we don't usually run mixed seeds (also true for HI?) self.__useParameterizedTRTCuts = False self.__useNewParameterizationTRT = False - self.__maxHoles = 2 - self.__maxPixelHoles = 1 + self.__maxHoles = 2 + self.__maxPixelHoles = 1 self.__maxSctHoles = 1 self.__maxDoubleHoles = 0 - self.__Xi2max = 9. + self.__Xi2max = 9. self.__Xi2maxNoAdd = 25. elif self.__indetflags.cutLevel() == 5: # ==CutLevel 3 with loosened hole cuts and chi^2 cuts self.__minPT = 0.300 * Units.GeV @@ -601,11 +601,11 @@ class ConfiguredNewTrackingCuts : self.__maxPixelHoles = 1 self.__maxSctHoles = 1 self.__maxDoubleHoles = 0 - self.__Xi2max = 9. + self.__Xi2max = 9. self.__Xi2maxNoAdd = 25. self.__radMax = 600. * Units.mm # restrict to pixels + first SCT layer - self.__useTRT = False + self.__useTRT = False # --- changes for Pixel/SCT segments from AthenaCommon.DetFlags import DetFlags @@ -613,7 +613,7 @@ class ConfiguredNewTrackingCuts : self.__minClusters = 3 elif ( DetFlags.haveRIO.SCT_on() and not DetFlags.haveRIO.pixel_on() ): self.__minClusters = 6 - + # --- changes for Pixel segments if mode == "Pixel": self.__extension = "Pixel" # this runs parallel to NewTracking @@ -627,9 +627,9 @@ class ConfiguredNewTrackingCuts : self.__maxShared = 0 self.__seedFilterLevel = 2 self.__nHolesMax = self.__maxHoles - self.__nHolesGapMax = self.__maxHoles + self.__nHolesGapMax = self.__maxHoles self.__useSCT = False - self.__useTRT = False + self.__useTRT = False if self.__indetflags.doMinBias(): if self.__indetflags.doHIP300(): @@ -646,21 +646,21 @@ class ConfiguredNewTrackingCuts : self.__maxShared = 0 self.__seedFilterLevel = 2 self.__nHolesMax = self.__maxHoles - self.__nHolesGapMax = self.__maxHoles + self.__nHolesGapMax = self.__maxHoles self.__useSCT = False - self.__useTRT = False - + self.__useTRT = False + if self.__indetflags.doCosmics(): self.__minPT = 0.500 * Units.GeV - self.__maxPrimaryImpact = 1000. * Units.mm - self.__maxZImpact = 10000. * Units.mm + self.__maxPrimaryImpact = 1000. * Units.mm + self.__maxZImpact = 10000. * Units.mm self.__maxHoles = 3 self.__maxPixelHoles = 3 self.__maxShared = 0 # no shared hits in cosmics self.__roadWidth = 60. self.__seedFilterLevel = 3 # 2 ? self.__nHolesMax = self.__maxHoles - self.__nHolesGapMax = self.__maxHoles + self.__nHolesGapMax = self.__maxHoles self.__Xi2max = 60.0 self.__Xi2maxNoAdd = 100.0 self.__nWeightedClustersMin = 6 @@ -678,7 +678,7 @@ class ConfiguredNewTrackingCuts : self.__maxShared = 0 self.__seedFilterLevel = 2 self.__nHolesMax = self.__maxHoles - self.__nHolesGapMax = self.__maxHoles + self.__nHolesGapMax = self.__maxHoles # self.__useSCT = False self.__useSCT = True # self.__useTRT = False @@ -700,9 +700,9 @@ class ConfiguredNewTrackingCuts : self.__maxShared = 0 self.__seedFilterLevel = 2 self.__nHolesMax = self.__maxHoles - self.__nHolesGapMax = self.__maxHoles + self.__nHolesGapMax = self.__maxHoles self.__usePixel = False - self.__useTRT = False + self.__useTRT = False if self.__indetflags.doMinBias(): if self.__indetflags.doHIP300(): @@ -712,8 +712,8 @@ class ConfiguredNewTrackingCuts : if self.__indetflags.doCosmics(): self.__minPT = 0.500 * Units.GeV - self.__maxPrimaryImpact = 1000. * Units.mm - self.__maxZImpact = 10000. * Units.mm + self.__maxPrimaryImpact = 1000. * Units.mm + self.__maxZImpact = 10000. * Units.mm self.__maxHoles = 3 self.__maxPixelHoles = 0 self.__maxSctHoles = 3 @@ -721,7 +721,7 @@ class ConfiguredNewTrackingCuts : self.__roadWidth = 60. self.__seedFilterLevel = 3 # 2 ? self.__nHolesMax = self.__maxHoles - self.__nHolesGapMax = self.__maxHoles + self.__nHolesGapMax = self.__maxHoles self.__Xi2max = 60.0 self.__Xi2maxNoAdd = 100.0 self.__nWeightedClustersMin = 6 @@ -737,7 +737,7 @@ class ConfiguredNewTrackingCuts : self.__minTRTonly = 15 self.__maxTRTonlyShared = 0.7 - # --- mode for SCT and TRT + # --- mode for SCT and TRT if mode == "SCTandTRT": self.__extension = "SCTandTRT" # this runs parallel to NewTracking self.__minPT = 0.4 * Units.GeV @@ -750,14 +750,14 @@ class ConfiguredNewTrackingCuts : self.__maxShared = 0 self.__seedFilterLevel = 2 self.__nHolesMax = self.__maxHoles - self.__nHolesGapMax = self.__maxHoles + self.__nHolesGapMax = self.__maxHoles self.__usePixel = False - self.__useTRT = True + self.__useTRT = True if self.__indetflags.doCosmics(): self.__minPT = 0.500 * Units.GeV - self.__maxPrimaryImpact = 1000. * Units.mm - self.__maxZImpact = 10000. * Units.mm + self.__maxPrimaryImpact = 1000. * Units.mm + self.__maxZImpact = 10000. * Units.mm self.__maxHoles = 3 self.__maxPixelHoles = 0 self.__maxSctHoles = 3 @@ -765,7 +765,7 @@ class ConfiguredNewTrackingCuts : self.__roadWidth = 60. self.__seedFilterLevel = 3 # 2 ? self.__nHolesMax = self.__maxHoles - self.__nHolesGapMax = self.__maxHoles + self.__nHolesGapMax = self.__maxHoles self.__Xi2max = 60.0 self.__Xi2maxNoAdd = 100.0 self.__nWeightedClustersMin = 6 @@ -785,7 +785,7 @@ class ConfiguredNewTrackingCuts : self.__nWeightedClustersMin = 0 self.__seedFilterLevel = 1 self.__maxdImpactPPSSeeds = 100000.0 * Units.mm - self.__maxdImpactSSSSeeds = 100000.0 * Units.mm + self.__maxdImpactSSSSeeds = 100000.0 * Units.mm self.__maxPrimaryImpact = 100000.0 * Units.mm # low lumi self.__maxZImpact = 320000.0 * Units.mm # Was 250 mm self.__maxPT = 100000.0 * Units.GeV # some overlap @@ -793,7 +793,7 @@ class ConfiguredNewTrackingCuts : self.__minClusters = 0 self.__minSiNotShared = 0 self.__maxShared = 1000 # cut is now on number of shared modules - self.__minPixel = 0 + self.__minPixel = 0 self.__maxHoles = 0 self.__maxPixelHoles = 0 self.__maxSctHoles = 0 @@ -805,7 +805,7 @@ class ConfiguredNewTrackingCuts : self.__useSCT = False self.__usePixel = True - + # elif rec.Commissioning(): # self.__minClusters = 7 # Igor 6, was 7 # self.__maxHoles = 5 # was 5 @@ -813,7 +813,7 @@ class ConfiguredNewTrackingCuts : # self.__maxDoubleHoles = 4 # was 2 # self.__maxPrimaryImpact = 50.0 * Units.mm # low lumi # self.__maxZImpact = 500.0 * Units.mm - + # ---------------------------------------------------------------------------- # --- private method def __set_indetflags(self): @@ -864,7 +864,7 @@ class ConfiguredNewTrackingCuts : return self.__minClusters def minPixel( self ) : - return self.__minPixel + return self.__minPixel def minSecondaryClusters( self ) : return self.__minSecondaryClusters @@ -901,7 +901,7 @@ class ConfiguredNewTrackingCuts : def maxDoubleHoles( self ) : return self.__maxDoubleHoles - + def maxSecondaryDoubleHoles( self ) : return self.__maxSecondaryDoubleHoles @@ -973,7 +973,7 @@ class ConfiguredNewTrackingCuts : def Xi2max( self ) : return self.__Xi2max - + def Xi2maxNoAdd( self ) : return self.__Xi2maxNoAdd @@ -985,12 +985,12 @@ class ConfiguredNewTrackingCuts : def SecondaryXi2max( self ) : return self.__SecondaryXi2max - + def SecondaryXi2maxNoAdd( self ) : return self.__SecondaryXi2maxNoAdd def nWeightedClustersMin( self ) : - return self.__nWeightedClustersMin + return self.__nWeightedClustersMin def maxdImpactPPSSeeds( self ) : return self.__maxdImpactPPSSeeds @@ -1000,7 +1000,7 @@ class ConfiguredNewTrackingCuts : def usePixel( self ) : return self.__usePixel - + def useSCT( self ) : return self.__useSCT @@ -1009,7 +1009,7 @@ class ConfiguredNewTrackingCuts : def useTRT( self ) : return self.__useTRT - + def doZBoundary( self ) : return self.__doZBoundary @@ -1017,96 +1017,96 @@ class ConfiguredNewTrackingCuts : return self.__RoISeededBackTracking def printInfo( self ) : - print '****** Inner Detector Track Reconstruction Cuts ************************************' - print '*' - print '* SETUP is : ',self.__mode - print '* extension : ',self.__extension - print '*' - print '* InDetFlags.cutLevel() = ', self.__indetflags.cutLevel() - print '*' - print '* Pixel used : ', self.__usePixel - print '* SCT used : ', self.__useSCT - print '* TRT used : ', self.__useTRT - print '*' - print '* min pT : ', self.__minPT, ' MeV' - print '* max Z IP : ', self.__maxZImpact, ' mm' - print '* min eta : ', self.__minEta - print '* max eta : ', self.__maxEta + print('****** Inner Detector Track Reconstruction Cuts ************************************') + print('*') + print('* SETUP is : ',self.__mode) + print('* extension : ',self.__extension) + print('*') + print('* InDetFlags.cutLevel() = ', self.__indetflags.cutLevel()) + print('*') + print('* Pixel used : ', self.__usePixel) + print('* SCT used : ', self.__useSCT) + print('* TRT used : ', self.__useTRT) + print('*' ) + print('* min pT : ', self.__minPT, ' MeV') + print('* max Z IP : ', self.__maxZImpact, ' mm') + print('* min eta : ', self.__minEta) + print('* max eta : ', self.__maxEta) if self.__mode=="LowPt": - print '* max PT : ', self.__maxPT, ' MeV' - print '*' - print '* NewTracking cuts:' - print '* -----------------' - print '* max Rphi IP (primaries) : ', self.__maxPrimaryImpact, ' mm' - print '* min number of clusters : ', self.__minClusters - print '* min number of pixel hits : ', self.__minPixel - print '* min number of NOT shared : ', self.__minSiNotShared - print '* max number of shared : ', self.__maxShared - print '* max number of Si holes : ', self.__maxHoles - print '* max number of Pixel holes : ', self.__maxPixelHoles - print '* max number of SCT holes : ', self.__maxSctHoles - print '* max number of double holes : ', self.__maxDoubleHoles - print '*' - print '* seed filter level : ', self.__seedFilterLevel - print '* maximal R of SP for seeding : ', self.__radMax - print '* max holes in pattern : ', self.__nHolesMax - print '* max holes gap in pattern : ', self.__nHolesGapMax - print '* Xi2 max : ', self.__Xi2max - print '* Xi2 max no add : ', self.__Xi2maxNoAdd - print '* max impact on seeds PPS/SSS : ', self.__maxdImpactPPSSeeds,', ',self.__maxdImpactSSSSeeds - print '* nWeightedClustersMin : ', self.__nWeightedClustersMin + print('* max PT : ', self.__maxPT, ' MeV') + print('*') + print('* NewTracking cuts:') + print('* -----------------') + print('* max Rphi IP (primaries) : ', self.__maxPrimaryImpact, ' mm') + print('* min number of clusters : ', self.__minClusters) + print('* min number of pixel hits : ', self.__minPixel) + print('* min number of NOT shared : ', self.__minSiNotShared) + print('* max number of shared : ', self.__maxShared) + print('* max number of Si holes : ', self.__maxHoles) + print('* max number of Pixel holes : ', self.__maxPixelHoles) + print('* max number of SCT holes : ', self.__maxSctHoles) + print('* max number of double holes : ', self.__maxDoubleHoles) + print('*') + print('* seed filter level : ', self.__seedFilterLevel) + print('* maximal R of SP for seeding : ', self.__radMax) + print('* max holes in pattern : ', self.__nHolesMax) + print('* max holes gap in pattern : ', self.__nHolesGapMax) + print('* Xi2 max : ', self.__Xi2max) + print('* Xi2 max no add : ', self.__Xi2maxNoAdd) + print('* max impact on seeds PPS/SSS : ', self.__maxdImpactPPSSeeds,', ',self.__maxdImpactSSSSeeds) + print('* nWeightedClustersMin : ', self.__nWeightedClustersMin) if self.__useTRT: - print '* min TRT on track extension : ', self.__minTRTonTrk - print '* min TRT precision fraction : ', self.__minTRTPrecFrac + print('* min TRT on track extension : ', self.__minTRTonTrk) + print('* min TRT precision fraction : ', self.__minTRTPrecFrac) if self.__indetflags.doBremRecovery() and self.__mode == "Offline": - print '*' - print "* -> Brem recovery enabled !" - print '* min pT for brem reocvery : ', self.__minPTBrem, ' MeV' + print('*') + print("* -> Brem recovery enabled !") + print('* min pT for brem reocvery : ', self.__minPTBrem, ' MeV') if self.__indetflags.doCaloSeededBrem(): - print "* -> in Calo seeded mode !!!" - print '* phi Width of road for brem : ', self.__phiWidthBrem - print '* eta Width of road for brem : ', self.__etaWidthBrem - print '*' + print("* -> in Calo seeded mode !!!") + print('* phi Width of road for brem : ', self.__phiWidthBrem) + print('* eta Width of road for brem : ', self.__etaWidthBrem) + print('*') if self.__useTRT and self.__RoISeededBackTracking: - print '*' - print '* RoI seeded BackTracking and TRT only !!!' - print '*' + print('*') + print('* RoI seeded BackTracking and TRT only !!!') + print('*') if self.__useSCT and self.__useTRT: - print '* BackTracking cuts:' - print '* ------------------' - print '* min pt : ', self.__minSecondaryPt, ' MeV' - print '* max Rphi IP (secondaries) : ', self.__maxSecondaryImpact, ' mm' - print '* min number of clusters : ', self.__minSecondaryClusters - print '* min number of NOT shared : ', self.__minSecondarySiNotShared - print '* max number of shared : ', self.__maxSecondaryShared - print '* max number of Si holes : ', self.__maxSecondaryHoles - print '* max number of Pixel holes : ', self.__maxSecondaryPixelHoles - print '* max number of SCT holes : ', self.__maxSecondarySCTHoles - print '* max number of double holes : ', self.__maxSecondaryDoubleHoles - print '* min TRT on track : ', self.__minSecondaryTRTonTrk - print '* min TRT precision fraction : ', self.__minSecondaryTRTPrecFrac - print '* max TRT shared fraction : ', self.__maxSecondaryTRTShared - print '* max holes in pattern : ', self.__SecondarynHolesMax - print '* max holes gap in pattern : ', self.__SecondarynHolesGapMax - print '* Xi2 max : ', self.__SecondaryXi2max - print '* Xi2 max no add : ', self.__SecondaryXi2maxNoAdd - print '* TRT segment finder pt bins : ', self.__TRTSegFinderPtBins - print '* rejectShortExtensions : ', self.__rejectShortExtensions - print '* SiExtensionsCuts : ', self.__SiExtensionCuts - print '*' + print('* BackTracking cuts:') + print('* ------------------') + print('* min pt : ', self.__minSecondaryPt, ' MeV') + print('* max Rphi IP (secondaries) : ', self.__maxSecondaryImpact, ' mm') + print('* min number of clusters : ', self.__minSecondaryClusters) + print('* min number of NOT shared : ', self.__minSecondarySiNotShared) + print('* max number of shared : ', self.__maxSecondaryShared) + print('* max number of Si holes : ', self.__maxSecondaryHoles) + print('* max number of Pixel holes : ', self.__maxSecondaryPixelHoles) + print('* max number of SCT holes : ', self.__maxSecondarySCTHoles) + print('* max number of double holes : ', self.__maxSecondaryDoubleHoles) + print('* min TRT on track : ', self.__minSecondaryTRTonTrk) + print('* min TRT precision fraction : ', self.__minSecondaryTRTPrecFrac) + print('* max TRT shared fraction : ', self.__maxSecondaryTRTShared) + print('* max holes in pattern : ', self.__SecondarynHolesMax) + print('* max holes gap in pattern : ', self.__SecondarynHolesGapMax) + print('* Xi2 max : ', self.__SecondaryXi2max) + print('* Xi2 max no add : ', self.__SecondaryXi2maxNoAdd) + print('* TRT segment finder pt bins : ', self.__TRTSegFinderPtBins) + print('* rejectShortExtensions : ', self.__rejectShortExtensions) + print('* SiExtensionsCuts : ', self.__SiExtensionCuts) + print('*') if self.__useTRT: - print '* useParameterizedTRTCuts : ', self.__useParameterizedTRTCuts - print '* useNewParameterizationTRT : ', self.__useNewParameterizationTRT - print '* excludeUsedTRToutliers : ', self.__excludeUsedTRToutliers - print '*' - print '* TRT only cuts:' - print '* --------------' - print '* min pt : ', self.__minTRTonlyPt, ' MeV' - print '* min TRT only hits : ', self.__minTRTonly - print '* max TRT shared fraction : ', self.__maxTRTonlyShared - print '* useTRTonlyParamCuts : ', self.__useTRTonlyParamCuts - print '* old transition hit logic : ', self.__useTRTonlyOldLogic - print '*' - print '************************************************************************************' + print('* useParameterizedTRTCuts : ', self.__useParameterizedTRTCuts) + print('* useNewParameterizationTRT : ', self.__useNewParameterizationTRT) + print('* excludeUsedTRToutliers : ', self.__excludeUsedTRToutliers) + print('*') + print('* TRT only cuts:') + print('* --------------') + print('* min pt : ', self.__minTRTonlyPt, ' MeV') + print('* min TRT only hits : ', self.__minTRTonly) + print('* max TRT shared fraction : ', self.__maxTRTonlyShared) + print('* useTRTonlyParamCuts : ', self.__useTRTonlyParamCuts) + print('* old transition hit logic : ', self.__useTRTonlyOldLogic) + print('*') + print('************************************************************************************') diff --git a/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredSecVertexFinding.py b/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredSecVertexFinding.py index 59a8e2d32fb1ae3bbadadb038b346a94cca06317..87e05e32ac6ca57968461221f2f7fc52e8bb22ed 100644 --- a/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredSecVertexFinding.py +++ b/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredSecVertexFinding.py @@ -43,7 +43,7 @@ class ConfiguredSecVertexFinding: useThetaCnst = VertexCuts.useThetaCnst()) ToolSvc += InDetSecVxFitterTool if (printConfig): - print InDetSecVxFitterTool + print(InDetSecVxFitterTool) # # --- Distance of minimum approach utility # @@ -51,7 +51,7 @@ class ConfiguredSecVertexFinding: InDetSecVxTrkDistanceFinder = Trk__SeedNewtonTrkDistanceFinder(name = prefix+'TrkDistanceFinder') ToolSvc += InDetSecVxTrkDistanceFinder if (printConfig): - print InDetSecVxTrkDistanceFinder + print(InDetSecVxTrkDistanceFinder) # # --- Helper Tool # @@ -59,7 +59,7 @@ class ConfiguredSecVertexFinding: InDetSecVxHelper = InDet__ConversionFinderUtils(name = prefix+"FinderUtils") ToolSvc += InDetSecVxHelper if (printConfig): - print InDetSecVxHelper + print(InDetSecVxHelper) # # --- Track selector tool # @@ -82,7 +82,7 @@ class ConfiguredSecVertexFinding: ToolSvc += InDetSecVxTrackSelector if (printConfig): - print InDetSecVxTrackSelector + print(InDetSecVxTrackSelector) # # Track pairs selector # @@ -97,7 +97,7 @@ class ConfiguredSecVertexFinding: MinTrackAngle = VertexCuts.TrkPairSel_MinTrackAngle()) ToolSvc += InDetSecVxTrackPairsSelector if (printConfig): - print InDetSecVxTrackPairsSelector + print(InDetSecVxTrackPairsSelector) # # Vertex point estimator # @@ -108,7 +108,7 @@ class ConfiguredSecVertexFinding: MaxPhi = VertexCuts.VtxPt_MaxPhi()) ToolSvc += InDetSecVtxPointEstimator if (printConfig): - print InDetSecVtxPointEstimator + print(InDetSecVtxPointEstimator) # # Secondary Vertex post selector # @@ -123,7 +123,7 @@ class ConfiguredSecVertexFinding: MaxPhiVtxTrk = VertexCuts.SecVtxPost_MaxPhiVtxTrk()) ToolSvc += InDetSecVtxPostSelector if (printConfig): - print InDetSecVtxPostSelector + print(InDetSecVtxPostSelector) # # Single track secondary vertex tool # @@ -138,7 +138,7 @@ class ConfiguredSecVertexFinding: MinRatioOfHLhits = VertexCuts.SingleTrk_MinRatioOfHLhits()) ToolSvc += InDetSingleTrackSecVtx if (printConfig): - print InDetSingleTrackSecVtx + print(InDetSingleTrackSecVtx) # # conversion finder tool # @@ -160,7 +160,7 @@ class ConfiguredSecVertexFinding: MinInitVtxR = VertexCuts.Finder_MinInitVtxR()) ToolSvc += InDetSecVtxFinderTool if (printConfig): - print InDetSecVtxFinderTool + print(InDetSecVtxFinderTool) # --- remember instances self.__prefix = prefix @@ -187,5 +187,5 @@ class ConfiguredSecVertexFinding: InDetConversionOutputName = self.__SecVertices) self.__topSequence += InDetSecVtxFinder if (self.__printConfig): - print InDetSecVtxFinder + print(InDetSecVtxFinder) diff --git a/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredSecondaryVertexCuts.py b/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredSecondaryVertexCuts.py index 7fb36d3523337583b9a7a00f5869c6786c9b42e7..bb6fba107c0a6296a1df07e7b1140584e33ef3a4 100644 --- a/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredSecondaryVertexCuts.py +++ b/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredSecondaryVertexCuts.py @@ -213,8 +213,8 @@ class ConfiguredSecondaryVertexCuts : self.__SingleTrk_MinRatioOfHLhits = 0.85 # e-prob cut single-TRT converison else: - print "*********************** ERROR, wrong configuration for Configured Secondary Vertex Cuts !!!" - print " mode given : ", mode + print("*********************** ERROR, wrong configuration for Configured Secondary Vertex Cuts !!!") + print(" mode given : ", mode) # ---------------------------------------------------------------------------- # --- private method @@ -374,77 +374,77 @@ class ConfiguredSecondaryVertexCuts : return self.__Finder_MinInitVtxR def printInfo( self ) : - print '****** Inner Detector Secondary Vertex Reconstruction Cuts ****************************' - print '*' - print '* secondary vertex mode : ',self.__mode - print '*' - print '* Vertex Fitter settings' - print '* - Iteration Number : ',self.__Fitter_IterationNumber - print '* - Make Extended Vertex : ',self.__Fitter_MakeExtendedVertex - print '* - First Measured Point : ',self.__Fitter_FirstMeasuredPoint - print '* - Robustness : ',self.__Fitter_Robustness - print '* - Input Particle Masses : ',self.__Fitter_InputParticleMasses - print '* - Vertex for constraint : ',self.__Fitter_VertexForConstraint - print '* - Cov for constraint : ',self.__Fitter_CovVrtForConstraint - print '* - First measured point limit : ',self.__Fitter_FirstMeasuredPointLimit - print '* - use Phi constraint : ',self.__Fitter_usePhiCnst - print '* - use Theta constraint : ',self.__Fitter_useThetaCnst - print '*' - print '* cuts for Track selector tool' - print '* - Track max Si d0 : ',self.__TrkSel_maxSiD0 - print '* - Track max TRT d0 : ',self.__TrkSel_maxTrtD0 - print '* - Track max Si Z0 : ',self.__TrkSel_maxSiZ0 - print '* - Track max TRT Z0 : ',self.__TrkSel_maxTrtZ0 - print '* - Track min pt : ',self.__TrkSel_minPt - print '* - Track Ratio Cut1 : ',self.__TrkSel_RatioCut1 - print '* - Track Ratio Cut2 : ',self.__TrkSel_RatioCut2 - print '* - Track Ratio Cut3 : ',self.__TrkSel_RatioCut3 - print '* - Track Ratio TRT : ',self.__TrkSel_RatioTRT - print '* - Track IsConverion : ',self.__TrkSel_IsConversion - print '* - track Si sig d0 : ',self.__TrkSel_significanceD0_Si - print '* - Track Ratio V0 : ',self.__TrkSel_RatioV0 - print '*' - print '* Track pairs selector [SI+SI,SI+TRT,TRT+TRT]' - print '* - Track Pair Max First Hit Radius : ',self.__TrkPairSel_MaxFirstHitRadius - print '* - Track Pair Max Dist btw Tracks : ',self.__TrkPairSel_MaxDistBetweenTracks - print '* - Track Pair Max Eta : ',self.__TrkPairSel_MaxEta - print '* - Track Pair Max Init Distance : ',self.__TrkPairSel_MaxInitDistance - print '* - Track Pair Min Track Angle : ',self.__TrkPairSel_MinTrackAngle - print '*' - print '* Vertex point estimator' - print '* - Vertex Point Min Delta R : ',self.__VtxPt_MinDeltaR - print '* - Vertex Point Max Delta R : ',self.__VtxPt_MaxDeltaR - print '* - Vertex Point Max Phi : ',self.__VtxPt_MaxPhi - print '*' - print '* Secondary Vertex post selector' - print '* - SVPostSel Max Chi2 Vtx : ',self.__SecVtxPost_MaxChi2Vtx - print '* - SVPostSel Max Inv Mass : ',self.__SecVtxPost_MaxInvariantMass - print '* - SVPostSel Max Min Fit P : ',self.__SecVtxPost_MinFitMomentum - print '* - SVPostSel Min Pt : ',self.__SecVtxPost_MinPt - print '* - SVPostSel Min Radius : ',self.__SecVtxPost_MinRadius - print '* - SVPostSel Max dR : ',self.__SecVtxPost_MaxdR - print '* - SVPostSel Max Phi Vtx : ',self.__SecVtxPost_MaxPhiVtxTrk - print '*' - print '* Single track secondary vertex tool' - print '* - Max Blayer hits for conversions : ',self.__SingleTrk_MaxBLayerHits - print '* - Single tr. Min Initial Hit Radius : ',self.__SingleTrk_MinInitialHitRadius - print '* - same for no blayer : ',self.__SingleTrk_MinInitialHitRadius_noBlay - print '* - Single tr. Min Ratio HL hits : ',self.__SingleTrk_MinRatioOfHLhits - print '*' - print '* InDetSecVtxFinderTool ' - print '* - Finder Remove TRT Tracks : ',self.__Finder_RemoveTrtTracks - print '* - Finder IsConversions : ',self.__Finder_IsConversion - print '* - Finder Min Dist Vtx Hit : ',self.__Finder_MinDistVtxHit - print '* - Finder Max Dist Vtx Hit : ',self.__Finder_MaxDistVtxHit - print '* - Finder Min Flight Angle : ',self.__Finder_MinFlightAngle - print '* - Finder Min Init Vtx R : ',self.__Finder_MinInitVtxR - print '*' - print '************************ General Configuration *************************************' - if self.__mode == "StartUp": - print 'No luminosity mode: single collision, loosen cuts to get as many V0 as possible' - - if self.__mode == "PileUp": - print 'Pile Up luminosity mode: multiple collisions' - - print '************************************************************************************' + print('****** Inner Detector Secondary Vertex Reconstruction Cuts ****************************') + print('*') + print('* secondary vertex mode : ',self.__mode ) + print('*') + print('* Vertex Fitter settings') + print('* - Iteration Number : ',self.__Fitter_IterationNumber ) + print('* - Make Extended Vertex : ',self.__Fitter_MakeExtendedVertex ) + print('* - First Measured Point : ',self.__Fitter_FirstMeasuredPoint ) + print('* - Robustness : ',self.__Fitter_Robustness ) + print('* - Input Particle Masses : ',self.__Fitter_InputParticleMasses ) + print('* - Vertex for constraint : ',self.__Fitter_VertexForConstraint ) + print('* - Cov for constraint : ',self.__Fitter_CovVrtForConstraint ) + print('* - First measured point limit : ',self.__Fitter_FirstMeasuredPointLimit) + print('* - use Phi constraint : ',self.__Fitter_usePhiCnst) + print('* - use Theta constraint : ',self.__Fitter_useThetaCnst) + print('*' ) + print('* cuts for Track selector tool') + print('* - Track max Si d0 : ',self.__TrkSel_maxSiD0 ) + print('* - Track max TRT d0 : ',self.__TrkSel_maxTrtD0 ) + print('* - Track max Si Z0 : ',self.__TrkSel_maxSiZ0 ) + print('* - Track max TRT Z0 : ',self.__TrkSel_maxTrtZ0 ) + print('* - Track min pt : ',self.__TrkSel_minPt ) + print('* - Track Ratio Cut1 : ',self.__TrkSel_RatioCut1 ) + print('* - Track Ratio Cut2 : ',self.__TrkSel_RatioCut2 ) + print('* - Track Ratio Cut3 : ',self.__TrkSel_RatioCut3 ) + print('* - Track Ratio TRT : ',self.__TrkSel_RatioTRT) + print('* - Track IsConverion : ',self.__TrkSel_IsConversion ) + print('* - track Si sig d0 : ',self.__TrkSel_significanceD0_Si ) + print('* - Track Ratio V0 : ',self.__TrkSel_RatioV0 ) + print('*' ) + print('* Track pairs selector [SI+SI,SI+TRT,TRT+TRT]') + print('* - Track Pair Max First Hit Radius : ',self.__TrkPairSel_MaxFirstHitRadius ) + print('* - Track Pair Max Dist btw Tracks : ',self.__TrkPairSel_MaxDistBetweenTracks ) + print('* - Track Pair Max Eta : ',self.__TrkPairSel_MaxEta ) + print('* - Track Pair Max Init Distance : ',self.__TrkPairSel_MaxInitDistance ) + print('* - Track Pair Min Track Angle : ',self.__TrkPairSel_MinTrackAngle ) + print('*') + print('* Vertex point estimator') + print('* - Vertex Point Min Delta R : ',self.__VtxPt_MinDeltaR) + print('* - Vertex Point Max Delta R : ',self.__VtxPt_MaxDeltaR) + print('* - Vertex Point Max Phi : ',self.__VtxPt_MaxPhi ) + print('*') + print('* Secondary Vertex post selector') + print('* - SVPostSel Max Chi2 Vtx : ',self.__SecVtxPost_MaxChi2Vtx ) + print('* - SVPostSel Max Inv Mass : ',self.__SecVtxPost_MaxInvariantMass) + print('* - SVPostSel Max Min Fit P : ',self.__SecVtxPost_MinFitMomentum) + print('* - SVPostSel Min Pt : ',self.__SecVtxPost_MinPt) + print('* - SVPostSel Min Radius : ',self.__SecVtxPost_MinRadius ) + print('* - SVPostSel Max dR : ',self.__SecVtxPost_MaxdR) + print('* - SVPostSel Max Phi Vtx : ',self.__SecVtxPost_MaxPhiVtxTrk ) + print('*') + print('* Single track secondary vertex tool') + print('* - Max Blayer hits for conversions : ',self.__SingleTrk_MaxBLayerHits ) + print('* - Single tr. Min Initial Hit Radius : ',self.__SingleTrk_MinInitialHitRadius) + print('* - same for no blayer : ',self.__SingleTrk_MinInitialHitRadius_noBlay) + print('* - Single tr. Min Ratio HL hits : ',self.__SingleTrk_MinRatioOfHLhits ) + print('*') + print('* InDetSecVtxFinderTool ') + print('* - Finder Remove TRT Tracks : ',self.__Finder_RemoveTrtTracks ) + print('* - Finder IsConversions : ',self.__Finder_IsConversion ) + print('* - Finder Min Dist Vtx Hit : ',self.__Finder_MinDistVtxHit ) + print('* - Finder Max Dist Vtx Hit : ',self.__Finder_MaxDistVtxHit ) + print('* - Finder Min Flight Angle : ',self.__Finder_MinFlightAngle ) + print('* - Finder Min Init Vtx R : ',self.__Finder_MinInitVtxR ) + print('*') + print('************************ General Configuration *************************************') + if self.__mode == "StartUp": + print('No luminosity mode: single collision, loosen cuts to get as many V0 as possible') + + if self.__mode == "PileUp": + print('Pile Up luminosity mode: multiple collisions') + + print('************************************************************************************') diff --git a/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredVertexingCuts.py b/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredVertexingCuts.py index 799bd280a61221123c16856ec248eb09c325225b..7b465beb84751a1ddfd1ab2aa5b0f695144e9e8b 100644 --- a/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredVertexingCuts.py +++ b/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredVertexingCuts.py @@ -302,42 +302,42 @@ class ConfiguredVertexingCuts : # def printInfo( self ) : - print '****** Inner Detector Primary Vertex Reconstruction Cuts ****************************' - print '*' - print '* mode is : ', self.__mode - print '* cut level for primary vertexing is : ', self.__indetflags.priVtxCutLevel() - print '*' - print '* Track Cut Level : ', self.__TrackCutLevel - print '*' - print '* min pT : ', self.__minPT, ' MeV' - print '* Max IP d0 : ', self.__IPd0Max - print '* Max IP Z0 : ', self.__IPz0Max - print '* Max z0 : ', self.__z0Max - print '* Max Sig IP d0 : ', self.__sigIPd0Max - print '* Max Sig IP z0 : ', self.__sigIPz0Max - print '* Max Sig d0 : ', self.__d0significanceMax - print '* Max Sig z0 : ', self.__z0significanceMax - print '* Max eta : ', self.__etaMax + print('****** Inner Detector Primary Vertex Reconstruction Cuts ****************************') + print('*') + print('* mode is : ', self.__mode) + print('* cut level for primary vertexing is : ', self.__indetflags.priVtxCutLevel()) + print('*') + print('* Track Cut Level : ', self.__TrackCutLevel) + print('*') + print('* min pT : ', self.__minPT, ' MeV') + print('* Max IP d0 : ', self.__IPd0Max) + print('* Max IP Z0 : ', self.__IPz0Max) + print('* Max z0 : ', self.__z0Max) + print('* Max Sig IP d0 : ', self.__sigIPd0Max) + print('* Max Sig IP z0 : ', self.__sigIPz0Max) + print('* Max Sig d0 : ', self.__d0significanceMax) + print('* Max Sig z0 : ', self.__z0significanceMax) + print('* Max eta : ', self.__etaMax) #cluster and track quality cuts - print '* Use TrackSummary : ', self.__useTrackSummaryInfo - print '* Min N Innermost Layer Hits : ', self.__nHitInnermostLayer - print '* Min N Pix Hit : ', self.__nHitPix - print '* Max N Pix Holes : ', self.__nHolesPix - print '* Min N SCT Hits : ', self.__nHitSct - print '* Min N Si Hits : ', self.__nHitSi - print '* Min N TRT Hits : ', self.__nHitTrt - print '* Min N high threshold hits TRT : ', self.__nHitTrtHighEFractionMax - print '* Min N high threshold hits TRT (incl. outliers) : ', self.__nHitTrtHighEFractionWithOutliersMax - print '* Use shared hit info : ', self.__useSharedHitInfo - print '* Use Track Quality info : ', self.__useTrackQualityInfo - print '* Chi2/ndf of the fit : ', self.__fitChi2OnNdfMax - print '* TRT Max eta : ', self.__TrtMaxEtaAcceptance - print '*' - print '* Chi2 cut method : ', self.__chi2CutMethod - print '* Enable Multiple Vertices : ', self.__enableMultipleVertices - print '*' - print '************************************************************************************' + print('* Use TrackSummary : ', self.__useTrackSummaryInfo) + print('* Min N Innermost Layer Hits : ', self.__nHitInnermostLayer) + print('* Min N Pix Hit : ', self.__nHitPix) + print('* Max N Pix Holes : ', self.__nHolesPix) + print('* Min N SCT Hits : ', self.__nHitSct) + print('* Min N Si Hits : ', self.__nHitSi) + print('* Min N TRT Hits : ', self.__nHitTrt) + print('* Min N high threshold hits TRT : ', self.__nHitTrtHighEFractionMax) + print('* Min N high threshold hits TRT (incl. outliers) : ', self.__nHitTrtHighEFractionWithOutliersMax) + print('* Use shared hit info : ', self.__useSharedHitInfo) + print('* Use Track Quality info : ', self.__useTrackQualityInfo) + print('* Chi2/ndf of the fit : ', self.__fitChi2OnNdfMax) + print('* TRT Max eta : ', self.__TrtMaxEtaAcceptance) + print('*') + print('* Chi2 cut method : ', self.__chi2CutMethod ) + print('* Enable Multiple Vertices : ', self.__enableMultipleVertices ) + print('*') + print('************************************************************************************') #------------------------------------------------------------------------- diff --git a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py index 6f36c69727941a7ae7654da6cfdaecde8a87d1ec..12ac761cbdc04a612578c6c48eb177e53fa92bb4 100644 --- a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py +++ b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py @@ -72,7 +72,7 @@ class Enabled(JobProperty): oname = self.__class__._nInstancesContextDict[i].__name__ ocontext = self.__class__._nInstancesContextDict[i]._context_name.partition('.'+oname) if context != ocontext: - #print ocontext + #print(ocontext) if context[0] == ocontext[0]: objects.append(self.__class__._nInstancesContextDict[i]) return objects @@ -108,7 +108,7 @@ class doDBM(InDetFlagsJobProperty): StoredValue = False class doPrintConfigurables(InDetFlagsJobProperty): - """if this is on the all the print InDetXYZ lines are activated""" + """if this is on the all the print(InDetXYZ lines are activated""" statusOn = True allowedTypes = ['bool'] StoredValue = True @@ -1215,7 +1215,7 @@ class InDetJobProperties(JobPropertyContainer): from AthenaCommon.DetFlags import DetFlags from AthenaCommon.BeamFlags import jobproperties - print "InDetJobProperties::setupDefaults(): jobproperties.Beam.beamType() is "+jobproperties.Beam.beamType()+" bunch spacing is "+str(jobproperties.Beam.bunchSpacing()) + print("InDetJobProperties::setupDefaults(): jobproperties.Beam.beamType() is "+jobproperties.Beam.beamType()+" bunch spacing is "+str(jobproperties.Beam.bunchSpacing())) if ( jobproperties.Beam.beamType()=="collisions" and jobproperties.Beam.bunchSpacing() <= 25): self.checkThenSet(self.InDet25nsec , True) @@ -1321,7 +1321,7 @@ class InDetJobProperties(JobPropertyContainer): # --- special case SLHC elif (self.doSLHC()): - print "----> InDetJobProperties for SLHC" + print("----> InDetJobProperties for SLHC") self.checkThenSet(self.doNewTracking , True ) self.checkThenSet(self.doLowPt , False) self.checkThenSet(self.doVeryLowPt , False) @@ -1354,8 +1354,8 @@ class InDetJobProperties(JobPropertyContainer): self.checkThenSet(self.doTrackSegmentsDisappearing, False) elif (self.doIBL()): - print "----> InDetJobProperties for IBL" - print "----> DEPRECATED! This should now be the default settings" + print("----> InDetJobProperties for IBL") + print("----> DEPRECATED! This should now be the default settings") #self.checkThenSet(self.doNewTracking , True ) #self.checkThenSet(self.doLowPt , False) #self.checkThenSet(self.doVeryLowPt , False) @@ -1382,7 +1382,7 @@ class InDetJobProperties(JobPropertyContainer): #self.checkThenSet(self.doSGDeletion , True ) elif (self.doHighPileup()): - print "----> InDetJobProperties for high pilep" + print("----> InDetJobProperties for high pilep") self.checkThenSet(self.doNewTracking , True ) self.checkThenSet(self.doLowPt , False) self.checkThenSet(self.doVeryLowPt , False) @@ -1411,7 +1411,7 @@ class InDetJobProperties(JobPropertyContainer): # --- special setup for vtxlumi stream processing elif (self.doVtxLumi()): - print "----> InDetJobProperties for vertex lumi" + print("----> InDetJobProperties for vertex lumi") self.checkThenSet(self.doNewTracking , True ) self.checkThenSet(self.doLowPt , False) self.checkThenSet(self.doVeryLowPt , False) @@ -1451,7 +1451,7 @@ class InDetJobProperties(JobPropertyContainer): # --- special setup for vtxbeamspot stream processing elif (self.doVtxBeamSpot()): - print "----> InDetJobProperties for vertex lumi" + print("----> InDetJobProperties for vertex lumi") self.checkThenSet(self.doNewTracking , True ) self.checkThenSet(self.doLowPt , False) self.checkThenSet(self.doVeryLowPt , False) @@ -1487,7 +1487,7 @@ class InDetJobProperties(JobPropertyContainer): # --- special case minimal reconstruction setup elif (self.doMinimalReco()): - print "----> InDetJobProperties for minimal reconstruction" + print("----> InDetJobProperties for minimal reconstruction") self.checkThenSet(self.preProcessing , True ) self.checkThenSet(self.doPRDFormation , True ) self.checkThenSet(self.doSpacePointFormation , True ) @@ -1527,7 +1527,7 @@ class InDetJobProperties(JobPropertyContainer): # --- new setup for LargeD0 retracking -- what the user # --- is allowed to change elif self.doDVRetracking(): - print "----> InDetJobProperties for high-d0 tracks reconstruction" + print("----> InDetJobProperties for high-d0 tracks reconstruction") # see setDVRetracking method which overrides some of the flags self.checkThenSet(self.doLargeD0 , True ) self.checkThenSet(self.useExistingTracksAsInput, True ) @@ -1667,9 +1667,9 @@ class InDetJobProperties(JobPropertyContainer): #Method to do the final setup of the flags according to user input before. #This method MUST ONLY BE CALLED once in InDetRecExample/InDetRec_jobOptions.py!! if not self.Enabled: - print 'InDetFlags.init(): ID flags are disabled. Locking container and not doing anything else.' + print('InDetFlags.init(): ID flags are disabled. Locking container and not doing anything else.') else: - print 'Initializing InDetJobProperties with DetFlags, GlobalFlags and other high level flags.' + print('Initializing InDetJobProperties with DetFlags, GlobalFlags and other high level flags.') # THIS METHOD MUST BE THE FIRST TO BE CALLED. DO NOT MOVE IT OR ADD THINGS IN FRONT self.setupDefaults() @@ -1877,7 +1877,7 @@ class InDetJobProperties(JobPropertyContainer): if (self.trackFitterType() is not 'KalmanFitter' and self.trackFitterType() is not 'KalmanDNAFitter') : self.refitROT = True if not self.refitROT() and not self.redoTRT_LR() : - print 'ConfiguredInDetFlags.py WARNING refitROT and redoTRT_LR are both False, NOT RECOMMENDED!' + print('ConfiguredInDetFlags.py WARNING refitROT and redoTRT_LR are both False, NOT RECOMMENDED!') # # refKF needs a new method in IUpdator, where there is currently only one implementation if (self.trackFitterType() is 'ReferenceKalmanFitter'): @@ -1890,8 +1890,8 @@ class InDetJobProperties(JobPropertyContainer): or (self.trackFitterType() is 'DistributedKalmanFilter') or (self.trackFitterType() is 'GlobalChi2Fitter' ) or (self.trackFitterType() is 'GaussianSumFilter') ): - print 'InDetJobProperties.py WARNING unregistered or invalid track fitter setup.' - print ' --> re-setting to TrkKalmanFitter.' + print('InDetJobProperties.py WARNING unregistered or invalid track fitter setup.') + print(' --> re-setting to TrkKalmanFitter.') self.trackFitterType = 'KalmanFitter' # @@ -1932,7 +1932,7 @@ class InDetJobProperties(JobPropertyContainer): self.checkThenSet(self.doTRT_PRDFormation, False) # do this also if Enabled == False - print "Initialization of InDetFlags finished - locking container!" + print("Initialization of InDetFlags finished - locking container!") self.lock_JobProperties() def loadTrackingGeometry(self): @@ -2139,164 +2139,164 @@ class InDetJobProperties(JobPropertyContainer): # ---------------------------------------------------------------------------- def printInfo(self) : - print '****** Inner Detector Flags ********************************************************' + print('****** Inner Detector Flags ********************************************************') if self.AODall() : - print '*' - print '* --------------------> write AOD classes for all trackers!' - print '*' + print('*') + print('* --------------------> write AOD classes for all trackers!') + print('*') if self.doSLHC() : - print '*' - print '* --------------------> Special reconstruction for SLHC !' + print('*') + print('* --------------------> Special reconstruction for SLHC !') if self.doSLHCVeryForward(): - print '* --------------------> Including Very Forward Extension !' - print '*' + print('* --------------------> Including Very Forward Extension !') + print('*') if self.doIBL() : - print '*' - print '* --------------------> Special reconstruction for IBL !' - print '*' + print('*') + print('* --------------------> Special reconstruction for IBL !') + print('*') if self.doDBM() : - print '*' - print '* --------------------> Special reconstruction for DBM !' - print '*' + print('*') + print('* --------------------> Special reconstruction for DBM !') + print('*') if self.doDBMstandalone() : - print '*' - print '* --------------------> Standalone reconstruction for DBM !' - print '*' + print('*') + print('* --------------------> Standalone reconstruction for DBM !') + print('*') if self.doHighPileup() : - print '*' - print '* --------------------> Special reconstruction for high pile-up !' - print '*' + print('*') + print('* --------------------> Special reconstruction for high pile-up !') + print('*') if self.doVtxLumi() : - print '*' - print '* --------------------> Special reconstruction for vertex lumi measurement !' - print '*' + print('*') + print('* --------------------> Special reconstruction for vertex lumi measurement !') + print('*') if self.doVtxBeamSpot() : - print '*' - print '* --------------------> Special reconstruction for vertex beamspot measurement !' - print '*' + print('*') + print('* --------------------> Special reconstruction for vertex beamspot measurement !') + print('*') if self.doCosmics() : - print '*' - print '* --------------------> Special reconstruction for cosmics !' - print '*' + print('*') + print('* --------------------> Special reconstruction for cosmics !') + print('*') if self.doHeavyIon() : - print '*' - print '* --------------------> Special reconstruction for heavy ions !' - print '*' + print('*') + print('* --------------------> Special reconstruction for heavy ions !') + print('*') if self.doMinimalReco() : - print '*' - print '* --------------------> Minimal Reconstruction !' - print '*' + print('*') + print('* --------------------> Minimal Reconstruction !') + print('*') if self.doDVRetracking() : - print '*' - print '* --------------------> Special reconstruction for high-d0 tracks !' - print '*' + print('*') + print('* --------------------> Special reconstruction for high-d0 tracks !') + print('*') if self.disableInDetReco(): - print '*' - print '* --------------------> Disabling Reconstruction !' - print '*' + print('*') + print('* --------------------> Disabling Reconstruction !') + print('*') if self.disableTracking() and not self.disableInDetReco(): - print '*' - print '* --------------------> Disabling all tracking !' - print '*' + print('*') + print('* --------------------> Disabling all tracking !') + print('*') if self.doMinBias(): - print '*' - print '* --------------------> old Min Bias Mode (no longer supported)' - print '*' + print('*') + print('* --------------------> old Min Bias Mode (no longer supported)') + print('*') if self.doLowMuRunSetup(): - print '*' - print '* --------------------> Low Mu Run Setup for Min Bias studies' - print '*' + print('*') + print('* --------------------> Low Mu Run Setup for Min Bias studies') + print('*') if self.doRobustReco(): - print '*' - print '* --------------------> Robust Reco Cuts' - print '*' + print('*') + print('* --------------------> Robust Reco Cuts') + print('*') if self.doSingleCollisionVertexReco(): - print '*' - print '* --------------------> Single collision vertex reco' - print '*' + print('*') + print('* --------------------> Single collision vertex reco') + print('*') if self.doInnerDetectorCommissioning: - print '*' - print '* --------------------> Loose setting for Commissioning' - print '*' + print('*') + print('* --------------------> Loose setting for Commissioning') + print('*') # ----------------------------------------- - print '*' - print '* PreProcessing:' - print '* ==============' - print '*' + print('*') + print('* PreProcessing:') + print('* ==============') + print('*') if self.InDet25nsec(): - print '* -----> 25 nsec setup for SCT/TRT' + print('* -----> 25 nsec setup for SCT/TRT') else: - print '* -----> 50 nsec setup for SCT/TRT' - print '*' + print('* -----> 50 nsec setup for SCT/TRT') + print('*') if self.doPRDFormation() : - print '* run PrepRawDataFormation' + print('* run PrepRawDataFormation') if self.doPixelClusterSplitting(): if self.doTIDE_Ambi(): - print '* - run TIDE ambi with pixel cluster splitting' - print '* splitting technique: ', self.pixelClusterSplittingType() - print '* split prob1 cut: ', self.pixelClusterSplitProb1() - print '* split prob2 cut: ', self.pixelClusterSplitProb2() - print '* Min split pt: [MeV] ', self.pixelClusterSplitMinPt() + print('* - run TIDE ambi with pixel cluster splitting') + print('* splitting technique: ', self.pixelClusterSplittingType()) + print('* split prob1 cut: ', self.pixelClusterSplitProb1()) + print('* split prob2 cut: ', self.pixelClusterSplitProb2()) + print('* Min split pt: [MeV] ', self.pixelClusterSplitMinPt()) if self.doTIDE_RescalePixelCovariances(): - print '* rescaling pixel cluster covariances: ', self.doTIDE_RescalePixelCovariances() + print('* rescaling pixel cluster covariances: ', self.doTIDE_RescalePixelCovariances()) else: - print '* - run new Pixel clustering with splitting using analog information' - print '* splitting technique: ', self.pixelClusterSplittingType() + print('* - run new Pixel clustering with splitting using analog information') + print('* splitting technique: ', self.pixelClusterSplittingType()) if self.selectSCTIntimeHits(): if self.InDet25nsec(): - print '* - use 01X masking for SCT readout in reconstruction' + print('* - use 01X masking for SCT readout in reconstruction') else: - print '* - use X1X masking for SCT readout in reconstruction' + print('* - use X1X masking for SCT readout in reconstruction') if self.cutSCTOccupancy(): - print '* - cut on SCT occupancy for masking noisy modules' + print('* - cut on SCT occupancy for masking noisy modules') if self.removeTRTNoise(): - print '* - remove flagged TRT noise' + print('* - remove flagged TRT noise') if self.noTRTTiming(): - print '* - ignore TRT timing information !' + print('* - ignore TRT timing information !') if self.doSpacePointFormation() : - print '* run SpacePointFormation' + print('* run SpacePointFormation') # ----------------------------------------- - print '*' - print '* TrackFinding:' - print '* =============' + print('*') + print('* TrackFinding:') + print('* =============') # ----------------------------------------- if self.doNewTracking() : - print '*' - print '* NewTracking is ON:' + print('*') + print('* NewTracking is ON:') if self.doSiSPSeededTrackFinder() : - print '* - run SiSPSeededTrackFinder' + print('* - run SiSPSeededTrackFinder') if self.useZvertexTool() : - print '* and use ZvertexTool' + print('* and use ZvertexTool') if self.doAmbiSolving() : - print '* - run AmbiguitySolver' + print('* - run AmbiguitySolver') if self.doTRTExtension() : - print '* - run TRT_TrackExtension' + print('* - run TRT_TrackExtension') if self.doExtensionProcessor() : - print '* - run TrackExtensionProcessor' + print('* - run TrackExtensionProcessor') if self.redoTRT_LR() : - print '* and redo LR and tube hits in fit for TRT !!!' + print('* and redo LR and tube hits in fit for TRT !!!') # ----------------------------------------- if self.doBackTracking() : - print '*' - print '* BackTracking is ON:' + print('*') + print('* BackTracking is ON:') if self.doTrtSegments() : - print '* - run TRT Segment finding' + print('* - run TRT Segment finding') if self.doTRTSeededTrackFinder() : - print '* - run TRT seeded track finding' + print('* - run TRT seeded track finding') if self.loadTRTSeededSPFinder() : - print '* and load TRT_SeededSpacePointFinder' + print('* and load TRT_SeededSpacePointFinder') if self.loadSimpleTRTSeededSPFinder() : - print '* and load SimpleTRT_SeededSpacePointFinder' + print('* and load SimpleTRT_SeededSpacePointFinder') if self.doResolveBackTracks() : - print '* - run ambi on TRT seeded tracks' + print('* - run ambi on TRT seeded tracks') if self.doTRTStandalone() : - print '* - create TRT standalone tracks' + print('* - create TRT standalone tracks') # ----------------------------------------- if self.doNewTrackingSegments(): - print '*' - print '* Create separate track segments for:' + print('*') + print('* Create separate track segments for:') standAloneTracking = '* - ' if self.doTrackSegmentsPixel(): standAloneTracking += 'Pixel ' @@ -2304,145 +2304,145 @@ class InDetJobProperties(JobPropertyContainer): standAloneTracking += 'SCT ' if self.doTrackSegmentsTRT(): standAloneTracking += 'TRT' - print standAloneTracking + print(standAloneTracking) # ----------------------------------------- if self.doLargeD0() or self.doLowPtLargeD0() : - print '*' - print '* LargeD0 Tracking is ON' + print('*') + print('* LargeD0 Tracking is ON') if self.doSiSPSeededTrackFinder() : - print '* - run SiSPSeededTrackFinder' + print('* - run SiSPSeededTrackFinder') if self.useZvertexTool() : - print '* and use ZvertexTool' + print('* and use ZvertexTool') if self.doAmbiSolving() : - print '* - run AmbiguitySolver' + print('* - run AmbiguitySolver') if self.doTRTExtension() : - print '* - run TRT_TrackExtension' + print('* - run TRT_TrackExtension') if self.doExtensionProcessor() : - print '* - run TrackExtensionProcessor' + print('* - run TrackExtensionProcessor') if self.redoTRT_LR() : - print '* and redo LR and tube hits in fit for TRT !!!' + print('* and redo LR and tube hits in fit for TRT !!!') # ----------------------------------------- if self.useExistingTracksAsInput() : - print '*' - print '* Use (D)ESD tracks as input' + print('*') + print('* Use (D)ESD tracks as input') # ----------------------------------------- if self.doLowPt() : - print '*' - print '* LowPtTracking is ON' + print('*') + print('* LowPtTracking is ON') if self.doVeryLowPt() : - print '* and VeryLowPtTracking is ON' + print('* and VeryLowPtTracking is ON') # ----------------------------------------- if self.doSLHCConversionFinding() : - print '*' - print '* SLHCConversionFinding is ON' + print('*') + print('* SLHCConversionFinding is ON') # ----------------------------------------- if self.doForwardTracks(): - print '*' - print '* Forward Tracklets are ON' + print('*') + print('* Forward Tracklets are ON') # ----------------------------------------- - print '*' - print '* Cut level for Tracking is set to : ',self.cutLevel() + print('*') + print('* Cut level for Tracking is set to : ',self.cutLevel()) if not self.doHeavyIon(): - print '* (1) - 2010 settings' - print '* (2) - start of 2011 settings' - print '* (3) - tighter version of (2)' - print '* (4) - max d0 cut on SSS seeds' - print '* (5) - cut level 4 + seed level 2' - print '* (6) - TRTonly cuts for pileup' - print '* (7) - BackTracking cuts for pileup' - print '* (8) - slightly tighter hole cuts for NewTracking' - print '* (9) - slightly tighter IP cuts' - print '* (10)- use Z boundary seeding' - print '* (11)- TRT only uses eta depending hit cuts' - print '* (12)- Tighter X2 cuts on both track and hits being accepted' - print '* (13)- TRT segment making in RoI guided model' + print('* (1) - 2010 settings') + print('* (2) - start of 2011 settings') + print('* (3) - tighter version of (2)') + print('* (4) - max d0 cut on SSS seeds') + print('* (5) - cut level 4 + seed level 2') + print('* (6) - TRTonly cuts for pileup') + print('* (7) - BackTracking cuts for pileup') + print('* (8) - slightly tighter hole cuts for NewTracking') + print('* (9) - slightly tighter IP cuts') + print('* (10)- use Z boundary seeding') + print('* (11)- TRT only uses eta depending hit cuts') + print('* (12)- Tighter X2 cuts on both track and hits being accepted') + print('* (13)- TRT segment making in RoI guided model') else: - print '* (1) - 2010 heavy ion settings' - print '* (2) - 2011 heavy ion settings with seed level 2' - print '* (3) - 2011 heavy ion settings with seed level 2 and pT cut at 0.3 GeV' + print('* (1) - 2010 heavy ion settings') + print('* (2) - 2011 heavy ion settings with seed level 2') + print('* (3) - 2011 heavy ion settings with seed level 2 and pT cut at 0.3 GeV') # ----------------------------------------- if self.doBremRecovery(): - print '* run Brem Recovery in tracking' + print('* run Brem Recovery in tracking') if self.doCaloSeededBrem(): - print '* - restrict Brem Recovery to Calo ROIs' + print('* - restrict Brem Recovery to Calo ROIs') # ----------------------------------------- if self.doxKalman() or self.doiPatRec() or self.doFatras(): - print '*' - print '* Alternative trackings:' + print('*') + print('* Alternative trackings:') if self.doxKalman() : - print '* - run xKalman' + print('* - run xKalman') if self.doiPatRec() : - print '* - run iPatRec' + print('* - run iPatRec') if self.doFatras() : - print '* - run FATRAS' + print('* - run FATRAS') # ----------------------------------------- if self.doRefit() : - print '*' - print '* do a refit of all tracks' + print('*') + print('* do a refit of all tracks') if self.doSlimming() : - print '*' + print('*') if not self.doSlimPoolTrack() : - print '* slim down the tracks for output on ESD' + print('* slim down the tracks for output on ESD') else : - print '* persistify slim tracks ' + print('* persistify slim tracks ') # ----------------------------------------- - print '*' - print '* PostProcessing:' - print '* ===============' - print '*' + print('*') + print('* PostProcessing:') + print('* ===============') + print('*') if self.doVertexFinding() : - print '* run primary vertex finding with : ',self.primaryVertexSetup() - print '* - using sorting based on : ',self.primaryVertexSortingSetup() - print '* - primary vertexing cut setup : ',self.primaryVertexCutSetup() + print('* run primary vertex finding with : ',self.primaryVertexSetup()) + print('* - using sorting based on : ',self.primaryVertexSortingSetup()) + print('* - primary vertexing cut setup : ',self.primaryVertexCutSetup()) if self.doPrimaryVertex3DFinding() : - print '* - use 3D seed finding' - print '* - privtx cut level : ', self.priVtxCutLevel() + print('* - use 3D seed finding') + print('* - privtx cut level : ', self.priVtxCutLevel()) if self.doParticleCreation() : - print '* create TrackParticles' + print('* create TrackParticles') if self.doSharedHits() : - print '* - and do shared hits search' + print('* - and do shared hits search') if self.KeepFirstParameters() : - print '* - keep first parameters on track' + print('* - keep first parameters on track') elif self.KeepParameters() : - print '* - keep extra parameters on track' + print('* - keep extra parameters on track') if self.doV0Finder() : - print '* run V0 finder' + print('* run V0 finder') if self.useV0Fitter() : - print '* - use V0 fitter' + print('* - use V0 fitter') else: - print '* - use VkalVrt' + print('* - use VkalVrt') pass if self.doSimpleV0Finder() : - print '* - running with simple V0Finder cuts' + print('* - running with simple V0Finder cuts') else: - print '* - running with full V0Finder cuts' + print('* - running with full V0Finder cuts') pass pass #if self.doSimpleV0Finder() : - # print '* run simple V0 finder' + # print('* run simple V0 finder') # if self.useV0Fitter() : - # print '* - use V0 fitter' + # print('* - use V0 fitter') # else: - # print '* - use VkalVrt' + # print('* - use VkalVrt') # pass # pass if self.doSecVertexFinder() : - print '* run V0 search using conversion finder with vertexing cut setup : ',self.secondaryVertexCutSetup() + print('* run V0 search using conversion finder with vertexing cut setup : ',self.secondaryVertexCutSetup()) if self.doConversions() : - print '* run conversion finder with conversion vertexing cut setup : ',self.conversionVertexCutSetup() + print('* run conversion finder with conversion vertexing cut setup : ',self.conversionVertexCutSetup()) # ----------------------------------------- if self.doStatistics() : - print '* run statistics packages' + print('* run statistics packages') if self.doStandardPlots() : - print '* run Standard Plots package' + print('* run Standard Plots package') if self.doPhysValMon() : - print '* run Physics Validation Monitoring' + print('* run Physics Validation Monitoring') if self.doNtupleCreation(): ntupleString = '* Ntuple cluster/drift circle trees activated:' if self.doSctClusterNtuple(): ntupleString += ' SCT' if self.doSctClusterNtuple(): - print ntupleString + print(ntupleString) ntupleString = '* Ntuple track trees activated:' if self.doTrkNtuple(): @@ -2454,7 +2454,7 @@ class InDetJobProperties(JobPropertyContainer): if self.doTrtTrkNtuple(): ntupleString += ' \"TRT Track Extension\"' if self.doTrkNtuple() or self.doPixelTrkNtuple() or self.doSctTrkNtuple() or self.doTrtTrkNtuple(): - print ntupleString + print(ntupleString) ntupleString = '* Ntuple vertex trees activated:' if self.doVtxNtuple(): @@ -2464,7 +2464,7 @@ class InDetJobProperties(JobPropertyContainer): if self.doV0VtxNtuple(): ntupleString += ' V0s' if self.doVtxNtuple() or self.doConvVtxNtuple() or self.doV0VtxNtuple(): - print ntupleString + print(ntupleString) if self.doD3PDCreation(): ntupleString = '* D3PD track trees activated:' @@ -2477,7 +2477,7 @@ class InDetJobProperties(JobPropertyContainer): if self.doTrtTrkD3PD(): ntupleString += ' \"TRT Tracklets\"' if self.doTrkD3PD() or self.doPixelTrkD3PD() or self.doSctTrkD3PD() or self.doTrtTrkD3PD(): - print ntupleString + print(ntupleString) ntupleString = '* D3PD vertex trees activated:' if self.doVtxD3PD(): @@ -2489,14 +2489,14 @@ class InDetJobProperties(JobPropertyContainer): if self.doV0VtxD3PD(): ntupleString += ' V0s' if self.doVtxD3PD() or self.doVtxMonitoringD3PD() or self.doConvVtxD3PD() or self.doV0VtxD3PD(): - print ntupleString + print(ntupleString) if self.doTriggerD3PD(): - print '* D3PD trigger tree activated' + print('* D3PD trigger tree activated') # ----------------------------------------- if (self.doMonitoringGlobal() or self.doMonitoringPrimaryVertexingEnhanced() or self.doMonitoringPixel() or self.doMonitoringSCT() or self.doMonitoringTRT() or self.doMonitoringAlignment()): - print '*' + print('*') myString = '* Run Monitoring on for: ' if self.doMonitoringGlobal(): myString += ' Global' @@ -2510,85 +2510,85 @@ class InDetJobProperties(JobPropertyContainer): myString += ' TRT' if self.doMonitoringAlignment(): myString += ' Alignment' - print myString - print '*' + print(myString) + print('*') # ----------------------------------------- - print '*' - print '* Other parameters' - print '* =================' - print '*' + print('*') + print('* Other parameters') + print('* =================') + print('*') if self.doTruth() : - print '* run truth association: '+self.truthMatchStrategy() + print('* run truth association: '+self.truthMatchStrategy()) if self.solenoidOn() : - print '* solenoid field is ON' + print('* solenoid field is ON') if self.usePixelDCS(): - print '* use Pixel DCS' + print('* use Pixel DCS') if self.useSctDCS(): if not self.useHVForSctDCS(): - print '* use SCT DCS' + print('* use SCT DCS') else: - print '* use non-standard SCT DCS based on ~20V HV cut' + print('* use non-standard SCT DCS based on ~20V HV cut') if self.useTrtDCS(): - print '* use TRT DCS' + print('* use TRT DCS') if self.useDynamicAlignFolders(): - print '* use of Dynamic alignment folder scheme enabled' + print('* use of Dynamic alignment folder scheme enabled') if not self.doPRDFormation(): - print '* PRD Formation is off for all technologies' + print('* PRD Formation is off for all technologies') if not self.doPixelPRDFormation(): - print '* Pixel PRD Formation is off' + print('* Pixel PRD Formation is off') if not self.doSCT_PRDFormation(): - print '* SCT PRD Formation is off' + print('* SCT PRD Formation is off') if not self.doTRT_PRDFormation(): - print '* TRT PRD Formation is off' + print('* TRT PRD Formation is off') # ----------------------------------------- - print '*' - print '* Configurable Services loaded:' - print '* =============================' - print '*' + print('*') + print('* Configurable Services loaded:') + print('* =============================') + print('*') if self.loadTrackingGeometry() : - print '* load tracking geometry for Inner Detector' + print('* load tracking geometry for Inner Detector') if self.useBeamConstraint() : - print '* use Beam Spot Constraint in reconstruction/vertexing' + print('* use Beam Spot Constraint in reconstruction/vertexing') # ----------------------------------------- - print '*' - print '* Configurable Tools loaded:' - print '* ==========================' - print '*' + print('*') + print('* Configurable Tools loaded:') + print('* ==========================') + print('*') if self.loadRotCreator() : - print '* load ROT_Creator for Inner Detector' + print('* load ROT_Creator for Inner Detector') if self.useBroadClusterErrors(): - print '* - (commissioning) use broad cluster errors !' + print('* - (commissioning) use broad cluster errors !') if self.loadTrackingGeometry(): - print '* load TrackingGeometry' + print('* load TrackingGeometry') if self.loadExtrapolator() : - print '* load Extrapolator:' + print('* load Extrapolator:') if self.propagatorType() is 'RungeKutta' : - print '* - load Runge Kutta propagator' + print('* - load Runge Kutta propagator') elif self.propagatorType() is 'STEP' : - print '* - load STEP propagator' + print('* - load STEP propagator') if self.materialInteractions() : - print '* - use material corrections of type %s in extrapolation and fit'% self.materialInteractionsType() + print('* - use material corrections of type %s in extrapolation and fit'% self.materialInteractionsType()) if self.loadUpdator() : if self.kalmanUpdator() is "fast" : - print '* load MeasurementUpdator_xk' + print('* load MeasurementUpdator_xk') else: - print '* load MeasurementUpdator' + print('* load MeasurementUpdator') if self.loadFitter() : - print '* load track fitter of type ', self.trackFitterType() + print('* load track fitter of type ', self.trackFitterType()) if self.refitROT() : - print '* - refit from ROT' + print('* - refit from ROT') else: - print '* - refit from PRD, redo the ROTs' + print('* - refit from PRD, redo the ROTs') if self.loadAssoTool() : - print '* load PRD_AssociationToolGangedPixels' + print('* load PRD_AssociationToolGangedPixels') if self.loadSummaryTool() : - print '* load TrackSummaryTool' + print('* load TrackSummaryTool') if self.doHolesOnTrack() : - print '* - and do holes on track search' - print '*' - print '************************************************************************************' + print('* - and do holes on track search') + print('*') + print('************************************************************************************') # ---------------------------------------------------------------------------- # --- set methods for less often used switches @@ -2599,8 +2599,8 @@ class InDetJobProperties(JobPropertyContainer): def usePrimVertexZcoordinate ( self, usezvertex ) : self.useZvertexTool = usezvertex if not self.doNewTracking() : - print 'ConfiguredInDetFlags.py WARNING toggling the z-vertex constraint has no effect' - print ' because the new tracking IS NOT SWITCHED ON!' + print('ConfiguredInDetFlags.py WARNING toggling the z-vertex constraint has no effect') + print(' because the new tracking IS NOT SWITCHED ON!') # ---------------------------------------------------------------------------- # --- set different vertexing options diff --git a/InnerDetector/InDetExample/InDetRecExample/python/InDetKeys.py b/InnerDetector/InDetExample/InDetRecExample/python/InDetKeys.py index 7db5ad617e679b4dbb005e0c73c21a11189035eb..f5883a0b0ecaefbe3995172761a639582d07232c 100644 --- a/InnerDetector/InDetExample/InDetRecExample/python/InDetKeys.py +++ b/InnerDetector/InDetExample/InDetRecExample/python/InDetKeys.py @@ -1071,10 +1071,10 @@ class InDetContainerKeys(JobPropertyContainer): def lockAllExceptAlias(self): # Lock everything except AliasToTracks (do it this way to avoid a warning when unlocking AliasToTracks) - print "InDetKeys: Locking all keys except aliases" + print("InDetKeys: Locking all keys except aliases") # InDetKeys.lock_JobProperties() # InDetKeys.AliasToTracks.unlock() - [k.lock() for k in InDetKeys.__dict__.values() if hasattr(k,'is_locked') and not isinstance(k,type(InDetKeys.AliasToTracks))] + [k.lock() for k in list(InDetKeys.__dict__.values()) if hasattr(k,'is_locked') and not isinstance(k,type(InDetKeys.AliasToTracks))] return pass diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetHivePreExec.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetHivePreExec.py deleted file mode 100644 index fcc34dd7472e0c88893e5f734f123edfb9f51764..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetHivePreExec.py +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -# - -#Early failure warning -from AthenaCommon.AlgScheduler import AlgScheduler -AlgScheduler.CheckDependencies( True ) - -## get a handle on the ServiceManager -from AthenaCommon.AppMgr import ServiceMgr as svcMgr -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() -from SGComps.SGCompsConf import SGInputLoader -topSequence += SGInputLoader( OutputLevel=INFO, ShowEventDump=False ) -topSequence.SGInputLoader.Load = [ ('PixelRDO_Container','PixelRDOs'), - ('TRT_RDO_Container','TRT_RDOs'), - ('SCT_RDO_Container','SCT_RDOs'), - #('CaloClusterROI_Collection','InDetHadCaloClusterROIs'), - #('CaloClusterROI_Collection','InDetCaloClusterROIs'), - #('Trk::SegmentCollection','TRTSegments'), - ] - -# -#from InDetRecExample.InDetJobProperties import InDetFlags -#InDetFlags.doTRTPhaseCalculation = False -#InDetFlags.doTruth = False diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecCabling.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecCabling.py index dbac27f58476ba6c9ee883b1c265666a68735527..33311271b6a2bfc6bc66e70efcec3a1b809bc654 100755 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecCabling.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecCabling.py @@ -17,7 +17,7 @@ if DetFlags.detdescr.pixel_on() and not 'PixelCabling' in dir(): PixelCablingSvc = getService("PixelCablingSvc") ServiceMgr += PixelCablingSvc if (InDetFlags.doPrintConfigurables()): - print PixelCablingSvc + print(PixelCablingSvc) # # --- SCT cabling @@ -30,7 +30,7 @@ if DetFlags.detdescr.SCT_on(): SCT_CablingCondAlgFromCoraCool = getAlgorithm("SCT_CablingCondAlgFromCoraCool") condSeq += SCT_CablingCondAlgFromCoraCool if (InDetFlags.doPrintConfigurables()): - print SCT_CablingCondAlgFromCoraCool + print(SCT_CablingCondAlgFromCoraCool) # # --- TRT cabling @@ -44,12 +44,12 @@ if DetFlags.detdescr.TRT_on() and not 'TRT_Cabling' in dir(): TRT_Cabling.RealData=True ToolSvc += TRT_Cabling if (InDetFlags.doPrintConfigurables()): - print TRT_Cabling + print(TRT_Cabling) from TRT_Cabling.TRT_CablingConf import TRT_CablingSvc TRT_CablingSvc = TRT_CablingSvc() ServiceMgr += TRT_CablingSvc if (InDetFlags.doPrintConfigurables()): - print TRT_CablingSvc + print(TRT_CablingSvc) diff --git a/LArCalorimeter/LArDetDescr/share/LArDetDescr_joboptions.py b/LArCalorimeter/LArDetDescr/share/LArDetDescr_joboptions.py index cf9278429ccae67d20d673a5c7101187ae482ada..ba5f4ac1411b305dfd47b4acc6a5daf8c7bd5ec1 100755 --- a/LArCalorimeter/LArDetDescr/share/LArDetDescr_joboptions.py +++ b/LArCalorimeter/LArDetDescr/share/LArDetDescr_joboptions.py @@ -1,4 +1,4 @@ -print "now initializing the LAr readout geometry : standard Atlas flavour" +print("now initializing the LAr readout geometry : standard Atlas flavour") # ------------------------------------------------ # FIXME : setup online identifier & mapping @@ -17,7 +17,7 @@ if not rec.doAODMerging(): include( "LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py" ) include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) else : - raise RunTimeError, " from LArDetDescr_joboptions.py: DataSource not supported" + raise (RunTimeError, " from LArDetDescr_joboptions.py: DataSource not supported") # must be included once only : include.block ("LArDetDescr/LArDetDescr_joboptions.py") diff --git a/LArCalorimeter/LArExample/LArConditionsCommon/share/LArConditionsCommon_comm_jobOptions.py b/LArCalorimeter/LArExample/LArConditionsCommon/share/LArConditionsCommon_comm_jobOptions.py index 6ba06e7718ea67c3bc5c12695285432ee08aaa59..8927c367db4e7b6fa40e124d57f72e7e27bd15f2 100755 --- a/LArCalorimeter/LArExample/LArConditionsCommon/share/LArConditionsCommon_comm_jobOptions.py +++ b/LArCalorimeter/LArExample/LArConditionsCommon/share/LArConditionsCommon_comm_jobOptions.py @@ -22,7 +22,7 @@ if rec.projectName().startswith("data09") : larCondFlags.OFCShapeFolder="5samples3bins17phases" if svcMgr.MessageSvc.OutputLevel <= DEBUG : - print larCondFlags + print(larCondFlags) if larCondFlags.LArElecCalibSqlite.statusOn and larCondFlags.LArElecCalibSqlite()!="": @@ -201,7 +201,7 @@ if larCondFlags.LoadElecCalib(): pass pass else: - print "In SuperCell case... so far will not initialise folders." + print("In SuperCell case... so far will not initialise folders.") else: #Run 1 case, no COOL-inline electronic calibration if not SuperCells: @@ -279,13 +279,13 @@ if larCondFlags.LoadElecCalib(): pass pass else: - print "In SuperCell case... so far will not initialise folders." + print("In SuperCell case... so far will not initialise folders.") pass #special case for overlay jobs: We need LArfSampl if DetFlags.overlay.LAr_on() and larCondFlags.LArfSamplTag()!="": - print "Tag=%s" % larCondFlags.LArfSamplTag() + print("Tag=%s" % larCondFlags.LArfSamplTag()) conddb.addFolderWithTag("LAR_OFL","/LAR/ElecCalibMC/fSampl",larCondFlags.LArfSamplTag(),force=True,forceMC=True,className="LArfSamplMC") from LArRecUtils.LArRecUtilsConf import LArSymConditionsAlg_LArfSamplMC_LArfSamplSym_ as LArfSamplSymAlg from LArRecUtils.LArMCSymCondAlg import LArMCSymCondAlgDefault diff --git a/MuonSpectrometer/MuonCablings/MuonRPC_Cabling/python/MuonRPC_CablingConfig.py b/MuonSpectrometer/MuonCablings/MuonRPC_Cabling/python/MuonRPC_CablingConfig.py index 7342c16de671c951c380cc27be6ba88f7648aaf9..7eace2e69c76005751251ea10ea894a750203b3d 100755 --- a/MuonSpectrometer/MuonCablings/MuonRPC_Cabling/python/MuonRPC_CablingConfig.py +++ b/MuonSpectrometer/MuonCablings/MuonRPC_Cabling/python/MuonRPC_CablingConfig.py @@ -14,11 +14,11 @@ class MuonRPC_CablingConfig (MuonRPC_CablingSvc): def setDefaults(cls,handle): if hasattr(handle,'ConfFileName'): if handle.ConfFileName!="LVL1confAtlas.data": - print "RPCcablingSvc uses a non standard configuration: ", handle.ConfFileName + print("RPCcablingSvc uses a non standard configuration: ", handle.ConfFileName) if hasattr(handle,'CorrFileName'): if handle.CorrFileName!="LVL1confAtlas.corr": - print "RPCcablingSvc uses a non standard correction set: ", handle.CorrFileName + print("RPCcablingSvc uses a non standard correction set: ", handle.CorrFileName) MuonRPC_CablingSvc = MuonRPC_CablingConfig() diff --git a/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCablingConfig.py b/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCablingConfig.py index c4ec7d91b08aac3c0a36a62ac9b01e5447f12d97..8bff1d85ffe8023ce3752ecaa9131833c120c648 100644 --- a/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCablingConfig.py +++ b/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCablingConfig.py @@ -9,7 +9,7 @@ from MuonByteStream.MuonByteStreamFlags import muonByteStreamFlags from AthenaCommon.AppMgr import theApp,ToolSvc,ServiceMgr from AthenaCommon.DetFlags import DetFlags from RecExConfig.RecFlags import rec as recFlags -from MuonCnvFlags import muonCnvFlags +from MuonCnvExample.MuonCnvFlags import muonCnvFlags from AthenaCommon.AlgSequence import AthSequencer from MuonMDT_Cabling.MuonMDT_CablingConf import MuonMDT_CablingAlg diff --git a/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCalibConfig.py b/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCalibConfig.py index 4192531a946de1c8f494b977811eb5daed75a6c6..ff616dd444b224b0bc0cdeb59467e3987a9b03b9 100644 --- a/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCalibConfig.py +++ b/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCalibConfig.py @@ -16,7 +16,7 @@ from AthenaCommon import CfgMgr #-------------------------------------------------------------- from MuonCnvExample.MuonCnvUtils import specialAddFolderSplitOnline,mdtCalibWindowNumber -from MuonCalibFlags import mdtCalibFlags,cscCalibFlags +from MuonCnvExample.MuonCalibFlags import mdtCalibFlags,cscCalibFlags mdtCalibFlags.setDefaults() cscCalibFlags.setDefaults() diff --git a/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCnvFlags.py b/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCnvFlags.py index 5fd06d0df37919353c97ad0a90fa56234c33691a..9e9611f98c7dedc828f94936a24f0584210beed3 100644 --- a/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCnvFlags.py +++ b/MuonSpectrometer/MuonCnv/MuonCnvExample/python/MuonCnvFlags.py @@ -12,7 +12,7 @@ from RecExConfig.RecFlags import rec as recFlags import re logMuon = logging.getLogger(__name__) -from MuonCnvUtils import setJobPropertyDefault +from MuonCnvExample.MuonCnvUtils import setJobPropertyDefault def setDefault(prop,value): return setJobPropertyDefault(prop,value,logMuon) diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/python/CscCondDB.py b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/python/CscCondDB.py index 920c01ac6fb3bce011c606c133f4927daaa8d4f9..47e7dee02e4e8fdd89b25489e5cc86e3dec721ca 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/python/CscCondDB.py +++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/python/CscCondDB.py @@ -5,7 +5,7 @@ #most of what is below is just a convenience, and more specific folder setups can #be done by interfacing directly with conddb in the user's joboptions. -import CscCoolFolders +from MuonCondSvc import CscCoolFolders class CscCondDB: "Class to hold configuration information for cscCondDbSvc" diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/python/CscCoolFolders.py b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/python/CscCoolFolders.py index 90131b2db612453b6c29d6ffa5177fbb8262c534..d199d14d4b3fbf0f12f5e99669fb79ee68173127 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/python/CscCoolFolders.py +++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondSvc/python/CscCoolFolders.py @@ -54,8 +54,8 @@ def folderList(folderKeys, getOnline = False): folders = [] for folderKey in folderKeys: if not (folderKey in dict): - print "WARNING folder key " + folderKey + " not recognized! All keys and folder pairs are: " - print dict + print("WARNING folder key " + folderKey + " not recognized! All keys and folder pairs are: ") + print(dict) else: if(getOnline): folders += ['/CSC/ONL/'+ dict[folderKey]] diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonReadCalib.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonReadCalib.py index b3bfd3888edc7bea02e31e84c669822da3969e10..fe79af5b5315eddd9f74ddf378649a41da08398e 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonReadCalib.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonReadCalib.py @@ -7,7 +7,7 @@ from AthenaCommon.Logging import logging logging.getLogger().info("Importing %s", __name__) from AthenaCommon.CfgGetter import getPublicTool,getService,getPrivateTool,getAlgorithm -from MuonRecFlags import muonRecFlags +from MuonRecExample.MuonRecFlags import muonRecFlags muonRecFlags.setDefaults() if muonRecFlags.doCSCs(): diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py index e73e942cba7c8d9a240f4da0d45742a75b365e38..7edcbe0de1c2aa9984b6a15b7878878eadb3aeb3 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py @@ -13,12 +13,12 @@ from AthenaCommon.BeamFlags import jobproperties beamFlags = jobproperties.Beam from MuonCnvExample.MuonCnvUtils import mdtCalibWindowNumber -from MuonRecUtils import logMuon,ConfiguredBase,uglyHackedInclude,ExtraFlags +from MuonRecExample.MuonRecUtils import logMuon,ConfiguredBase,uglyHackedInclude,ExtraFlags -from MuonRecFlags import muonRecFlags +from MuonRecExample.MuonRecFlags import muonRecFlags muonRecFlags.setDefaults() -from MuonStandaloneFlags import muonStandaloneFlags +from MuonRecExample.MuonStandaloneFlags import muonStandaloneFlags muonStandaloneFlags.setDefaults() from MuonCnvExample.MuonCalibFlags import mdtCalibFlags diff --git a/Reconstruction/RecExample/RecExConfig/CMakeLists.txt b/Reconstruction/RecExample/RecExConfig/CMakeLists.txt index 5a411cc2f7336a84d67f431d8b0d1b1cc00c03dc..21c0870e74269b137e5e047c351a34597a977ba9 100644 --- a/Reconstruction/RecExample/RecExConfig/CMakeLists.txt +++ b/Reconstruction/RecExample/RecExConfig/CMakeLists.txt @@ -10,3 +10,6 @@ atlas_install_python_modules( python/*.py ) atlas_install_joboptions( share/*.py share/tests/*.py ) atlas_install_scripts( share/RecExConfig_links.sh ) +atlas_add_test( testObjKeyStore SCRIPT python -m RecExConfig.testObjKeyStore + POST_EXEC_SCRIPT nopost.sh ) + diff --git a/Reconstruction/RecExample/RecExConfig/python/AutoConfiguration.py b/Reconstruction/RecExample/RecExConfig/python/AutoConfiguration.py index 727f264afab767d2757b2ed8a83392d46a9525f8..c9adcf5faf4dbed3907d71b65ac87ad4785caa8c 100644 --- a/Reconstruction/RecExample/RecExConfig/python/AutoConfiguration.py +++ b/Reconstruction/RecExample/RecExConfig/python/AutoConfiguration.py @@ -328,7 +328,7 @@ def GetProjectName(): project=rec.projectName() if not project in KnownProjects: logAutoConfiguration.warning("Project '%s' is not part of the KnownProjects list."%project) - #print KnownProjects + #print(KnownProjects) return project @@ -589,18 +589,18 @@ def GetDefaultTagRefStream(streams): elif 'StreamRAW_ref' in streams: return 'StreamRAW_ref' else: - raise RuntimeError," readRDO locked True and no Stream1 nor StreamRDO nor StreamRAW !" + raise RuntimeError(" readRDO locked True and no Stream1 nor StreamRDO nor StreamRAW !") if rec.readESD.is_locked() and rec.readESD(): if 'StreamESD_ref' in streams: return 'StreamESD_ref' else: - raise RuntimeError," readESD locked True and no StreamESD !" + raise RuntimeError(" readESD locked True and no StreamESD !") if rec.readAOD.is_locked() and rec.readAOD(): if 'StreamAOD_ref' in streams: return 'StreamAOD_ref' else: - raise RuntimeError," readAOD locked True and no StreamAOD !" + raise RuntimeError(" readAOD locked True and no StreamAOD !") # now deal with default case @@ -615,7 +615,7 @@ def GetDefaultTagRefStream(streams): elif 'StreamRAW_ref' in streams: return 'StreamRAW_ref' else: - raise RuntimeError, " no known streams !" + raise RuntimeError(" no known streams !") return None @@ -856,7 +856,7 @@ def IsInInputFile(collectionname,key=None): ItemDic = convert_itemList(layout='dict') if ItemDic.has_key(collectionname): logAutoConfiguration.info("found collection with name %s in input file." % collectionname) - print ItemDic[collectionname] + print(ItemDic[collectionname]) if key is None: logAutoConfiguration.info("no explicit storegate key given. Returning True") return True diff --git a/Reconstruction/RecExample/RecExConfig/python/GetCool.py b/Reconstruction/RecExample/RecExConfig/python/GetCool.py index c98788eb5539da19ec2b0b7a9400ca292077bf73..99648ee0d6864fa5afdb5b9c50c8789cdf2e5a3a 100644 --- a/Reconstruction/RecExample/RecExConfig/python/GetCool.py +++ b/Reconstruction/RecExample/RecExConfig/python/GetCool.py @@ -23,7 +23,7 @@ def _setup(): from CoolConvUtilities.MagFieldUtils import getFieldForRun if lb==None: - print rn + logGetCool.info(rn) cool=getFieldForRun(rn) else: # MagFieldDCSInfo diff --git a/Reconstruction/RecExample/RecExConfig/python/InputFilePeeker.py b/Reconstruction/RecExample/RecExConfig/python/InputFilePeeker.py index b0bd8f40ee4794e531e8a7969ef925046b6bb1bb..7cebe4ca092d31feabcfa503c13b63d124a4ffe4 100644 --- a/Reconstruction/RecExample/RecExConfig/python/InputFilePeeker.py +++ b/Reconstruction/RecExample/RecExConfig/python/InputFilePeeker.py @@ -50,7 +50,7 @@ def _setup(): try: fi = athFile.fopen(inFile) inputFileSummary = fi.fileinfos - except Exception,err: + except Exception as err: msg.warning("Unable to open file [%s]"%inFile) msg.warning('caught:\n%s',err) import traceback @@ -65,9 +65,8 @@ def _setup(): #First try to catch the no entries case if inputFileSummary['stream_names'] == []: try: - #print fi.infos['metadata_items'][0][1] inputFileSummary['stream_names'] = [fi.infos['metadata_items'][0][1]] - except Exception, err: + except Exception as err: msg.info("Unable to find stream names in file metadata.") #If stream_names still not found, check for bytestream case or give default value @@ -133,7 +132,7 @@ def _setup(): # default PoolFileCatalog would be removed catalog_name += list(svcMgr.PoolSvc.ReadCatalog[:]) pass - except Exception, err: + except Exception as err: msg.info( 'problem getting ReadCatalog value from svcMgr.PoolSvc:\n%s', err) @@ -166,7 +165,7 @@ def _setup(): newInFile=None if newInFile is None: - raise RuntimeError,"unable to redirect tag to any file. Autoconfiguration fails" + raise(RuntimeError,"unable to redirect tag to any file. Autoconfiguration fails") else: inputFileSummary = fi.fileinfos # store information in inputFileSummary diff --git a/Reconstruction/RecExample/RecExConfig/python/ObjKeyStore.py b/Reconstruction/RecExample/RecExConfig/python/ObjKeyStore.py index 1679fa78cdcd87115de15e2cef587609e0d347a6..05a3623e2edacdfcff5c88cdfed9ada62e59b27e 100755 --- a/Reconstruction/RecExample/RecExConfig/python/ObjKeyStore.py +++ b/Reconstruction/RecExample/RecExConfig/python/ObjKeyStore.py @@ -97,7 +97,7 @@ class _ObjKeyStore( object ): def Print(self): - print self._store + print(self._store) def __repr__(self): return "%r" % self._store diff --git a/Reconstruction/RecExample/RecExConfig/python/Resilience.py b/Reconstruction/RecExample/RecExConfig/python/Resilience.py deleted file mode 100644 index ee931ff9e6d5291906b090e4e00633c995513fdf..0000000000000000000000000000000000000000 --- a/Reconstruction/RecExample/RecExConfig/python/Resilience.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -print "WARNING RecExConfig.Resilience obsolete. Please use AthenaCommon.Resilience !" -# usage treatException(" problem with bla ") -# catch exception if recConfFlags.AllowIgnoreConfigError otherwise rethrow -# from RecExConfig.Resilience import treatException -# try: -# something=wrong -# except Exception: -# print "doSomethingIntelligent about this exception" -# treatException(" failed to something=wrong. Did something intelligent about it") - -def treatException (desc): - from RecExConfig.RecConfFlags import recConfFlags - if recConfFlags.AllowIgnoreConfigError(): - import traceback - print traceback.format_exc() - print "ERROR: "+desc - return None - else: - raise - -# do comand with optional catch of exception -# usage protect ("Could not load MakeAODCellsFromCluster!", include, "CaloRec/MakeAODCellsFromCluster_jobOptions.py") -# be careful that this will not catch exception if an argument is invalid -def protect (desc, fn, *args, **kw): - try: - return fn (*args, **kw) - except Exception: - treatException(desc) - return None - - - -# protectedInclude ("Could not load MakeAODCellsFromCluster!", "CaloRec/MakeAODCellsFromCluster_jobOptions.py") -# exception is caught optionally -def protectedInclude (jo): - from AthenaCommon.Include import include - return protect ("Could not load " + jo, include, jo) - - - - diff --git a/Reconstruction/RecExample/RecExConfig/python/testObjKeyStore.py b/Reconstruction/RecExample/RecExConfig/python/testObjKeyStore.py index f08073a4e4e09a1a4a01837f5446938370bae4f0..79edbddf52ea380f49d0905c4086044538d4496c 100755 --- a/Reconstruction/RecExample/RecExConfig/python/testObjKeyStore.py +++ b/Reconstruction/RecExample/RecExConfig/python/testObjKeyStore.py @@ -1,21 +1,20 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -import user from RecExConfig.ObjKeyStore import ObjKeyStore, objKeyStore # simple dictionary test thed= { "JetCollection" : [ "Cone7Jets","another"], "TrucCluster" : "blah" , "RunOut" : "OfIdeas" } -print "thed:",thed +print("thed:",thed) bla=thed["JetCollection"] -print bla +print(bla) anotherd= { "JetCollection" : [ "Cone7Jets" ,"yetanother"], "autruche" : "runFast" } -print "anotherd:",anotherd +print("anotherd:",anotherd) for k in anotherd.keys(): - if thed.has_key(k): + if k in thed: for v in anotherd[k]: if not v in thed[k]: thed[k]+=[v] pass @@ -25,10 +24,10 @@ for k in anotherd.keys(): pass pass -print "thed merged with anotherd:",thed -print thed +print("thed merged with anotherd:",thed) +print(thed) -print ":"*80 +print(":"*80) ## testing singleton-ness m = ObjKeyStore() @@ -38,50 +37,50 @@ assert m is b assert m is ObjKeyStore() assert m is objKeyStore -print "empty" -print ":"*80 +print("empty") +print(":"*80) m.Print() -print "now use addStreamESD" -print ":"*80 +print("now use addStreamESD") +print(":"*80) m.addStreamESD( 'McEventCollection', [ 'GEN_EVENT', 'GEN_AOD', 'TruthEvent' ] ) m.addStreamESD( 'JetCollection', [ 'Cone4Jets', 'Cone7Jets', 'KtJets', 'Cone4TruthJets' ] ) -print "."*80 +print("."*80) m.Print() -print "now merge in: addMany takes a dictionary as argument" +print("now merge in: addMany takes a dictionary as argument") m.addManyTypesStreamESD(thed) -print "."*80 +print("."*80) m.Print() -print "now merge in: addMany with a dictionary generated on the fly" +print("now merge in: addMany with a dictionary generated on the fly") m.addManyTypesStreamAOD({'JetCollection' : [ 'Cone4Jets', 'Paraboloid' ] ,'Cacatoes': 'Yellow'}) -print "."*80 +print("."*80) m.Print() -print "."*80 +print("."*80) hasT = m.isInStreamESD('t','*') hasMc= m.isInStreamESD('McEventCollection','*') -print "t:", hasT -print "Mc:",hasMc +print("t:", hasT) +print("Mc:",hasMc) assert( not hasT ) assert( hasMc ) -###print m.isInInput('McEventCollection') +###print(m.isInInput('McEventCollection')) -print "MCGEN_EVENT:",m.isInStreamESD('McEventCollection','GEN_EVENT') -print "MCGEN_TRUC:",m.isInStreamESD('McEventCollection','GEN_TRUC') +print("MCGEN_EVENT:",m.isInStreamESD('McEventCollection','GEN_EVENT')) +print("MCGEN_TRUC:",m.isInStreamESD('McEventCollection','GEN_TRUC')) -print "."*80 +print("."*80) m.addStreamAOD( 'ParticleJetContainer', 'ConeTowerParticleJets' ) m.Print() -print "."*80 +print("."*80) -print "### writing ESD stream..." +print("### writing ESD stream...") m.writeStreamESD('esd.cfg.py') # first, create the file @@ -98,14 +97,14 @@ def _fill( item ): aodFile.close() del aodFile -print "###DRDR reading AOD stream..." +print("###DRDR reading AOD stream...") m.readStreamESD('aod.cfg.py') -print "."*80 +print("."*80) m.addDetector( 'A-metaux', [ 'CornoFulgur', 'AsteroHache', 'FulgurAuPoing' ] ) -print "."*80 -print objKeyStore -print "."*80 +print("."*80) +print(objKeyStore) +print("."*80) import os if not os.path.exists("myrun"): os.mkdir( "myrun" ) @@ -127,28 +126,28 @@ assert( objKeyStore.isInStreamAOD('TruthParticleContainer','SpclMC') ) caught = False try: objKeyStore['unallowedKey'] = range(10) -except KeyError, err: +except KeyError as err: caught = True - print "Caught: %s" % str(err) - print "OK" + print("Caught: %s" % str(err)) + print("OK") assert(caught) caught = False try: - print objKeyStore['unallowedKey'] -except KeyError, err: + print(objKeyStore['unallowedKey']) +except KeyError as err: caught = True - print "Caught: %s" % str(err) - print "OK" + print("Caught: %s" % str(err)) + print("OK") assert(caught) caught = False try: - print "StreamAOD content:",objKeyStore['streamAOD'] -except KeyError, err: + print("StreamAOD content:",objKeyStore['streamAOD']) +except KeyError as err: caught = True - print "Caught: %s" % str(err) - print "ARGH!!" + print("Caught: %s" % str(err)) + print("ARGH!!") assert(not caught) ## reset StreamTAG: @@ -156,28 +155,28 @@ objKeyStore['streamTAG'] = {} assert( not objKeyStore.isInStreamTAG( "JetCollection", "Tag_Cone4Jets" ) ) assert( not objKeyStore.isInStreamTAG( "McEventCollection", "*" ) ) -print "## testing the include of a 'config' file of objKeyStore..." +print("## testing the include of a 'config' file of objKeyStore...") objKeyStore.readStreamTAG("RecExConfig/test_tag_from_share.py") assert( objKeyStore.isInStreamTAG( "JetCollection", "Tag_Cone4Jets" ) ) assert( not objKeyStore.isInStreamTAG( "McEventCollection", "*" ) ) -print "## testing the include of a 'config' file of objKeyStore... [OK]" +print("## testing the include of a 'config' file of objKeyStore... [OK]") -print "" -print "#"*80 -print "## testing 'baseline' RecExCommon..." -print "#"*80 +print("") +print("#"*80) +print("## testing 'baseline' RecExCommon...") +print("#"*80) def objReset(): from RecExConfig.ObjKeyStore import objKeyStore objKeyStore.clear() -print "## loading 'test_rdo'..." +print("## loading 'test_rdo'...") objReset() objKeyStore.readInputFile("RecExConfig/test_rdo.py") assert( objKeyStore.isInInputFile('LArRawChannelContainer', 'LArRawChannels') ) -print "## loading 'test_rdo'... [OK]" +print("## loading 'test_rdo'... [OK]") -print "## loading 'test_esd'..." +print("## loading 'test_esd'...") objReset() objKeyStore.readInputBackNav("RecExConfig/test_rdo.py") objKeyStore.readInputFile ("RecExConfig/test_esd.py") @@ -186,9 +185,9 @@ assert( not objKeyStore.isInInputFile('LArRawChannelContainer', assert( objKeyStore.isInInputFile('CaloCellContainer', 'AllCalo' ) ) assert( objKeyStore.isInInputBackNav('LArRawChannelContainer', 'LArRawChannels') ) -print "## loading 'test_esd'... [OK]" +print("## loading 'test_esd'... [OK]") -print "## loading 'test_aod'..." +print("## loading 'test_aod'...") objReset() objKeyStore.readInputBackNav("RecExConfig/test_rdo.py") objKeyStore.readInputBackNav("RecExConfig/test_esd.py") @@ -200,13 +199,13 @@ assert( objKeyStore.isInInputBackNav('LArRawChannelContainer', 'LArRawChannels') ) assert( objKeyStore.isInInputBackNav('CaloCellContainer', 'AllCalo' ) ) assert( objKeyStore.isInInputFile('CaloCellContainer', 'AODCellContainer' ) ) -print "## loading 'test_aod'... [OK]" -print "##" -print "## testing 'baseline' RecExCommon... [OK]" -print "#"*80 -print objKeyStore +print("## loading 'test_aod'... [OK]") +print("##") +print("## testing 'baseline' RecExCommon... [OK]") +print("#"*80) +print(objKeyStore) ## import sys ## modules = sys.modules.keys() ## modules.sort() -## print "modules:",modules +## print("modules:",modules) diff --git a/Reconstruction/RecExample/RecExConfig/python/testResilience.py b/Reconstruction/RecExample/RecExConfig/python/testResilience.py deleted file mode 100755 index 1bdb64662066ec7720a70eb4513b47e1333a3ebf..0000000000000000000000000000000000000000 --- a/Reconstruction/RecExample/RecExConfig/python/testResilience.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -# testing exception handline -# to use it : -# athena -i testResilience.py -from RecExConfig.RecConfFlags import recConfFlags -# if true catch exception and proceed -# if false rethrow exception and stop - - -for flag in [ True , False ]: - recConfFlags.AllowIgnoreConfigError=flag - - print "*"*80 - # if all that is needed is to protect an include - from RecExConfig.Resilience import protectedInclude - protectedInclude ("truc/pouet.py") - - print "*"*80 - - - # if more than an include or if want to do sthg special in case of an exception - from RecExConfig.Resilience import treatException - try: - something=wrong - except Exception: - print "doSomethingIntelligent about this exception" - treatException(" failed to something=wrong. Did something intelligent about it") - - - - print "*"*80 - - -stop diff --git a/Reconstruction/RecExample/RecExConfig/share/testResilience.py b/Reconstruction/RecExample/RecExConfig/share/testResilience.py deleted file mode 100755 index 98a9aab18f23f9575c269df6620fbcce285f920f..0000000000000000000000000000000000000000 --- a/Reconstruction/RecExample/RecExConfig/share/testResilience.py +++ /dev/null @@ -1,31 +0,0 @@ -# testing exception handline - -from RecExConfig.RecConfFlags import recConfFlags -# if true catch exception and proceed -# if false rethrow exception and stop -recConfFlags.AllowIgnoreConfigError=True - - -# if all that is needed is to protect an include -from RecExConfig.Resilience import protected_include -protected_include ("truc/pouet.py") - -from RecExConfig.Resilience import protected_import -protected_import (Truc,Pouet) - - -# if more than an include or if want to do sthg special in case of an exception -from RecExConfig.Resilience import signal_exception -try: - include ("truc/pouet.py") - pass -except Exception: - print "doSomethingIntelligent about this exception" - signal_exception(" failed to include truc/pouet.py. Did something intelligent about it") - - - - - - -stop diff --git a/TileCalorimeter/TileConditions/python/TileCondToolConf.py b/TileCalorimeter/TileConditions/python/TileCondToolConf.py index 606b65e5ace282b6adef6cbd9bde88146dbbe729..28a4819c7819a89636f1788281e93c26351af565 100644 --- a/TileCalorimeter/TileConditions/python/TileCondToolConf.py +++ b/TileCalorimeter/TileConditions/python/TileCondToolConf.py @@ -665,7 +665,7 @@ def getTileCondToolOfcCool(source = 'FILE', runType = 'PHY', ofcType = 'OF2', na if ofcType == 'OF1' and not (isUsedDataBaseRun2 or isMC): return None - from TileCoolMgr import GetTileOfcCoolSource, AddTileOfcCoolSource, tileCoolMgr + from TileConditions.TileCoolMgr import GetTileOfcCoolSource, AddTileOfcCoolSource, tileCoolMgr ofc = 'TileOfc' + ofcType.capitalize() ofcCondAlg = ofc + 'CondAlg' diff --git a/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py b/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py index ccf301562989bf75a36b9cccd83a913ed19140c5..53acd1b57ac9b8546835aaf02466bde79d9a9766 100644 --- a/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py +++ b/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py @@ -49,12 +49,12 @@ class _TileInfoConfigurator( TileInfoLoader ): @property #_______________________________________________________________ - def _msg(self): + def msg(self): """ Returns logging. """ #=== One can use loggers but not as a datamember of configurables as loggers' - #=== instances can't be pickled. Hence we use _msg as a property + #=== instances can't be pickled. Hence we use msg as a property #=== initialize logger with INFO level import AthenaCommon.Logging as L @@ -73,38 +73,38 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== prevent a second initialization if self._coolIsConfigured: - self._msg.info("setupCOOL already called previously, ignoring this repeated call!") + self.msg.info("setupCOOL already called previously, ignoring this repeated call!") return self._coolIsConfigured = True #=== connect all tools to COOL from AthenaCommon.AppMgr import ToolSvc - self._msg.info("Changing default TileBadChanTool configuration to COOL source") + self.msg.info("Changing default TileBadChanTool configuration to COOL source") from .TileCondToolConf import getTileBadChanTool ToolSvc += getTileBadChanTool('COOL') - self._msg.info("Changing default TileCondToolEmscale configuration to COOL source") + self.msg.info("Changing default TileCondToolEmscale configuration to COOL source") from .TileCondToolConf import getTileCondToolEmscale ToolSvc += getTileCondToolEmscale('COOL') - self._msg.info("Changing default TileCondToolNoiseSample configuration to COOL source") + self.msg.info("Changing default TileCondToolNoiseSample configuration to COOL source") from .TileCondToolConf import getTileCondToolNoiseSample ToolSvc += getTileCondToolNoiseSample('COOL') -# self._msg.info("Changing default TileCondToolNoiseAutoCr configuration to COOL source") +# self.msg.info("Changing default TileCondToolNoiseAutoCr configuration to COOL source") # from .TileCondToolConf import getTileCondToolAutoCr # ToolSvc += getTileCondToolAutoCr('COOL') - #self._msg.info("Changing default TileCondToolNoiseRawChn configuration to COOL source") + #self.msg.info("Changing default TileCondToolNoiseRawChn configuration to COOL source") #from .TileCondToolConf import getTileCondToolNoiseRawChn #ToolSvc += getTileCondToolNoiseRawChn('COOL') - self._msg.info("Changing default TileCondToolTiming configuration to COOL source") + self.msg.info("Changing default TileCondToolTiming configuration to COOL source") from .TileCondToolConf import getTileCondToolTiming ToolSvc += getTileCondToolTiming('COOL',type) - # self._msg.info("Changing default TileCondToolPulseShape configuration to COOL source") + # self.msg.info("Changing default TileCondToolPulseShape configuration to COOL source") # from .TileCondToolConf import getTileCondToolPulseShape # ToolSvc += getTileCondToolPulseShape('COOL') @@ -130,17 +130,17 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== prevent a second initialization if ofcType == 'OF2': if self._coolofcIsConfigured: - self._msg.info("setupCOOLOFC already called previously, ignoring this repeated call!") + self.msg.info("setupCOOLOFC already called previously, ignoring this repeated call!") return True self._coolofcIsConfigured = True elif ofcType == 'OF1': if self._coolof1ofcIsConfigured: - self._msg.info("setupCOOLOFC for OF1 already called previously, ignoring this repeated call!") + self.msg.info("setupCOOLOFC for OF1 already called previously, ignoring this repeated call!") return True self._coolof1ofcIsConfigured = True name = 'TileCondToolOfcCoolOF1' else: - self._msg.info("setupCOOLOFC: not known OFC type: %s! Nothing will be done!", ofcType) + self.msg.info("setupCOOLOFC: not known OFC type: %s! Nothing will be done!", ofcType) return False #=== connect TileCondToolOfcCool to COOL @@ -148,7 +148,7 @@ class _TileInfoConfigurator( TileInfoLoader ): from .TileCondToolConf import getTileCondToolOfcCool toolOfcCool = getTileCondToolOfcCool('COOL', type, ofcType, name ) if toolOfcCool is not None: - self._msg.info("Changing default TileCondToolOfcCool configuration to COOL source for %s", ofcType) + self.msg.info("Changing default TileCondToolOfcCool configuration to COOL source for %s", ofcType) ToolSvc += toolOfcCool return True elif ofcType == 'OF1': @@ -174,12 +174,12 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== prevent a second initialization if not online: if self._cooltimeIsConfigured: - self._msg.info("setupCOOLTIME already called previously, ignoring this repeated call!") + self.msg.info("setupCOOLTIME already called previously, ignoring this repeated call!") return self._cooltimeIsConfigured = True else: if self._coolonlinetimeIsConfigured: - self._msg.info("setupCOOLTIME for online already called previously, ignoring this repeated call!") + self.msg.info("setupCOOLTIME for online already called previously, ignoring this repeated call!") return self._coolonlinetimeIsConfigured = True name = 'TileCondToolOnlineTiming' @@ -187,7 +187,7 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== connect TileCondToolTiming to COOL from AthenaCommon.AppMgr import ToolSvc - self._msg.info("Changing default TileCondToolTiming configuration to COOL source") + self.msg.info("Changing default TileCondToolTiming configuration to COOL source") from .TileCondToolConf import getTileCondToolTiming ToolSvc += getTileCondToolTiming('COOL', type, online, name ) @@ -221,14 +221,14 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== prevent a second initialization if self._coolcispulseIsConfigured: - self._msg.info("setupCOOLCISPULSE already called previously, ignoring this repeated call!") + self.msg.info("setupCOOLCISPULSE already called previously, ignoring this repeated call!") return self._coolcispulseIsConfigured = True #=== connect all tools to COOL from AthenaCommon.AppMgr import ToolSvc - self._msg.info("Changing default TileCondToolPulseShape configuration to COOL source") + self.msg.info("Changing default TileCondToolPulseShape configuration to COOL source") from .TileCondToolConf import getTileCondToolPulseShape ToolSvc += getTileCondToolPulseShape('COOL','CISPULSE100','TileCondToolPulseShape') ToolSvc += getTileCondToolPulseShape('COOL','CISPULSE5P2','TileCondToolPulse5p2Shape') @@ -246,14 +246,14 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== prevent a second initialization if self._coollaspulseIsConfigured: - self._msg.info("setupCOOLLASPULSE already called previously, ignoring this repeated call!") + self.msg.info("setupCOOLLASPULSE already called previously, ignoring this repeated call!") return self._coollaspulseIsConfigured = True #=== connect TileCondToolOfcCool to COOL from AthenaCommon.AppMgr import ToolSvc - self._msg.info("Changing default TileCondToolPulseShape configuration to COOL source") + self.msg.info("Changing default TileCondToolPulseShape configuration to COOL source") from .TileCondToolConf import getTileCondToolPulseShape ToolSvc += getTileCondToolPulseShape('COOL','LAS','TileCondToolPulseShape') @@ -268,14 +268,14 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== prevent a second initialization if self._coolphypulseIsConfigured: - self._msg.info("setupCOOLPHYPULSE already called previously, ignoring this repeated call!") + self.msg.info("setupCOOLPHYPULSE already called previously, ignoring this repeated call!") return self._coolphypulseIsConfigured = True #=== connect TileCondToolOfcCool to COOL from AthenaCommon.AppMgr import ToolSvc - self._msg.info("Changing default TileCondToolPHYPULSECool configuration to COOL source") + self.msg.info("Changing default TileCondToolPHYPULSECool configuration to COOL source") from .TileCondToolConf import getTileCondToolPulseShape ToolSvc += getTileCondToolPulseShape('COOL') @@ -290,14 +290,14 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== prevent a second initialization if self._coolintegratorIsConfigured: - self._msg.info("setupCOOLINTEGRATOR already called previously, ignoring this repeated call!") + self.msg.info("setupCOOLINTEGRATOR already called previously, ignoring this repeated call!") return self._coolintegratorIsConfigured = True #=== connect TileCondToolIntegrator to COOL from AthenaCommon.AppMgr import ToolSvc - self._msg.info("Changing default TileCondToolIntegrator configuration to COOL source") + self.msg.info("Changing default TileCondToolIntegrator configuration to COOL source") from .TileCondToolConf import getTileCondToolIntegrator ToolSvc += getTileCondToolIntegrator('COOL','TileCondToolIntegrator') @@ -312,14 +312,14 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== prevent a second initialization if self._coolmuidIsConfigured: - self._msg.info("setupCOOLMUID already called previously, ignoring this repeated call!") + self.msg.info("setupCOOLMUID already called previously, ignoring this repeated call!") return self._coolmuidIsConfigured = True #=== connect TileCondToolMuID to COOL from AthenaCommon.AppMgr import ToolSvc - self._msg.info("Changing default TileCondToolMuID configuration to COOL source") + self.msg.info("Changing default TileCondToolMuID configuration to COOL source") from .TileCondToolConf import getTileCondToolMuID ToolSvc += getTileCondToolMuID('COOL','TileCondToolMuID') @@ -335,14 +335,14 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== prevent a second initialization if self._coolacrIsConfigured: - self._msg.info("setupCOOLAutoCr already called previously, ignoring this repeated call!") + self.msg.info("setupCOOLAutoCr already called previously, ignoring this repeated call!") return self._coolacrIsConfigured = True #=== connect TileCondToolMuID to COOL from AthenaCommon.AppMgr import ToolSvc - self._msg.info("Changing default TileCondToolNoiseAutoCr configuration to COOL source") + self.msg.info("Changing default TileCondToolNoiseAutoCr configuration to COOL source") from .TileCondToolConf import getTileCondToolAutoCr ToolSvc += getTileCondToolAutoCr('COOL','TileCondToolAutoCr') @@ -357,14 +357,14 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== prevent a second initialization if self._coolEmExpertIsConfigured: - self._msg.info("setupCOOLEMEXPERT already called previously, ignoring this repeated call!") + self.msg.info("setupCOOLEMEXPERT already called previously, ignoring this repeated call!") return self._coolEmExpertIsConfigured = True #=== connect TileExpertToolEmscale to COOL from AthenaCommon.AppMgr import ToolSvc - self._msg.info("Changing default TileExpertToolEmscale configuration to COOL source") + self.msg.info("Changing default TileExpertToolEmscale configuration to COOL source") from .TileCondToolConf import getTileExpertToolEmscale ToolSvc += getTileExpertToolEmscale('COOL') @@ -383,7 +383,7 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== prevent a second initialization if self._coolDCSIsConfigured: - self._msg.info("setupCOOLDCS already called previously, ignoring this repeated call!") + self.msg.info("setupCOOLDCS already called previously, ignoring this repeated call!") return self._coolDCSIsConfigured = True @@ -396,7 +396,7 @@ class _TileInfoConfigurator( TileInfoLoader ): dcs = 'TileDCS' dcsCondAlg = dcs + 'CondAlg' if TileUseDCS and not hasattr(condSequence, dcsCondAlg): - self._msg.info("setting up DCS TileCal conditions data") + self.msg.info("setting up DCS TileCal conditions data") dbConnStr = 'DCS_OFL' from IOVDbSvc.CondDB import conddb if useHV: @@ -425,7 +425,7 @@ class _TileInfoConfigurator( TileInfoLoader ): #=== prevent a second initialization if self._coolDspThresholdIsConfigured: - self._msg.info("setupCOOLDspThrehsold already called previously, ignoring this repeated call!") + self.msg.info("setupCOOLDspThrehsold already called previously, ignoring this repeated call!") return True #=== connect TileCondToolMuID to COOL @@ -433,7 +433,7 @@ class _TileInfoConfigurator( TileInfoLoader ): from .TileCondToolConf import getTileCondToolDspThreshold toolDspThreshold = getTileCondToolDspThreshold('COOL','TileCondToolDspThreshold') if toolDspThreshold is not None: - self._msg.info("Changing default TileCondToolDspThreshold configuration to COOL source") + self.msg.info("Changing default TileCondToolDspThreshold configuration to COOL source") ToolSvc += toolDspThreshold self._coolDspThresholdIsConfigured = True return True @@ -448,7 +448,7 @@ class _TileInfoConfigurator( TileInfoLoader ): Input parameters: - Nbits : Number of bits of an ADC (either 10 or 12) """ - self._msg.info("Setting {0}-bit Tile ADC".format(Nbits)) + self.msg.info("Setting {0}-bit Tile ADC".format(Nbits)) if Nbits == 10: self.ADCmax = 1023 self.ADCmaskValue = 2047 @@ -493,60 +493,60 @@ def TileInfoConfigurator(name="TileInfoLoader", **kwargs): #=== ensure the availability of TileCablingSvc if not hasattr(svcMgr, "TileCablingSvc"): - svc._msg.info("Adding TileCablingSvc to ServiceMgr") + svc.msg.info("Adding TileCablingSvc to ServiceMgr") svcMgr += CfgMgr.TileCablingSvc() #=== ensure the configuration of all needed tools # if not hasattr(ToolSvc, "TileBadChanTool"): -# svc._msg.info("Adding default TileBadChanTool to ToolSvc") +# svc.msg.info("Adding default TileBadChanTool to ToolSvc") # from .TileCondToolConf import getTileBadChanTool # ToolSvc += getTileBadChanTool() # if not hasattr(ToolSvc, "TileCondToolOfc"): -# svc._msg.info("Adding default TileCondToolOfc to ToolSvc") +# svc.msg.info("Adding default TileCondToolOfc to ToolSvc") # from .TileConditionsConf import TileCondToolOfc # ToolSvc += TileCondToolOfc() # if not hasattr(ToolSvc, "TileCondToolEmscale"): -# svc._msg.info("Adding default TileCondToolEmscale to ToolSvc") +# svc.msg.info("Adding default TileCondToolEmscale to ToolSvc") # from .TileCondToolConf import getTileCondToolEmscale # ToolSvc += getTileCondToolEmscale() #if not hasattr(ToolSvc, "TileCondToolIntegrator"): - # svc._msg.info("Adding default TileCondToolIntegrator to ToolSvc") + # svc.msg.info("Adding default TileCondToolIntegrator to ToolSvc") # from .TileCondToolConf import getTileCondToolIntegrator # ToolSvc += getTileCondToolIntegrator() # if not hasattr(ToolSvc, "TileCondToolNoiseSample"): -# svc._msg.info("Adding default TileCondToolNoiseSample to ToolSvc") +# svc.msg.info("Adding default TileCondToolNoiseSample to ToolSvc") # from .TileCondToolConf import getTileCondToolNoiseSample # ToolSvc += getTileCondToolNoiseSample() # if not hasattr(ToolSvc, "TileCondToolNoiseAutoCr"): - # svc._msg.info("Adding default TileCondToolNoiseAutoCr to ToolSvc") + # svc.msg.info("Adding default TileCondToolNoiseAutoCr to ToolSvc") # from .TileCondToolConf import getTileCondToolAutoCr # ToolSvc += getTileCondToolAutoCr() #if not hasattr(ToolSvc, "TileCondToolNoiseRawChn"): - # svc._msg.info("Adding default TileCondToolNoiseRawChn to ToolSvc") + # svc.msg.info("Adding default TileCondToolNoiseRawChn to ToolSvc") # from .TileCondToolConf import getTileCondToolNoiseRawChn # ToolSvc += getTileCondToolNoiseRawChn() # if not hasattr(ToolSvc, "TileCondToolTiming"): -# svc._msg.info("Adding default TileCondToolTiming to ToolSvc") +# svc.msg.info("Adding default TileCondToolTiming to ToolSvc") # from .TileCondToolConf import getTileCondToolTiming # ToolSvc += getTileCondToolTiming() # if not hasattr(ToolSvc, "TileCondToolPulseShape"): -# svc._msg.info("Adding default TileCondToolPulseShape to ToolSvc") +# svc.msg.info("Adding default TileCondToolPulseShape to ToolSvc") # from .TileCondToolConf import getTileCondToolPulseShape # ToolSvc += getTileCondToolPulseShape() #if not hasattr(ToolSvc, "TileCondToolOfcCool"): - # svc._msg.info("Adding default TileCondToolOfcCool to ToolSvc") + # svc.msg.info("Adding default TileCondToolOfcCool to ToolSvc") # from .TileCondToolConf import getTileCondToolOfcCool # ToolSvc += getTileCondToolOfcCool() diff --git a/TileCalorimeter/TileConditions/share/TileConditions_jobOptions.py b/TileCalorimeter/TileConditions/share/TileConditions_jobOptions.py index 291f838516f240157e351f2f0879515b0b461e71..d1ed9ef57c2927b77b9f1766ca3934949a86b5dc 100644 --- a/TileCalorimeter/TileConditions/share/TileConditions_jobOptions.py +++ b/TileCalorimeter/TileConditions/share/TileConditions_jobOptions.py @@ -1,6 +1,7 @@ # Author: N. Gollub (nils.gollub@cern.ch) # main job option to setup TileConditions # +from __future__ import division include.block ("TileConditions/TileConditions_jobOptions.py") from AthenaCommon.Logging import logging msg = logging.getLogger( 'TileConditions_jobOptions.py' ) @@ -94,7 +95,7 @@ if TileUseDCS or ('TileCheckOFC' in dir() and TileCheckOFC) or ('RunOflOFC' in d msg.info("Adjusting TileInfo for %s samples" % TileFrameLength ) tileInfoConfigurator.NSamples = TileFrameLength -tileInfoConfigurator.TrigSample = (TileFrameLength-1)/2 +tileInfoConfigurator.TrigSample = (TileFrameLength-1)//2 # Floor division if athenaCommonFlags.isOnline(): #=== setup reading from COOL DB