def _stream_from_file(file, seq, tuplename, streamNameRoot, clevel): """Infer the Athena stream name from the file name. Create a new stream if needed. """ # Make sure that THistSvc exists. from AthenaCommon.AppMgr import ServiceMgr if not hasattr(ServiceMgr, 'THistSvc'): from GaudiSvc.GaudiSvcConf import THistSvc ServiceMgr += THistSvc() # Search existing streams for one writing to this file. # If we find one, return it. # Also build a list of the names of all existing streams. streams = {} for s in ServiceMgr.THistSvc.Output: stream = s.split()[0] streams[stream] = 1 sfile = None ifile = s.find("DATAFILE='") if ifile >= 0: ifile += 10 i2 = s.find("'", ifile) if i2 >= 0: sfile = s[ifile:i2] if sfile == file: return stream # Didn't find the stream. We'll need to create a new one. # This involves making another algorithm, so we need to have # the sequence available. if not seq: raise TypeError("Need to create a new stream for tuple %s, " "but sequence wasn't specified." % tuplename) # Find a unique name for the new stream. stream = streamNameRoot istream = 1 while streams.has_key(stream): stream = streamNameRoot + ` istream ` istream += 1 # Create the stream, and add it to the sequence. from AnalysisTools.AthAnalysisToolsConf import AANTupleStream st = AANTupleStream(stream, ExtraRefNames=['StreamESD', 'StreamRDO', 'StreamAOD'], OutputName=file, WriteInputDataHeader=True, StreamName=stream) seq += [st] # Register with THistSvc. ServiceMgr.THistSvc.Output += [ "%s DATAFILE='%s' OPT='RECREATE' CL='%i'" % (stream, file, clevel) ] return stream
#DATAPATH = '/direct/usatlas+u/vj/vj_tracking/datafile/mc09_7TeV.105004.pythia_ddiff.recon.ESD.e514_s764_s767_r1229_tid126162_00/' #DATAPATH = '/direct/usatlas+u/vj/vj_tracking/datafile/mc09_7TeV.105003.pythia_sdiff.recon.ESD.e514_s764_s767_r1229_tid126163_00/' from glob import glob #INPUT = glob(DATAPATH + 'ESD*.root*') #print INPUT #ServiceMgr.EventSelector.InputCollections = INPUT ########################################## # setup TTree registration Service # save ROOT histograms and NTuple from GaudiSvc.GaudiSvcConf import THistSvc ServiceMgr += THistSvc() ServiceMgr.THistSvc.Output = ["AANT DATAFILE='vert.root' OPT='RECREATE'"] from AnalysisTools.AthAnalysisToolsConf import AANTupleStream topSequence += AANTupleStream() topSequence.AANTupleStream.ExtraRefNames = ["StreamESD", "Stream1"] topSequence.AANTupleStream.OutputName = 'vert.root' topSequence.AANTupleStream.WriteInputDataHeader = True topSequence.AANTupleStream.OutputLevel = INFO # Number of Events to process theApp.EvtMax = -1 #ServiceMgr.EventSelector.SkipEvents = 2 ServiceMgr.MessageSvc.OutputLevel = INFO ## uncomment following lines to dump truth info #from TruthExamples.TruthExamplesConf import DumpMC #topSequence += DumpMC() #DumpMC.McEventKey = "GEN_AOD"
#=== add to the job from AthenaCommon.AlgSequence import AlgSequence job = AlgSequence() job += tileInfoDump #=== save ROOT histograms and Tuple for bad cells if hasattr(tileInfoDump, "PrintBadCells"): if tileInfoDump.PrintBadCells: from GaudiSvc.GaudiSvcConf import THistSvc svcMgr += THistSvc() svcMgr.THistSvc.Output = [ "AANT DATAFILE='tileBadCells.root' OPT='RECREATE'" ] from AnalysisTools.AthAnalysisToolsConf import AANTupleStream job += AANTupleStream() AANTupleStream = AANTupleStream() AANTupleStream.ExtraRefNames = ["StreamESD", "Stream1"] AANTupleStream.OutputName = 'tileBadCells.root' AANTupleStream.WriteInputDataHeader = True AANTupleStream.OutputLevel = WARNING #============================================================ #=== MessageSvc setup #============================================================ MessageSvc = Service("MessageSvc") MessageSvc.OutputLevel = INFO MessageSvc.defaultLimit = 9999999 #============================================================ #=== Dummy event loop setup
jobproperties.PerfMonFlags.doMonitoring = False #from PerfMonComps.JobOptCfg import PerfMonSvc #svcMgr += PerfMonSvc() #jobproperties.PerfMonFlags.doDetailedMonitoring = True #-------------------------------------------------------------- # Event related parameters #-------------------------------------------------------------- # Number of events to be processed (default is 10) theApp.EvtMax = 10000 theApp.EvtSel = "EventSelector" # CBNT from AnalysisTools.AthAnalysisToolsConf import AANTupleStream theAANTupleStream = AANTupleStream(OutputName=NtupleName, ExistDataHeader=False) include("CBNT_Athena/CBNT_AthenaAware_jobOptions.py") include("CBNT_Athena/CBNT_EventInfo_jobOptions.py") include("CBNT_Athena/CBNT_Audit_jobOptions.py") # CBNT for EM calo cluster include("CaloRec/CaloCluster_CBNT_jobOptions.py") # CBNT for CaloTopo cluster include("CaloRec/CaloTopoCluster_CBNT_jobOptions.py") # CBNT for EMTopo clustr include("CaloRec/EMTopoCluster_CBNT_jobOptions.py") # CBNT for calo cells, with 3 sigma noise cut from CaloRec.CaloRecConf import CBNTAA_CaloCell CBNT_LArCell = CBNTAA_CaloCell("CBNT_LArCell")
MyEDMTester.DoDumpSummaryToFile = True MyEDMTester.DoDumpToFile = False # Aesthetic track summary for all collections include("MuonTrackPerformance/MuonTrackStatistics_jobOptions.py") #from MuonTrackPerformance.MuonTrackPerformanceConf import MuonTrackStatisticsAlg #MuonTrackStatistics = MuonTrackStatisticsAlg("MuonTrackStatistics") MuonTrackStatistics.writeToFile = True MuonTrackStatistics.TrackLocationList = ["MooreTracks"] if muonCombinedRecFlags.doMuidCombined(): MuonTrackStatistics.TrackLocationList += ["ConvertedMuIdCBTracks"] if muonCombinedRecFlags.doMuGirl(): MuonTrackStatistics.TrackLocationList += ["MuGirlRefittedTracks"] if muonCombinedRecFlags.doMuTagIMO(): MuonTrackStatistics.TrackLocationList += ["MuTagIMOTracks"] MuonTrackStatistics.TrackLocationList += ["ConvertedMBoyTracks"] if muonCombinedRecFlags.doStaco(): MuonTrackStatistics.TrackLocationList += ["ConvertedStacoTracks"] if muonCombinedRecFlags.doMuTag(): MuonTrackStatistics.TrackLocationList += ["ConvertedMuTagTracks"] MuonTrackStatistics.TrackLocationList += ["MuonSpectrometerTracks"] # Suppress too many WARNINGs from TrkResidualPullCalculator.TrkResidualPullCalculatorConf import Trk__ResidualPullCalculator Trk__ResidualPullCalculator.OutputLevel = ERROR # kluge to avoid crash in creating D3PD from AnalysisTools.AthAnalysisToolsConf import AANTupleStream AANTupleStream('D3PD').ExistDataHeader = False
from GaudiSvc.GaudiSvcConf import THistSvc ServiceMgr += THistSvc() THistSvc = ServiceMgr.THistSvc else: theApp.Dlls += [ "AnalysisTools" ] THistSvc = Service ( "THistSvc" ) THistSvc.Output = [ "AANT DATAFILE='ntuple.root' TYP='ROOT' OPT='NEW'" ] if doBphysNtuple: if usedRelease >= 13: if not hasattr( topSequence, "AANTStreamBchains" ): if usedRelease >= 16: from AnalysisTools.AthAnalysisToolsConf import AANTupleStream else: from AnalysisTools.AnalysisToolsConf import AANTupleStream topSequence += AANTupleStream( "AANTStreamBchains" ) AANTStreamBchains = getattr( topSequence, "AANTStreamBchains" ) else: theApp.TopAlg += [ "AANTupleStream/AANTStreamBchains" ] AANTStreamBchains = Algorithm( "AANTStreamBchains" ) AANTStreamBchains.ExtraRefNames = [ "StreamESD", "Stream1" ] AANTStreamBchains.WriteInputDataHeader = True AANTStreamBchains.OutputName = "ntuple.root" if doCBNT: if usedRelease >= 13: if not hasattr( topSequence, "AANTStreamCBNT" ): if usedRelease >= 16: from AnalysisTools.AthAnalysisToolsConf import AANTupleStream else: from AnalysisTools.AnalysisToolsConf import AANTupleStream
svcMgr.THistSvc.Output = [ "AANT DATAFILE='ntuple2.root' TYPE='ROOT' OPT='RECREATE'" ] NtupleName = "ntuple1.root" from AnalysisTools.AthAnalysisToolsConf import AANTupleStream aa = AANTupleStream() aa.ExtraRefNames = ["StreamESD", "StreamRDO"] aa.OutputName = NtupleName aa.ExistDataHeader = False aa.WriteInputDataHeader = True topSequence += aa from CBNT_Athena.CBNT_AthenaAwareCfg import CBNT_AthenaAware CBNT_Athena = CBNT_AthenaAware() topSequence += CBNT_Athena include("CBNT_Athena/CBNT_EventInfo_jobOptions.py") from CaloIdentifier import SUBCALO from CaloRec.CaloRecConf import CBNTAA_CaloCell theApp.Dlls += ["CaloRec"] #CBNT_Athena.Members += [ "CBNT_CaloCell/CBNT_RoILArCaloCell" ] CBNT_RoILArCaloCell = CBNTAA_CaloCell("CBNT_RoILArCaloCell") CBNT_Athena += CBNT_RoILArCaloCell CBNT_RoILArCaloCell.CaloNums = [SUBCALO.LAREM, SUBCALO.LARHEC, SUBCALO.LARFCAL] #CBNT_RoILArCaloCell.NtupleLocID="/FILE1/CALO/168"; CBNT_RoILArCaloCell.CellsName = "HLT_TrigT2CaloEgammaCells" CBNT_RoILArCaloCell.MaxNCells = 10000 CBNT_RoILArCaloCell.Suffix = "LRoI" CBNT_RoILArCaloCell.SaveDetInfo = True
# Re-run MET "default" from MissingETPerformace.METRefGetter import METRefGetter METRefGetter() aanName="aant.default.root" ServiceMgr.THistSvc.Output = [ "AANT DATAFILE='aant.default.root' OPT='RECREATE'" ] ######################################### # Sum up all different MET RefFinal terms from MissingETPerformance.METGetterAOD_Neutrinofication import METGetterAOD METGetterAOD() ################ # Ntuple Service from AnalysisTools.AthAnalysisToolsConf import AANTupleStream topSequence.ZeeSequence += AANTupleStream() AANTupleStream = AANTupleStream() AANTupleStream.OutputName = aanName AANTupleStream.WriteInputDataHeader = True AANTupleStream.OutputLevel = WARNING ########################## # Default MissingET ntuple from MissingET.MissingETConf import CBNTAA_MissingET topSequence.ZeeSequence += CBNTAA_MissingET() ################################### # Neutrinofication MissingET ntuple include ( "MissingETPerformance/CBNTAA_MissingET_Neutrinofication_jobOptions.py" ) topSequence.ZeeSequence.CBNTAA_MissingET_Neutrinofication.OutputLevel=WARNING