def CaloLumiBCIDToolDefault(name='CaloLumiBCIDToolDefault'): mlog = logging.getLogger('CaloLumiBCIDToolDefault') from CaloTools.CaloToolsConf import CaloLumiBCIDTool from AthenaCommon.AthenaCommonFlags import athenaCommonFlags from AthenaCommon.GlobalFlags import globalflags if globalflags.DataSource() == 'data': from LumiBlockComps.LuminosityToolDefault import LuminosityToolDefault theLumiTool = LuminosityToolDefault() from AthenaCommon.AppMgr import ToolSvc ToolSvc += theLumiTool from IOVDbSvc.CondDB import conddb #conddb.addFolder("","/LAR/ElecCalibOfl/LArPileupShape<db>sqlite://;schema=/afs/cern.ch/user/g/gunal/public/DB/bcid/shape.db;dbname=COMP200</db><key>LArShape32</key><tag>LARElecCalibOflLArPileupShape-mc</tag>") #conddb.addFolder("","/LAR/ElecCalibOfl/LArPileupAverage<db>sqlite://;schema=/afs/cern.ch/user/g/gunal/public/DB/bcid/LArPileupAverage-data.db;dbname=COMP200</db><tag>LARElecCalibOflLArPileupAverage-data11-00</tag>") if athenaCommonFlags.isOnline: conddb.addFolder( "LAR_ONL", "/LAR/LArPileup/LArPileupShape<key>LArShape32</key>") conddb.addFolder("LAR_ONL", "/LAR/LArPileup/LArPileupAverage") else: conddb.addFolder( "LAR_OFL", "/LAR/ElecCalibOfl/LArPileupShape<key>LArShape32</key>") conddb.addFolder("LAR_OFL", "/LAR/ElecCalibOfl/LArPileupAverage") theTool = CaloLumiBCIDTool(name, isMC=False, LumiTool=theLumiTool, keyShape="LArShape32") else: from LArRecUtils.LArOFCToolDefault import LArOFCToolDefault theOFCTool = LArOFCToolDefault() from AthenaCommon.AppMgr import ToolSvc ToolSvc += theOFCTool from TrigBunchCrossingTool.BunchCrossingTool import BunchCrossingTool theBunchCrossingTool = BunchCrossingTool() from IOVDbSvc.CondDB import conddb conddb.addFolder("LAR_OFL", "/LAR/ElecCalibMC/Shape") #conddb.addFolder("","/LAR/ElecCalibMC/LArPileupAverage<db>sqlite://;schema=/afs/cern.ch/user/g/gunal/public/DB/bcid/LArPileupAverage-mc.db;dbname=OFLP200</db><tag>LARElecCalibMCLArPileupAverage-mc11b-00</tag>") conddb.addFolder("LAR_OFL", "/LAR/ElecCalibMC/LArPileupAverage") theTool = CaloLumiBCIDTool(name, isMC=True, LArOFCTool=theOFCTool, BunchCrossingTool=theBunchCrossingTool) return theTool
def CaloMBAverageToolDefault(name='CaloMBAverageToolDefault'): from CaloTools.CaloToolsConf import CaloMBAverageTool # get public tool LArOFCTool from LArRecUtils.LArOFCToolDefault import LArOFCToolDefault theOFCTool = LArOFCToolDefault() from AthenaCommon.AppMgr import ToolSvc ToolSvc += theOFCTool from AthenaCommon.BeamFlags import jobproperties if jobproperties.Beam.zeroLuminosity(): NMinBias = 0 deltaBunch = 1 else: NMinBias = jobproperties.Beam.numberOfCollisions() deltaBunch = int(jobproperties.Beam.bunchSpacing() / (25. * ns) + 0.5) theTool = CaloMBAverageTool(name, LArOFCTool=theOFCTool, NMinBias=NMinBias, deltaBunch=deltaBunch) return theTool
theLArPileUpTool.MaskingTool = job.digitmaker1.LArPileUpTool.MaskingTool theLArPileUpTool.BadChannelTool = job.digitmaker1.LArPileUpTool.BadChannelTool theLArDigits.LArPileUpTool = theLArPileUpTool job += theLArDigits from LArROD.LArRODConf import LArRawChannelBuilder newLArRawChannelBuilder = LArRawChannelBuilder("newLArRawChannelBuilder") newLArRawChannelBuilder.DataLocation = job.LArRawChannelBuilder.DataLocation newLArRawChannelBuilder.ADC2MeVTool = ToolSvc.LArADC2MeVToolDefault if globalflags.DataSource() == 'data' or larRODFlags.forceIter(): newLArRawChannelBuilder.UseOFCTool = False newLArRawChannelBuilder.PhaseInversion = True newLArRawChannelBuilder.LArRawChannelContainerName = "LArRawChannels" newLArRawChannelBuilder.PedestalKey = 'LArPedestal' else: from LArRecUtils.LArOFCToolDefault import LArOFCToolDefault theOFCTool = LArOFCToolDefault() ToolSvc += theOFCTool newLArRawChannelBuilder.OFCTool = theOFCTool newLArRawChannelBuilder.LArRawChannelContainerName = job.LArRawChannelBuilder.LArRawChannelContainerName newLArRawChannelBuilder.UseOFCTool = True newLArRawChannelBuilder.EvtStore = "BkgEvent_0_SG" newLArRawChannelBuilder.OutputLevel = DEBUG job += newLArRawChannelBuilder from LArROD.LArDigits import DefaultLArDigitThinner newLArDigitThinner = DefaultLArDigitThinner( 'newLArDigitThinner') # automatically added to topSequence job.newLArDigitThinner.EvtStore = "BkgEvent_0_SG"
include.block("CaloConditions/LArTTCellMap_ATLAS_jobOptions.py") include.block("CaloConditions/CaloTTIdMap_ATLAS_jobOptions.py") # the LAr and Calo detector description package include("CaloDetMgrDetDescrCnv/CaloDetMgrDetDescrCnv_joboptions.py") include("CaloIdCnv/CaloIdCnv_joboptions.py") #include( "LArCondCnv/LArCondCnv_IdMapH6_jobOptions.py" ) # -- Digitization - LArCalorimeter include("LArDetDescr/LArDetDescr_H6_joboptions.py") theApp.Dlls += ["LArG4H6SDTools"] from LArG4H6SD.LArG4H6SDToolsConf import LArTBH6TriggerTimeTool from AthenaCommon.AppMgr import ToolSvc ToolSvc += LArTBH6TriggerTimeTool() from LArRecUtils.LArOFCToolDefault import LArOFCToolDefault theLArOFCTool = LArOFCToolDefault() theLArOFCTool.FromDatabase = False ToolSvc += theLArOFCTool ToolSvc.LArTBH6TriggerTimeTool.isFixed = True ToolSvc.LArTBH6TriggerTimeTool.FixedTime = 83. #maybe this one ToolSvc.LArTBH6TriggerTimeTool.OutputLevel = 4 include("H6G4Sim/LArDigitization_H6G4_jobOptions.py") DetDescrCnvSvc.DecodeIdDict = True include("LArROD/LArROD_jobOptions.py") LArRawChannelBuilder.Ecut = 0 #DetDescrCnvSvc.LArIDFileName = "IdDictParser/IdDictLArCalorimeter_H6_2004.xml"
def CaloNoiseToolDefault(flag='',name='CaloNoiseToolDefault'): # check if tool already exists from AthenaCommon.AppMgr import ServiceMgr as svcMgr if hasattr(svcMgr.ToolSvc, name): # re-use previously configured (public) tool return getattr(svcMgr.ToolSvc, name) mlog = logging.getLogger( 'CaloNoiseToolDefault' ) if flag=='db' : _useDB = True elif flag=='tool' : _useDB = False else : # will put here logic to select according to global flag from AthenaCommon.GlobalFlags import globalflags from AthenaCommon.BeamFlags import jobproperties if globalflags.DataSource()=='data' and globalflags.DetGeo()!='ctbh6' and globalflags.DetGeo()!='ctbh8': _useDB = True elif globalflags.DataSource()=='geant4' and jobproperties.Beam.zeroLuminosity(): _useDB = True else: # now uses also calonoisetoolDB for MC with pileup.. requires a new global tag for pileup reco to have the noise properly read _useDB = True if _useDB : mlog.info(" Using CaloNoiseToolDB" ) from AthenaCommon.GlobalFlags import globalflags if globalflags.DataSource()=='data': from CaloTools.CaloNoiseToolDBData import CaloNoiseToolDBData theTool = CaloNoiseToolDBData(name) else: from CaloTools.CaloNoiseToolDBMC import CaloNoiseToolDBMC theTool = CaloNoiseToolDBMC(name) return theTool else : mlog.info("Using CaloNoiseTool") from CaloTools.CaloToolsConf import CaloNoiseTool # Tile configuration from AthenaCommon.DetFlags import DetFlags if DetFlags.Tile_on(): from TileConditions.TileInfoConfigurator import TileInfoConfigurator tileInfoConfigurator = TileInfoConfigurator() tileInfoConfigurator.setupCOOL() UseTile = True else: UseTile = False # CaloNoiseTool configuration WorkMode=1 WithOF=True TileInfoName="TileInfo" # get public tool LArADC2MeVTool from LArRecUtils.LArADC2MeVToolDefault import LArADC2MeVToolDefault theADC2MeVTool = LArADC2MeVToolDefault() from AthenaCommon.AppMgr import ToolSvc ToolSvc += theADC2MeVTool # get public tool LArOFCTool from LArRecUtils.LArOFCToolDefault import LArOFCToolDefault theOFCTool = LArOFCToolDefault() from AthenaCommon.AppMgr import ToolSvc ToolSvc += theOFCTool from AthenaCommon.BeamFlags import jobproperties if jobproperties.Beam.zeroLuminosity(): ReturnNoise="electronicNoise" NMinBias=0 deltaBunch=1 else: ReturnNoise="totalNoise" NMinBias=jobproperties.Beam.numberOfCollisions() deltaBunch=int(jobproperties.Beam.bunchSpacing()/( 25.*ns)+0.5) from AthenaCommon.GlobalFlags import globalflags if globalflags.DataSource()=='data': IsMC = False UseSymmetry= False else: IsMC = True UseSymmetry= True from LArROD.LArRODFlags import larRODFlags theTool = CaloNoiseTool(name, WorkMode = WorkMode, WithOF = WithOF, UseTile = UseTile, TileInfoName = TileInfoName, LArADC2MeVTool = theADC2MeVTool, LArOFCTool = theOFCTool, ReturnNoise = ReturnNoise, NMinBias = NMinBias, deltaBunch = deltaBunch, IsMC = IsMC, UseSymmetry = UseSymmetry, firstSample=larRODFlags.firstSample()) return theTool
topSequence += LArAutoCorr2Ntuple if doObj("OFC"): conddb.addFolder("", getDBFolderAndTag("/LAR/ElecCalibMC/HVScaleCorr")) conddb.addFolder("", getDBFolderAndTag("/LAR/ElecCalibMC/Noise")) conddb.addFolder("", getDBFolderAndTag("/LAR/ElecCalibMC/AutoCorr")) from LArRecUtils.LArADC2MeVToolDefault import LArADC2MeVToolDefault from LArRecUtils.LArAutoCorrNoiseToolDefault import LArAutoCorrNoiseToolDefault theLArADC2MeVToolDefault = LArADC2MeVToolDefault() ToolSvc += theLArADC2MeVToolDefault theLArAutoCorrNoiseToolDefault = LArAutoCorrNoiseToolDefault() theLArAutoCorrNoiseToolDefault.NSamples = 5 ToolSvc += theLArAutoCorrNoiseToolDefault from LArRecUtils.LArOFCToolDefault import LArOFCToolDefault theOFCTool = LArOFCToolDefault() theOFCTool.Dump = True ToolSvc += theOFCTool from LArCalibTools.LArCalibToolsConf import LArOFC2Ntuple LArOFC2Ntuple = LArOFC2Ntuple("LArOFC2Ntuple") LArOFC2Ntuple.ContainerKey = "LArOFC" LArOFC2Ntuple.AddFEBTempInfo = False LArOFC2Ntuple.IsMC = True LArOFC2Ntuple.OFCTool = theOFCTool topSequence += LArOFC2Ntuple if (doObj("SHAPE")): conddb.addFolder("", getDBFolderAndTag("/LAR/ElecCalibMC/Shape")) from LArCalibTools.LArCalibToolsConf import LArShape2Ntuple LArShape2Ntuple = LArShape2Ntuple("LArShape2Ntuple")