3 from AthenaConfiguration.ComponentFactory
import CompFactory
4 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
7 idlowpt=900311, idhighpt=800831, wlowpt=0.099791, whighpt=0.00209):
11 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
13 from TileGeoModel.TileGMConfig
import TileGMCfg
17 from LArCabling.LArCablingConfig
import LArOnOffIdMappingSCCfg
20 rKey=
"LArOnOffIdMapSC"
22 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
27 result.addCondAlgo(CompFactory.LArMCSymCondAlg(
"LArMCSymCondAlgSC",SuperCell=supercell,ReadKey=rKey))
29 from xAODEventInfoCnv.xAODEventInfoCnvConfig
import EventInfoCnvAlgCfg
32 larMinBiasAlg = CompFactory.LArMinBiasAlg()
33 larMinBiasAlg.datasetID_lowPt=idlowpt
34 larMinBiasAlg.datasetID_highPt=idhighpt
36 larMinBiasAlg.weight_lowPt = wlowpt
37 larMinBiasAlg.weight_highPt= whighpt
38 larMinBiasAlg.EvtInfo=
"EventInfo"
39 larMinBiasAlg.CablingKey=rKey
40 larMinBiasAlg.SuperCell=supercell
43 result.addEventAlgo(larMinBiasAlg)
46 if os.path.exists(output):
48 result.addService(CompFactory.THistSvc(Output = [
"file1 DATAFILE='"+output+
"' OPT='RECREATE'"]))
49 result.setAppProperty(
"HistogramPersistency",
"ROOT")
56 if __name__==
"__main__":
58 parser= argparse.ArgumentParser(description=
"Compute LArMinBias from hits")
59 parser.add_argument(
'-r',
'--run',type=int,default=999999,help=
"run number")
60 parser.add_argument(
'-o',
'--output',type=str,default=
"ntuple.root",help=
"name of th root output file")
61 parser.add_argument(
'-i',
'--input',type=list_of_strings,default=[],help=
"name of the input files")
62 parser.add_argument(
'-t',
'--globaltag', type=str, help=
"Global conditions tag ")
63 parser.add_argument(
'--idlow',type=int,default=900311,help=
"ID of lowPt sample")
64 parser.add_argument(
'--idhigh',type=int,default=800831,help=
"ID of highPt sample")
65 parser.add_argument(
'--wlow',type=float,default=0.099791,help=
"weight of lowPt sample")
66 parser.add_argument(
'--whigh',type=float,default=0.00209,help=
"weight of highPt sample")
67 parser.add_argument(
'-s',
'--isSC',default=
False,action=
'store_true',help=
"running for SC ?")
68 args = parser.parse_args()
70 print(len(args.input))
72 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
74 flags.Input.RunNumbers=[args.run]
75 print(
"set the runnumber: ",flags.Input.RunNumbers)
76 flags.Input.Files=args.input
77 flags.IOVDb.DatabaseInstance=
"OFLP200"
78 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
79 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
82 flags.IOVDb.GlobalTag=args.globaltag
90 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
93 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
97 idlowpt=args.idlow, idhighpt=args.idhigh,
98 wlowpt=args.wlow, whighpt=args.whigh))
100 print(
"Start running...")
101 cfg.getService(
"MessageSvc").debugLimit=1000000