예제 #1
0
    def __init__(self, name='CaloTrackingGeometryBuilderCond'):

        from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags

        from LArTrackingGeometry.ConfiguredLArVolumeBuilder import ConfiguredLArVolumeBuilder

        # import the ToolSvc
        from AthenaCommon.AppMgr import ToolSvc
        if 'ToolSvc' not in dir():
            ToolSvc = ToolSvc()

        ConfLArVolumeBuilder = ConfiguredLArVolumeBuilder()
        ToolSvc += ConfLArVolumeBuilder

        from TileTrackingGeometry.ConfiguredTileVolumeBuilder import ConfiguredTileVolumeBuilder

        ConfTileVolumeBuilder = ConfiguredTileVolumeBuilder()
        ToolSvc += ConfTileVolumeBuilder

        # The volume helper
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeHelper
        CaloTrackingVolumeHelper = Trk__TrackingVolumeHelper(
            name='TrackingVolumeHelper')
        ToolSvc += CaloTrackingVolumeHelper

        Calo__CaloTrackingGeometryBuilderCond.__init__(self,name,\
                                                   LArVolumeBuilder = ConfLArVolumeBuilder,\
                                                   TileVolumeBuilder = ConfTileVolumeBuilder,\
                                                   TrackingVolumeHelper = CaloTrackingVolumeHelper,\
                                                   GapLayerEnvelope    = TrkDetFlags.CaloEnvelopeCover(),\
                                                   EntryVolumeName = TrkDetFlags.CaloEntryVolumeName(),\
                                                   ExitVolumeName  = TrkDetFlags.CaloContainerName(),
                                                   MagneticFieldMode = TrkDetFlags.MagneticFieldMode())
    def __init__(self, name='MuonTrackingGeometryBuilder'):

        from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags

        # import the ToolSvc
        from AthenaCommon.AppMgr import ToolSvc
        if 'ToolSvc' not in dir():
            ToolSvc = ToolSvc()

        from MuonTrackingGeometry.MuonTrackingGeometryConf import Muon__MuonStationTypeBuilder
        MuonStationTypeBuilder = Muon__MuonStationTypeBuilder(
            name='MuonStationTypeBuilder')

        ToolSvc += MuonStationTypeBuilder

        # muon active/passive geometry setup
        from MuonTrackingGeometry.MuonTrackingGeometryConf import Muon__MuonStationBuilder
        MuonStationBuilder = Muon__MuonStationBuilder(
            name='MuonStationBuilder')
        ToolSvc += MuonStationBuilder

        from MuonTrackingGeometry.MuonTrackingGeometryConf import Muon__MuonInertMaterialBuilder
        MuonInertMaterialBuilder = Muon__MuonInertMaterialBuilder(
            name='MuonInertMaterialBuilder')
        ToolSvc += MuonInertMaterialBuilder

        Muon__MuonTrackingGeometryBuilder.__init__(self,name,\
                                                   EntryVolumeName=TrkDetFlags.MuonSystemEntryVolumeName(),\
                                                   ExitVolumeName  = TrkDetFlags.MuonSystemContainerName())
예제 #3
0
def _setupGeoModel():
    from AthenaCommon.JobProperties import jobproperties
    from AthenaCommon.AppMgr import ServiceMgr as svcMgr

    try:
        from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags
        if not (hasattr(svcMgr, 'DetDescrCnvSvc')
                and TrkDetFlags.ISF_FatrasCustomGeometry()):
            import DetDescrCnvSvc.DetStoreConfig
            svcMgr.DetDescrCnvSvc.IdDictFromRDB = True
    except ImportError:
        import DetDescrCnvSvc.DetStoreConfig
        svcMgr.DetDescrCnvSvc.IdDictFromRDB = True

    # Conditions DB setup and TagInfo
    from IOVDbSvc.CondDB import conddb
    import EventInfoMgt.EventInfoMgtInit

    if (jobproperties.Global.DataSource() == "geant3"):
        from AtlasGeoModel import GeoModelInitDC1

    elif (jobproperties.Global.DetGeo() == "ctbh8"):
        from AtlasGeoModel import GeoModelInitCTB

    elif (jobproperties.Global.DetGeo() == "ctbh6"):
        from AtlasGeoModel import GeoModelInitH6

    else:
        from AtlasGeoModel import GeoModelInitStandard

    pass
예제 #4
0
def FastShowerCellBuilderToolBaseCfg(flags, name, **kwargs):

    acc = RNG(flags.Random.Engine)
    acc.merge(
        addFolders(flags,
                   "/GLOBAL/AtlfastII/FastCaloSimParam",
                   "GLOBAL_OFL",
                   tag="FastCaloSim_v2"))

    localFileNameList = AdditionalParticleParametrizationFileNames()
    localFileNameList.insert(0, "L1_L2_egamma_corr.config20.root")
    kwargs.setdefault("AdditionalParticleParametrizationFileNames",
                      localFileNameList)

    kwargs.setdefault("RandomService", acc.getService("AthRNGSvc"))
    kwargs.setdefault("RandomStreamName", "AthRNGSvc")
    kwargs.setdefault("DoSimulWithInnerDetectorTruthOnly", True)
    kwargs.setdefault("ID_cut_off_r", [1150])
    kwargs.setdefault("ID_cut_off_z", [3490])
    kwargs.setdefault("DoSimulWithInnerDetectorV14TruthCuts", True)
    kwargs.setdefault("DoNewEnergyEtaSelection", True)
    kwargs.setdefault("DoEnergyInterpolation", True)
    kwargs.setdefault("use_Ekin_for_depositions", True)
    kwargs.setdefault("McLocation", flags.Sim.FastShower.InputCollection)
    kwargs.setdefault("ParticleParametrizationFileName", "")
    kwargs.setdefault("Extrapolator", NITimedExtrapolatorCfg(flags))
    # New kwarg from old FastCaloSimFactory
    kwargs.setdefault("CaloEntrance", TrkDetFlags.InDetContainerName())

    #######################################################################################################
    #theFastShowerCellBuilderTool.Invisibles=[12, 14, 16, 1000022]
    #########################################################################################################

    acc.setPrivateTools(CompFactory.FastShowerCellBuilderTool(name, **kwargs))
    return acc
예제 #5
0
def getInDetTrackingGeometryBuilder(name="ISF_InDetTrackingGeometryBuilder", **kwargs):
    # get hand on the ID Tracking Geometry Builder
    kwargs.setdefault("namePrefix"              , 'Fatras')
    kwargs.setdefault("setLayerAssociation"     , False)
    #kwargs.setdefault("VolumeEnclosureOuterR"   , 1148.) ### HACK: Cannot set via imput arguments. Is this right?? -kg
    if TrkDetFlags.ISF_FatrasCustomGeometry() :
        from ISF_FatrasDetDescrTools.CustomInDetTrackingGeometryBuilder import CustomInDetTrackingGeometryBuilder as IDGeometryBuilder
    else :
        if not TrkDetFlags.SLHC_Geometry() :
            kwargs.setdefault("buildTrtStrawLayers" , True)
            from InDetTrackingGeometry.ConfiguredInDetTrackingGeometryBuilder import ConfiguredInDetTrackingGeometryBuilder as IDGeometryBuilder
        else :
            from InDetTrackingGeometry.ConfiguredSLHC_InDetTrackingGeometryBuilder import ConfiguredSLHC_InDetTrackingGeometryBuilder as IDGeometryBuilder
    t = IDGeometryBuilder(name, **kwargs )
    t.VolumeEnclosureOuterR = 1148.
    #t.EnvelopeDefinitionSvc = 'ISF_EnvelopeDefSvc'
    return t
예제 #6
0
    def __init__(self,name = 'TileVolumeBuilder'):

        from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags

        # import the ToolSvc if necessary
        from AthenaCommon.AppMgr import ToolSvc
        if 'ToolSvc' not in dir():
           ToolSvc = ToolSvc()
       
        # The volume helper for the Tile
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeHelper
        TileTrackingVolumeHelper = Trk__TrackingVolumeHelper(name='TrackingVolumeHelper')
        ToolSvc += TileTrackingVolumeHelper 
              
        Tile__TileVolumeBuilder.__init__(self,name,
                                         UseCaloSurfBuilder = TrkDetFlags.TileUseCaloSurfBuilder(),
                                         TrackingVolumeHelper = TileTrackingVolumeHelper,                                         
                                         BarrelEnvelopeCover  = TrkDetFlags.TileBarrelEnvelopeCover(),
                                         OutputLevel = TrkDetFlags.TileBuildingOutputLevel(),
                                         MagneticFieldMode = TrkDetFlags.MagneticFieldMode())
예제 #7
0
# ---- setup of pixel tool
from PixelGeoModel.PixelGeoModelConf import PixelDetectorTool
pixelTool = PixelDetectorTool()
# --- turn off alignment
pixelTool.Alignable = False

# --- setup of tracking geometry
from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags
TrkDetFlags.SLHC_Geometry = True
TrkDetFlags.PixelBuildingOutputLevel = INFO
TrkDetFlags.SCT_BuildingOutputLevel = INFO
TrkDetFlags.TRT_BuildingOutputLevel = INFO
TrkDetFlags.MagneticFieldCallbackEnforced = False
TrkDetFlags.TRT_BuildStrawLayers = False
TrkDetFlags.MaterialFromCool = True
TrkDetFlags.MaterialDatabaseLocal = False and TrkDetFlags.MaterialFromCool()
TrkDetFlags.MaterialStoreGateKey = '/GLOBAL/TrackingGeo/SLHC_LayerMaterial'
TrkDetFlags.MaterialTagBase = 'SLHC_LayerMat_v'
TrkDetFlags.MaterialVersion = 6
if SLHC_Flags.SLHC_Version() is '':
    TrkDetFlags.MaterialMagicTag = jobproperties.Global.DetDescrVersion()
else:
    TrkDetFlags.MaterialMagicTag = SLHC_Flags.SLHC_Version()
if TrkDetFlags.MaterialDatabaseLocal() is True:
    TrkDetFlags.MaterialDatabaseLocalPath = ''
    TrkDetFlags.MaterialDatabaseLocalName = 'SLHC_LayerMaterial-' + SLHC_Flags.SLHC_Version(
    ) + '.db'
TrkDetFlags.MagneticFieldCallbackEnforced = False
TrkDetFlags.LArUseMaterialEffectsOnTrackProvider = False
TrkDetFlags.TileUseMaterialEffectsOnTrackProvider = False
예제 #8
0
#--------------------------------------------------------------
# Assign the TrackingGeometry to the Algorithm
#--------------------------------------------------------------

# the layer material inspector
from TrkDetDescrTestTools.TrkDetDescrTestToolsConf import Trk__LayerMaterialInspector
LayerMaterialInspector = Trk__LayerMaterialInspector(
    name='LayerMaterialInspector')
LayerMaterialInspector.OutputLevel = INFO
ToolSvc += LayerMaterialInspector

# the tracking volume displayer
from TrkDetDescrTestTools.TrkDetDescrTestToolsConf import Trk__TrackingVolumeDisplayer
TrackingVolumeDisplayer = Trk__TrackingVolumeDisplayer(
    name='TrackingVolumeDisplayer')
TrackingVolumeDisplayer.TrackingVolumeOutputFile = 'TrackingVolumes-' + TrkDetFlags.MaterialMagicTag(
) + '.C'
TrackingVolumeDisplayer.LayerOutputFile = 'Layers-' + TrkDetFlags.MaterialMagicTag(
) + '.C'
TrackingVolumeDisplayer.SurfaceOutputFile = 'Surfaces-' + TrkDetFlags.MaterialMagicTag(
) + '.C'
ToolSvc += TrackingVolumeDisplayer

# PROPAGATOR DEFAULTS --------------------------------------------------------------------------------------

TestEnergyLossUpdator = []
from TrkExTools.TrkExToolsConf import Trk__EnergyLossUpdator
AtlasEnergyLossUpdator = Trk__EnergyLossUpdator(name="AtlasEnergyLossUpdator")
ToolSvc += AtlasEnergyLossUpdator
ToolSvc.AtlasEnergyLossUpdator.DetailedEloss = True
TestEnergyLossUpdator += [AtlasEnergyLossUpdator]
예제 #9
0
  def __init__(self):
    from AthenaCommon.Include import include
    from AthenaCommon.AppMgr import ToolSvc

    ##################################################################################
    # The FatrasTrackingGeometry Svc fragment
    #
    # usage: 
    #   include('TrkDetDescrSvc/FatrasTrackingGeometrySvc.py')
    #
    #    + for the navigator, set the TrackingGeometryName to:
    #      FatrasTrackingGeometrySvc.trackingGeometryName()
    #
    ##################################################################################
    # import the DetFlags for the setting
    from AthenaCommon.DetFlags import DetFlags

    #################################################################################
    # Material for the Geometry
    #
    # if only ID is switched on different COOLDB Folders
    #    and different Tag is used
    # 
    #################################################################################

    from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags
    
    if TrkDetFlags.ConfigurationOutputLevel() < 3 :
      print '[ Configuration : start ] *** FatrasTrackingGeometry ********************************'
      print '[ TrackingGeometrySvc ]'

    # check whether the material retrieval is ment to be from COOL
    if TrkDetFlags.MaterialFromCool() :
        # the tag names
        CoolDataBaseFolder = TrkDetFlags.MaterialStoreGateKey()
        AtlasMaterialTag = TrkDetFlags.MaterialTagBase()+str(TrkDetFlags.MaterialVersion())+'_'

        if TrkDetFlags.ConfigurationOutputLevel() < 3 :
           print '[ TrackingGeometrySvc ] Associating DB folder : ',CoolDataBaseFolder
           print '[ TrackingGeometrySvc ]     base material tag : ',AtlasMaterialTag

        # we need the conditions interface
        from IOVDbSvc.CondDB import conddb
        # use a local database
        if TrkDetFlags.MaterialDatabaseLocal():
            # specify the local database
            DataBasePath  = TrkDetFlags.MaterialDatabaseLocalPath() 
            DataBaseName  = TrkDetFlags.MaterialDatabaseLocalName()
            MagicTag      = TrkDetFlags.MaterialMagicTag()
            DataBaseConnection = '<dbConnection>sqlite://X;schema='+DataBasePath+DataBaseName+';dbname=OFLP200</dbConnection>'
            conddb.blockFolder('/GLOBAL/TrackingGeo/LayerMaterial')
            conddb.addFolderWithTag('',DataBaseConnection+CoolDataBaseFolder,AtlasMaterialTag+MagicTag,force=True)
            if TrkDetFlags.ConfigurationOutputLevel() < 3 :
                print '[ TrackingGeometrySvc ] Using Local Database: '+DataBaseConnection        
            # make sure that the pool files are in the catalog
            #from PoolSvc.PoolSvcConf import PoolSvc
            #PoolSvc.ReadCatalog += [ DataBasePath+'PoolFileCatalog.xml' ]                
        elif TrkDetFlags.SLHC_Geometry() :
            # set the folder to the SLHC location
            CoolDataBaseFolder = '/GLOBAL/TrackingGeo/SLHC_LayerMaterial'
            ctag = AtlasMaterialTag+TrkDetFlags.MaterialMagicTag()
            cfoldertag = CoolDataBaseFolder+' <tag>'+ctag+'</tag>'
            conddb.addFolderSplitMC('GLOBAL',cfoldertag,cfoldertag)
        else :
            # load the right folders (preparation for calo inclusion)
            cfolder = CoolDataBaseFolder +'<tag>TagInfoMajor/'+AtlasMaterialTag+'/GeoAtlas</tag>'
            conddb.addFolderSplitMC('GLOBAL',cfolder,cfolder)

    #################################################################################
    # The Geometry Builder
    #################################################################################

    # the name to register the Geometry
    FatrasTrackingGeometryName = 'FatrasTrackingGeometry'

    # the geometry builder alg tool
    from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__GeometryBuilder
    FatrasGeometryBuilder = Trk__GeometryBuilder(name = 'FatrasGeometryBuilder')
    # switch on the Detectors
    FatrasGeometryBuilder.InDetTrackingGeometry  = DetFlags.ID_on()
    FatrasGeometryBuilder.CaloTrackingGeometry   = DetFlags.Calo_on()
    FatrasGeometryBuilder.MuonTrackingGeometry   = DetFlags.Muon_on() # avoid double building of MTG
    # register it to tool svc
    ToolSvc += FatrasGeometryBuilder

    # (ID) 
    if DetFlags.ID_on() :
      # get hand on the ID Tracking Geometry Builder
      if not TrkDetFlags.SLHC_Geometry() :
        from InDetTrackingGeometry.ConfiguredInDetTrackingGeometryBuilder import ConfiguredInDetTrackingGeometryBuilder as IDGeometryBuilder
      else :
        from InDetTrackingGeometry.ConfiguredSLHC_InDetTrackingGeometryBuilder import ConfiguredSLHC_InDetTrackingGeometryBuilder as IDGeometryBuilder
      if not TrkDetFlags.SLHC_Geometry() :   
        self.__InDetTrackingGeometryBuilder__ = IDGeometryBuilder(name ='InDetTrackingGeometryBuilder',
                                                         namePrefix = 'Fatras',
                                                         setLayerAssociation = False,
                                                         buildTrtStrawLayers = True)
        self.__InDetTrackingGeometryBuilder__.VolumeEnclosureOuterR = 1148.
      else :   
        self.__InDetTrackingGeometryBuilder__ = IDGeometryBuilder(name ='InDetTrackingGeometryBuilder',
                                                         namePrefix = 'Fatras',
                                                         setLayerAssociation = False)
        self.__InDetTrackingGeometryBuilder__.VolumeEnclosureOuterR = 1148.

      # make a public tool out of it
      ToolSvc += self.__InDetTrackingGeometryBuilder__
      # and give it to the Geometry Builder
      FatrasGeometryBuilder.InDetTrackingGeometryBuilder = self.__InDetTrackingGeometryBuilder__
      # 
    # (Calo)
    if DetFlags.Calo_on():
       from CaloTrackingGeometry.ConfiguredCaloTrackingGeometryBuilder import ConfiguredCaloTrackingGeometryBuilder as ConfiguredCaloGeo
       CaloTrackingGeometryBuilder = ConfiguredCaloGeo(name = 'FatrasCaloTrackingGeometryBuilder')
       CaloTrackingGeometryBuilder.RecordLayerIndexCaloSampleMap = True
       # make a publid tool
       ToolSvc += CaloTrackingGeometryBuilder
       # and give it to the Geometry Builder
       FatrasGeometryBuilder.CaloTrackingGeometryBuilder = CaloTrackingGeometryBuilder

    # (Muon)  
    if DetFlags.Muon_on():
       from MuonTrackingGeometry.ConfiguredMuonTrackingGeometry import MuonTrackingGeometryBuilder
       FatrasMuonTrackingGeometryBuilder = MuonTrackingGeometryBuilder(name = 'FatrasMuonTrackingGeometryBuilder')
       FatrasMuonTrackingGeometryBuilder.BarrelZ = 6783.  
       FatrasMuonTrackingGeometryBuilder.InnerBarrelRadius = 4255.  
       ToolSvc += FatrasMuonTrackingGeometryBuilder
       # and give it to the Geometry Builder
       FatrasGeometryBuilder.MuonTrackingGeometryBuilder = FatrasMuonTrackingGeometryBuilder      
  

    # then get the tuning parameters
    from FatrasExample.FatrasTuning import FatrasTuningFlags
    if FatrasTuningFlags.MaterialDistortionsX0.statusOn and \
       FatrasTuningFlags.MaterialDistortionsRho.statusOn :
      from TrkDetDescrSvc.TrkDetDescrSvcConf import CalibrationTrackingGeometrySvc as GeometrySvc
    else :  
      from TrkDetDescrSvc.TrkDetDescrSvcConf import TrackingGeometrySvc as GeometrySvc
    FatrasTrackingGeometrySvc = GeometrySvc(name = 'FatrasTrackingGeometrySvc')

    # register the Builder 
    FatrasTrackingGeometrySvc.GeometryBuilder = FatrasGeometryBuilder
    # and register the name under which the geometry is registered
    FatrasTrackingGeometrySvc.TrackingGeometryName = FatrasTrackingGeometryName
    # global scaling of the material if necessary
    FatrasTrackingGeometrySvc.GlobalScaleFactor = FatrasTuningFlags.MaterialScalor()
    # some flags - only works when ID is on
    FatrasTrackingGeometrySvc.AssignMaterialFromCOOL   = True
    FatrasTrackingGeometrySvc.BuildGeometryFromTagInfo = True
    # Material scaling & distortion
    if FatrasTuningFlags.MaterialDistortionsX0.statusOn and \
       FatrasTuningFlags.MaterialDistortionsRho.statusOn :
       FatrasTrackingGeometrySvc.RandomDistortions          = True
       FatrasTrackingGeometrySvc.DistortionsRadiationLength = FatrasTuningFlags.MaterialDistortionsX0() 
       FatrasTrackingGeometrySvc.DistortionsDensity         = FatrasTuningFlags.MaterialDistortionsRho()
       from FatrasExample.FatrasValidation import FatrasValidationFlags
       FatrasTrackingGeometrySvc.RecordDistortions          = FatrasValidationFlags.MaterialDistortions()
       FatrasTrackingGeometrySvc.DistortionOutputFolder     = '/'+FatrasValidationFlags.ValidationStream()+'/MaterialDistortions'
    # switch to the rigth CoolDB folder 
    FatrasTrackingGeometrySvc.InputLayerMaterialSetName = CoolDataBaseFolder

    from AthenaCommon.AppMgr import ServiceMgr as svcMgr
    svcMgr += FatrasTrackingGeometrySvc

    print '* [ Configuration : start ] *** FatrasTrackingGeometry ********************************'
    print '* [ FatrasTrackingGeometrySvc   ]'
    print FatrasTrackingGeometrySvc
    print '* [ GeometryBuilder       ]'
    print FatrasGeometryBuilder
    print '* [ Configuration : end   ] *** FatrasTrackingGeometry ********************************'

    ##################################################################################    

    self.__geoSvc__ = FatrasTrackingGeometrySvc
예제 #10
0
OutputMagicTag = 'AtlasLayerMat_v20_ATLAS-R2-2015'
OutputMapName = '/GLOBAL/TrackingGeo/LayerMaterialV2'

# Tracking specifications ####################################
from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags
# now say where the file is
TrkDetFlags.MaterialStoreGateKey = '/GLOBAL/TrackingGeo/BinnedLayerMaterial'
TrkDetFlags.MaterialDatabaseLocalPath = ''
TrkDetFlags.MaterialDatabaseLocalName = 'AtlasLayerMaterial-' + DetDescrVersion + '.db'
TrkDetFlags.MaterialMagicTag = InputMagicTag
print TrkDetFlags

# we need the conditions interface
from IOVDbSvc.CondDB import conddb
# specify the local database
DataBasePath = TrkDetFlags.MaterialDatabaseLocalPath()
DataBaseName = TrkDetFlags.MaterialDatabaseLocalName()
DataBaseConnection = '<dbConnection>sqlite://X;schema=' + DataBasePath + DataBaseName + ';dbname=OFLP200</dbConnection>'
conddb.blockFolder('/GLOBAL/TrackingGeo/LayerMaterialV2')
conddb.addFolderWithTag('',
                        DataBaseConnection +
                        TrkDetFlags.MaterialStoreGateKey(),
                        TrkDetFlags.MaterialMagicTag(),
                        force=True)

# Number of events to be processed
theApp.EvtMax = 1

# Full job is a list of algorithms
from AthenaCommon.AlgSequence import AlgSequence
job = AlgSequence()
    def __init__(self,
                 name='InDetTrackingGeometryBuilder',
                 namePrefix='',
                 setLayerAssociation=True,
                 buildTrtStrawLayers=False):

        # get the ToolSvc
        from AthenaCommon.AppMgr import ToolSvc, ServiceMgr

        # the Detector flags to be imported
        from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags

        # beampipe
        from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__BeamPipeBuilder
        BeamPipeBuilder = InDet__BeamPipeBuilder(name=namePrefix +
                                                 'BeamPipeBuilder')
        BeamPipeBuilder.BeamPipeRadius = TrkDetFlags.BeamPipeRadius()
        BeamPipeBuilder.BeamPipeThickness = TrkDetFlags.BeamPipeThickness()
        BeamPipeBuilder.BeamPipeMaterialBinsZ = TrkDetFlags.BeamPipeLayerMaterialBinsZ(
        )
        BeamPipeBuilder.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel()
        ToolSvc += BeamPipeBuilder

        # the layer builders
        layerbuilders = []
        binnings = []
        colors = []

        # @TODO put DetFlags isOn here, but make sure that this is really when the detector is not built

        # PIXEL building
        from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__SiLayerBuilder
        PixelLayerBuilder = InDet__SiLayerBuilder(name=namePrefix +
                                                  'PixelLayerBuilder')
        PixelLayerBuilder.PixelCase = True
        PixelLayerBuilder.Identification = 'Pixel'
        PixelLayerBuilder.SiDetManagerLocation = 'Pixel'
        # additionall layers - handle with care !
        PixelLayerBuilder.BarrelAdditionalLayerRadii = [130]  # The PST
        PixelLayerBuilder.BarrelAdditionalLayerType = [
            0
        ]  # -- will shift volume boundary to PST
        PixelLayerBuilder.EndcapAdditionalLayerPositionsZ = [-1900.,
                                                             1900.]  # DBM
        PixelLayerBuilder.EndcapAdditionalLayerType = [1, 1]  # DBM
        # Pixel barrel specifications
        PixelLayerBuilder.BarrelLayerBinsZ = TrkDetFlags.PixelBarrelLayerMaterialBinsZ(
        )
        PixelLayerBuilder.BarrelLayerBinsPhi = TrkDetFlags.PixelBarrelLayerMaterialBinsPhi(
        )
        PixelLayerBuilder.EndcapLayerBinsR = TrkDetFlags.PixelEndcapLayerMaterialBinsR(
        )
        PixelLayerBuilder.EndcapLayerBinsPhi = TrkDetFlags.PixelEndcapLayerMaterialBinsPhi(
        )

        # set the layer association
        PixelLayerBuilder.SetLayerAssociation = setLayerAssociation
        # output level
        PixelLayerBuilder.OutputLevel = TrkDetFlags.PixelBuildingOutputLevel()
        # the binning type of the layers
        PixelLayerBinning = 2
        # add it to tool service
        ToolSvc += PixelLayerBuilder
        # put them to the caches
        layerbuilders += [PixelLayerBuilder]
        binnings += [PixelLayerBinning]
        colors += [3]

        # SCT building
        SCT_LayerBuilder = InDet__SiLayerBuilder(name=namePrefix +
                                                 'SCT_LayerBuilder')
        SCT_LayerBuilder.PixelCase = False
        SCT_LayerBuilder.Identification = 'SCT'
        SCT_LayerBuilder.SiDetManagerLocation = 'SCT'
        # additionall layers - handle with care !
        SCT_LayerBuilder.EndcapAdditionalLayerPositionsZ = [-2850, 2850]
        SCT_LayerBuilder.EndcapAdditionalLayerType = [0, 0]
        # SCT barrel specifications
        SCT_LayerBuilder.BarrelLayerBinsZ = TrkDetFlags.SCT_BarrelLayerMaterialBinsZ(
        )
        SCT_LayerBuilder.BarrelLayerBinsPhi = TrkDetFlags.SCT_BarrelLayerMaterialBinsPhi(
        )
        # SCT endcap specifications
        SCT_LayerBuilder.EndcapLayerBinsR = TrkDetFlags.SCT_EndcapLayerMaterialBinsR(
        )
        SCT_LayerBuilder.EndcapLayerBinsPhi = TrkDetFlags.SCT_EndcapLayerMaterialBinsPhi(
        )
        SCT_LayerBuilder.EndcapComplexRingBinning = TrkDetFlags.SCT_EndcapLayerDynamicRings(
        )
        # set the layer association
        SCT_LayerBuilder.SetLayerAssociation = setLayerAssociation
        # output level
        SCT_LayerBuilder.OutputLevel = TrkDetFlags.SCT_BuildingOutputLevel()
        # the binning type of the layer
        SCT_LayerBinning = 2
        # SCT -> ToolSvc
        ToolSvc += SCT_LayerBuilder
        # put them to the caches
        layerbuilders += [SCT_LayerBuilder]
        binnings += [SCT_LayerBinning]
        colors += [4]

        from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__TRT_LayerBuilder
        TRT_LayerBuilder = InDet__TRT_LayerBuilder(name=namePrefix +
                                                   'TRT_LayerBuilder')
        # TRT barrel specifications
        TRT_LayerBuilder.ModelBarrelLayers = TrkDetFlags.TRT_BarrelModelLayers(
        )
        TRT_LayerBuilder.BarrelLayerBinsZ = TrkDetFlags.TRT_BarrelLayerMaterialBinsZ(
        )
        TRT_LayerBuilder.BarrelLayerBinsPhi = TrkDetFlags.TRT_BarrelLayerMaterialBinsPhi(
        )
        # SCT endcap specifications
        TRT_LayerBuilder.ModelEndcapLayers = TrkDetFlags.TRT_EndcapModelLayers(
        )
        TRT_LayerBuilder.EndcapLayerBinsR = TrkDetFlags.TRT_EndcapLayerMaterialBinsR(
        )
        TRT_LayerBuilder.EndcapLayerBinsPhi = TrkDetFlags.TRT_EndcapLayerMaterialBinsPhi(
        )
        # set the binning from bi-aequidistant to arbitrary for complex TRT volumes
        TRT_LayerBinning = 1
        if buildTrtStrawLayers or TrkDetFlags.TRT_BuildStrawLayers():
            TRT_LayerBinning = 2
            TRT_LayerBuilder.ModelLayersOnly = False
        # output level
        TRT_LayerBuilder.OutputLevel = TrkDetFlags.TRT_BuildingOutputLevel()
        # TRT -> ToolSvc
        ToolSvc += TRT_LayerBuilder
        # put them to the caches
        layerbuilders += [TRT_LayerBuilder]
        binnings += [TRT_LayerBinning]
        colors += [5]

        # helpers for the InDetTrackingGeometry Builder : layer array creator
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerArrayCreator
        InDetLayerArrayCreator = Trk__LayerArrayCreator(
            name='InDetLayerArrayCreator')
        InDetLayerArrayCreator.EmptyLayerMode = 2  # deletes empty material layers from arrays
        InDetLayerArrayCreator.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel(
        )
        # add to ToolSvc
        ToolSvc += InDetLayerArrayCreator

        # helpers for the InDetTrackingGeometry Builder : volume array creator
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeArrayCreator
        InDetTrackingVolumeArrayCreator = Trk__TrackingVolumeArrayCreator(
            name='InDetTrackingVolumeArrayCreator')
        InDetTrackingVolumeArrayCreator.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel(
        )
        # add to ToolSvc
        ToolSvc += InDetTrackingVolumeArrayCreator

        # helpers for the InDetTrackingGeometry Builder : tracking voluem helper for glueing
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeHelper
        InDetTrackingVolumeHelper = Trk__TrackingVolumeHelper(
            name='InDetTrackingVolumeHelper')
        InDetTrackingVolumeHelper.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel(
        )
        # the material bins
        InDetTrackingVolumeHelper.BarrelLayerBinsZ = TrkDetFlags.InDetPassiveLayerMaterialBinsRz(
        )
        InDetTrackingVolumeHelper.BarrelLayerBinsPhi = TrkDetFlags.InDetPassiveLayerMaterialBinsPhi(
        )
        InDetTrackingVolumeHelper.EndcapLayerBinsR = TrkDetFlags.InDetPassiveLayerMaterialBinsRz(
        )
        InDetTrackingVolumeHelper.EndcapLayerBinsPhi = TrkDetFlags.InDetPassiveLayerMaterialBinsPhi(
        )
        # add to ToolSvc
        ToolSvc += InDetTrackingVolumeHelper

        # helpers for the InDetTrackingGeometry Builder : cylinder volume creator
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__CylinderVolumeCreator
        InDetCylinderVolumeCreator = Trk__CylinderVolumeCreator(
            name='InDetCylinderVolumeCreator')
        # give him the layer array creator
        InDetCylinderVolumeCreator.LayerArrayCreator = InDetLayerArrayCreator
        InDetCylinderVolumeCreator.TrackingVolumeArrayCreator = InDetTrackingVolumeArrayCreator
        InDetCylinderVolumeCreator.TrackingVolumeHelper = InDetTrackingVolumeHelper
        # specifiy the binning, passive layers, entry layers
        InDetCylinderVolumeCreator.PassiveLayerThickness = TrkDetFlags.InDetPassiveLayerThickness(
        )
        InDetCylinderVolumeCreator.PassiveLayerBinsPhi = TrkDetFlags.InDetPassiveLayerMaterialBinsPhi(
        )
        InDetCylinderVolumeCreator.PassiveLayerBinsRZ = TrkDetFlags.InDetPassiveLayerMaterialBinsRz(
        )
        # output level
        InDetCylinderVolumeCreator.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel(
        )
        # add to ToolSvc
        ToolSvc += InDetCylinderVolumeCreator

        # the envelope definition service
        from SubDetectorEnvelopes.SubDetectorEnvelopesConf import DetDescrDBEnvelopeSvc
        AtlasEnvelopeSvc = DetDescrDBEnvelopeSvc(
            'AtlasEnvelopeSvcDefinitionSvc')
        # set the output level for the Envelope service
        AtlasEnvelopeSvc.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel()
        # add to SvcMgr
        ServiceMgr += AtlasEnvelopeSvc

        # the tracking geometry builder
        InDet__RobustTrackingGeometryBuilder.__init__(self,namePrefix+name,\
                                                      BeamPipeBuilder   = BeamPipeBuilder,\
                                                      LayerBuilders     = layerbuilders,
                                                      LayerBinningType  = binnings,
                                                      ColorCodes        = colors,
                                                      BarrelEntryLayers = [ 2, 2, 2 ],
                                                      EndcapEntryLayers = [ 1, 0, 1 ],
                                                      EnvelopeDefinitionSvc = AtlasEnvelopeSvc,
                                                      VolumeEnclosureDiscPositions = [ 3000., 3450. ],
                                                      TrackingVolumeCreator     = InDetCylinderVolumeCreator,
                                                      LayerArrayCreator         = InDetLayerArrayCreator,
                                                      BuildBoundaryLayers       = TrkDetFlags.InDetBuildMaterialBoundaries(),
                                                      ReplaceAllJointBoundaries = TrkDetFlags.InDetBuildJointBoundaries(),
                                                      OutputLevel               = TrkDetFlags.InDetBuildingOutputLevel(),
                                                      ExitVolumeName            = TrkDetFlags.InDetContainerName(),
                                                      MagneticFieldMode         = TrkDetFlags.MagneticFieldMode())
예제 #12
0
niPropagator.MaterialEffects = False
ToolSvc += niPropagator
mlog.info("configure nono-interacting propagator finished")

mlog.info("now configure the TimedExtrapolator...")
from TrkExTools.TimedExtrapolator import TimedExtrapolator

timedExtrapolator = TimedExtrapolator()
timedExtrapolator.STEP_Propagator = niPropagator
timedExtrapolator.ApplyMaterialEffects = False
ToolSvc += timedExtrapolator
mlog.info("configure TimedExtrapolator finished")

from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags

ISF_HitAnalysis.CaloEntrance = TrkDetFlags.InDetContainerName()
ISF_HitAnalysis.Extrapolator = timedExtrapolator

#############################

from AthenaCommon.CfgGetter import getPublicTool

fcsgeohelper = getPublicTool('FastCaloSimGeometryHelper')
ToolSvc += fcsgeohelper
ISF_HitAnalysis.CaloGeometryHelper = fcsgeohelper

ISF_HitAnalysis.FastCaloSimCaloExtrapolation = getPublicTool(
    'FastCaloSimCaloExtrapolation')
ISF_HitAnalysis.FastCaloSimCaloExtrapolation.OutputLevel = ERROR
ToolSvc.FastCaloSimCaloExtrapolation.OutputLevel = ERROR
예제 #13
0
def FastCaloSimFactory(name="FastCaloSimFactory", **kwargs):

    from AthenaCommon.Logging import logging
    mlog = logging.getLogger('FastCaloSimFactory::configure:')

    from CaloRec.CaloCellFlags import jobproperties
    from AthenaCommon.AppMgr import ToolSvc

    #########################################################################################################

    #from FastCaloSim.FastCaloSimConf import FastShowerCellBuilderTool
    #theFastShowerCellBuilderTool=FastShowerCellBuilderTool()

    mlog.info("now configure the non-interacting propagator...")
    from TrkExSTEP_Propagator.TrkExSTEP_PropagatorConf import Trk__STEP_Propagator
    niPropagator = Trk__STEP_Propagator()
    niPropagator.MaterialEffects = False
    ToolSvc += niPropagator
    mlog.info("configure nono-interacting propagator finished")

    mlog.info("now configure the TimedExtrapolator...")
    from TrkExTools.TimedExtrapolator import TimedExtrapolator
    timedExtrapolator = TimedExtrapolator()
    timedExtrapolator.STEP_Propagator = niPropagator
    timedExtrapolator.ApplyMaterialEffects = False
    ToolSvc += timedExtrapolator
    #theFastShowerCellBuilderTool.Extrapolator=timedExtrapolator
    mlog.info("configure TimedExtrapolator finished")

    from CaloTrackingGeometry.CaloTrackingGeometryConf import CaloSurfaceHelper
    caloSurfaceHelper = CaloSurfaceHelper()
    ToolSvc += caloSurfaceHelper
    #theFastShowerCellBuilderTool.CaloSurfaceHelper=caloSurfaceHelper

    from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags
    #theFastShowerCellBuilderTool.CaloEntrance = TrkDetFlags.InDetContainerName()

    kwargs.setdefault("CaloEntrance", TrkDetFlags.InDetContainerName())
    kwargs.setdefault("CaloSurfaceHelper", caloSurfaceHelper)
    kwargs.setdefault("Extrapolator", timedExtrapolator)

    from FastCaloSim.FastCaloSimConf import FastShowerCellBuilderTool
    theFastShowerCellBuilderTool = FastShowerCellBuilderTool(name, **kwargs)

    #########################################################################################################
    #theFastShowerCellBuilderTool.Invisibles=[12, 14, 16, 1000022]

    #########################################################################################################
    import os

    try:
        ParticleParametrizationFileName = theFastShowerCellBuilderTool.ParticleParametrizationFileName
    except:
        ParticleParametrizationFileName = ""

    if ParticleParametrizationFileName == "" and len(
            theFastShowerCellBuilderTool.
            AdditionalParticleParametrizationFileNames) == 0:
        try:
            ATLASCALDATA = os.environ["ATLASCALDATA"]
            ParticleParametrizationFileName = ATLASCALDATA + "/FastCaloSim/v1/ParticleEnergyParametrization.root"
        except:
            ATLASCALDATA = ""
            ParticleParametrizationFileName = "ParticleEnergyParametrization.root"

    theFastShowerCellBuilderTool.ParticleParametrizationFileName = ParticleParametrizationFileName
    mlog.info("ParticleParametrizationFile=%s",
              ParticleParametrizationFileName)

    #from AthenaCommon.AppMgr import theApp
    #svcMgr = theApp.serviceMgr()
    #svcMgr.MessageSvc.debugLimit   = 100000000

    mlog.info("all values:")
    print theFastShowerCellBuilderTool

    return theFastShowerCellBuilderTool
예제 #14
0
    def __init__(self,name = 'InDetTrackingGeometryBuilder',
                      namePrefix = '',
                      setLayerAssociation = True):

        # get the ToolSvc
        from AthenaCommon.AppMgr import ToolSvc, ServiceMgr           
        from AthenaCommon.DetFlags import DetFlags
       
        # the Detector flags to be imported
        from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags
        
        # beampipe        
        from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__BeamPipeBuilder
        BeamPipeBuilder = InDet__BeamPipeBuilder(name=namePrefix+'BeamPipeBuilder')
        BeamPipeBuilder.BeamPipeRadius 	        = TrkDetFlags.BeamPipeRadius()
        BeamPipeBuilder.BeamPipeThickness       = TrkDetFlags.BeamPipeThickness() 
        BeamPipeBuilder.BeamPipeMaterialBinsZ   = TrkDetFlags.BeamPipeLayerMaterialBinsZ()
        BeamPipeBuilder.OutputLevel             = TrkDetFlags.InDetBuildingOutputLevel()
        # the binning type of the layers   
        BeamPipeBinning = 2
        # where to build it from
        BeamPipeBuilder.BeamPipeFromGeoModel    = TrkDetFlags.BeamPipeFromGeoModel()
        BeamPipeBuilder.BeamPipeEnvelope        = TrkDetFlags.BeamPipeEnvelope()
        if not TrkDetFlags.BeamPipeFromGeoModel():
            BeamPipeBuilder.BeamPipeOffsetX	        = TrkDetFlags.BeamPipeOffsetX()
            BeamPipeBuilder.BeamPipeOffsetY	        = TrkDetFlags.BeamPipeOffsetY()
            BeamPipeBuilder.BeamPipeRadius 	        = TrkDetFlags.BeamPipeRadius()

        ToolSvc += BeamPipeBuilder

        # the layer providers
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerProvider
        BeamPipeProvider = Trk__LayerProvider(name=namePrefix+'BeamPipeProvider')
        BeamPipeProvider.LayerBuilder = BeamPipeBuilder
        ToolSvc += BeamPipeProvider
                
        # the layer builders
        layerProviders   = [ BeamPipeProvider ]
        binningsCenter  = [ BeamPipeBinning ]
        binningsEndcap  = [ BeamPipeBinning ]
        colors          = [ 2 ]
                                
        # PIXEL building
        from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__SiLayerBuilder
        PixelLayerBuilder = InDet__SiLayerBuilder(name=namePrefix+'PixelLayerBuilder')
        PixelLayerBuilder.PixelCase 	       = True
        PixelLayerBuilder.Identification       = 'Pixel1'
        PixelLayerBuilder.SiDetManagerLocation = 'Pixel'
        # The pixel split mode
        PixelLayerBuilder.SplitMode            = TrkDetFlags.PixelSplitMode()
        # Pixel barrel specifications
        PixelLayerBuilder.BarrelLayerBinsZ     = TrkDetFlags.PixelBarrelLayerMaterialBinsZ()
        PixelLayerBuilder.BarrelLayerBinsPhi   = TrkDetFlags.PixelBarrelLayerMaterialBinsPhi()
        PixelLayerBuilder.EndcapLayerBinsR     = TrkDetFlags.PixelEndcapLayerMaterialBinsR()
        PixelLayerBuilder.EndcapLayerBinsPhi   = TrkDetFlags.PixelEndcapLayerMaterialBinsPhi()
        # set the layer association
        PixelLayerBuilder.SetLayerAssociation  = setLayerAssociation
        # output level
        PixelLayerBuilder.OutputLevel         = TrkDetFlags.PixelBuildingOutputLevel()
        # the binning type of the layers   
        PixelLayerBinning = 2
        # add it to tool service
        ToolSvc += PixelLayerBuilder
        # put them to the caches
        PixelLayerProvider = Trk__LayerProvider(name=namePrefix+'PixelLayerProvider')
        PixelLayerProvider.LayerBuilder = PixelLayerBuilder
        ToolSvc += PixelLayerProvider
        layerProviders  += [ PixelLayerProvider ]
        binningsCenter += [ PixelLayerBinning ]
        binningsEndcap += [ PixelLayerBinning ]
        colors         += [ 3 ]
        # check if the pixel split mode is one
        if TrkDetFlags.PixelSplitMode() != 0:
            # set split mode to pixel layer builder 
            print ("[SLHC_GeometryBuilder] Building Pixel layers in split mode")
            # change the identificaiton of the first one
            PixelLayerBuilder.Identification       = 'Pixel1'
            # and now configure the second one
            PixelLayerBuilder2 = InDet__SiLayerBuilder(name=namePrefix+'PixelLayerBuilder2')
            PixelLayerBuilder2.PixelCase 	        = True
            PixelLayerBuilder2.SplitMode            = TrkDetFlags.PixelSplitMode()
            PixelLayerBuilder2.Identification       = 'Pixel2'
            PixelLayerBuilder2.SiDetManagerLocation = 'Pixel'
            # Pixel barrel specifications
            PixelLayerBuilder2.BarrelLayerBinsZ     = TrkDetFlags.PixelBarrelLayerMaterialBinsZ()
            PixelLayerBuilder2.BarrelLayerBinsPhi   = TrkDetFlags.PixelBarrelLayerMaterialBinsPhi()
            PixelLayerBuilder2.EndcapLayerBinsR     = TrkDetFlags.PixelEndcapLayerMaterialBinsR()
            PixelLayerBuilder2.EndcapLayerBinsPhi   = TrkDetFlags.PixelEndcapLayerMaterialBinsPhi()
            # set the layer association
            PixelLayerBuilder2.SetLayerAssociation  = setLayerAssociation
            # output level
            PixelLayerBuilder2.OutputLevel         = TrkDetFlags.PixelBuildingOutputLevel()
            # add it to tool service
            ToolSvc += PixelLayerBuilder2

            # the layer providers
            PixelLayerProvider2 = Trk__LayerProvider(name=namePrefix+'PixelLayerProvider2')
            PixelLayerProvider2.LayerBuilder = PixelLayerBuilder2
            ToolSvc += PixelLayerProvider2
            # put them to the caches
            layerProviders  += [ PixelLayerProvider2 ]
            binningsCenter += [ PixelLayerBinning ]
            binningsEndcap += [ PixelLayerBinning ]
            colors         += [ 3 ]
             
        
        if DetFlags.SCT_on() :
            # SCT building
            SCT_LayerBuilder = InDet__SiLayerBuilder(name=namePrefix+'SCT_LayerBuilder')
            SCT_LayerBuilder.PixelCase                       = False
            SCT_LayerBuilder.Identification                  = 'SCT1'
            SCT_LayerBuilder.SiDetManagerLocation            = 'SCT'
            # general steering
            SCT_LayerBuilder.SplitMode                       = TrkDetFlags.SCT_SplitMode()
            # SCT barrel specifications
            SCT_LayerBuilder.BarrelLayerBinsZ                = TrkDetFlags.SCT_BarrelLayerMaterialBinsZ()
            SCT_LayerBuilder.BarrelLayerBinsPhi              = TrkDetFlags.SCT_BarrelLayerMaterialBinsPhi()
            # SCT endcap specifications                          
            SCT_LayerBuilder.EndcapLayerBinsR                = TrkDetFlags.SCT_EndcapLayerMaterialBinsR()
            SCT_LayerBuilder.EndcapLayerBinsPhi              = TrkDetFlags.SCT_EndcapLayerMaterialBinsPhi()
            # SCT_LayerBuilder.EndcapComplexRingBinning        = TrkDetFlags.SCT_EndcapLayerDynamicRings()
            # set the layer association                   
            SCT_LayerBuilder.SetLayerAssociation             = setLayerAssociation        
            # output level                                 
            SCT_LayerBuilder.OutputLevel                     = TrkDetFlags.SCT_BuildingOutputLevel()
            # the binning type of the layer     
            SCT_LayerBinning = 2
            # SCT -> ToolSvc                             
            ToolSvc += SCT_LayerBuilder                       
            # the layer providers
            SCT_LayerProvider = Trk__LayerProvider(name=namePrefix+'SCT_LayerProvider')
            SCT_LayerProvider.LayerBuilder = SCT_LayerBuilder
            ToolSvc += SCT_LayerProvider

            # put them to the caches
            layerProviders  += [ SCT_LayerProvider ]
            binningsCenter += [ SCT_LayerBinning ]
            binningsEndcap += [ SCT_LayerBinning ]
            colors         += [ 4 ]
                                                              
            # the split and the second SCT layer builder is needed if the SCT outer barrel
            # spans over the full width      
            if TrkDetFlags.SCT_SplitMode() != 0 :
              print ("[SLHC_GeometryBuilder] Building SCT layers in split mode")
              from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__SiLayerBuilder
              SCT_LayerBuilder2 = InDet__SiLayerBuilder(name=namePrefix+'SCT_LayerBuilder2')
            
              # switch of the pixel case
              SCT_LayerBuilder2.PixelCase                = False
              SCT_LayerBuilder2.SiDetManagerLocation     = 'SCT'
              # set the general parameters
              SCT_LayerBuilder2.OutputLevel              = 2
              SCT_LayerBuilder2.SplitMode                = TrkDetFlags.SCT_SplitMode()
              SCT_LayerBuilder2.Identification           = "SCT2"
              # SCT barrel specifications
              SCT_LayerBuilder2.BarrelLayerBinsZ         = TrkDetFlags.SCT_BarrelLayerMaterialBinsZ()
              SCT_LayerBuilder2.BarrelLayerBinsPhi       = TrkDetFlags.SCT_BarrelLayerMaterialBinsPhi()
              # SCT endcap specifications                     
              SCT_LayerBuilder2.EndcapLayerBinsR         = TrkDetFlags.SCT_EndcapLayerMaterialBinsR()
              SCT_LayerBuilder2.EndcapLayerBinsPhi       = TrkDetFlags.SCT_EndcapLayerMaterialBinsPhi()
              # set the layer association
              SCT_LayerBuilder2.SetLayerAssociation = setLayerAssociation        
              # output level
              SCT_LayerBuilder2.OutputLevel         = TrkDetFlags.SCT_BuildingOutputLevel()
              ToolSvc += SCT_LayerBuilder2
              # the layer providers
              SCT_LayerProvider2 = Trk__LayerProvider(name=namePrefix+'SCT_LayerProvider2')
              SCT_LayerProvider2.LayerBuilder = SCT_LayerBuilder2
              ToolSvc += SCT_LayerProvider2
              # put them to the caches
              layerProviders  += [ SCT_LayerProvider2 ] 
              binningsCenter += [ SCT_LayerBinning ]
              binningsEndcap += [ SCT_LayerBinning ]
              colors         += [ 5 ]

        
        # helpers for the InDetTrackingGeometry Builder : layer array creator
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerArrayCreator
        InDetLayerArrayCreator = Trk__LayerArrayCreator(name = 'InDetLayerArrayCreator')
        InDetLayerArrayCreator.EmptyLayerMode           = 2 # deletes empty material layers from arrays
        InDetLayerArrayCreator.OutputLevel              = TrkDetFlags.InDetBuildingOutputLevel()
        # add to ToolSvc
        ToolSvc += InDetLayerArrayCreator

        # helpers for the InDetTrackingGeometry Builder : volume array creator
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeArrayCreator
        InDetTrackingVolumeArrayCreator                       = Trk__TrackingVolumeArrayCreator(name = 'InDetTrackingVolumeArrayCreator')
        InDetTrackingVolumeArrayCreator.OutputLevel           = TrkDetFlags.InDetBuildingOutputLevel()
        # add to ToolSvc
        ToolSvc += InDetTrackingVolumeArrayCreator
        
        # helpers for the InDetTrackingGeometry Builder : tracking voluem helper for glueing
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeHelper
        InDetTrackingVolumeHelper                             = Trk__TrackingVolumeHelper(name ='InDetTrackingVolumeHelper')
        InDetTrackingVolumeHelper.OutputLevel                 = TrkDetFlags.InDetBuildingOutputLevel()
        # the material bins 
        InDetTrackingVolumeHelper.BarrelLayerBinsZ            = TrkDetFlags.InDetPassiveLayerMaterialBinsRz()
        InDetTrackingVolumeHelper.BarrelLayerBinsPhi          = TrkDetFlags.InDetPassiveLayerMaterialBinsPhi() 
        InDetTrackingVolumeHelper.EndcapLayerBinsR            = TrkDetFlags.InDetPassiveLayerMaterialBinsRz()
        InDetTrackingVolumeHelper.EndcapLayerBinsPhi          = TrkDetFlags.InDetPassiveLayerMaterialBinsPhi() 
        # add to ToolSvc
        ToolSvc += InDetTrackingVolumeHelper
        
        # helpers for the InDetTrackingGeometry Builder : cylinder volume creator
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__CylinderVolumeCreator
        InDetCylinderVolumeCreator = Trk__CylinderVolumeCreator(name = 'InDetCylinderVolumeCreator')
        # give him the layer array creator
        InDetCylinderVolumeCreator.LayerArrayCreator          = InDetLayerArrayCreator
        InDetCylinderVolumeCreator.TrackingVolumeArrayCreator = InDetTrackingVolumeArrayCreator
        InDetCylinderVolumeCreator.TrackingVolumeHelper       = InDetTrackingVolumeHelper
        # specifiy the binning, passive layers, entry layers
        InDetCylinderVolumeCreator.PassiveLayerThickness      = TrkDetFlags.InDetPassiveLayerThickness()  
        InDetCylinderVolumeCreator.PassiveLayerBinsPhi        = TrkDetFlags.InDetPassiveLayerMaterialBinsPhi()  
        InDetCylinderVolumeCreator.PassiveLayerBinsRZ         = TrkDetFlags.InDetPassiveLayerMaterialBinsRz()  
        # output level                                       
        InDetCylinderVolumeCreator.OutputLevel                = TrkDetFlags.InDetBuildingOutputLevel()        
        # add to ToolSvc
        ToolSvc += InDetCylinderVolumeCreator        
        
        # the envelope definition service
        from SubDetectorEnvelopes.SubDetectorEnvelopesConf import DetDescrDBEnvelopeSvc
        AtlasEnvelopeSvc = DetDescrDBEnvelopeSvc('AtlasEnvelopeSvcDefinitionSvc')
        # set the output level for the Envelope service
        AtlasEnvelopeSvc.OutputLevel      = TrkDetFlags.InDetBuildingOutputLevel()  
        # add to SvcMgr
        ServiceMgr += AtlasEnvelopeSvc
        
        # the tracking geometry builder
        InDet__StagedTrackingGeometryBuilder.__init__(self,namePrefix+name,\
                                                      BeamPipeBuilder           = BeamPipeBuilder,\
                                                      LayerBuilders             = layerProviders,
                                                      LayerBinningTypeCenter    = binningsCenter,
                                                      LayerBinningTypeEndcap    = binningsEndcap,
                                                      ColorCodes                = colors,
                                                      EnvelopeDefinitionSvc     = AtlasEnvelopeSvc,
                                                      # VolumeEnclosureDiscPositions = [ 3000., 3450. ],
                                                      TrackingVolumeCreator     = InDetCylinderVolumeCreator,
                                                      LayerArrayCreator         = InDetLayerArrayCreator,
                                                      BuildBoundaryLayers       = True,
                                                      # ReplaceAllJointBoundaries = TrkDetFlags.InDetBuildMaterialBoundaries(),
                                                      OutputLevel               = TrkDetFlags.InDetBuildingOutputLevel(),
                                                      ExitVolumeName            = TrkDetFlags.InDetContainerName(),
                                                      MagneticFieldMode         = TrkDetFlags.MagneticFieldMode(),
                                                      isSLHC = True)
예제 #15
0
from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags
TrkDetFlags.SLHC_Geometry = True
TrkDetFlags.PixelBuildingOutputLevel = VERBOSE
TrkDetFlags.SCT_BuildingOutputLevel = VERBOSE
TrkDetFlags.TRT_BuildingOutputLevel = VERBOSE
TrkDetFlags.MagneticFieldCallbackEnforced = False
TrkDetFlags.TRT_BuildStrawLayers = False
# TrkDetFlags.MaterialFromCool                = False
TrkDetFlags.MaterialDatabaseLocal = False
#  SLHC_Flags.SLHC_Version() != '' and TrkDetFlags.MaterialFromCool()
TrkDetFlags.MaterialStoreGateKey = '/GLOBAL/TrackingGeo/SLHC_LayerMaterial'
TrkDetFlags.MaterialTagBase = 'SLHC_LayerMat_v'
TrkDetFlags.MaterialVersion = 6
TrkDetFlags.MaterialMagicTag = jobproperties.Global.DetDescrVersion()
if TrkDetFlags.MaterialDatabaseLocal() is True:
    TrkDetFlags.MaterialMagicTag = SLHC_Flags.SLHC_Version()
    TrkDetFlags.MaterialDatabaseLocalPath = ''
    TrkDetFlags.MaterialDatabaseLocalName = 'SLHC_LayerMaterial-' + SLHC_Flags.SLHC_Version(
    ) + '.db'
TrkDetFlags.MagneticFieldCallbackEnforced = False
# TrkDetFlags.LArUseMaterialEffectsOnTrackProvider  = False
# TrkDetFlags.TileUseMaterialEffectsOnTrackProvider = False

##############################################################
# test the different geometries

GeometryMode = 1

# EmptyGeometry          = 0
# AtlasGeometry          = 1
예제 #16
0
MuonStationTypeBuilder = Muon__MuonStationTypeBuilder(
    name='MuonStationTypeBuilder')
ToolSvc += MuonStationTypeBuilder

# muon active/passive geometry setup
from MuonTrackingGeometry.MuonTrackingGeometryConf import Muon__MuonStationBuilder

MuonStationBuilder = Muon__MuonStationBuilder(name='MuonStationBuilder')
MuonStationBuilder.StationTypeBuilder = MuonStationTypeBuilder
ToolSvc += MuonStationBuilder

from MuonTrackingGeometry.MuonTrackingGeometryConf import Muon__MuonInertMaterialBuilder

MuonInertMaterialBuilder = Muon__MuonInertMaterialBuilder(
    name='MuonInertMaterialBuilder')
ToolSvc += MuonInertMaterialBuilder

# muon tracking geometry builder
from MuonTrackingGeometry.MuonTrackingGeometryConf import Muon__MuonTrackingGeometryBuilder

MuonTrackingGeometryBuilder = Muon__MuonTrackingGeometryBuilder(
    name='MuonTrackingGeometryBuilder')
MuonTrackingGeometryBuilder.EntryVolumeName = TrkDetFlags.MuonSystemEntryVolumeName(
)
MuonTrackingGeometryBuilder.ExitVolumeName = TrkDetFlags.MuonSystemContainerName(
)
MuonTrackingGeometryBuilder.OutputLevel = TrkDetFlags.MuonBuildingOutputLevel()
ToolSvc += MuonTrackingGeometryBuilder

#print MuonTrackingGeometryBuilder
예제 #17
0
    def __init__(self, name='AtlasTrackingGeometrySvc'):

        if TrkDetFlags.ConfigurationOutputLevel() < 3:
            print('[ Configuration : start ] *** ' + name +
                  ' ********************************')
            print('[ TrackingGeometrySvc ]')

        from AthenaCommon.AppMgr import ToolSvc

        #################################################################################
        # The Geometry Builder
        #################################################################################

        # the name to register the Geometry
        AtlasTrackingGeometryName = 'AtlasTrackingGeometry'

        # the geometry builder alg tool
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__GeometryBuilder
        AtlasGeometryBuilder = Trk__GeometryBuilder(
            name='AtlasGeometryBuilder')
        # switch the building outputlevel on
        AtlasGeometryBuilder.OutputLevel = TrkDetFlags.ConfigurationOutputLevel(
        )

        # the envelope definition service
        from AthenaCommon.CfgGetter import getPrivateTool,getPrivateToolClone,getPublicTool,getPublicToolClone,\
           getService,getServiceClone,getAlgorithm,getAlgorithmClone
        AtlasEnvelopeSvc = getService('AtlasGeometry_EnvelopeDefSvc')

        # (ID)
        if DetFlags.ID_on():
            # get hand on the ID Tracking Geometry Builder
            if TrkDetFlags.ISF_FatrasCustomGeometry():
                if hasattr(ToolSvc,
                           TrkDetFlags.ISF_FatrasCustomGeometryBuilderName()):
                    InDetTrackingGeometryBuilder = getattr(
                        ToolSvc,
                        TrkDetFlags.ISF_FatrasCustomGeometryBuilderName())
            elif TrkDetFlags.XMLFastCustomGeometry():
                if hasattr(ToolSvc,
                           TrkDetFlags.InDetTrackingGeometryBuilderName()):
                    InDetTrackingGeometryBuilder = getattr(
                        ToolSvc,
                        TrkDetFlags.InDetTrackingGeometryBuilderName())
            else:
                if not TrkDetFlags.SLHC_Geometry(
                ) and not TrkDetFlags.InDetStagedGeometryBuilder():
                    from InDetTrackingGeometry.ConfiguredInDetTrackingGeometryBuilder import ConfiguredInDetTrackingGeometryBuilder as IDGeometryBuilder
                elif not TrkDetFlags.SLHC_Geometry():
                    from InDetTrackingGeometry.ConfiguredStagedTrackingGeometryBuilder import ConfiguredStagedTrackingGeometryBuilder as IDGeometryBuilder
                else:
                    from InDetTrackingGeometry.ConfiguredSLHC_InDetTrackingGeometryBuilder import ConfiguredSLHC_InDetTrackingGeometryBuilder as IDGeometryBuilder
                InDetTrackingGeometryBuilder = IDGeometryBuilder(
                    name='InDetTrackingGeometryBuilder')

            InDetTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc
            InDetTrackingGeometryBuilder.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel(
            )
            # and give it to the Geometry Builder
            AtlasGeometryBuilder.InDetTrackingGeometryBuilder = InDetTrackingGeometryBuilder
            #
        # (Calo)
        if DetFlags.Calo_on():
            from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__CylinderVolumeCreator
            CaloVolumeCreator = Trk__CylinderVolumeCreator("CaloVolumeCreator")
            CaloVolumeCreator.OutputLevel = TrkDetFlags.CaloBuildingOutputLevel(
            )
            ToolSvc += CaloVolumeCreator

            from CaloTrackingGeometry.ConfiguredCaloTrackingGeometryBuilder import ConfiguredCaloTrackingGeometryBuilder as ConfiguredCaloGeo
            CaloTrackingGeometryBuilder = ConfiguredCaloGeo(
                name='CaloTrackingGeometryBuilder')
            CaloTrackingGeometryBuilder.TrackingVolumeCreator = CaloVolumeCreator
            CaloTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc
            CaloTrackingGeometryBuilder.OutputLevel = TrkDetFlags.CaloBuildingOutputLevel(
            )
            CaloTrackingGeometryBuilder.GeometryName = 'Calo'
            # and give it to the Geometry Builder
            AtlasGeometryBuilder.CaloTrackingGeometryBuilder = CaloTrackingGeometryBuilder

        # (Muon)
        if DetFlags.Muon_on():
            from MuonTrackingGeometry.ConfiguredMuonTrackingGeometry import MuonTrackingGeometryBuilder
            MuonTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc
            # and give it to the Geometry Builder
            AtlasGeometryBuilder.MuonTrackingGeometryBuilder = MuonTrackingGeometryBuilder

        # processors
        AtlasGeometryProcessors = []

        # check whether the material retrieval is ment to be from COOL
        if TrkDetFlags.MaterialSource() is 'COOL':
            # the material provider
            from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerMaterialProvider as LayerMaterialProvider
            AtlasMaterialProvider = LayerMaterialProvider(
                'AtlasMaterialProvider')
            AtlasMaterialProvider.OutputLevel = TrkDetFlags.ConfigurationOutputLevel(
            )
            AtlasMaterialProvider.LayerMaterialMapName = TrkDetFlags.MaterialStoreGateKey(
            )

            AtlasGeometryProcessors += [AtlasMaterialProvider]

            # the tag names
            CoolDataBaseFolder = TrkDetFlags.MaterialStoreGateKey()
            AtlasMaterialTag = TrkDetFlags.MaterialTagBase() + str(
                TrkDetFlags.MaterialVersion(
                )) + TrkDetFlags.MaterialSubVersion() + '_'

            if TrkDetFlags.ConfigurationOutputLevel() < 3:
                print('[ TrackingGeometrySvc ] Associating DB folder : ',
                      CoolDataBaseFolder)

            # we need the conditions interface
            from IOVDbSvc.CondDB import conddb
            # use a local database
            if TrkDetFlags.MaterialDatabaseLocal():
                # specify the local database
                DataBasePath = TrkDetFlags.MaterialDatabaseLocalPath()
                DataBaseName = TrkDetFlags.MaterialDatabaseLocalName()
                MagicTag = TrkDetFlags.MaterialMagicTag()
                DataBaseConnection = '<dbConnection>sqlite://X;schema=' + DataBasePath + DataBaseName + ';dbname=OFLP200</dbConnection>'
                conddb.blockFolder('/GLOBAL/TrackingGeo/LayerMaterialV2')
                conddb.addFolderWithTag('',
                                        DataBaseConnection +
                                        CoolDataBaseFolder,
                                        AtlasMaterialTag + MagicTag,
                                        force=True)
                if TrkDetFlags.ConfigurationOutputLevel() < 3:
                    print('[ TrackingGeometrySvc ] Using Local Database: ' +
                          DataBaseConnection)
                # make sure that the pool files are in the catalog
            elif TrkDetFlags.SLHC_Geometry():
                # set the folder to the SLHC location
                CoolDataBaseFolder = '/GLOBAL/TrackingGeo/LayerMaterialITK'
                ctag = AtlasMaterialTag + TrkDetFlags.MaterialMagicTag()
                cfoldertag = CoolDataBaseFolder + ' <tag>' + ctag + '</tag>'
                conddb.addFolderSplitMC('GLOBAL', cfoldertag, cfoldertag)
            else:
                print('[ TrackingGeometrySvc ]     base material tag : ',
                      AtlasMaterialTag)
                cfolder = CoolDataBaseFolder + '<tag>TagInfoMajor/' + AtlasMaterialTag + '/GeoAtlas</tag>'
                print('[ TrackingGeometrySvc ]     translated to COOL: ',
                      cfolder)
                # load the right folders (preparation for calo inclusion)
                conddb.addFolderSplitMC('GLOBAL', cfolder, cfolder)

        elif TrkDetFlags.MaterialSource() is 'Input':
            # the material provider
            from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__InputLayerMaterialProvider
            AtlasMaterialProvider = Trk__InputLayerMaterialProvider(
                'AtlasMaterialProvider')
            AtlasMaterialProvider.OutputLevel = TrkDetFlags.ConfigurationOutputLevel(
            )
            AtlasGeometryProcessors += [AtlasMaterialProvider]

        # material validation
        if TrkDetFlags.MaterialValidation():
            # load the material inspector
            from TrkDetDescrTestTools.TrkDetDescrTestToolsConf import Trk__LayerMaterialInspector
            AtlasLayerMaterialInspector = Trk__LayerMaterialInspector(
                'AtlasLayerMaterialInspector')
            AtlasLayerMaterialInspector.OutputLevel = TrkDetFlags.ConfigurationOutputLevel(
            )

            AtlasGeometryProcessors += [AtlasLayerMaterialInspector]

        # call the base class constructor : sets the tools
        Trk__TrackingGeometrySvc.__init__(self,name,\
                                          GeometryBuilder = AtlasGeometryBuilder,\
                                          TrackingGeometryName = AtlasTrackingGeometryName,\
                                          GeometryProcessors = AtlasGeometryProcessors, \
                                          BuildGeometryFromTagInfo = True,\
                                          OutputLevel = TrkDetFlags.ConfigurationOutputLevel())

        # screen output of the configuration
        if TrkDetFlags.ConfigurationOutputLevel() < 3:
            print(self)
            print('* [ GeometryBuilder       ]')
            print(AtlasGeometryBuilder)
            print('* [ Configuration : end   ] ***' + name +
                  '********************************')
예제 #18
0
    def __init__(self,
                 name='InDetTrackingGeometryBuilder',
                 namePrefix='',
                 setLayerAssociation=True,
                 buildTrtStrawLayers=False,
                 buildCustomPixel=False,
                 buildCustomSCT=False,
                 buildCustomTRT=False,
                 createXML=True,
                 dictionaryFileName='InDetTrackingGeometry.xml'):

        # get the ToolSvc
        from AthenaCommon.AppMgr import ToolSvc, ServiceMgr

        # the Detector flags to be imported
        from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags

        from ISF_FatrasDetDescrTools.ISF_FatrasDetDescrToolsConf import iFatras__InputLayerMaterialProvider
        ISF_InputLayerMaterialProvider = iFatras__InputLayerMaterialProvider(
            name=namePrefix + 'ISF_InputLayerMaterialProvider')
        #ISF_InputLayerMaterialProvider.OutputLevel = 1
        ToolSvc += ISF_InputLayerMaterialProvider
        print ISF_InputLayerMaterialProvider

        # beampipe
        from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__BeamPipeBuilder
        BeamPipeBuilder = InDet__BeamPipeBuilder(name=namePrefix +
                                                 'BeamPipeBuilder')
        BeamPipeBuilder.BeamPipeRadius = TrkDetFlags.BeamPipeRadius()
        BeamPipeBuilder.BeamPipeThickness = TrkDetFlags.BeamPipeThickness()
        BeamPipeBuilder.BeamPipeMaterialBinsZ = TrkDetFlags.BeamPipeLayerMaterialBinsZ(
        )
        BeamPipeBuilder.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel()
        ToolSvc += BeamPipeBuilder
        print BeamPipeBuilder

        # the layer providers
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerProvider
        BeamPipeProvider = Trk__LayerProvider(name=namePrefix +
                                              'BeamPipeProvider')
        BeamPipeProvider.LayerBuilder = BeamPipeBuilder
        ToolSvc += BeamPipeProvider

        # binning of the beam pipe
        BeamPipeBinning = 2

        # the layer builders
        layerProviders = [BeamPipeProvider]
        binningsCenter = [BeamPipeBinning]
        binningsEndcap = [BeamPipeBinning]
        colors = [2]

        IBLLayerBuilder = None
        PixelLayerBuilder = None
        if buildCustomPixel:
            from ISF_FatrasDetDescrTools.ISF_FatrasDetDescrToolsConf import iFatras__PlanarDetLayerBuilder
            ## EXT IBL building
            #IBLLayerBuilder = iFatras__PlanarDetLayerBuilder(name=namePrefix+'IBLLayerBuilder')
            #IBLLayerBuilder.PixelCase 	                = True
            #IBLLayerBuilder.Identification              = 'Pixel'
            #IBLLayerBuilder.InputLayerMaterialProvider  = ISF_InputLayerMaterialProvider

            ## Assign custom material
            #IBLLayerBuilder.BarrelLayerBinsZ        = TrkDetFlags.PixelBarrelLayerMaterialBinsZ()
            #IBLLayerBuilder.BarrelLayerBinsPhi      = TrkDetFlags.PixelBarrelLayerMaterialBinsPhi()
            #IBLLayerBuilder.EndcapLayerBinsR        = TrkDetFlags.PixelEndcapLayerMaterialBinsR()
            #IBLLayerBuilder.EndcapLayerBinsPhi      = TrkDetFlags.PixelEndcapLayerMaterialBinsPhi()
            #IBLLayerBuilder.CustomMaterial          = False
            #IBLLayerBuilder.CustomMaterialThickness = 0.250
            #IBLLayerBuilder.CustomMaterialX0        = 8.333
            #IBLLayerBuilder.CustomMaterialL0        = 100
            #IBLLayerBuilder.CustomMaterialA         = 14
            #IBLLayerBuilder.CustomMaterialZ         = 28.0855
            #IBLLayerBuilder.CustomMaterialRho       = 0.00233

            ## INNER PIXEL BARREL
            #INPB_NR = 1
            #IBLLayerBuilder.BarrelLayers = INPB_NR
            #IBLLayerBuilder.LayersZsectors = [40]  # [58, 58]
            #IBLLayerBuilder.LayerPhiSectors = [16]
            #IBLLayerBuilder.LayerTilt = [-14.0 ] * INPB_NR   #degrees
            #IBLLayerBuilder.LayerMinPhi = [-180.0 ] * INPB_NR   #degrees
            #IBLLayerBuilder.LayerMaxPhi = [ 180.0 ] * INPB_NR   #degrees
            #IBLLayerBuilder.LayerMinZ = [-40.5 * z/2. for z in IBLLayerBuilder.LayersZsectors] #mm
            #IBLLayerBuilder.LayerMaxZ = [40.5 * z/2. for z in IBLLayerBuilder.LayersZsectors] #mm
            #IBLLayerBuilder.LayerRadius = [39.]
            #IBLLayerBuilder.LayerThickness = [0.150 + 0.150 + 0.182] * INPB_NR   # chip + sensor + hybrid   # CHECK HYBRID MATERIAL
            #IBLLayerBuilder.LayerLengthY = [ 40.5 ]
            #IBLLayerBuilder.LayerLengthXmin = [ 16.81 ]
            #IBLLayerBuilder.LayerPitchX = [0.050] * INPB_NR
            #IBLLayerBuilder.LayerPitchY = [0.050] * INPB_NR
            #IBLLayerBuilder.LayerRotation = [0.] * INPB_NR
            #IBLLayerBuilder.AdditionalLayerRadius = []

            #IBLLayerBuilder.EndcapDiscs = 0

            ## set the layer association
            #IBLLayerBuilder.SetLayerAssociation  = setLayerAssociation
            #IBLLayerBuilder.OutputLevel         = TrkDetFlags.PixelBuildingOutputLevel()

            ## the binning type of the layers
            #IBLLayerBinning = 2

            ## add it to tool service
            #ToolSvc += IBLLayerBuilder
            #print IBLLayerBuilder

            ## the layer providers
            #IBLLayerProvider = Trk__LayerProvider(name=namePrefix+'IBLLayerProvider')
            #IBLLayerProvider.LayerBuilder = IBLLayerBuilder
            #ToolSvc += IBLLayerProvider

            ## put them to the caches
            #layerProviders  += [ IBLLayerProvider ]
            #binningsCenter  += [ IBLLayerBinning ]
            #binningsEndcap  += [ IBLLayerBinning ]
            #colors          += [ 3 ]

            # PIXEL building
            PixelLayerBuilder = iFatras__PlanarDetLayerBuilder(
                name=namePrefix + 'PixelLayerBuilder')
            PixelLayerBuilder.PixelCase = True
            PixelLayerBuilder.Identification = 'Pixel'

            PixelLayerBuilder.InputLayerMaterialProvider = ISF_InputLayerMaterialProvider

            # Pixel barrel specifications

            # Noemi's configuration

            # Assign custom material
            PixelLayerBuilder.BarrelLayerBinsZ = TrkDetFlags.PixelBarrelLayerMaterialBinsZ(
            )
            PixelLayerBuilder.BarrelLayerBinsPhi = 100  #TrkDetFlags.PixelBarrelLayerMaterialBinsPhi()
            PixelLayerBuilder.EndcapLayerBinsR = TrkDetFlags.PixelEndcapLayerMaterialBinsR(
            )
            PixelLayerBuilder.EndcapLayerBinsPhi = TrkDetFlags.PixelEndcapLayerMaterialBinsPhi(
            )
            PixelLayerBuilder.CustomMaterial = True
            PixelLayerBuilder.CustomMaterialThickness = 0.250
            PixelLayerBuilder.CustomMaterialX0 = 8.333
            PixelLayerBuilder.CustomMaterialL0 = 100
            PixelLayerBuilder.CustomMaterialA = 14
            PixelLayerBuilder.CustomMaterialZ = 28.0855
            PixelLayerBuilder.CustomMaterialRho = 0.00233

            ## BARREL
            PixelLayerBuilder.BarrelLayers = 3
            if IBLLayerBuilder:
                PixelLayerBuilder.LayerOffset = IBLLayerBuilder.BarrelLayers
            PixelLayerBuilder.LayersZsectors = [13, 13, 13]
            PixelLayerBuilder.LayerPhiSectors = [22, 38, 52]
            PixelLayerBuilder.LayerTilt = [-20.0, -20.0, -20.0]  #degree
            PixelLayerBuilder.LayerPhiOffset = [0., 0.,
                                                360. / 52. * 0.4]  #degree
            PixelLayerBuilder.LayerMinPhi = [-180.0, -180.0, -180.0]  #degree
            PixelLayerBuilder.LayerMaxPhi = [180.0, 180.0, 180.0]  #degree
            PixelLayerBuilder.LayerMinZ = [-400.5, -400.5, -400.5]
            PixelLayerBuilder.LayerMaxZ = [400.5, 400.5, 400.5]
            PixelLayerBuilder.LayerRadius = [50.5, 88.5, 122.5]
            PixelLayerBuilder.LayerThickness = [0.250, 0.250, 0.250]
            PixelLayerBuilder.LayerLengthY = [60.8, 60.8, 60.8]
            PixelLayerBuilder.LayerLengthXmin = [16.4, 16.4, 16.4]
            PixelLayerBuilder.LayerPitchX = [0.010, 0.010, 0.010]
            PixelLayerBuilder.LayerPitchY = [0.055, 0.055, 0.055]
            #PixelLayerBuilder.LayerPitchY = [ 6.08, 6.08, 6.08 ]
            #PixelLayerBuilder.LayerPitchX = [ 1.64, 1.64, 1.64 ]
            PixelLayerBuilder.LayerRotation = [1., 1., 1.]  #degree
            PixelLayerBuilder.LayerSCTlike = False
            PixelLayerBuilder.AdditionalLayerRadius = []  #45.5, 83.5, 117.5 ]

            # ENDCAPS
            PixelLayerBuilder.EndcapDiscs = 3
            if IBLLayerBuilder:
                PixelLayerBuilder.DiscOffset = IBLLayerBuilder.EndcapDiscs
            PixelLayerBuilder.DiscPhiSectors = [[48], [48], [48]]
            PixelLayerBuilder.DiscZpos = [
                -649.0, -579.0, -493.5, 496.5, 581.0, 651.0
            ]
            PixelLayerBuilder.DiscRingMinR = [[88.8], [88.8], [88.8]]
            PixelLayerBuilder.DiscRingMaxR = [[149.6], [149.6], [149.6]]
            PixelLayerBuilder.DiscMinPhi = [[-180.0], [-180.0], [-180.0]]
            PixelLayerBuilder.DiscMaxPhi = [[180.0], [180.0], [180.0]]
            PixelLayerBuilder.DiscThickness = [0.250, 0.250, 0.250]
            PixelLayerBuilder.DiscLengthY = [[60.8], [60.8], [60.8]]
            PixelLayerBuilder.DiscLengthXmin = [[16.4], [16.4], [16.4]]
            PixelLayerBuilder.DiscPitchX = [[0.010], [0.010], [0.010]]
            PixelLayerBuilder.DiscPitchY = [[0.055], [0.055], [0.055]]
            #PixelLayerBuilder.DiscPitchY = [ [6.08], [6.08], [6.08] ]
            #PixelLayerBuilder.DiscPitchX = [ [1.64], [1.64], [1.64] ]
            PixelLayerBuilder.DiscSeparation = [[4.], [4.], [4.]]
            PixelLayerBuilder.AdditionalDiscZpos = [
                -1900., 1900.
            ]  #-645.0, -575.0, -445.0, 445.0, 575.0, 645.0]

            #ENDCAPS
            #PixelLayerBuilder.EndcapDiscs = 7
            #PixelLayerBuilder.DiscPhiSectors = [[48], [48], [48], [48], [48], [48], [48]]
            #PixelLayerBuilder.DiscZpos = [-850, -800, -750, -700, -650.0, -580.0, -450.0, 450.0, 580.0, 650.0, 700, 750, 800, 850]
            #PixelLayerBuilder.DiscRingMinR = [[88.8], [88.8], [88.8], [88.8], [88.8], [88.8], [88.8] ]
            #PixelLayerBuilder.DiscRingMaxR = [[149.6], [149.6], [149.6], [149.6], [149.6], [149.6], [149.6]]
            #PixelLayerBuilder.DiscMinPhi = [[-180.0], [-180.0], [-180.0], [-180.0], [-180.0], [-180.0], [-180.0]]
            #PixelLayerBuilder.DiscMaxPhi = [[180.0],  [180.0],  [180.0], [180.0],  [180.0],  [180.0], [180.0]]
            #PixelLayerBuilder.DiscThickness = [0.250, 0.250, 0.250, 0.250, 0.250, 0.250, 0.250]
            #PixelLayerBuilder.DiscLengthY = [[60.8], [60.8], [60.8], [60.8], [60.8], [60.8], [60.8]]
            #PixelLayerBuilder.DiscLengthXmin = [[16.4], [16.4], [16.4], [16.4], [16.4], [16.4], [16.4]]
            #PixelLayerBuilder.DiscPitchX = [[0.8], [0.8], [0.8], [0.8], [0.8], [0.8], [0.8]]
            #PixelLayerBuilder.DiscPitchY = [[0.8], [0.8], [0.8], [0.8], [0.8], [0.8], [0.8]]
            ##PixelLayerBuilder.DiscStereo = [[0], [0], [0]]
            ##PixelLayerBuilder.DiscStereoSeparation = [[0], [0], [0]]
            #PixelLayerBuilder.AdditionalDiscZpos = [] #-645.0, -575.0, -445.0, 445.0, 575.0, 645.0]

            # BARREL
            #PixelLayerBuilder.BarrelLayers = 1
            #PixelLayerBuilder.LayersZsectors = [ 13 ]
            #PixelLayerBuilder.LayerPhiSectors = [ 22 ]
            #PixelLayerBuilder.LayerTilt = [ -20.0 ] #degree
            #PixelLayerBuilder.LayerMinPhi = [ -180.0 ] #degree
            #PixelLayerBuilder.LayerMaxPhi = [ 180.0 ] #degree
            #PixelLayerBuilder.LayerMinZ = [ -400.5 ]
            #PixelLayerBuilder.LayerMaxZ = [ 400.5 ]
            #PixelLayerBuilder.LayerRadius = [ 50.5 ]
            #PixelLayerBuilder.LayerThickness = [ 0.250 ]
            #PixelLayerBuilder.LayerLengthY = [ 60.8 ]
            #PixelLayerBuilder.LayerLengthXmin = [ 16.4]
            #PixelLayerBuilder.LayerPitchX = [ 0.010 ]
            #PixelLayerBuilder.LayerPitchY = [ 0.055 ]
            #PixelLayerBuilder.LayerRotation = [ 1 ] #degree
            #PixelLayerBuilder.LayerStereo = [ 0 ]
            #PixelLayerBuilder.AdditionalLayerRadius = [ 45.5 ] #, 83.5, 117.5 ]

            #PixelLayerBuilder.BarrelLayers = 0
            #PixelLayerBuilder.LayersZsectors = [ 13 , 13]
            #PixelLayerBuilder.LayerPhiSectors = [ 22, 38 ]
            #PixelLayerBuilder.LayerTilt = [ -20.0 , -20.0]
            #PixelLayerBuilder.LayerMinPhi = [ -180.0, -180.0]
            #PixelLayerBuilder.LayerMaxPhi = [ 180.0, 180.0]
            #PixelLayerBuilder.LayerMinZ = [ -400.5, -400.5 ]
            #PixelLayerBuilder.LayerMaxZ = [ 400.5, 400.5]
            #PixelLayerBuilder.LayerRadius = [ 50.5, 88.5]
            #PixelLayerBuilder.LayerThickness = [0.250, 0.250]
            #PixelLayerBuilder.LayerPitchX = [ 0.4, 0.4 ]
            #PixelLayerBuilder.LayerPitchY = [ 0.4, 0.4 ]
            #PixelLayerBuilder.LayerLengthY = [ 60.8, 60.8 ]
            #PixelLayerBuilder.LayerLengthXmin = [ 16.4, 16.4 ]
            #PixelLayerBuilder.LayerRotation = [1, 1 ]
            #PixelLayerBuilder.LayerStereo = [0, 0]
            ##PixelLayerBuilder.LayerStereoSeparation = [0]
            #PixelLayerBuilder.AdditionalLayerRadius = []

            #PixelLayerBuilder.BarrelLayers = 4
            #PixelLayerBuilder.LayersZsectors = [ 13, 13, 13, 13]
            #PixelLayerBuilder.LayerPhiSectors = [ 22, 38, 52 , 80]
            #PixelLayerBuilder.LayerTilt = [ -20.0, -20.0, -20.0 , -20.0] #degree
            #PixelLayerBuilder.LayerMinPhi = [ -180.0, -180.0, -180.0 , -180.0] #degree
            #PixelLayerBuilder.LayerMaxPhi = [ 180.0, 180.0, 180.0 , 180.0] #degree
            #PixelLayerBuilder.LayerMinZ = [ -400.5, -400.5, -400.5 , -400.5]
            #PixelLayerBuilder.LayerMaxZ = [ 400.5, 400.5, 400.5, 400.5]
            #PixelLayerBuilder.LayerRadius = [ 50.5, 85.5, 110.5, 135.5]
            #PixelLayerBuilder.LayerThickness = [0.250, 0.250, 0.250, 0.250]
            #PixelLayerBuilder.LayerLengthY = [ 60.8, 60.8, 60.8, 60.8]
            #PixelLayerBuilder.LayerLengthXmin = [ 16.4 , 16.4 , 16.4, 16.4]
            #PixelLayerBuilder.LayerPitchX = [ 0.4, 0.4, 0.4, 0.4 ]
            #PixelLayerBuilder.LayerPitchY = [ 0.4, 0.4, 0.4, 0.4 ]
            #PixelLayerBuilder.LayerRotation = [1, 1, 1, 1] #degree
            #PixelLayerBuilder.LayerStereo = [0, 0, 0, 0]
            ##PixelLayerBuilder.LayerStereoSeparation = [0, 0, 0]
            #PixelLayerBuilder.AdditionalLayerRadius = [] #45.5, 83.5, 117.5 ]

            # set the layer association
            PixelLayerBuilder.SetLayerAssociation = setLayerAssociation
            # output level
            #TrkDetFlags.InDetBuildingOutputLevel = 0

            PixelLayerBuilder.OutputLevel = TrkDetFlags.PixelBuildingOutputLevel(
            )
            # the binning type of the layers
            PixelLayerBinning = 2
            # add it to tool service

            ToolSvc += PixelLayerBuilder
            print PixelLayerBuilder

            # the layer providers
            PixelLayerProvider = Trk__LayerProvider(name=namePrefix +
                                                    'PixelLayerProvider')
            PixelLayerProvider.LayerBuilder = PixelLayerBuilder
            ToolSvc += PixelLayerProvider

            # put them to the caches
            layerProviders += [PixelLayerProvider]
            binningsCenter += [PixelLayerBinning]
            binningsEndcap += [PixelLayerBinning]
            colors += [3]

        SCT_LayerBuilder = None
        if buildCustomSCT:
            # SCT building
            from ISF_FatrasDetDescrTools.ISF_FatrasDetDescrToolsConf import iFatras__PlanarDetLayerBuilder
            SCT_LayerBuilder = iFatras__PlanarDetLayerBuilder(
                name=namePrefix + 'SCT_LayerBuilder')
            SCT_LayerBuilder.PixelCase = False
            SCT_LayerBuilder.Identification = 'SCT'
            SCT_LayerBuilder.InputLayerMaterialProvider = ISF_InputLayerMaterialProvider
            SCT_LayerBuilder.SiDetManagerLocation = 'SCT'
            # SCT barrel specifications
            SCT_LayerBuilder.BarrelLayerBinsZ = TrkDetFlags.SCT_BarrelLayerMaterialBinsZ(
            )
            SCT_LayerBuilder.BarrelLayerBinsPhi = TrkDetFlags.SCT_BarrelLayerMaterialBinsPhi(
            )
            # SCT endcap specifications
            SCT_LayerBuilder.EndcapLayerBinsR = TrkDetFlags.SCT_EndcapLayerMaterialBinsR(
            )
            SCT_LayerBuilder.EndcapLayerBinsPhi = TrkDetFlags.SCT_EndcapLayerMaterialBinsPhi(
            )
            SCT_LayerBuilder.CustomMaterial = False
            SCT_LayerBuilder.CustomMaterialThickness = 0.250
            SCT_LayerBuilder.CustomMaterialX0 = 8.333
            SCT_LayerBuilder.CustomMaterialL0 = 100
            SCT_LayerBuilder.CustomMaterialA = 14
            SCT_LayerBuilder.CustomMaterialZ = 28.0855
            SCT_LayerBuilder.CustomMaterialRho = 0.00233
            SCT_LayerBuilder.DetElementMapName = "SCT_IdHashDetElementMap"

            SCT_LayerBuilder.BarrelLayers = 4
            SCT_LayerBuilder.LayerSCTlike = True
            #SCT_LayerBuilder.LayerInvertOtherSurface = True
            SCT_LayerBuilder.LayersZsectors = [12, 12, 12, 12]
            SCT_LayerBuilder.LayerPhiSectors = [32, 40, 48, 56]
            SCT_LayerBuilder.LayerPhiOffset = [
                (-360. / phi * 0.2 + 180. / phi)
                for phi in SCT_LayerBuilder.LayerPhiSectors
            ]  #degrees
            SCT_LayerBuilder.LayerTilt = [11.0, 11.0, 11.25, 11.25]  #degree
            SCT_LayerBuilder.LayerMinPhi = [-180.0, -180.0, -180.0,
                                            -180.0]  #degree
            SCT_LayerBuilder.LayerMaxPhi = [180.0, 180.0, 180.0,
                                            180.0]  #degree
            SCT_LayerBuilder.LayerMinZ = [
                -742.095, -742.095, -742.095, -742.095
            ]
            SCT_LayerBuilder.LayerMaxZ = [742.095, 742.095, 742.095, 742.095]
            SCT_LayerBuilder.LayerRadius = [299., 371., 443., 514.]
            SCT_LayerBuilder.LayerRSeparation = [-3., -3., -3., -3.]
            SCT_LayerBuilder.LayerThickness = [0.2850, 0.2850, 0.2850, 0.2850]
            SCT_LayerBuilder.LayerLengthY = [126.09, 126.09, 126.09, 126.09]
            SCT_LayerBuilder.LayerLengthXmin = [61.44, 61.44, 61.44, 61.44]
            SCT_LayerBuilder.LayerPitchX = [0.080, 0.080, 0.080, 0.080]
            #SCT_LayerBuilder.LayerPitchX = [ 6.144 , 6.144 , 6.144 , 6.144]
            SCT_LayerBuilder.LayerPitchY = [126.09, 126.09, 126.09, 126.09]
            SCT_LayerBuilder.LayerRotation = [0., 0., 0., 0.]  #degree
            SCT_LayerBuilder.LayerStereo = [-1.15, -1.15, -1.15, -1.15]
            SCT_LayerBuilder.LayerStereoSeparation = [1., 1., 1., 1.]
            SCT_LayerBuilder.AdditionalLayerRadius = []

            SCT_LayerBuilder.EndcapDiscs = 9
            SCT_LayerBuilder.DiscSCTlike = True
            #SCT_LayerBuilder.DiscSCTlike = False
            # discs are ordered from the smaller z to the bigger one
            # from the smallest ring to the biggest
            SCT_LayerBuilder.DiscPhiSectors = [[40, 52], [40, 40, 52],
                                               [40, 40, 52], [40, 40, 52],
                                               [40, 40, 52], [40, 40, 52],
                                               [40, 52], [40, 52], [48]]
            #SCT_LayerBuilder.DiscZpos = [-2735.45, -2520.25, -2130.45, -1786.65, -1415.95, -1315.15, -1106.75, -949.25, -869.05,
            #                              869.05, 949.25, 1106.75, 1315.15, 1415.95, 1786.65, 2130.45, 2520.25, 2735.45]
            SCT_LayerBuilder.DiscZpos = [
                -2742.45, -2511.25, -2123.45, -1778.55, -1406.95, -1307.15,
                -1098.75, -941.25, -861.05, 860.05, 940.25, 1097.75, 1306.15,
                1405.95, 1777.65, 2121.45, 2511.25, 2741.45
            ]
            SCT_LayerBuilder.DiscRingMinR = [[337.6, 438.77],
                                             [275.0, 337.6, 438.77],
                                             [275.0, 337.6, 438.77],
                                             [275.0, 337.6, 438.77],
                                             [275.0, 337.6, 438.77],
                                             [275.0, 337.6, 438.77],
                                             [337.6, 438.77], [402.8, 438.77],
                                             [438.77]]
            SCT_LayerBuilder.DiscRingMaxR = [[455.3, 560.0],
                                             [334.1, 455.3, 560.0],
                                             [334.1, 455.3, 560.0],
                                             [334.1, 455.3, 560.0],
                                             [334.1, 455.3, 560.0],
                                             [334.1, 455.3, 560.0],
                                             [455.3, 560.0], [455.3, 560.0],
                                             [560.0]]
            SCT_LayerBuilder.DiscMinPhi = [[-180.0, -180.0],
                                           [-180.0, -180.0, -180],
                                           [-180.0, -180.0, -180],
                                           [-180.0, -180.0, -180],
                                           [-180.0, -180.0, -180],
                                           [-180.0, -180.0, -180],
                                           [-180.0, -180.0], [-180.0, -180.0],
                                           [-180.0]]
            SCT_LayerBuilder.DiscMaxPhi = [[180.0, 180.0], [180.0, 180.0, 180],
                                           [180.0, 180.0, 180],
                                           [180.0, 180.0, 180],
                                           [180.0, 180.0, 180],
                                           [180.0, 180.0, 180], [180.0, 180.0],
                                           [180.0, 180.0], [180.0]]
            SCT_LayerBuilder.DiscThickness = [
                0.2850, 0.2850, 0.2850, 0.2850, 0.2850, 0.2850, 0.2850, 0.2850,
                0.2850
            ]
            #SCT_LayerBuilder.DiscLengthY = [[117.7, 117.7], [117.7, 117.7, 117.7], [117.7, 117.7, 117.7], [117.7, 117.7, 117.7], [117.7, 117.7, 117.7], [117.7, 117.7, 117.7], [117.7, 117.7], [117.7, 117.7], [117.7]]
            #SCT_LayerBuilder.DiscLengthXmin = [[53.78, 53.78], [53.78, 53.78, 53.78], [53.78, 53.78, 53.78], [53.78, 53.78, 53.78], [53.78, 53.78, 53.78], [53.78, 53.78, 53.78], [53.78, 53.78], [53.78, 53.78], [53.78]]
            #SCT_LayerBuilder.DiscLengthXmax = [[72.53, 72.53], [72.53, 72.53, 72.53], [72.53, 72.53, 72.53], [72.53, 72.53, 72.53], [72.53, 72.53, 72.53], [72.53, 72.53, 72.53], [72.53, 72.53], [72.53, 72.53], [72.53]]
            #SCT_LayerBuilder.DiscLengthXmin = [[83.78, 83.78], [83.78, 83.78, 83.78], [83.78, 83.78, 83.78], [83.78, 83.78, 83.78], [83.78, 83.78, 83.78], [83.78, 83.78, 83.78], [83.78, 83.78], [83.78, 83.78], [83.78]]
            #SCT_LayerBuilder.DiscLengthXmax = [[92.53, 92.53], [92.53, 92.53, 92.53], [92.53, 92.53, 92.53], [92.53, 92.53, 92.53], [92.53, 92.53, 92.53], [92.53, 92.53, 92.53], [92.53, 92.53], [92.53, 92.53], [92.53]]
            SCT_LayerBuilder.DiscLengthXmin = [[53.784, 54.490],
                                               [43.810, 53.784, 54.490],
                                               [43.810, 53.784, 54.490],
                                               [43.810, 53.784, 54.490],
                                               [43.810, 53.784, 54.490],
                                               [43.810, 53.784, 54.490],
                                               [53.784, 54.490],
                                               [64.174, 54.490], [54.490]]
            SCT_LayerBuilder.DiscLengthXmax = [[72.534, 69.548],
                                               [53.226, 72.534, 69.548],
                                               [53.226, 72.534, 69.548],
                                               [53.226, 72.534, 69.548],
                                               [53.226, 72.534, 69.548],
                                               [53.226, 72.534, 69.548],
                                               [72.534, 69.548],
                                               [72.534, 69.548], [69.548]]
            SCT_LayerBuilder.DiscLengthY = [[117.700, 121.236],
                                            [59.100, 117.700, 121.236],
                                            [59.100, 117.700, 121.236],
                                            [59.100, 117.7, 121.236],
                                            [59.100, 117.7, 121.236],
                                            [59.100, 117.7, 121.236],
                                            [117.7, 121.236],
                                            [52.474, 121.236], [121.236]]
            #SCT_LayerBuilder.DiscPitchX = [[0.080, 0.080], [0.080, 0.080, 0.080], [0.080, 0.080, 0.080], [0.080, 0.080, 0.080], [0.080, 0.080, 0.080], [0.080, 0.080, 0.080], [0.080, 0.080], [0.080, 0.080], [0.080]]
            #SCT_LayerBuilder.DiscPitchY = [[117.700, 121.236], [59.100, 117.700, 121.236], [59.100, 117.700, 121.236], [59.100, 117.7, 121.236], [59.100, 117.7, 121.236], [59.100, 117.7, 121.236], [117.7, 121.236], [52.474, 121.236], [121.236]]
            SCT_LayerBuilder.DiscPitchX = [[207.0e-06, 161.5e-06],
                                           [207.0e-06, 207.0e-06, 161.5e-06],
                                           [207.0e-06, 207.0e-06, 161.5e-06],
                                           [207.0e-06, 207.0e-06, 161.5e-06],
                                           [207.0e-06, 207.0e-06, 161.5e-06],
                                           [207.0e-06, 207.0e-06, 161.5e-06],
                                           [207.0e-06, 161.5e-06],
                                           [207.0e-06, 161.5e-06], [161.5e-06]
                                           ]  #in rad for DiscSurfaces
            SCT_LayerBuilder.DiscPitchY = [[117.700, 121.236],
                                           [59.100, 117.700, 121.236],
                                           [59.100, 117.700, 121.236],
                                           [59.100, 117.7, 121.236],
                                           [59.100, 117.7, 121.236],
                                           [59.100, 117.7, 121.236],
                                           [117.7, 121.236], [52.474, 121.236],
                                           [121.236]]
            #SCT_LayerBuilder.DiscPitchX = [[5.3784, 5.4490], [4.3810, 5.3784, 5.4490], [4.3810, 5.3784, 5.4490], [4.3810, 5.3784, 5.4490], [4.3810, 5.3784, 5.4490], [4.3810, 5.3784, 5.4490], [5.3784, 5.4490], [6.4174, 5.4490], [5.4490]]
            #SCT_LayerBuilder.DiscPitchY = [[117.700, 121.236], [59.100, 117.700, 121.236], [59.100, 117.700, 121.236], [59.100, 117.7, 121.236], [59.100, 117.7, 121.236], [59.100, 117.7, 121.236], [117.7, 121.236], [52.474, 121.236], [121.236]]
            SCT_LayerBuilder.DiscSeparation = [[5.3, 5.3], [5.3, 5.3, 5.3],
                                               [5.1, 5.1,
                                                5.1], [5.3, 5.3, 5.3],
                                               [5.3, 5.3, 5.3],
                                               [5.2, 5.2, 5.2], [5.2, 5.2],
                                               [5.2, 5.2], [5.1]]
            SCT_LayerBuilder.RingDisplacement = [[15.1, 15.1],
                                                 [15.1, 15.1, 15.1],
                                                 [15.2, 15.2, 15.2],
                                                 [15.1, 15.1, 15.1],
                                                 [15.1, 15.1, 15.1],
                                                 [15.15, 15.15, 15.15],
                                                 [15.15, 15.15],
                                                 [15.15, 15.15], [0.]]
            SCT_LayerBuilder.DiscStereo = [[2.3, 2.3], [2.3, 2.3, 2.3],
                                           [2.3, 2.3, 2.3], [2.3, 2.3, 2.3],
                                           [2.3, 2.3, 2.3], [2.3, 2.3, 2.3],
                                           [2.3, 2.3, 2.3], [2.3, 2.3],
                                           [2.3, 2.3], [2.3]]
            #SCT_LayerBuilder.DiscStereo = [[10.0, 10.0], [10., 10., 10.], [10., 10., 10.], [10., 10., 10.], [10., 10., 10.], [10., 10., 10.], [10., 10., 10.], [10., 10.], [10., 10.], [10.]]
            SCT_LayerBuilder.DiscStereoSeparation = [[1., 1.], [1., 1., 1.],
                                                     [1., 1.,
                                                      1.], [1., 1., 1.],
                                                     [1., 1., 1.],
                                                     [1., 1., 1.], [1., 1.],
                                                     [1., 1.], [1.]]

            #SCT_LayerBuilder.EndcapDiscs = 1
            #SCT_LayerBuilder.DiscSCTlike = True
            ##SCT_LayerBuilder.DiscSCTlike = False
            ## discs are ordered from the smaller z to the bigger one
            ## from the smallest ring to the biggest
            #SCT_LayerBuilder.DiscPhiSectors = [[16]]
            #SCT_LayerBuilder.DiscZpos = [-1000, 1000]
            #SCT_LayerBuilder.DiscRingMinR = [[337.6]]
            #SCT_LayerBuilder.DiscRingMaxR = [[455.3]]
            #SCT_LayerBuilder.DiscMinPhi = [[-180.0]]
            #SCT_LayerBuilder.DiscMaxPhi = [[180.0]]
            #SCT_LayerBuilder.DiscThickness = [0.2850]
            #SCT_LayerBuilder.DiscLengthXmin = [[40]]
            #SCT_LayerBuilder.DiscLengthXmax = [[80]]
            #SCT_LayerBuilder.DiscLengthY = [[117.70]]
            #SCT_LayerBuilder.DiscPitchX = [[0.080]]
            #SCT_LayerBuilder.DiscPitchY = [[117.70]]
            #SCT_LayerBuilder.DiscStereo = [[90.]]
            #SCT_LayerBuilder.DiscStereoSeparation = [[1.]]

            #SCT_LayerBuilder.EndcapDiscs = 1
            #SCT_LayerBuilder.DiscSCTlike = True
            ##SCT_LayerBuilder.DiscSCTlike = False
            ## discs are ordered from the smaller z to the bigger one
            ## from the smallest ring to the biggest
            #SCT_LayerBuilder.DiscPhiSectors = [[16]]
            #SCT_LayerBuilder.DiscZpos = [-900., 900.]
            #SCT_LayerBuilder.DiscRingMinR = [[337.6]]
            #SCT_LayerBuilder.DiscRingMaxR = [[455.3]]
            #SCT_LayerBuilder.DiscMinPhi = [[-180.0]]
            #SCT_LayerBuilder.DiscMaxPhi = [[180.0]]
            #SCT_LayerBuilder.DiscThickness = [0.2850]
            #SCT_LayerBuilder.DiscLengthXmin = [[53.784]]
            #SCT_LayerBuilder.DiscLengthXmax = [[72.534]]
            #SCT_LayerBuilder.DiscLengthY = [[117.700]]
            #SCT_LayerBuilder.DiscPitchX = [[207.0e-06]]
            #SCT_LayerBuilder.DiscPitchX = [[0.0079739*2.]]
            #SCT_LayerBuilder.DiscPitchY = [[117.700]]
            #SCT_LayerBuilder.DiscStereo = [[10.]]
            #SCT_LayerBuilder.DiscStereoSeparation = [[1.]]

            SCT_LayerBuilder.AdditionalDiscZpos = [-2850, 2850]

            # set the layer association
            SCT_LayerBuilder.SetLayerAssociation = setLayerAssociation

            # output level
            SCT_LayerBuilder.OutputLevel = TrkDetFlags.SCT_BuildingOutputLevel(
            )

            # the binning type of the layer
            SCT_LayerBinning = 2
            # SCT -> ToolSvc
            ToolSvc += SCT_LayerBuilder
            print SCT_LayerBuilder

            # the layer providers
            SCT_LayerProvider = Trk__LayerProvider(name=namePrefix +
                                                   'SCT_LayerProvider')
            SCT_LayerProvider.LayerBuilder = SCT_LayerBuilder
            ToolSvc += SCT_LayerProvider

            # put them to the caches
            layerProviders += [SCT_LayerProvider]
            binningsCenter += [SCT_LayerBinning]
            binningsEndcap += [SCT_LayerBinning]
            colors += [4]

        TRT_LayerBuilder = None
        if buildCustomTRT:
            print "No TRT for the moment"
            # TRT building
        #from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__TRT_LayerBuilder
        #TRT_LayerBuilder = InDet__TRT_LayerBuilder(name=namePrefix+'TRT_LayerBuilder')
        ## TRT barrel specifications
        #TRT_LayerBuilder.ModelBarrelLayers  = TrkDetFlags.TRT_BarrelModelLayers()
        #TRT_LayerBuilder.BarrelLayerBinsZ   = TrkDetFlags.TRT_BarrelLayerMaterialBinsZ()
        #TRT_LayerBuilder.BarrelLayerBinsPhi = TrkDetFlags.TRT_BarrelLayerMaterialBinsPhi()
        ## SCT endcap specifications
        #TRT_LayerBuilder.ModelEndcapLayers  = TrkDetFlags.TRT_EndcapModelLayers()
        #TRT_LayerBuilder.EndcapLayerBinsR   = TrkDetFlags.TRT_EndcapLayerMaterialBinsR()
        #TRT_LayerBuilder.EndcapLayerBinsPhi = TrkDetFlags.TRT_EndcapLayerMaterialBinsPhi()
        ## set the binning from bi-aequidistant to arbitrary for complex TRT volumes
        #TRT_LayerBinning = 1
        #if buildTrtStrawLayers or TrkDetFlags.TRT_BuildStrawLayers() :
        #TRT_LayerBinning = 2
        #TRT_LayerBuilder.ModelLayersOnly = False
        ## output level
        #TRT_LayerBuilder.OutputLevel        = TrkDetFlags.TRT_BuildingOutputLevel()
        ## TRT -> ToolSvc
        #ToolSvc += TRT_LayerBuilder
        ## put them to the caches
        #layerbuilders += [ TRT_LayerBuilder ]
        #binnings      += [ TRT_LayerBinning ]
        #colors        += [ 5 ]

        # helpers for the InDetTrackingGeometry Builder : layer array creator

        if createXML:
            from ISF_FatrasDetDescrTools import XMLDumper
            InDetXMLDumper = XMLDumper.XMLDumper(name='InDetXMLDumper',
                                                 fileName=dictionaryFileName)
            if IBLLayerBuilder:
                InDetXMLDumper.addPixelBuilder(IBLLayerBuilder)
            if PixelLayerBuilder:
                InDetXMLDumper.addPixelBuilder(PixelLayerBuilder)
            if SCT_LayerBuilder:
                InDetXMLDumper.addSCTBuilder(SCT_LayerBuilder)
            if TRT_LayerBuilder:
                InDetXMLDumper.addTRTBuilder(TRT_LayerBuilder)
            InDetXMLDumper.dump()
            InDetXMLDumper.closeFile()

        # layer && tracking volume array creator

        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerArrayCreator
        InDetLayerArrayCreator = Trk__LayerArrayCreator(
            name='InDetLayerArrayCreator')
        InDetLayerArrayCreator.EmptyLayerMode = 2  # deletes empty material layers from arrays
        InDetLayerArrayCreator.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel(
        )
        # add to ToolSvc
        ToolSvc += InDetLayerArrayCreator

        # helpers for the InDetTrackingGeometry Builder : volume array creator
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeArrayCreator
        InDetTrackingVolumeArrayCreator = Trk__TrackingVolumeArrayCreator(
            name='InDetTrackingVolumeArrayCreator')
        InDetTrackingVolumeArrayCreator.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel(
        )
        # add to ToolSvc
        ToolSvc += InDetTrackingVolumeArrayCreator

        # helpers for the InDetTrackingGeometry Builder : tracking voluem helper for glueing
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeHelper
        InDetTrackingVolumeHelper = Trk__TrackingVolumeHelper(
            name='InDetTrackingVolumeHelper')
        InDetTrackingVolumeHelper.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel(
        )
        # the material bins
        InDetTrackingVolumeHelper.BarrelLayerBinsZ = TrkDetFlags.InDetPassiveLayerMaterialBinsRz(
        )
        InDetTrackingVolumeHelper.BarrelLayerBinsPhi = TrkDetFlags.InDetPassiveLayerMaterialBinsPhi(
        )
        InDetTrackingVolumeHelper.EndcapLayerBinsR = TrkDetFlags.InDetPassiveLayerMaterialBinsRz(
        )
        InDetTrackingVolumeHelper.EndcapLayerBinsPhi = TrkDetFlags.InDetPassiveLayerMaterialBinsPhi(
        )
        # add to ToolSvc
        ToolSvc += InDetTrackingVolumeHelper

        # helpers for the InDetTrackingGeometry Builder : cylinder volume creator
        from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__CylinderVolumeCreator
        InDetCylinderVolumeCreator = Trk__CylinderVolumeCreator(
            name='InDetCylinderVolumeCreator')
        # give him the layer array creator
        InDetCylinderVolumeCreator.LayerArrayCreator = InDetLayerArrayCreator
        InDetCylinderVolumeCreator.TrackingVolumeArrayCreator = InDetTrackingVolumeArrayCreator
        InDetCylinderVolumeCreator.TrackingVolumeHelper = InDetTrackingVolumeHelper
        # specifiy the binning, passive layers, entry layers
        InDetCylinderVolumeCreator.PassiveLayerThickness = TrkDetFlags.InDetPassiveLayerThickness(
        )
        InDetCylinderVolumeCreator.PassiveLayerBinsPhi = TrkDetFlags.InDetPassiveLayerMaterialBinsPhi(
        )
        InDetCylinderVolumeCreator.PassiveLayerBinsRZ = TrkDetFlags.InDetPassiveLayerMaterialBinsRz(
        )
        # output level
        InDetCylinderVolumeCreator.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel(
        )
        # add to ToolSvc
        ToolSvc += InDetCylinderVolumeCreator

        # the envelope definition service
        from SubDetectorEnvelopes.SubDetectorEnvelopesConf import DetDescrDBEnvelopeSvc
        AtlasEnvelopeSvc = DetDescrDBEnvelopeSvc(
            'AtlasEnvelopeSvcDefinitionSvc')

        # set the output level for the Envelope service
        AtlasEnvelopeSvc.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel()
        # add to SvcMgr
        ServiceMgr += AtlasEnvelopeSvc

        # the tracking geometry builder
        InDet__StagedTrackingGeometryBuilder.__init__(
            self,
            namePrefix + name,
            LayerBuilders=layerProviders,
            LayerBinningTypeCenter=binningsCenter,
            LayerBinningTypeEndcap=binningsEndcap,
            ColorCodes=colors,
            EnvelopeDefinitionSvc=AtlasEnvelopeSvc,
            VolumeEnclosureDiscPositions=[3000., 3450.],
            TrackingVolumeCreator=InDetCylinderVolumeCreator,
            LayerArrayCreator=InDetLayerArrayCreator,
            CheckForRingLayout=False,
            BuildBoundaryLayers=TrkDetFlags.InDetBuildMaterialBoundaries(),
            ReplaceAllJointBoundaries=TrkDetFlags.InDetBuildJointBoundaries(),
            OutputLevel=TrkDetFlags.InDetBuildingOutputLevel(),
            ExitVolumeName=TrkDetFlags.InDetContainerName(),
            MagneticFieldMode=TrkDetFlags.MagneticFieldMode())
예제 #19
0
def initialiseCoolDataBaseFolder():
    if TrkDetFlags.ConfigurationOutputLevel() < 3 :
      print ('[ Configuration : start ] *** FatrasTrackingGeometry ********************************')
      print ('[ TrackingGeometrySvc ]')

    # check whether the material retrieval is ment to be from COOL
    if TrkDetFlags.MaterialSource() == 'COOL' :
        # the tag names
        CoolDataBaseFolder = TrkDetFlags.MaterialStoreGateKey()
        AtlasMaterialTag = TrkDetFlags.MaterialTagBase()+str(TrkDetFlags.MaterialVersion())+'_'

        if TrkDetFlags.ConfigurationOutputLevel() < 3 :
           print ('[ TrackingGeometrySvc ] Associating DB folder : ',CoolDataBaseFolder)
           print ('[ TrackingGeometrySvc ]     base material tag : ',AtlasMaterialTag)

        # we need the conditions interface
        from IOVDbSvc.CondDB import conddb
        # use a local database
        if TrkDetFlags.MaterialDatabaseLocal():
            # specify the local database
            DataBasePath  = TrkDetFlags.MaterialDatabaseLocalPath()
            DataBaseName  = TrkDetFlags.MaterialDatabaseLocalName()
            MagicTag      = TrkDetFlags.MaterialMagicTag()
            DataBaseConnection = '<dbConnection>sqlite://X;schema='+DataBasePath+DataBaseName+';dbname=OFLP200</dbConnection>'
            conddb.blockFolder('/GLOBAL/TrackingGeo/LayerMaterial')
            conddb.addFolderWithTag('',DataBaseConnection+CoolDataBaseFolder,AtlasMaterialTag+MagicTag,force=True)
            if TrkDetFlags.ConfigurationOutputLevel() < 3 :
                print ('[ TrackingGeometrySvc ] Using Local Database: '+DataBaseConnection)
            # make sure that the pool files are in the catalog
            #from PoolSvc.PoolSvcConf import PoolSvc
            #PoolSvc.ReadCatalog += [ DataBasePath+'PoolFileCatalog.xml' ]
        elif TrkDetFlags.SLHC_Geometry() :
            # set the folder to the SLHC location
            CoolDataBaseFolder = '/GLOBAL/TrackingGeo/SLHC_LayerMaterial'
            ctag = AtlasMaterialTag+TrkDetFlags.MaterialMagicTag()
            cfoldertag = CoolDataBaseFolder+' <tag>'+ctag+'</tag>'
            conddb.addFolderSplitMC('GLOBAL',cfoldertag,cfoldertag)
        else :
            # load the right folders (preparation for calo inclusion)
            cfolder = CoolDataBaseFolder +'<tag>TagInfoMajor/'+AtlasMaterialTag+'/GeoAtlas</tag>'
            conddb.addFolderSplitMC('GLOBAL',cfolder,cfolder)

    #HACK: CoolDataBaseFolder may not be set at this point! Is this right? -KG
    return CoolDataBaseFolder
예제 #20
0
TrkDetFlags.TRT_BuildStrawLayers = False
# TrkDetFlags.MaterialFromCool                = True
TrkDetFlags.MaterialDatabaseLocal = True  # False and TrkDetFlags.MaterialFromCool()
TrkDetFlags.MaterialStoreGateKey = '/GLOBAL/TrackingGeo/SLHC_LayerMaterial'
#TrkDetFlags.MaterialTagBase                 = 'SLHC_LayerMat_v'
TrkDetFlags.MaterialTagBase = 'AtlasLayerMat_v'
# TrkDetFlags.MaterialVersion                 = 6
TrkDetFlags.MaterialVersion = 17

TrkDetFlags.MaterialSource = 'COOL'

if SLHC_Flags.SLHC_Version() is '':
    TrkDetFlags.MaterialMagicTag = jobproperties.Global.DetDescrVersion()
else:
    TrkDetFlags.MaterialMagicTag = SLHC_Flags.SLHC_Version()
if TrkDetFlags.MaterialDatabaseLocal() is True:
    # prepare the magic tag
    splitGeo = DetDescrVersion.split('-')
    TrkDetFlags.MaterialMagicTag = splitGeo[0] + '-' + splitGeo[
        1] + '-' + splitGeo[2]
    # now say where the file is
    TrkDetFlags.MaterialStoreGateKey = '/GLOBAL/TrackingGeo/BinnedLayerMaterial'
    TrkDetFlags.MaterialDatabaseLocalPath = './'
    TrkDetFlags.MaterialDatabaseLocalName = 'AtlasLayerMaterial-' + DetDescrVersion + '.db'
    # TrkDetFlags.MaterialDatabaseLocalPath    = ''
    # TrkDetFlags.MaterialDatabaseLocalName    = 'SLHC_LayerMaterial-'+SLHC_Flags.SLHC_Version()+'.db'
TrkDetFlags.MagneticFieldCallbackEnforced = False
# TrkDetFlags.LArUseMaterialEffectsOnTrackProvider  = False
# TrkDetFlags.TileUseMaterialEffectsOnTrackProvider = False

import MagFieldServices.SetupField
예제 #21
0
# --- the truth track creation algorithm
from InDetRecExample.TrackingCommon import getInDetPRDtoTrackMapToolGangedPixels
from TrkTruthTrackAlgs.TrkTruthTrackAlgsConf import Trk__TruthTrackCreation
InDetTruthTrackCreation = Trk__TruthTrackCreation(
    name='InDetTruthTrackCreation',
    PRD_TruthTrajectoryBuilder=ISF_PRD_TruthTrajectoryBuilder,
    TruthTrackBuilder=InDetTruthTrackBuilder,
    OutputTrackCollection=InDetKeys.PseudoTracks(),
    AssociationTool=getIFS_PRDtoTrackMapTool(),
    TrackSummaryTool=InDetTrackSummaryTool)
InDetTruthTrackCreation.OutputLevel = OutputLevel  #VERBOSE
topSequence += InDetTruthTrackCreation
print InDetTruthTrackCreation

if TrkDetFlags.ISF_FatrasCustomGeometry():
    InDetKeys.PixelClustersTruth = "PRD_MultiTruthPlanarPixel"
    InDetKeys.SCT_ClustersTruth = "PRD_MultiTruthPlanarSCT"
InDetFlags.doPhysValMon = True
InDetRecTestBLayerTool = None

InDetTrackSummaryToolSharedHits = InDetTrackSummaryTool

InDetKeys.UnslimmedTracks = InDetKeys.PseudoTracks()
InDetKeys.UnslimmedTracksTruth = InDetKeys.PseudoTracksTruth()

InputTrackCollection = InDetKeys.PseudoTracks()

include("InDetRecExample/ConfiguredInDetTrackTruth.py")
InDetTracksTruth = ConfiguredInDetTrackTruth(
    InDetKeys.PseudoTracks(), InDetKeys.PseudoDetailedTracksTruth(),