ATLAS Offline Software
Loading...
Searching...
No Matches
RivetAnalysis_JO.py
Go to the documentation of this file.
1import os
2
3theApp.EvtMax = -1
4
5import AthenaPoolCnvSvc.ReadAthenaPool
6svcMgr.EventSelector.InputCollections = ["!TESTSAMPLE!"]
7
8systWeights =!SYSTWEIGHTS!
9
10from AthenaCommon.AlgSequence import AlgSequence
11job = AlgSequence()
12
13from Rivet_i.Rivet_iConf import Rivet_i
14
15
16from AthenaCommon.AppMgr import ServiceMgr as svcMgr
17from GaudiSvc.GaudiSvcConf import THistSvc
18
19svcMgr += THistSvc()
20
21def 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
28if systWeights==None: systWeights={'Nominal': 0}
29
30analyses= "!RIVETANALYSIS!"
31for 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
void print(char *figname, TCanvas *c1)
Interface to the Rivet analysis package.
Definition Rivet_i.h:31
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition hcg.cxx:310