3from AthenaConfiguration.ComponentFactory
import CompFactory
4from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
7 idlowpt=900311, idhighpt=800831, wlowpt=0.099791, whighpt=0.00209):
9 result=ComponentAccumulator()
11 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
12 result.merge(LArGMCfg(flags))
13 from TileGeoModel.TileGMConfig
import TileGMCfg
14 result.merge(TileGMCfg(flags))
17 from LArCabling.LArCablingConfig
import LArOnOffIdMappingSCCfg
18 result.merge(LArOnOffIdMappingSCCfg(flags))
19 result.addCondAlgo(CompFactory.CaloSuperCellAlignCondAlg(
'CaloSuperCellAlignCondAlg'))
21 rKey=
"LArOnOffIdMapSC"
23 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
24 result.merge(LArOnOffIdMappingCfg(flags))
28 result.addCondAlgo(CompFactory.LArMCSymCondAlg(
"LArMCSymCondAlg",SuperCell=supercell,ReadKey=rKey))
30 from xAODEventInfoCnv.xAODEventInfoCnvConfig
import EventInfoCnvAlgCfg
31 result.merge(EventInfoCnvAlgCfg(flags, disableBeamSpot=
True))
33 larMinBiasAlg = CompFactory.LArMinBiasAlg()
34 larMinBiasAlg.datasetID_lowPt=idlowpt
35 larMinBiasAlg.datasetID_highPt=idhighpt
37 larMinBiasAlg.weight_lowPt = wlowpt
38 larMinBiasAlg.weight_highPt= whighpt
39 larMinBiasAlg.EvtInfo=
"EventInfo"
40 larMinBiasAlg.CablingKey=rKey
41 larMinBiasAlg.SuperCell=supercell
44 result.addEventAlgo(larMinBiasAlg)
47 if os.path.exists(output):
49 result.addService(CompFactory.THistSvc(Output = [
"file1 DATAFILE='"+output+
"' OPT='RECREATE'"]))
50 result.setAppProperty(
"HistogramPersistency",
"ROOT")
57if __name__==
"__main__":
59 parser= argparse.ArgumentParser(description=
"Compute LArMinBias from hits")
60 parser.add_argument(
'-r',
'--run',type=int,default=999999,help=
"run number")
61 parser.add_argument(
'-o',
'--output',type=str,default=
"ntuple.root",help=
"name of the root output file")
62 parser.add_argument(
'-i',
'--input',type=list_of_strings,default=[],help=
"name of the input files")
63 parser.add_argument(
'-t',
'--globaltag', type=str, help=
"Global conditions tag ")
64 parser.add_argument(
'--idlow',type=int,default=900311,help=
"ID of lowPt sample")
65 parser.add_argument(
'--idhigh',type=int,default=800831,help=
"ID of highPt sample")
66 parser.add_argument(
'--wlow',type=float,default=0.099791,help=
"weight of lowPt sample")
67 parser.add_argument(
'--whigh',type=float,default=0.00209,help=
"weight of highPt sample")
68 parser.add_argument(
'-s',
'--isSC',default=
False,action=
'store_true',help=
"running for SC ?")
69 parser.add_argument(
'-g',
'--geometrytag',type=str,default=
"",help=
"geometry tag to use")
70 args = parser.parse_args()
72 print(len(args.input))
74 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
75 flags = initConfigFlags()
76 flags.Input.RunNumbers=[args.run]
77 print(
"set the runnumber: ",flags.Input.RunNumbers)
78 flags.Input.Files=args.input
79 flags.IOVDb.DatabaseInstance=
"OFLP200"
81 flags.GeoModel.AtlasVersion = args.geometrytag
83 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
84 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
87 flags.IOVDb.GlobalTag=args.globaltag
95 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
96 cfg=MainServicesCfg(flags)
98 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
99 cfg.merge(PoolReadCfg(flags))
102 idlowpt=args.idlow, idhighpt=args.idhigh,
103 wlowpt=args.wlow, whighpt=args.whigh))
105 print(
"Start running...")
106 cfg.getService(
"MessageSvc").debugLimit=1000000
void print(char *figname, TCanvas *c1)
LArMinBiasAlgCfg(flags, output='ntuple.root', supercell=False, idlowpt=900311, idhighpt=800831, wlowpt=0.099791, whighpt=0.00209)