Temporary Workaround for TrackMatching and PID¶
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:
- 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)
- cd MAUS_ROOT_DIR/bin/Global
- Edit temp_globals_datacard.py:
- so that input_root_file_name is the file from (1)
- set your simulation_geometry_filename
- set pid_config to either step_4 (for helical tracks) or commissioning (for straight tracks)
- set pid_beam_setting to a tag of your choosing, default is 6-200
- if running a negative beam, change pid_beamline_polarity to negative
- change track_matching_pid_hypothesis to a single hypothesis (kMuPlus would do)
- now run temp_pid_pdf_generator.py --configuration_file temp_globals_datacard.py
- 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.
- Combine PDFs from the three directories into a single root file using hadd:
- hadd single_PDF_root_file muon_PDFs_directory/* pion_PDFs_directory/* positron_PDFs_directory/*
- You'll need your sample of MC/data that you want to run PID on, that has already been processed by the local recon.
- Again edit temp_globals_datacard.py:
- so that input_root_file_name is the file you want to run PID on
- change PID_PDFs_file to point to single_PDF_root_file from above
- change track_matching_pid_hypothesis to "all"
- While there are other optional settings that the user might want to change in temp_globals_datacard.py, simulation_geometry_filename, pid_config. pid_beam_setting and pid_beamline_polarity must be the same as they were when the PDFs were made.
- run temp_globalpid.py --configuration_file temp_globals_datacard.py
- 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. for some reason you would always like to explicitly match via propagation, set it to false (). In that case, note that:
- For producing PDFs, the track_matching_tolerances should be significantly increased (say by a factor of 100)
- If you're working with straight track data, you can set track_matching_energy_loss to False for a performance boost