Difference between revisions of "HOWTO extract photons or pi0's from the framework"

From GlueXWiki
Jump to: navigation, search
 
Line 1: Line 1:
 
 
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.
 
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 ==
 
== Using DPhoton objects ==
  
The DPhoton objects contain a list of all (assumed) photons reconstructed by the FCAL and the BCAL.  This
+
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;
 +
  eventLoop->Get(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 &pi;<sup>0</sup>'s or &eta;'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:
 +
 
 +
  pi0Vect[i]->getChi2();
 +
 
 +
or
 +
 
 +
  pi0Vect[i]->getProb();
 +
 
 +
Consult the DTwoGammaFit.h file for all available function.  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 "&pi;<sup>0</sup> peak" you can histogram the variable
 +
 
 +
  pi0Vect[i]->getUMass();
 +
 
 +
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 &pi;<sup>0</sup>'s using &chi;<sup>2</sup> 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 &pi;<sup>0</sup>'s  regardless of the momentum or direction of the &pi;<sup>0</sup>.
 +
 
 +
One can get a feel for the overall accuracy of the reconstructed error matrices by plotting either the distribution obtained from getProb() or getChi2() for *true* &pi;<sup>0</sup>'s.  The former should be flat, uniform from 0 to 1, while the latter should be a unit-Gaussian.

Revision as of 08:52, 24 November 2009

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;
  eventLoop->Get(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:

  pi0Vect[i]->getChi2();

or

  pi0Vect[i]->getProb();

Consult the DTwoGammaFit.h file for all available function. 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

  pi0Vect[i]->getUMass();

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 either the distribution obtained from getProb() or getChi2() for *true* π0's. The former should be flat, uniform from 0 to 1, while the latter should be a unit-Gaussian.