Mattione Particle Classes

From GlueXWiki
Jump to: navigation, search

Reconstructed Physics Data Class Structure

                                             DPhysicsEvent                                        //Only one created per event (for now)
                                                  |
                                        vector < DParticleSet >                                      //One DParticleSet for each DVertex
                                         /        |          \
                   vector < DNeutralTrack >    DVertex        vector < DChargedTrack >                        //Organized by particle id
                              |                   |    \
         vector < DNeutralTrackHypothesis >     Misc.    vector < DChargedTrack >
                 /            |        \                              |
     FOM, Particle_t, DKinematicData, etc.               vector < DChargedTrackHypothesis >
                                                              /            |             \
                                                         FOM, Particle_t, DTrackTimeBased, etc.

* Particle_t is an enum defined in libraries/include/particleType.h that is used to store the particle id (values = Proton, PiPlus, etc.)
  * It uses the GEANT particle ID scheme. 


Track Fitting Object Descriptions

  • DTrackCandidate: Initial track candidate constructed from CDC & FDC hits.
  • DTrackWireBased: Resulting track from wire-based track fitting using different PID hypotheses. Multiple DTrackWireBased objects per DTrackCandidate, one for each PID hypothesis.
  • DTrackTimeBased: Resulting track from time-based track fitting. Contains the position, four-momentum, etc. of the particle. Multiple DTrackTimeBased objects per DTrackCandidate, one for each PID hypothesis.

Primary Physics Results Object Descriptions

  • DChargedTrack: The reconstructed charged track object resulting from a series of drift chamber wire hits. Fits to these hits using different PID hypotheses results in multiple DChargedTrackHypothesis objects for each DChargedTrack.
  • DChargedTrackHypothesis: See DChargedTrack. Stores information on the matching to BCAL/FCAL/TOF hits (timing, PID, FOM, etc.). Track information (position, four-momentum, etc.) is stored in its DTrackTimeBased member object.
  • DVertex: The reconstructed vertex objects resulting from grouping DChargedTrack objects together.
  • DNeutralTrack: The reconstructed neutral track object resulting from a BCAL or FCAL shower. These showers are matched to each DVertex for both photon and neutron PID, resulting in multiple DNeutralTrackHypothesis objects for each DNeutralTrack.
  • DNeutralTrackHypothesis: See DNeutralTrack. Stores information on the time matching to the charged tracks (timing, PID, FOM, etc.). Track information (position, four-momentum, etc.) is stored in the DKinematicData member object.
  • DParticleSet: For each DVertex, the DVertex, DChargedTrack, and DNeutralTrack objects are grouped together. The tracks are sorted by particle id.
  • DPhysicsEvent: Contains the DParticleSets for the physics event.

Other Physics Results Object Descriptions

  • DNeutralShowerCandidate: The FCAL and BCAL showers that are not matched with each DChargedTrackHypothesis of any DChargedTrack object. This class also provides a common interface to the shower physics information.
  • DVertexIndependentResults: Stores the top-level vertex-independent objects, the DChargedTrack and DNeutralShowerCandidate objects.

Previous Class Structure

                                    DPhysicsEvent
                                         |
                               vector < DParticleSet >                                                     //One DParticleSet for each DVertex
                                  /      |       \
 vector < DVertex::shower_info_t >    DVertex     vector < vector < DVertex::track_info_t > >              //Organized by particle id
                                    /    |    \
                                   /     |     \
  vector < DVertex::shower_info_t >    Misc.    vector < vector < DVertex::track_info_t > >                     
              /                \                                /         |           \
         DBCALShower       DFCALShower                tprojected    DTrackTimeBased    FOM


* DVertex::shower_info_t is a class that inherits from DKinematicData
* DVertex::track_info_t is a struct
* vector < vector < DVertex::track_info_t > > : for each DTrackCandidate there are multiple fit hypotheses (DTrackTimeBased), corresponding to different particle masses
  • Note that this structure assumed that all neutrals were photons.
  • Charged track grouping, FCAL/BCAL/TOF matching, and shower grouping was all performed in one factory (DVertex_factory).

Reasons for Change

The new class structure is more intuitive. Although they were commonly used, neither DChargedTrack nor DPhoton were actually used in any way to create the DPhysicsEvent class. Instead, the particle information was stored as either DVertex::shower_info_t or DVertex::track_info_t objects.

Also, the reconstruction algorithm assumed that all of the showers in the calorimeters not matched to charged tracks corresponded to photons, instead of allowing for the possibility of neutron detection (such as from lambda decay). This assumption was also implicit in the class structure, as there was no way of storing separate objects for different neutral track mass hypotheses.

Particle ID

Charged Tracks

  • The hits from each charged track (DTrackCandidate) are fit with different id(mass)-hypotheses, yielding DChargedTrackHypothesis objects (via DTrackTimeBased).
  • First the DChargedTrackHypothesis objects are matched with BCAL, FCAL, and TOF hits.
  • These hits are then used to calculate the time of the particle at it's position-of-closest-approach (POCA) to the beamline ("vertex").
    • This time is calculated (in DParticleID) using the flight time of the track, which is calculated from it's mass, momentum, and path length (in DReferenceTrajectory).
  • If there is both a Start Counter hit and a BCAL/FCAL/TOF hit:
    • The RF time is propagated from the center of the target to the z-position of the vertex.
    • The Start Counter hit time is used to select the RF beam bucket. This shifts the propagated RF time by the multiple of 2.004 ns that yields the smallest difference between the RF time and the Start Counter hit time propagated to the vertex.
    • The propagated RF time is then compared to the BCAL/FCAL/TOF projected time at the vertex. This difference (compared to its typical (hard-coded) uncertainty) is used to calculate the χ2 and FOM for this particle id.
  • If there is NOT both a Start Counter hit and a BCAL/FCAL/TOF hit:
    • There is not enough information to determine the particle id based on timing information.
    • Therefore, the χ2 and FOM from dE/dx matching (calculated in DTrackTimeBased) is used to determine the particle ID.

Neutral Tracks

  • NOT FULLY IMPLEMENTED!! (see below)
  • A DNeutralTrackHypothesis object is created for each DVertex and id-hypothesis (photon, neutron) of each shower that is not "fully" matched to a charged track.
    • A shower that is matched to some but not all DChargedTrackHypothesis of a given DChargedTrack is not considered to be "fully" matched.
    • Photons are assumed to deposit all of their energy into the calorimeter, while an energy-correction is applied for neutrons (NOT YET IMPLEMENTED!!).
  • For each DNeutralTrackHypothesis object, its projected time at the DVertex is calculated from its hit-time, energy, mass, and path length.
  • This time is compared to the DVertex time. This difference (compared to its typical (hard-coded) uncertainty (NOT YET DETERMINED!!)) is used to calculate the χ2 and FOM for this particle id.
  • KLUDGE: Until neutron reconstruction is implemented, the FOM of all neutron hypotheses is set to zero.

Differences compared to the old version of PID

  • The time difference of the charged tracks was calculated by first creating the DVertex, then using the DVertex time to shift the RF time.
    • This DVertex time was calculated from the weighted average of the start counter hit times, propagated to the vertex.
  • The charged track FOM combined the dE/dx χ2 from tracking with the time difference χ2
  • Neutron ID perviously not perfromed: all matched showers not matched to charged tracks were assumed to be photons.
    • These photons were then matched to the vertices by time, rather than setting the time from the vertex.
    • This allowed photons that did not match in time to have their own DVertex. This is no longer implemented. Neutrals only have their own DVertex (the center of the target) if no charged tracks were reconstructed.

Accessing Physics Information

  • The DVertex class attempts to group the tracks together into different reaction vertices. So the way of extracting the physics information depends on whether or not you want to perform your own vertex reconstruction.

Using Reconstructed DVertex

  • The easiest way of accessing the physics information is through the DParticleSet. The charged and neutral tracks are sorted by figure-of-merit, such that the track hypotheses with the highest FOM are listed first. Although you may perform your own particle ID, the tracks are sorted in DParticleSet using the PID with the highest FOM.
    • e.g. Proton_Momentum = DParticleSet->proton[0]->dChargedTrackHypotheses[0]->dTrackTimeBased->momentum().Mag()
    • e.g. Photon_Momentum = DParticleSet->photon[0]->dNeutralTrackHypotheses[0]->dKinematicData->momentum().Mag()

Performing your own Vertex Reconstruction

  • The top-level (final) reconstructed-vertex-independent information classes are: DChargedTrack and DNeutralShowerCandidate. These objects may be grabbed directly, but they are also stored in the DVertexIndependentResults class.
    • e.g. Track_Momentum = DChargedTrack->dChargedTrackHypotheses[0]->dTrackTimeBased->momentum().Mag()
    • e.g. Shower_Energy = DNeutralShowerCandidate->dEnergy
  • Note that there may be DNeutralShowerCandidate objects that are matched to some of the DChargedTrackHypothesis objects (including those with the highest FOM), so be careful to exclude these where necessary. They are included in case the user wants to perform particle ID differently than how it is performed in the reconstruction software. See DNeutralTrackHypothesis_factory::evnt() to see how these are removed after DVertex construction.

Code Updates

Major code structure changes

  • DPhoton, DBCALPhoton, and DFCALPhoton are no longer supported and should be removed.
  • The structure of DChargedTrack has changed, so its usage needs to be changed everywhere it is found.
  • In DParticleSet the physics information is now stored in vectors of DChargedTrack and DNeutralTrack objects, rather than in DVertex::track_info_t and DVertex::shower_info_t objects.

Updated Code

  • Libraries: PID, TRACKING, FCAL, BCAL
  • Programs & Plugins: phys_tree

Code that Needs to Be Updated

  • Programs & Plugins: hdview2, danaevio, many more...

To Be Implemented

  • The calculation of the neutron energy from the energy deposited in the shower.
  • The uncertainty of the neutral vertex-time-difference for use in the FOM calculation.
  • Enable neutron PID by removing "FOM = -1.0" line.