Project

General

Profile

Combining beamline and detector simulation

This webpage describes how we can combine beamline simulation and detector simulation files. Beamline simulation is a root file and detector simulation is art root file. It is very convenient to work with file which has both beamline and detector information. Hence, we combine them using an art module BeamlineSimInput_module. This can be found in package TestBeam from repository.

Beamline simulation file is a root file which contains all the particles going through beamline components. An example of beamline root file is

/nova/ana/users/ayallapp/testbeam/beamlinesim_6gb.root

Detector simulation file is an art root file. This contains all the particles from beamline which are entering the NOvA testbeam detector. An example of detector art root file is

/nova/ana/users/ayallapp/testbeam/text_gen.g4bl.b_-0.9T.proton.64000.MergedAtstart_linebeam.trigger.root.job_1_10000.200m.shielding_5.full.root

Before running the BeamlineSimInput_module we need to modify beamline simulation root file so that it can run on this module.

1) First step is to filter all particles in beamline and get only the particles that enters nova testbeam detector. This can be done by following command

python save_particle_to_root.py beamlinesim_6gb.trigger.root

and the python code is in following location

/nova/ana/users/ayallapp/testbeam/save_particle_to_root.py

2) In Second step, we arrange all the particles entering nova testbeam detector by time and trigger on only good particles (particles which passes through all components of beamline). This is done by following command

python text.py -n -s -f <input_root_file>

and the python code is in following location

/nova/ana/users/ayallapp/testbeam/text.py

3)Final step is to use BeamlineSimInput_module to combine detector simulation art root file an beamline simulation root file. This can be done in following way

nova -c beamlinesiminputjob.fcl -s /nova/ana/users/ayallapp/testbeam/text_gen.g4bl.b_-0.9T.proton.64000.MergedAtstart_linebeam.trigger.root.job_1_10000.200m.shielding_5.full.root

Here in argument we give detector art root file . This module reads the particles from beamline simulation root file as well as detector simulation file and puts them into beamlinedetector.root file, which can be found in same folder after running the above command.

Please don't forget to change location of input beamlinesimulation root file to your input file. This can be done by giving path to your root file in BeamlineSimInput_module.cc in following line

beamlinesim::BeamlineSimInput::fBeamlineSimFile = new TFile("/nova/app/users/ayallapp/testbeam/test_testbeam/junting/beamlinesimulation_wohoo.root","READ");

Here is an example of what you get after running all the above command to combine beamline and detector simulation.

/nova/ana/users/ayallapp/testbeam/simulationfiles/beamlinedetector.root