Instructions to run TrigSim and TrigSimAnalyze


Installing the packages

  • In your work area, make a directory for running online/offline simulations.
  • Make a subdirectory named 'trigsim' indside that directory.
  • Go to http://www-d0online.fnal.gov/www/groups/tm/tm_main.html (TriggerMeister webpage), click on "Online Runs Database" and run a querry for your particular run number to find out the trigger version used.
  • On the page http://www-d0.fnal.gov/computing/trigsim/general/triglists.html, click on 'pre-fixed triggerlist', find out the version you need. right click on that link and download it into a known area. Make sure you download the .tar version and not the .xml version.
  • Untar the whole .tar file . this will give you a collection of .sim files.
  • Copy the .sim files into the the path/.../your area/trigsim directory which you had created before.
  • Go to the area where you have your packages installed. If you are using any D0 release and want to stick to it then you donot need to do the next steps in this point. If you need to use another release then do the following
    1. setup D0RunII version
    2. setup d0cvs
    3. newrel -t new work directory
    4. cd new work directory
    5. addpkg tsim_l3
    6. addpkg trigsim_analyze
    7. gmake all
  • Make sure that you have the data file you need to run on or you have a proper address for their location.

    Running TrigSim and TrigSimAnalyze

  • At the command prompt type this command : > runD0TrigSim -format=data -l3toollist=auto -filelist=input.dat -num=1000 -l3only

    explanation :

    -format=data means the type of files you are running on are raw data files. the option could also be =mc, =DST etc also depending on the need.

    -l3toollist=auto means that TrigSim runs a parsing routine over the level3.sim file ( in the "trigsim" directory) and produces a toollist.txt file

    -filelist=input.dat. You need to make a file named input.dat where you specify the exact location of your input files.

    -num=1000. this means run on the first 1000 events. This option can be excluded if you need to run simulations on the whole file.

  • The simulations will get over when the command prompt returns. In your main work area you will notice that a new directory has formed named
    D0Trig......Linux-input-DEFLIST. Change to that directory . There are 2 files in this directory which are of interest.
  • Copy the file named toollist.txt into the main working directory.
  • Check for a file named outputfile_00. If you have one then create a file named output.dat in the main directory specifying the location of outputfile_00. If you have multiple outputfiles , then create multiple paths in the same file output.dat .
  • Move to working directory.
  • On the commad prompt type

    > runTrigAnalyze -filelist=output.dat -format=data -l3only -l3toollist=toollist.txt -num=1000

    note :
    -l3toollist=toollist.txt tells TrigAnalyze to use the file "toollist.txt" (in your working directory) to know what tools to run. TrigAnalyze requires a toollist to know what information to extract. If one is not provided, or the provided one cannot be found, it defaults to an internal toollist that is not sufficient for most users.

    -l3only option should be used here if you had used -l3only option while running TrigSim before. The rest of the options are same as that of running TrigSim.

  • The output of the above mentioned simulation will be placed in a default directory named TrigSimAna....Linux-output. Change to that directory. Check for the file trigsim.root. Copy that file to another results area and name it offline.root. The .root file contains information about offline source.
  • Go to the release version directory. Move to trigsim_analyze/rcp directory
  • Open file named runTrigSimAnalyze_l3only.rcp
  • Add line RCP l3fana = < l3fanalyze L3Analyze_auto_online>
  • Delete line RCP l3fana = < l3fanalyze L3Analyze_auto_offline>
  • Save the file and come back to your main working area.
  • On the command prompt type

    > runTrigAnalyze -filelist=output.dat -format=data -l3only -l3toollist=toollist.txt -num=1000 -rcp=runTrigSimAnalyze_l3only.rcp

    explanation : In this case online analysis in being made on the raw dataset. The additional -rcp command was provided for using a non-default .rcp file which we have modified for the purpose.

  • The results are placed in the directory named TrigSimAna....Linux-input. Check out for the file named trigsim.root. Copy the file to the results area and name it online.root.
  • Now we have 2 root files online.root and offline.root.

    Running TrigSimAnalyze with EVENT information

  • edit the framework rcp file "runD0TrigSim_l3only.rcp" in trigsim_analyze/rcp to insert the name "event_info" in the "string Packages =" list and add the line "RCP event_info = " to the bottom of the file
  • Run with command
    > runTrigAnalyze -filelist=output.dat -format=data -l3only -l3toollist=toollist.txt -num=100 -rcp=runTrigSimAnalyze_l3only.rcp -localbuild -localfwkrcp
  • The event information in EVENT branch of the rtuple would be for "online" only even if you change the switch to "offline".
    Sudhir Malik
    Last modified: Mar 4 , 2004