HOWTO extract photons or pi0's from the framework

From GlueXWiki
Jump to: navigation, search

Many people will want to analyze final states with photons. There are several key high-level analysis objects for doing this. Unless you are doing calorimetry diagnostics it is not recommend that utilize any other object besides the ones listed below. This is because various corrections to the reconstructed photon four-momentum are applied through the reconstruction chain. Using the high level objects below guarantees that you will get a photon which has the current best measurement of the four-momentum and its error matrix.

Using DPhoton objects

The DPhoton objects contain a list of all (assumed) photons reconstructed by the FCAL and the BCAL. This includes clusters that are produced by the interaction of charged particles with the calorimeter. To extract the photons, loop over them, and veto those associated with charged particles, one would code something like this:

vector<const DPhoton*> photons;
for (unsigned int i = 0; i < photons.size() ; i++) {
   if ( photons[i]->getTag() == DPhoton::kCharge  ) continue;
   // now do something with the photon object

Note that the DPhoton object inherits from DKinematicData. Most of the general accessor functions for kinematic information (e.g., the photon energy) is contained in the DKinematicData class. The DPhoton class add some additional calorimetry-specific functions (e.g., determining whether the photon was reconstructed by the BCAL or the FCAL). Consult the header file for a list of available routines.

Using DTwoGammaFit objects

If you are interested in reconstructing π0's or η's, the recommended method is to utilize the two-photon fitter that is built into the framework. In order to do this, write something like:

 vector< const DTwoGammaFit* > pi0Vect;
 eventLoop->Get( pi0Vect, "PI0" )

In addition to "PI0", "ETA" is also a supported tag. You can then select objects by placing cuts on, for example:




Consult the DTwoGammaFit.h file for all available functions. The DTwoGammaFit object also inherits from DKinematicData. In this case the data contained in DKinematicData is that after the mass-constrained fit to the two photons has been performed. If you want to see the "π0 peak" you can histogram the variable


which is the invariant mass of the two photons before the fit.

Assuming that the calorimetry code is maintained and the error matrices are properly tuned, the latter method of selecting π0's using χ2 or probability of a fit is recommend over simply pairing photons and cutting on invariant mass. Both the BCAL and FCAL have somewhat different resolutions over the full angular and momentum range. The latter method correctly accounts for this and, in principle, permits the user enforce a requirement which has a constant probability of being satisfied for true π0's regardless of the momentum or direction of the π0.

One can get a feel for the overall accuracy of the reconstructed error matrices by plotting the distribution obtained from getProb(), for true π0's it should be flat, uniform from 0 to 1.


  • M. Kornicer's October 2007 talk on two-photon fitting (GlueX-doc 906): [1]