--
RachikSoualah - 2015-06-10
Note: All this documentation is taken form Timothée Theveneaux-Pelzer's talk at one of the PMG meetings.
- On lxplus :
setupATLAS
asetup 19.2.3.8.1,MCProd,here
cmt co Generators/PowhegControl -r PowhegControl-00-02-09
cd Generators/PowhegControl/cmt
cmt make
cd -
Rivet routines
Rivet routines available here :
atlasphys/Physics/Top/Software/MCvalidation/Rivet/Rivet2.X/trunk
Using the following routines :
MC_SingleTop_Truth
MC_fragmentation
Compiling the two routines :
svn co https://svn.cern.ch:/reps/atlasphys/Physics/Top/Software/MCvalidation/Rivet/Rivet2.X/trunk Rivet2.cd Rivet2.X/routines/MC_SingleTop_Truth
rivet-buildplugin RivetMC_SingleTop_Truth.so MC_SingleTop_Truth.cc
cd -
cd Rivet2.X/routines/MC_fragmentation
rivet-buildplugin RivetMC_fragmentation.so MC_fragmentation.cc
cd -
The two analyses are compiled in the files :
RivetMC_SingleTop_Truth.so
RivetMC_fragmentation.so
The reference sample - without
EvtGen - is :
mc12_8TeV.110119.PowhegPythia_P2011C_st_schan_lep.evgen.EVNT.e1720/
Using the instructions in this twiki :
https://twiki.cern.ch/twiki/bin/view/AtlasProtected/RivetForAtlas
On grid, running the rivet analyses afterwards and saving only the .yoda files :
pathena --trf="Generate_tf.py --ecmEnergy=8000 --runNumber=123456 --firstEvent=1 --maxEvents=5000 --randomSeed=%RNDM:100 \--jobConfig=MC15.123456.PowhegPythiaEvtGen_P2012_SingleTopSchan_noAllHad_antitop.py \--outputEVNTFile=test.pool.root --postInclude=runRivet_singletop.py"--extFile=RivetMC_SingleTop_Truth.so,RivetMC_fragmentation.so --long --split 40 --extOutFile myAnalysis.yoda \--outDS user.tpelzer.testOTF8TeV.MC15.123456.PowhegPythiaEvtGen_P2012_SingleTopSchan_noAllHad_antitop.new.5
On grid, running the Rivet routines on an existing sample and saving the .yoda files :
pathena runRivetAlone_singletop.py --split=50 --long --extOutFile=myAnalysis.yoda \
--inDS=mc12_8TeV.110119.PowhegPythia_P2011C_st_schan_lep.evgen.EVNT.e1720/ \
--outDS=user.tpelzer.mc12_8TeV.110119.PowhegPythia_P2011C_st_schan_lep.evgen.EVNT.e1720.Rivet.test.2 \
--extFile=RivetMC_SingleTop_Truth.so,RivetMC_fragmentation.so --nFiles=200
Links to tasks JEDI interface with logfiles :
Joboption for running Rivet just after production
import os
# limit number of events
from AthenaCommon.AppMgr import theApp
theApp.EvtMax = 1000000
## Now set up Rivet
from Rivet_i.Rivet_iConf import Rivet_i
rivet=Rivet_i("Rivet")
rivet.AnalysisPath = os.environ[?PWD?
rivet.Analyses += ["MC_fragmentation"]
rivet.Analyses += ["MC_SingleTop_Truth"]
rivet.HistoFile = "myAnalysis"
rivet.CrossSection = 1
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
topSequence += rivet
Joboption for running Rivet on an existing sample
from [[AthenaCommon.AppMgr][AthenaCommon.AppMgr]] import [[ServiceMgr][ServiceMgr]] as svcMgr
import glob
import [[AthenaPoolCnvSvc.ReadAthenaPool][AthenaPoolCnvSvc.ReadAthenaPool
]]svcMgr.EventSelector.InputCollections = glob.glob("test.pool.root")
#svcMgr.EventSelector.InputCollections = glob.glob("/tmp/tpelzer/test.pool.root")
import os
# limit number of events
from [[AthenaCommon.AppMgr][AthenaCommon.AppMgr]] import theApp
theApp.EvtMax = 1000000
## Now set up Rivet
from Rivet_i.Rivet_iConf import Rivet_i
rivet=Rivet_i("Rivet")
rivet.AnalysisPath = os.environ[?PWD?]
rivet.Analyses += ["MC_fragmentation"]
rivet.Analyses += ["MC_SingleTop_Truth"]
rivet.HistoFile = "myAnalysis"
rivet.CrossSection = 1
from [[AthenaCommon.AlgSequence][AthenaCommon.AlgSequence]] import [[AlgSequence][AlgSequence
]]topSequence = [[AlgSequence][AlgSequence]]()
topSequence += rivet
Joboption for running Rivet on an existing sample
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
import glob
import AthenaPoolCnvSvc.ReadAthenaPool
svcMgr.EventSelector.InputCollections = glob.glob("test.pool.root")
#svcMgr.EventSelector.InputCollections = glob.glob("/tmp/tpelzer/test.pool.root")
import os
# limit number of events
from AthenaCommon.AppMgr import theApp
theApp.EvtMax = 1000000
## Now set up Rivet
from Rivet_i.Rivet_iConf import Rivet_i
rivet=Rivet_i("Rivet")
rivet.AnalysisPath = os.environ[?PWD?]
rivet.Analyses += ["MC_fragmentation"]
rivet.Analyses += ["MC_SingleTop_Truth"]
rivet.HistoFile = "myAnalysis"
rivet.CrossSection = 1
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
topSequence += rivet
Merging the .yoda files of the reference sample :
yodamerge $(for files in \
$(ls user.tpelzer.mc12_8TeV.110119.PowhegPythia_P2011C_st_schan_lep.evgen.EVNT.e1720.Rivet.test.2_EXT0*/*.yoda*); \
do echo $files:1; done) -o reference.110119.yoda
Merging the .yoda files of the test samples :
yodamerge $(for files in \
$(ls user.tpelzer.testOTF8TeV.MC15.123456.PowhegPythiaEvtGen_P2012_SingleTopSchan_noAllHad_antitop.new.5_EXT0*/*.yoda*); \
do echo $files:2500000000; done) $(for files in \
$(ls user.tpelzer.testOTF8TeV.MC15.123456.PowhegPythiaEvtGen_P2012_SingleTopSchan_noAllHad_top.new.5_EXT0*/*.yoda*); \
do echo $files:2500000000; done) -o testOTF8TeV.MC15.123456.PowhegPythiaEvtGen_P2012_schan_inclusive_mergedNormalised.yoda
To produce the rivet plots :
rivet-mkhtml --mc-errs reference.110119.yoda:?Title=mc12_8TeV.110119?:?LineWidth=0.04? \
testOTF8TeV.MC15.123456.PowhegPythiaEvtGen_P2012_schan_inclusive_mergedNormalised.yoda:?Title=mc15_8TeV.test.w/EvtGen?:?LineWidth=0.04? \
-o ValidationPlots/Leptonic
Expected distributions from MC_SingleTop_Truth Rivet analysis
MET_* distributions
electron_1_* distributions
electrons_* distributions
muon_1_* distributions
muons_* distributions
neutrino_1_* distributions
neutrinos_* distributions
jets_* distributions
ljets_* distributions
taus_* distributions
t_* distributions
W_* distributions
B_hadrons_* distributions
bjets_* distributions
charged_* distributions
CosTheta_* and PhiS distributions
weight distribution