PIDLIB

Aus HERMESwiki
Zur Navigation springen Zur Suche springen

Page maintainer: Rebecca

Checked.png This page is considered done. It been reviewed by Delia. There may be missing elements, but they are all flagged and the text has no errors.

Intro

PID values are used to separate between hadrons and leptons at HERMES. Four detectors contribute to PID, the RICH, the TRD, the Preshower, and the Calorimeter.

Electron hadron separation is discussed in more detail in Bootcamp.

Essentials

The typical way to use PID at HERMES to to make a cut, such as

   0 < *PID3+PID5-FluxFactor < 100  for leptons
-100 < *PID3+PID5-FluxFactor < 0    for hadrons

Where the -100 and 100 cuts are to be sure to only include reasonable values (excluding particularly error codes of -999). These cuts can be changed based on your aim. For a more pure lepton sample you might move the cut to >1, for a more complete lepton sample you might move the cut to > -1.

What is PID3 and PID5?

A PID value is just the log of the ratio of the probability that the track is a lepton divided by the probability that it is a hadron.

Fehler beim Parsen (Konvertierungsfehler. Der Server („https://wikimedia.org/api/rest_“) hat berichtet: „Cannot get mml. Server problem.“): {\displaystyle log({\frac {P_{lep}(E,p)}{P_{had}(E,p)}})}

The PID values given in the uDST pages (see uDST Documentation) are defined as follows

PID2 = PID_Preshower + PID_Calorimeter
PID3 = PID_Preshower + PID_Calorimeter + PID_RICH
PID5 = PID_TRD

So you can see using PID3+PID5 uses all available information we have about PID.

What is a flux factor?

Since our PID scheme is based on Bayes Theorem, we need to also include the relative particle fluxes, which are a function of momentum and the HERMES theta angle. To do this you must uses the flux files that live at (see the example below!!)

/hermes/lib/pid/pro/Fluxes

Please note within this directory is another directory,

no_trigger_cut/ 

which contains the flux factors when there is no cut placed on trigger 21. If you are not using a trigger cut in your analysis you should use these fluxes for all tracks (regardless of if trigger 21 fired for a particular event).

You will also need to know the calorimeter threshold for the data you are using. This can be found in the uDST tables in the g1Quality.rCaloThresh entry. As a convention, the flux files are named "pol" for a calorimeter threshold of 1.4GeV and "unpol" for a calorimeter threshold of 3.5GeV (for 2006 and later files the names contain either 14 or 35 to indicate the calorimeter threshold). You should always use the flux factors that correspond with the calorimeter threshold, regardless of the polarization state of the data.

  • When checking the calorimeter threshold in the uDST table numerical precision may be a problem. Because of this is is best to check that the value in the table is near to 1.4/3.5, either by checking the values falls within a range or that the difference between the values in the table and 1.4/3.5 is small.
  • See the Codes section below for an example of how to read the flux factors into your user code.
  • 1995 and 1996 special case: Be aware that in 1995 and part of 1996 the calorimeter threshold was set to 3.5 during polarized data taking. See the 1995 data taking summary page and the 1996 data taking summary page. For this data the "unpolarized" flux factors (aka flux factors run with the 3.4 calorimeter threshold) should be used.
  • Naming scheme of the flux-files for transverse data (2002-2005): Since the naming of the flux-files in '/hermes/lib/pid/pro/Fluxes' is very historical, have a look at the following overview. The filenames are independent of the production. "%c" stands for charge and can have the values "neg" or "pos".
With TMC1 && No TMC2:                     
02, 03, 04: 04c1.flux.%c.14.2it.txt
05:         05c2.flux.%c.14.2it.txt

No TMC2 && No TMC1:
02, 03, 04: 04c1.flux.%c.14.2it.txt
05:         05c2.flux.%c.14.2it.txt

With TMC2 && No TMC1:
02, 04:     04c1-tmc2.flux.%c.14.2it.txt
05:         05c2-tmc2.flux.%c.14.2it.txt
03:         04c1.flux.%c.14.2it.txt (Remember: In 2003 only TMC1-Method is available)

What is PIDLIB and why would I use it?

The PID values are in the uDSTs, however, as you can see above, using only PID2, PID3, and PID5 you can not isolate the PID from the preshower and the calorimeter. This may be important if you are interested in the tracks where one of the detectors fails (outputting a -999 error code) but the other three are fine. In this case you may want to include only the preshower or only the calorimeter, which can only be done if you run PIDLIB in your user code. See here for details of how this can be acomplished by running PIDLIB, including the TRDxy correction. See here for a study demonstrating that this is only a problem for events with two tracks close together in the calorimeter.

Please note: If you decide to use PIDLIB you should check that you get the same values as the uDSTs!!

Please note: You must ALWAYS link to the IRT row of the smRICH table to get the input values to PIDLIB. This does not effect what you use for RICH identification as you may at a different place in your code link to EVT or DRT for RICH iType information.

More Info

For a detailed description of the PID formalism and how PIDLIB works see Juergen's PIDLIB paper

Details on running PIDLIB, including the TRDxy correction, are detailed in the latest PIDLIB README, which can be found on the PID page or in /hermes/lib/pid/new/README

The parent distributions for each uDST production are located in the subdirectories of this directory:

/hermes/lib/pid/new/PDs

PIDLIB with MC

While usually you only need perfect PID in MC, you may for some reason want to use the PID values to simulate data.

To run PIDLIB on a MC production you first need to create the parent distributions and fluxes. This is described here

Then you will need to run PIDLIB in your user code, which is described here

  • Note: You must of course use a MC production that has full detector simulations for all the PID detectors!

Code Repository

"Running PIDLIB in your user code"

Josh's C code for reading in flux factors

NEEDCODE Rebecca will write a Hanna++ flux example soon!