Difference between revisions of "Mattione Particle Classes"

From GlueXWiki
Jump to: navigation, search
(Particle ID)
(Particle ID)
Line 68: Line 68:
  
 
=== Charged Tracks ===
 
=== 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.  
 
* First the DChargedTrackHypothesis objects are matched with BCAL, FCAL, and TOF hits.  
Line 85: Line 87:
 
=== Neutral Tracks ===
 
=== Neutral Tracks ===
  
=== Old version of PID ===
+
* 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 &chi;<sup>2</sup> 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 &chi;<sup>2</sup> from tracking with the time difference &chi;<sup>2</sup>
 +
* Neutron ID not perfromed: all matched showers not matched to charged tracks were assumed to be photons.
  
 
== Accessing Physics Information ==
 
== Accessing Physics Information ==

Revision as of 16:01, 6 August 2011

Overview

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. 

Primary 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 the 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 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).

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 not perfromed: all matched showers not matched to charged tracks were assumed to be photons.

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.

Introduction

  • I think that the current class structure has become a little fragmented at the top level, and I'd like to suggest a few changes to make things simpler and more intuitive.
  • Although commonly used, neither DChargedTrack nor DPhoton are actually used in any way to create the DPhysicsEvent class. Instead, the particle information is stored as either DVertex::shower_info_t or DVertex::track_info_t objects. These objects are non-intuitive for final reconstructed objects, and most of their information is merely duplicated in the DChargedTrack and DPhoton classes.
  • Also, the reconstruction algorithm assumes that all of the showers in the calorimeters not matched to charged tracks correspond to photons, instead of allowing for the possibility of neutron detection (such as from Λ decay). This assumption is also implicit in the class structure, as there is no way of storing separate objects for different neutral track mass hypotheses.

Current Class Structure

                                    DPhysicsEvent
                                         |
                               vector < DParticleSet >                                                          //One DParticleSet for each DVertex
                                  /      |       \
 vector < DVertex::shower_info_t >    DVertex     vector < vector < DVertex::track_info_t > >                   //The particles in DVertex, 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

Proposed Class Structure

Data Classes Overview

  • Effectively, DVertex::track_info_t would be replaced by DChargedTrackHypothesis, and for each charged track a DChargedTrack object would contain multiple DChargedTrackHypothesis objects.
  • This structure is then mimicked by DNeutralTrack, allowing for multiple hypotheses for each neutral track.
  • Also, the particle id is stored as a Particle_t enum of the DChargedTrackHypothesis and DNeutralTrackHypothesis classes. This enum is defined in libraries/include/particleType.h, and uses the GEANT particle ID scheme. The particle id would be performed by calling a new function, DParticleID::IDTrack, which would implement the algorithm currently executed in DParticleSet_factory::evnt().
  • This not only eliminates the DVertex::shower_info_t and DVertex::track_info_t objects, but also avoids using the DPhoton, DBCALPhoton, and DFCALPhoton classes.
                                             DPhysicsEvent
                                                  |
                                        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. 

Factory Classes Overview

  • Particle construction was entirely performed in DVertex_factory, now broken up into separate factories. Details, in order of execution:
    • DChargedTrackHypothesis_factory: One DChargedTrackHypothesis per DTrackTimeBased, match track to TOF, BCAL, and FCAL objects, calculated particle id FOM.
  - FOM is calculated by: if start counter & TOF/BCAL/FCAL time: use ST hit to select RF beam bucket, use time difference between RF & TOF/BCAL/FCAL time (projected to particle vertex) to calculate FOM.
  - if neither start counter or TOF/BCAL/FCAL time: FOM from DTrackTimeBased is used (currently from track dEdx)
    • DChargedTrack_factory: group DChargedTrackHypothesis objects together into DChargedTracks (one DChargedTrack per DTrackCandidate (which can have several DChargedTrackHypothesis each), sort by FOM
    • DNeutralShowerCandidate: loop over DBCALShower and DFCALShower objects, create DNeutralShowerCandidate objects for each that are not DEFINITELY associated with DChargedTracks (definitely = associated to each DChargedTrackHypothesis of any given DChargedTrack). These objects provide uniform access to the shower variables.
    • DVertex_factory: group DChargedTracks together into different vertices (only the DChargedTrackHypothesis with the highest FOM is used for each DChargedTrack)
    • DNeutralTrackHypothesis_factory: loop over DNeutralShowerCandidates, create DNeutralTrackHypothesis objects for each. Ignore DNeutralShowerCandidates that correspond to the first DChargedTrackHypothesis of any DChargedTrack. FINISH ME!!!
    • DNeutralTrack_factory:


Notes on the particle (DChargedTrack, etc.) classes

  • Particle construction was entirely performed in DVertex_factory, now broken up into separate factories.
    • Factory order: DChargedTrackHypothesis, DChargedTrack, DVertex, DNeutralTrackHypothesis, DNeutralTrack, DParticleSet, DPhysicsEvent
    • These factories would essentially call JEventLoop->Get(vector<const DVertex*>) to construct the particles, then return only the desired objects.
  • The particle objects (DChargedTrack, DChargedTrackHypothesis, DNeutralTrack, and DNeutralTrackHypothesis) will store the objects they are matched with (DBCALShower, DFCALShower, DTOFPoint, and DVertex) as associated objects (not implemented in the current structure).
  • One DNeutralTrackHypothesis would be generated for each combination of DVertex and mass hypothesis, each with a FOM.

Other Notes

  • Class changes:
    • In the proposed scheme DPhoton, DBCALPhoton, and DFCALPhoton would no longer be used, but could still be created if desired.
    • Also, the definition of DChargedTrack would change.
      • To access the DTrackTimeBased data, you would call: DChargedTrack.hypotheses[0]->track->mass() instead of DChargedTrack.hypotheses[0]->mass()
      • Although not ideal (need to update code), having DChargedTrackHypothesis inherit from DKinematicData (like DTrackTimeBased does) would be worse in my opinion, because you'd have to directly copy all of the information (instead of just a pointer).
    • Would need to update associated programs (hdview2, ...?) and plugins.
  • Simulations of the fractional energy deposited by neutrons in the calorimeters are needed to implement neutron energy reconstruction and identification.
    • In the meantime, neutron ID would be effectively disabled (FOM forced to zero)

Pseudo-code

  • For those interested in specifics, here's a link to some pseudo-code showing how the new class structure would be implemented: PseudoCode.cc

Example Event with New Structure

  • γ p -> K+, K0, π0 n, where K0 -> π+ π-, and π0 -> γ, γ
  • The content of the DPhysicsEvent and DParticleSet objects for this reaction (assuming no additional detected tracks). Note that other particle id vectors exist in DParticleSet (proton, Km, etc.) but they aren't listed if they're just empty.
DPhysicsEvent: vector < DParticleSet > particle_set
               - particle_sets[0] (Reaction Vertex): DVertex vertex (Reaction Vertex)
                                                     vector < DChargedTrack > Kp
                                                     - Kp[0]      : vector < DChargedTrackHypothesis >
                                                                    - DChargedTrackHypothesis[0] (K+)
                                                                    - DChargedTrackHypothesis[1] (π+)
                                                                    - DChargedTrackHypothesis[2] (proton)
                                                     vector < DNeutralTrack > photon
                                                     - photon[0]  : vector < DNeutralTrackHypothesis > (all from same shower)
                                                                    - DNeutralTrackHypothesis[0] (γ, Reaction Vertex)
                                                                    - DNeutralTrackHypothesis[1] (γ, K0 Decay Vertex)
                                                                    - DNeutralTrackHypothesis[2] (neutron, Reaction Vertex)
                                                                    - DNeutralTrackHypothesis[3] (neutron, K0 Decay Vertex)
                                                     - photon[1]  : vector < DNeutralTrackHypothesis > (all from same shower)
                                                                    - DNeutralTrackHypothesis[0] (γ, Reaction Vertex)
                                                                    - DNeutralTrackHypothesis[1] (γ, K0 Decay Vertex)
                                                                    - DNeutralTrackHypothesis[2] (neutron, Reaction Vertex)
                                                                    - DNeutralTrackHypothesis[3] (neutron, K0 Decay Vertex)
                                                     vector < DNeutralTrack > neutron
                                                     - neutron[0] : vector < DNeutralTrackHypothesis > (all from same shower)
                                                                    - DNeutralTrackHypothesis[0] (neutron, Reaction Vertex)
                                                                    - DNeutralTrackHypothesis[1] (neutron, K0 Decay Vertex)
                                                                    - DNeutralTrackHypothesis[2] (γ, Reaction Vertex)
                                                                    - DNeutralTrackHypothesis[3] (γ, K0 Decay Vertex)

               - particle_sets[1] (K0 Decay Vertex): DVertex vertex (K0 Decay Vertex)
                                                     vector < DChargedTrack > pip
                                                     - pip[0]     : vector < DChargedTrackHypothesis >
                                                                    - DChargedTrackHypothesis[0] (π+)
                                                                    - DChargedTrackHypothesis[1] (K+)
                                                                    - DChargedTrackHypothesis[2] (proton)
                                                     vector < DChargedTrack > pim
                                                     - pim[0]     : vector < DChargedTrackHypothesis >
                                                                    - DChargedTrackHypothesis[0] (π-)
                                                                    - DChargedTrackHypothesis[1] (K-)
  • The contents of the DVertex objects listed above. Note that there are additional, miscellaneous variables (such as vertex position and time) not listed here.
DVertex (Reaction Vertex): vector < DNeutralTrack > neutraltracks
                           - neutraltracks[0] (γ from π0 decay) : vector < DNeutralTrackHypothesis > (all from same shower)
                                                                  - DNeutralTrackHypothesis[0] (γ, Reaction Vertex)
                                                                  - DNeutralTrackHypothesis[1] (γ, K0 Decay Vertex)
                                                                  - DNeutralTrackHypothesis[2] (neutron, Reaction Vertex)
                                                                  - DNeutralTrackHypothesis[3] (neutron, K0 Decay Vertex)
                           - neutraltracks[1] (other γ from π0) : vector < DNeutralTrackHypothesis > (all from same shower)
                                                                  - DNeutralTrackHypothesis[0] (γ, Reaction Vertex)
                                                                  - DNeutralTrackHypothesis[1] (γ, K0 Decay Vertex)
                                                                  - DNeutralTrackHypothesis[2] (neutron, Reaction Vertex)
                                                                  - DNeutralTrackHypothesis[3] (neutron, K0 Decay Vertex)
                           - neutraltracks[2] (neutron)         : vector < DNeutralTrackHypothesis > (all from same shower)
                                                                  - DNeutralTrackHypothesis[0] (neutron, Reaction Vertex)
                                                                  - DNeutralTrackHypothesis[1] (neutron, K0 Decay Vertex)
                                                                  - DNeutralTrackHypothesis[2] (γ, Reaction Vertex)
                                                                  - DNeutralTrackHypothesis[3] (γ, K0 Decay Vertex)
                           vector < DChargedTrack > chargedtracks
                           - chargedtracks[0] (K+)              : vector < DChargedTrackHypothesis >
                                                                  - DChargedTrackHypothesis[0] (K+)
                                                                  - DChargedTrackHypothesis[1] (π+)
                                                                  - DChargedTrackHypothesis[2] (proton)

DVertex (K0 Decay Vertex): vector < DNeutralTrack > neutraltracks
                           vector < DChargedTrack > chargedtracks
                           - chargedtracks[0] (π+)              : vector < DChargedTrackHypothesis >
                                                                  - DChargedTrackHypothesis[0] (π+)
                                                                  - DChargedTrackHypothesis[1] (K+)
                                                                  - DChargedTrackHypothesis[2] (proton)
                           - chargedtracks[1] (π-)              : vector < DChargedTrackHypothesis >
                                                                  - DChargedTrackHypothesis[0] (π-)
                                                                  - DChargedTrackHypothesis[1] (K-)