PandaRoot Macros

Macros Folder

The folder /macros contains the steering macros for PandaRoot. They are usually called via root macroname.C and the file name is identical to the macro name. Most important folders are:

  • [master](./master/mastermacros.md): Contains the standard macros to perform a complete simulation chain

  • tools: Collection of useful macros for e.g. the event display or additional MC track information

Description of folders:

  • data: Empty folder were by default the generated data of the macros is stored to

  • detectors: Sub-detector specific macros

  • examples: Various example macros

  • outdated: Macros not used anymore

  • params: Parameter files serving as an input to detector simulations

  • production: Scripts and macros for larger simulation campaigns

  • QA: QA macros used to test the proper running of PandaRoot

  • run: Macros to run complete simulation chain with full control over the used tasks

  • softrig: Macros used for the software trigger

  • timebased: Macros to run time-based simulations

  • tracking: Macros to run the different tracking and trackingQA algorithms

  • tutorials: Tutorial macros used at various PandaRoot workshops

@ingroup group_macros

# Master Macros

These ROOT macros run a complete chain of a default PandRoot simulation. They employ the so-called Master run and Master Tasks, which are tools to provide default settings and operation modes.

It is not important where you store the macros. You may copy the whole folder to a place of your liking. Keep in mid to source the config.sh -p script to set up each terminal you are using.

## First Steps

If you simply want to simulate & reconstruct some events with default settings you’ll need only 2 commands: Starting with a simulation (here 100 events) ` root -l -b -q sim_complete.C'(100)' ` you may process the detector answer and reconstruction in one go: ` root -l -b -q full_complete.C ` and subsequently run an analysis ` root -l -b -q full_complete.C ` Modify the macros to suit your purpose. The sections below introduce the options.

## Output Stages Instead of running everything in one go ` root -l -b -q full_complete.C ` you may run each stage separately. It is particularly useful if you want to have extra root files for each stage or if you want to stop processing at a certain stage. ` root -l -b -q digi_complete.C root -l -b -q reco_complete.C root -l -b -q pid_complete.C `

` root -l -b -q ana_complete.C `

## File List - TaskTool.C

  • ana_complete.C

  • ana_multikalman.C

  • digiOnly_complete.C

  • digi_complete.C

  • full_complete.C

  • pidTest_complete.C

  • pid_complete.C

  • pidideal_complete.C

  • psi2s_Jpsi2pi_Jpsi_mumu.dec

  • reco_complete.C

  • recoideal_complete.C

  • recolocal_complete.C

  • sim_complete.C

Master Macros

Introduction

The master macros are the standard simulation and reconstruction macros of PandaRoot. They use the MasterTasks to have the most recent default settings for the detector simulation.

Running

The typical sequence of macros is:

  • sim_complete.C - Event simulation. Set here the event generator you want to use

  • full_complete.C - Digitization, tracking and PID in one go

  • ana_complete.C - Analysis of the data. Adopt here your analysis method

A sequence which expands the digi, reco and pid ito separate steps is:

  • sim_complete.C - Event simulation. Set here the event generator you want to use

  • digi_complete.C - Detector response simulation and local reconstruction

  • reco_complete.C - Tracking

  • pid_complete.C - Combine tracks with PID information

  • ana_complete.C - Analysis of the data. Adopt here your analysis method

Common User Settings

It is encouraged that you copy the macros to a location of your choice and work from there. For your own analysis you have to modify the sim_complete.C macro to set the proper event generation. EvtGen mostly serves for signal events, FTF for continuum background, while the BoxGenerator is there for detector studies. Also you have to write your own analysis. The ana_complete.C macro may serve as a starting point. Also the tutorial section holds many examples to draw from.

The options available in the Master Tasks can be found at MasterTasks.

Typically the macro flow may look like this:

nEvents=1000
geant="TGeant4"
beammom=6.231553
prefix="../data/myAwesomeChannel"
options="multikalman"

root -l -b q sim_complete\($nEvents,\"$geant\",$beammom,\"$prefix\",\"$options\"\)
root -l -b q full_complete\($nEvents,\"$prefix\",\"$options\"\)
root -l -b q ana_complete\($nEvents,\"$prefix\",\"$options\"\)

Additional Macros

If you are interested in the output of a special stage of the simulation run or want to access a specific feature, there The Additional macros in this folder are:

  • digiOnly_complete.C - Only does the detector simulation but not the local reconstruction

  • recolocal_complete.C - Only does the local detector reconstruction.

  • recoideal_complete.C - TODO

  • ana_multikalman.C - Macro looking at

Run Macros

These macros are located in macro/run