Skip to content
Snippets Groups Projects
Commit 2f601bf4 authored by Atlas-Software Librarian's avatar Atlas-Software Librarian Committed by Graeme Stewart
Browse files

'CMakeLists.txt' (FastSimulationJobTransforms-00-00-27)

parent 31af4d9c
No related branches found
No related tags found
No related merge requests found
Showing
with 255 additions and 0 deletions
################################################################################
# Package: FastSimulationJobTransforms
################################################################################
# Declare the package name:
atlas_subdir( FastSimulationJobTransforms )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Tools/PyJobTransformsCore )
# Install files from the package:
atlas_install_joboptions( share/*.py )
atlas_install_runtime( share/*.db share/*.root )
package FastSimulationJobTransforms
use AtlasPolicy AtlasPolicy-*
use PyJobTransformsCore PyJobTransformsCore-* Tools
apply_pattern declare_python_modules files="*.py"
apply_pattern declare_joboptions files="*.py"
apply_pattern declare_runtime files="*.db *.root"
#--------------------------------------------------------------
# Run the fast sim
#--------------------------------------------------------------
print " Now do the FastSim ....."
#--------------------------------------------------------------
# FastHitConv
#--------------------------------------------------------------
from AthenaCommon.AlgSequence import AlgSequence
job=AlgSequence()
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
from AthenaCommon.AppMgr import ServiceMgr
# Add top algorithms to be run
from FastCaloSimHit.FastCaloSimHitConf import FastHitConv
theFastHitConv=FastHitConv("theFastHitConv")
from AthenaCommon.DetFlags import DetFlags
list = topSequence.getSequence()
topSequence.insert(list.index('LArDigitMaker/digitmaker1'), theFastHitConv) # put FastHitConv right before
# CaloDigi in topSequence
job.theFastHitConv.OutputLevel = ALL
job.OutputLevel = INFO
from AthenaCommon.DetFlags import DetFlags
if DetFlags.pileup.LAr_on() or DetFlags.pileup.Tile_on():
job.theFastHitConv.doPileup = True
else:
job.theFastHitConv.doPileup = False
print topSequence
from CaloRec.CaloCellFlags import jobproperties
jobproperties.CaloCellFlags.doFastCaloSim = True
jobproperties.CaloCellFlags.doFastCaloSimNoise = False
jobproperties.CaloCellFlags.doLArCellEmMisCalib = False
from FastCaloSimHit.FastCaloCellGetter import CaloCellGetter
theCaloCellGetter=CaloCellGetter() # CaloCellGetter then goes in front of FastHitConv
print "Set the TileHitVectors and LArHitContainers"
topSequence.TileHitVecToCnt.TileHitVectors += ["TileHitVec_Fast"]
topSequence.digitmaker1.EmBarrelHitContainerName += ["LArHitEMB_Fast"]
topSequence.digitmaker1.EmEndCapHitContainerName += ["LArHitEMEC_Fast"]
topSequence.digitmaker1.HecHitContainerName += ["LArHitHEC_Fast"]
topSequence.digitmaker1.ForWardHitContainerName += ["LArHitFCAL_Fast"] # It really is spelt with a "W" in the middle!
# Print out job sequence
print " The jobsequence is now:"
print job
# switch on Atlfast-I corrections with AtlfastCorrectors
from FastSimulationConfig.FastSimulationFlags import jobproperties
jobproperties.FastSimulation.doAtlfastICorrection=True
# switch on fast calorimeter simulation with FastCaloSim; add to existing cells in RDO file
include('FastSimulationJobTransforms/FastCaloSimRecConfig.py')
from FastSimulationConfig.FastSimulationFlags import jobproperties
jobproperties.FastSimulation.doFastCaloSimCaloAddCells=True
from CaloRec.CaloCellFlags import jobproperties
jobproperties.CaloCellFlags.doFastCaloSimAddCells = True
try:
from CaloClusterCorrection.CaloClusterCorrectionFlags import caloClusterCorrectionFlags
caloClusterCorrectionFlags.CaloSwWhichCorrection='v1_atlfast'
except:
print "Could not set AtlfastII egamma weights"
try:
from JetRec.JetRecFlags import jetFlags
jetFlags.CalibrationDBSuffix="AtlfastII"
except:
print "Could not set AtlfastII jet calibration"
include('FastSimulationJobTransforms/FastCaloSimJetCalibration.py')
include('FastSimulationJobTransforms/FastCaloSimEGammaCalibration.py')
# switch on fast calorimeter simulation with FastCaloSim
from FastSimulationConfig.FastSimulationFlags import jobproperties
jobproperties.FastSimulation.doFastCaloSim=True
include('FastSimulationJobTransforms/FastCaloSimObjectCalibration.py')
#include <TKey.h>
bool listdirs(TDirectory* dir,TString DBprefix="",TString top="")
{
TIterator *iter=dir->GetListOfKeys()->MakeIterator();
iter->Reset();
bool has_objects=false;
TKey *key=0;
while(key=(TKey*)(iter->Next()))
{
TClass *cl=gROOT->GetClass(key->GetClassName());
if(!cl) {
has_objects=true;
continue;
}
if(cl->InheritsFrom(TDirectory::Class()))
{
TDirectory* subdir=(TDirectory*)(key->ReadObj());
if(subdir) {
//subdir->pwd();
TString dirname;
if(top!="") dirname=top+"/"+subdir->GetName();
else dirname=subdir->GetName();
//cout<<dirname<<endl;
if(!listdirs(subdir,DBprefix,dirname)) return false;
}
} else {
has_objects=true;
}
}
if (iter) delete iter;
if(has_objects && top!="") {
cout<<'"'<<DBprefix<<top<<'"'<<","<<endl;
//return false;
}
return true;
}
void FastCaloSim_create_jobConfig_for_DB(TString infile="root://castoratlas//castor/cern.ch/user/m/mduehrss/Parametrization/ParticleParametrization_ATLFastII_NewParam_v2.root",
TString DBprefix="DB=/GLOBAL/AtlfastII/FastCaloSimParam:2:")
{
TFile* f=TFile::Open(infile);
listdirs(f,DBprefix);
}
File added
from AthenaCommon.GlobalFlags import globalflags
from FastSimulationConfig.FastSimulationFlags import jobproperties
jobproperties.FastSimulation.doFatrasID=True
jobproperties.FastSimulation.doFatrasMuon=True
jobproperties.FastSimulation.doParametrisedMuon=True
from FatrasExample.FatrasJobProperties import FatrasFlags
# set Muon Reco and ID reco on
FatrasFlags.RefittingID=False
FatrasFlags.ReconstructionID=True
# (MS)
FatrasFlags.RefittingMS=True
FatrasFlags.DigitizationMS=True
FatrasFlags.ReconstructionMS=True
# set the cluster merging parameters
from FatrasExample.FatrasClusterCreation import FatrasClusterCreationFlags
FatrasClusterCreationFlags.PixSimpleClusterMerge=True
FatrasClusterCreationFlags.PixClusterMergeSharedRDOs=True
FatrasClusterCreationFlags.PixClusterMergeAttachedRDOs=True
FatrasClusterCreationFlags.PixUseClusterMerger=True
from FatrasExample.FatrasKeys import FatrasKeyFlags
from FastCaloSim.FastCaloSimConf import FastShowerCellBuilderTool
theFastShowerCellBuilderTool=FastShowerCellBuilderTool()
theFastShowerCellBuilderTool.McLocation=FatrasKeyFlags.McEventCollection()
theFastShowerCellBuilderTool.OutputLevel = ERROR
# get a handle on the ServiceManager which holds all the services
# from AthenaCommon.AppMgr import ServiceMgr
# ServiceMgr.StoreGateSvc.Dump = True
File added
File added
File added
File added
#from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
#Stream1 = AthenaPoolOutputStream( "Stream1" ) WAAAHHHH! Do not do this, otherwise it won't work !!!!!
try:
Stream1.ItemList += ['FastShowerInfoContainer#FastShowerInfoContainer']
Stream1.OutputLevel = 2
except:
print "Could not set Stream1.ItemList += FastShowerInfoContainer"
##########
try:
StreamAOD.ItemList += ['FastShowerInfoContainer#FastShowerInfoContainer']
StreamAOD.OutputLevel = 2
except:
print "Could not set StreamAOD.ItemList += FastShowerInfoContainer"
##########
try:
StreamESD.ItemList += ['FastShowerInfoContainer#FastShowerInfoContainer']
StreamESD.OutputLevel = 2
except:
print "Could not set StreamAOD.ItemList += FastShowerInfoContainer"
from FastCaloSim.FastCaloSimConf import FastShowerCellBuilderTool
theFastShowerCellBuilderTool=FastShowerCellBuilderTool()
from FastSimulationConfig.FastSimulationFlags import jobproperties
jobproperties.FastSimulation.doFastCaloSim = True
from FastSimulationConfig.FastSimulationFlags import jobproperties
jobproperties.FastSimulation.doFastCaloSimCaloAddCells = True
from CaloRec.CaloCellFlags import jobproperties
jobproperties.CaloCellFlags.doFastCaloSimAddCells = True
include("FastSimulationJobTransforms/jobConfig.v14_Parametrisation.py")
#theFastShowerCellBuilderTool.OutputLevel=DEBUG
print "Running jobConfig.AtlfastIID.py"
#from FastCaloSim.FastCaloSimConf import FastShowerCellBuilderTool
#theFastShowerCellBuilderTool=FastShowerCellBuilderTool()
#include("FastSimulationJobTransforms/jobConfig.onlyFastCaloSimDigitization.py")
include("FastCaloSimHit/AF2Digitization.py")
include("FastSimulationJobTransforms/jobConfig.v14_Parametrisation.py")
#theFastShowerCellBuilderTool.OutputLevel=DEBUG
print "Running jobConfig.AtlfastIID.py"
#from FastCaloSim.FastCaloSimConf import FastShowerCellBuilderTool
#theFastShowerCellBuilderTool=FastShowerCellBuilderTool()
#include("FastSimulationJobTransforms/jobConfig.onlyFastCaloSimDigitization.py")
include("FastCaloSimHit/AF2Digitization.py")
include("FastSimulationJobTransforms/jobConfig.v14_Parametrisation.py")
include("FastSimulationJobTransforms/jobConfig.FastCaloSim_ID_cuts.py")
#theFastShowerCellBuilderTool.OutputLevel=DEBUG
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment