ATLAS Offline Software
RivetAnalysis_JO.py
Go to the documentation of this file.
1 import os
2 
3 theApp.EvtMax = -1
4 
5 import AthenaPoolCnvSvc.ReadAthenaPool
6 svcMgr.EventSelector.InputCollections = ["!TESTSAMPLE!"]
7 
8 systWeights =!SYSTWEIGHTS!
9 
10 from AthenaCommon.AlgSequence import AlgSequence
11 job = AlgSequence()
12 
13 from Rivet_i.Rivet_iConf import Rivet_i
14 
15 
16 from AthenaCommon.AppMgr import ServiceMgr as svcMgr
17 from GaudiSvc.GaudiSvcConf import THistSvc
18 
19 svcMgr += THistSvc()
20 
21 def safeFileName(name):
22  name=name.strip()
23  name= name.replace(".","p").replace(" ","_")
24  name= name.replace("pyoda",".yoda")
25  name= name.replace(":","_")
26  return name
27 
28 if systWeights==None: systWeights={'Nominal': 0}
29 
30 analyses= "!RIVETANALYSIS!"
31 for i in systWeights:
32  systName=safeFileName(i)
33 
34  print('weight name:',i,', output name',systName)
35 
36  rivet = Rivet_i(systName)
37  for analysis in analyses.split(","):
38  rivet.Analyses +=[analysis]
39 
40  rivet.RunName = ""
41  #rivet.HistoFile = "myanalysis"
42  if i!="Nominal" : rivet.WeightName=i
43  rivet.HistoFile = systName
44  rivet.DoRootHistos = False
45  #rivet.IgnoreBeamCheck = True
46  rivet.AnalysisPath = os.environ['PWD']
47  rivet.CrossSection = 1.0
48 
49  job += rivet
50 
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
python.AlgSequence.AlgSequence
AlgSequence
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py:7
RivetAnalysis_JO.safeFileName
def safeFileName(name)
Definition: RivetAnalysis_JO.py:21
Lb2Lll.THistSvc
THistSvc
Definition: Lb2Lll.py:216
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28