Difference between revisions of "Mattione Particle Classes"

From GlueXWiki
Jump to: navigation, search
(Example Event with New Structure)
(Example Event with New Structure)
Line 77: Line 77:
 
DPhysicsEvent: vector < DParticleSet >
 
DPhysicsEvent: vector < DParticleSet >
 
               - DParticleSet[0] (Reaction Vertex): DVertex (Reaction Vertex)
 
               - DParticleSet[0] (Reaction Vertex): DVertex (Reaction Vertex)
 +
                                                    vector < DChargedTrack > pip //empty
 +
                                                    vector < DChargedTrack > pim //empty
 +
                                                    vector < DChargedTrack > Kp
 +
                                                    - Kp[0]      : vector < DChargedTrackHypothesis >
 +
                                                                  - DChargedTrackHypothesis[0] (K+)
 +
                                                                  - DChargedTrackHypothesis[1] (&pi;+)
 +
                                                                  - DChargedTrackHypothesis[2] (proton)
 +
                                                    vector < DChargedTrack > Km //empty
 +
                                                    vector < DChargedTrack > proton //empty
 +
                                                    vector < DChargedTrack > otherp //unidentified positively charged particles //empty
 +
                                                    vector < DChargedTrack > othern //unidentified negatively charged particles //empty
 +
                                                    vector < DNeutralTrack > photon
 +
                                                    - photon[0]  : vector < DNeutralTrackHypothesis > (all from same shower)
 +
                                                                  - DNeutralTrackHypothesis[0] (&gamma;, Reaction Vertex)
 +
                                                                  - DNeutralTrackHypothesis[1] (&gamma;, K0 Decay Vertex)
 +
                                                                  - DNeutralTrackHypothesis[2] (neutron, Reaction Vertex)
 +
                                                                  - DNeutralTrackHypothesis[3] (neutron, K0 Decay Vertex)
 +
                                                    - photon[1]  : vector < DNeutralTrackHypothesis > (all from same shower)
 +
                                                                  - DNeutralTrackHypothesis[0] (&gamma;, Reaction Vertex)
 +
                                                                  - DNeutralTrackHypothesis[1] (&gamma;, 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] (&gamma;, Reaction Vertex)
 +
                                                                  - DNeutralTrackHypothesis[3] (&gamma;, K0 Decay Vertex)
 +
                                                    vector < DNeutralTrack > otherz //unidentified neutral particles //empty
 +
 +
              - DParticleSet[1] (K0 Decay Vertex): DVertex (K0 Decay Vertex)
 
                                                     vector < DNeutralTrack >
 
                                                     vector < DNeutralTrack >
 +
                                                    vector < DChargedTrack >
 +
                                                    - DChargedTrack[0] (&pi;+)              : vector < DChargedTrackHypothesis >
 +
                                                                                          - DChargedTrackHypothesis[0] (&pi;+)
 +
                                                                                          - DChargedTrackHypothesis[1] (K+)
 +
                                                                                          - DChargedTrackHypothesis[2] (proton)
 +
                                                    - DChargedTrack[1] (&pi;-)              : vector < DChargedTrackHypothesis >
 +
                                                                                          - DChargedTrackHypothesis[0] (&pi;-)
 +
                                                                                          - DChargedTrackHypothesis[1] (K-)
 +
 +
 +
XXXXXXXXXX
 +
 +
DPhysicsEvent: vector < DParticleSet >
 +
              - DParticleSet[0] (Reaction Vertex): DVertex (Reaction Vertex)
 +
                                                    vector < DNeutralTrack > photon
 
                                                     - DNeutralTrack[0] (&gamma; from &pi;0 decay) : vector < DNeutralTrackHypothesis > (all from same shower)
 
                                                     - DNeutralTrack[0] (&gamma; from &pi;0 decay) : vector < DNeutralTrackHypothesis > (all from same shower)
 
                                                                                           - DNeutralTrackHypothesis[0] (&gamma;, Reaction Vertex)
 
                                                                                           - DNeutralTrackHypothesis[0] (&gamma;, Reaction Vertex)
Line 88: Line 134:
 
                                                                                           - DNeutralTrackHypothesis[2] (neutron, Reaction Vertex)
 
                                                                                           - DNeutralTrackHypothesis[2] (neutron, Reaction Vertex)
 
                                                                                           - DNeutralTrackHypothesis[3] (neutron, K0 Decay Vertex)
 
                                                                                           - DNeutralTrackHypothesis[3] (neutron, K0 Decay Vertex)
                                                     - DNeutralTrack[2] (neutron)        : vector < DNeutralTrackHypothesis > (all from same shower)
+
                                                    vector < DNeutralTrack > neutron
 +
                                                     - DNeutralTrack[0] (neutron)        : vector < DNeutralTrackHypothesis > (all from same shower)
 
                                                                                           - DNeutralTrackHypothesis[0] (neutron, Reaction Vertex)
 
                                                                                           - DNeutralTrackHypothesis[0] (neutron, Reaction Vertex)
 
                                                                                           - DNeutralTrackHypothesis[1] (neutron, K0 Decay Vertex)
 
                                                                                           - DNeutralTrackHypothesis[1] (neutron, K0 Decay Vertex)

Revision as of 17:19, 29 June 2011

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

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 >                           //The particles in DVertex, organized by particle id
                                             /    |    \
                                            /     |     \
                    vector < DNeutralTrack >    Misc.    vector < DChargedTrack >
                              |                                        |
          vector < DNeutralTrackHypothesis >             vector < DChargedTrackHypothesis >
           /             |             \                      /            |             \
 FOM, tprojected, DKinematicData, Particle_t             FOM, tprojected, DTrackTimeBased, Particle_t


* 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. 

Notes on the particle (DChargedTrack, etc.) classes

  • Particle construction (creating the DChargedTrack, etc. objects) is still performed by the DVertex factory.
  • The particle objects (DChargedTrack, DChargedTrackHypothesis, DNeutralTrack, and DNeutralTrackHypothesis) will each have a factory so that they can be grabbed via JEventLoop->Get().
    • 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 -> γ, γ
DPhysicsEvent: vector < DParticleSet >
               - DParticleSet[0] (Reaction Vertex): DVertex (Reaction Vertex)
                                                    vector < DChargedTrack > pip //empty
                                                    vector < DChargedTrack > pim //empty
                                                    vector < DChargedTrack > Kp
                                                    - Kp[0]      : vector < DChargedTrackHypothesis >
                                                                   - DChargedTrackHypothesis[0] (K+)
                                                                   - DChargedTrackHypothesis[1] (π+)
                                                                   - DChargedTrackHypothesis[2] (proton)
                                                    vector < DChargedTrack > Km //empty
                                                    vector < DChargedTrack > proton //empty
                                                    vector < DChargedTrack > otherp //unidentified positively charged particles //empty
                                                    vector < DChargedTrack > othern //unidentified negatively charged particles //empty
                                                    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)
                                                    vector < DNeutralTrack > otherz //unidentified neutral particles //empty

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


XXXXXXXXXX

DPhysicsEvent: vector < DParticleSet >
               - DParticleSet[0] (Reaction Vertex): DVertex (Reaction Vertex)
                                                    vector < DNeutralTrack > photon
                                                    - DNeutralTrack[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)
                                                    - DNeutralTrack[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)
                                                    vector < DNeutralTrack > neutron
                                                    - DNeutralTrack[0] (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 >
                                                    - DChargedTrack[0] (K+)              : vector < DChargedTrackHypothesis >
                                                                                           - DChargedTrackHypothesis[0] (K+)
                                                                                           - DChargedTrackHypothesis[1] (π+)
                                                                                           - DChargedTrackHypothesis[2] (proton)
               - DParticleSet[1] (K0 Decay Vertex): DVertex (K0 Decay Vertex)
                                                    vector < DNeutralTrack >
                                                    vector < DChargedTrack >
                                                    - DChargedTrack[0] (π+)              : vector < DChargedTrackHypothesis >
                                                                                           - DChargedTrackHypothesis[0] (π+)
                                                                                           - DChargedTrackHypothesis[1] (K+)
                                                                                           - DChargedTrackHypothesis[2] (proton)
                                                    - DChargedTrack[1] (π-)              : vector < DChargedTrackHypothesis >
                                                                                           - DChargedTrackHypothesis[0] (π-)
                                                                                           - DChargedTrackHypothesis[1] (K-)