This demo will demonstrate how to run the very preliminary version of the ISF_ParametricSim locally. In order to do so, we will need to checkout several packages and make them locally. Currently, only the muon smearing is implemented and it is recommended to run the Parametric Simulation only on single muon events.
Lets start with logging in to the lxplus.cern.ch server:
ssh -Y user@lxplusNOSPAMPLEASE.cern.ch
We can now create a new workspace. We will need to use the migration 5 release:
mkdir ~/ISF_ParSimDemo
cd ~/ISF_ParSimDemo/
asetup mig5,rel4,here,slc6,gcc48
Step 1: checkout and commit the Parametric Simulation
We can now checkout the parametric simulation by running these lines from the $TestArea folder:
cmt checkout Simulation/ISF/ISF_ParametricSim/ISF_ParSimInterfaces
cmt checkout Simulation/ISF/ISF_ParametricSim/ISF_ParSimServices
cmt checkout Simulation/ISF/ISF_ParametricSim/ISF_ParSimTools
Now let's compile these packages:
cd ~/ISF_ParSimDemo/Simulation/ISF/ISF_ParametricSim/ISF_ParSimInterfaces/cmt/
cmt make
cd ~/ISF_ParSimDemo/Simulation/ISF/ISF_ParametricSim/ISF_ParSimServices/cmt/
cmt make
cd ~/ISF_ParSimDemo/Simulation/ISF/ISF_ParametricSim/ISF_ParSimTools/cmt
cmt make
Step 2: import the Parametric Simulation into the ISF
We will need to checkout some of the basic ISF packages and modify them in order to run the Parametric Simulation:
cd $TestArea
cmt checkout Simulation/ISF/ISF_Config
cmt checkout Simulation/ISF/ISF_SimulationSelectors
cmt checkout Simulation/ISF/ISF_Example
5 files need to be modified: ISF_MainConfig.py, ISF_ConfigConfigDb.py, ISF_SimulationSelectorsConfig.py, ISF_SimulationSelectorsConfigDb.py, and ISF_Output.py. We can replace our existing files with already modified files in
/afs/cern.ch/user/m/mmuskinj/public/ISF_ParSimDemo/
and make the packages or follow the instruction bellow. The files are also attached, but need to be changed from .txt to .py .
Let’s start with modifying the ISF_Config package. Open the ISF_Config/python/ISF_MainConfig.py file and add the following lines (for an example at line 327):
############## Simulator: ParametricSimulation ############### def getKernel_ParametricSimulation(name="ISF_Kernel_ParametricSimulation_IDOnly", **kwargs): kwargs.setdefault("BeamPipeSimulationSelectors" , [ 'ISF_DefaultParticleKillerSelector' ] ) kwargs.setdefault("IDSimulationSelectors" , [ 'ISF_DefaultParametricSimulationSelector' ] ) kwargs.setdefault("CaloSimulationSelectors" , [ 'ISF_DefaultParticleKillerSelector' ] ) kwargs.setdefault("MSSimulationSelectors" , [ 'ISF_DefaultParticleKillerSelector' ] ) kwargs.setdefault("CavernSimulationSelectors" , [ 'ISF_DefaultParticleKillerSelector' ] ) # set the simFlags accordingly (TODO: is this even needed?) from G4AtlasApps.SimFlags import simFlags simFlags.SimulationFlavour = "ParametricSimulation" return getKernel_GenericSimulator(name, **kwargs)We will also have to edit the ISF_Config/python/ISF_ConfigConfigDb.py file. Add the following line at the bottom of the file:
addAlgorithm("ISF_Config.ISF_MainConfig.getKernel_ParametricSimulation","ISF_Kernel_ParametricSimulation")Now we have to compile this package:
cd ~/ISF_ParSimDemo/Simulation/ISF/ISF_Config/cmt/
cmt make
def getDefaultParametricSimulationSelector(name="ISF_DefaultParametricSimulationSelector", **kwargs): kwargs.setdefault("Simulator" , getService('ISF_ParametricSimSvc')) return getDefaultSimSelector(name, **kwargs )And now edit the ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfigDb.py file by adding this line at the bottom:
addTool("ISF_SimulationSelectors.ISF_SimulationSelectorsConfig.getDefaultParametricSimulationSelector" , "ISF_DefaultParametricSimulationSelector" )Now we also have to compile this package:
cd ~/ISF_ParSimDemo/Simulation/ISF/ISF_SimulationSelectors/cmt/
cmt make
stream1.ItemList = ["EventInfo#*", "McEventCollection#TruthEvent", "JetCollection#*", "xAOD::TrackParticleContainer#*", "xAOD::TrackParticleAuxContainer#*"]Compile the package:
cd ~/ISF_ParSimDemo/Simulation/ISF/ISF_Example/cmt/
cmt make
cd $TestAreaThe Parametric Simulation is now run with the following command:
mkdir run-parsim; cd run-parsim
Sim_tf.py --simulator 'ParametricSimulation' --randomSeed 0 --enableLooperKiller True --maxEvents -1 \The input EVNT file contains 1000 single muon events, where all the muons have exactly the same properties. They have a defined p, eta, phi, and the position of the vertex:
--skipEvents 0 --geometryVersion ATLAS-GEO-20-00-01 --conditionsTag OFLCOND-MC12-SIM-00 \
--inputEVNTFile /afs/cern.ch/user/m/mmuskinj/public/ISF_ParSimDemo/outputFile.EVNT.pool.root \
--outputHITSFile "Hits.pool.root"
"PDGcode: 13", "p: constant 500000", "eta: constant 0.3", "phi: constant 0.583", "vertX: constant 0", "vertY: constant 10", "vertZ: constant -20"If the Parametric Simulation was run successfully, a Hits.pool.root file was generated. We can open this file with root and inspect its content. We will find all the information of the track particles in the
xAOD::TrackParticleAuxContainer_v2_SmearedTrackParticlesAux.container from the CollectionTree. Distributions of the smeared defining parameters (d0, z0, phi, theta, qOverP) can be seen.
I | Attachment | History | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|---|
![]() |
ISF_ConfigConfigDb.py.txt | r1 | manage | 8.7 K | 2015-03-06 - 15:37 | MihaMuskinja | |
![]() |
ISF_MainConfig.py.txt | r1 | manage | 40.6 K | 2015-03-06 - 15:37 | MihaMuskinja | |
![]() |
ISF_Output.py.txt | r1 | manage | 14.7 K | 2015-03-06 - 15:37 | MihaMuskinja | |
![]() |
ISF_SimulationSelectorsConfig.py.txt | r1 | manage | 15.2 K | 2015-03-06 - 15:37 | MihaMuskinja | |
![]() |
ISF_SimulationSelectorsConfigDb.py.txt | r1 | manage | 6.1 K | 2015-03-06 - 15:37 | MihaMuskinja |