Temporary Workaround for TrackMatching and PID

Workaround branch:

Please pull down and use this branch from MAUS as it includes all the fixes that you need for globals. It will be included in the latest merge asap, and when done this documentation will be updated. If you are reading this. Follow this.

(If installing with a separate location for third party libraries, use a 2.5.0 installation for those)

The scripts described below are available with this branch in:

Producing PDFs:

  1. Produce MC input to produce PDFs. Input should be in a single root file and have been passed through the local reconstruction. Obviously you want a high number of muons, pions and electrons (>5000, preferably 10000 at EMR)
  2. cd MAUS_ROOT_DIR/bin/Global
  3. Edit
    1. so that input_root_file_name is the file from (1)
    2. set your simulation_geometry_filename
    3. set pid_config to either step_4 (for helical tracks) or commissioning (for straight tracks)
    4. set pid_beam_setting to a tag of your choosing, default is 6-200
    5. if running a negative beam, change pid_beamline_polarity to negative
    6. change track_matching_pid_hypothesis to a single hypothesis (kMuPlus would do)
  4. now run --configuration_file
  5. This will create a set of directories (one for each particle hypothesis, 3 total) in MAUS_ROOT_DIR/files/PID/ of the style <pid_beam_setting>_<pid_hypothesis>_<time/date> (e.g. 6-200_mu_plus_2016_06_22T01_46_48_595110) that contain the root files with the PDFs in them.
  6. Combine PDFs from the three directories into a single root file using hadd:
  7. hadd single_PDF_root_file muon_PDFs_directory/* pion_PDFs_directory/* positron_PDFs_directory/*

Running PID:

  1. You'll need your sample of MC/data that you want to run PID on, that has already been processed by the local recon.
  2. Again edit
    1. so that input_root_file_name is the file you want to run PID on
    2. change PID_PDFs_file to point to single_PDF_root_file from above
    3. change track_matching_pid_hypothesis to "all"
  3. While there are other optional settings that the user might want to change in, simulation_geometry_filename, pid_config. pid_beam_setting and pid_beamline_polarity must be the same as they were when the PDFs were made.
  4. run --configuration_file
  5. This will produce your output root file with PID'd global tracks in it, that can be analysed with a C++/python script (but not fed back into MAUS).

Additional Information regarding datacard settings:

With the default setting for track_matching_no_single_event_check (True), trackpoints from an event will automatically be considered as belonging to the same particle, if the respective beamline section (upstream or downstream) has no detector with more than one trackpoint. If for some reason you would always like to explicitly match via propagation, set it to false (this will make Track Matching MUCH slower). In that case, note that:
  1. For producing PDFs, the track_matching_tolerances should be significantly increased (say by a factor of 100)
  2. If you're working with straight track data, you can set track_matching_energy_loss to False for a performance boost