Difference between revisions of "Mattione GlueX Analysis Factories"

From GlueXWiki
Jump to: navigation, search
(Analysis Utilities)
Line 9: Line 9:
 
* '''DReaction_factory''': Creates <span style="color:#0000FF">DReaction</span> objects to be analyzed.  Needs to be created in each analysis plugin.   
 
* '''DReaction_factory''': Creates <span style="color:#0000FF">DReaction</span> objects to be analyzed.  Needs to be created in each analysis plugin.   
  
=== Objects for PreKinFit DParticleCombo ===
+
=== Combo Construction Factories ===
* '''DParticleComboBlueprint_factory''': Creates a <span style="color:#0000FF">DParticleComboBlueprint</span> object for each possible track combination, excluding any possible multiplicity from multiple beam photons.  These <span style="color:#0000FF">DParticleComboBlueprint</span> objects store pointers to which <span style="color:#0000FF">DChargedTrack</span> and <span style="color:#0000FF">DNeutralShower</span> objects will be used for each particle in the reaction.  The beam photon multiplicity is handled in <span style="color:#0000FF">DParticleCombo_factory_PreKinFit</span>.
+
 
* '''DTrackTimeBased_factory_Combo''': If none of the existing <span style="color:#0000FF">DTrackTimeBased</span> objects for a given reconstructed track have the needed PID for a particle in a <span style="color:#0000FF">DReaction</span>, this creates new <span style="color:#0000FF">DTrackTimeBased</span> objects for them (e.g. <span style="color:Red">e<sup>-</sup></span>). This uses the reconstructed momentum from the <span style="color:#0000FF">DTrackTimeBased</span> object with the closest mass.  
 
* '''DTrackTimeBased_factory_Combo''': If none of the existing <span style="color:#0000FF">DTrackTimeBased</span> objects for a given reconstructed track have the needed PID for a particle in a <span style="color:#0000FF">DReaction</span>, this creates new <span style="color:#0000FF">DTrackTimeBased</span> objects for them (e.g. <span style="color:Red">e<sup>-</sup></span>). This uses the reconstructed momentum from the <span style="color:#0000FF">DTrackTimeBased</span> object with the closest mass.  
 
* '''DDetectorMatches_factory_Combo''': Stores the matching between each new <span style="color:#0000FF">DTrackTimeBased</span> object (from the <span style="color:Red">"Combo"</span> factory) and the existing shower/hit objects. No need matching is done, it just uses the matching results from the source object. Also stores the matching results from the default factory.  
 
* '''DDetectorMatches_factory_Combo''': Stores the matching between each new <span style="color:#0000FF">DTrackTimeBased</span> object (from the <span style="color:Red">"Combo"</span> factory) and the existing shower/hit objects. No need matching is done, it just uses the matching results from the source object. Also stores the matching results from the default factory.  
* '''DEventRFBunch_factory_Combo''': Determines the RF bunch that corresponds to each <span style="color:#0000FF">DParticleComboBlueprint</span>.  These are created separately for each <span style="color:#0000FF">DParticleCombo</span> because extra ghost and/or accidental tracks in the event that are not in the <span style="color:#0000FF">DParticleCombo</span> are excluded from the determination, improving the RF bunch selection.   
+
* '''DAnalysisResults_factory''': Loops over the <span style="color:#0000FF">DAnalysisAction</span> objects stored in each <span style="color:#0000FF">DReaction</span>, and executing them on the corresponding <span style="color:#0000FF">DParticleCombo</span>.  This creates and fills histograms of the number of events and <span style="color:#0000FF">DParticleCombo</span> objects that survive each cut.
* '''DChargedTrackHypothesis_factory_Combo''': Creates <span style="color:#0000FF">DChargedTrackHypothesis</span> objects for the <span style="color:#0000FF">DTrackTimeBased</span> objects created by <span style="color:#0000FF">DTrackTimeBased_factory_Combo</span>.  Also, creates new <span style="color:#0000FF">DChargedTrackHypothesis</span> objects using the <span style="color:Red">"Combo"</span>-tagged version of <span style="color:#0000FF">DEventRFBunch</span> to compute new PID FOMs.
+
* '''DNeutralParticleHypothesis_factory_Combo''': Creates new <span style="color:#0000FF">DNeutralParticleHypothesis</span> objects using the <span style="color:Red">"Combo"</span>-tagged version of <span style="color:#0000FF">DEventRFBunch</span> to compute new PID FOMs.
+
  
=== Pre-Kinematic Fit ===
+
=== Combo Construction Classes (not factories) ===
 
+
* '''DSourceComboer''': Finds all combos of charged tracks / neutral showers necessary to make the desired combosCalls methods in the other DSourceCombo* classes below as needed.  Also is responsible for dE/dx and E/p PID cuts.  
* '''DParticleCombo_factory_PreKinFit''': Creates a <span style="color:#0000FF">DParticleCombo</span> object for each <span style="color:#0000FF">DParticleComboBlueprint</span>, setting the data with the <span style="color:Red">"Combo"</span>-tagged versions of the <span style="color:#0000FF">DChargedTrackHypothesis</span>, <span style="color:#0000FF">DNeutralParticleHypothesis</span>, and <span style="color:#0000FF">DEventRFBunch</span> objects, as well as the measured <span style="color:#0000FF">DBeamPhoton</span> objectsAdditional <span style="color:#0000FF">DParticleCombo</span> objects are created if more than one valid <span style="color:#0000FF">DBeamPhoton</span> object is available.
+
* '''DSourceComboTimeHandler''': Responsible for PID timing cuts, binning photons by vertex-z, and RF bunch selection.
 
+
* '''DSourceComboVertexHandler''': Responsible for finding pre-kinfit vertex positions for the combosIf is photoproduction step, the POCA to the beamline of the tracks with &theta; closest to 90 degreesOtherwise, is the POCA between the two closest tracks.  
* '''DAnalysisResults_PreKinFit''': Loops over the <span style="color:#0000FF">DAnalysisAction</span> objects stored in each <span style="color:#0000FF">DReaction</span>, executing them on the corresponding <span style="color:#0000FF">DParticleCombo</span> objects until the kinematic fit results are needed for an action (<span style="color:#0000FF">DAnalysisAction</span>::<span style="color:#008000">Get_UseKinFitResultsFlag</span>() == <span style="color:Red">true</span>). This allows <span style="color:#0000FF">DAnalysisAction</span> objects to reject background combinations prior to kinematic fitting to save time and memoryThis creates and fills histograms of the number of events and <span style="color:#0000FF">DParticleCombo</span> objects that survive each cut.  This also creates and fills several reaction-independent histograms, such as thrown and reconstructed particle kinematics, and track multiplicity.
+
* '''DSourceComboP4Handler''': Responsible for placing invariant mass and missing mass squared cuts on the combosAlso for reconstructing the P4 of decaying particles as needed.  
 
+
* '''DParticleComboCreator''': Takes the results from the DSourceComboer and creates DParticleCombo objects from them, along with new DChargedTrackHypothesis and DNeutralParticleHypothesis objects for the tracks (using the combo-specific vertex position for PID, etc.).  
=== Objects for Post-Kinematic Fit (Default Tag) DParticleCombo ===
+
 
+
* NOTE: if no kinematic fit is requested/performed, then these objects aren't created.  
+
* '''DKinFitResults_factory''': For each <span style="color:#0000FF">DParticleCombo</span> that survived all of the cuts executed in <span style="color:#0000FF">DAnalysisResults_PreKinFit</span>, perform the kinematic fit specified by the <span style="color:#0000FF">DReaction</span> objects (if desired). See the "DKinFitResults_factory" section of [[Mattione_GlueX_Kinematic_Fitting | GlueX Kinematic Fitting]] for more details. 
+
* '''DChargedTrackHypothesis_factory_KinFit''': Create <span style="color:#0000FF">DChargedTrackHypothesis</span> objects containing the kinematically fit track parametersNew, unique objects are created for each charged particle in each kinematically fit <span style="color:#0000FF">DParticleCombo</span>.
+
* '''DNeutralParticleHypothesis_factory_KinFit''': Create <span style="color:#0000FF">DNeutralParticleHypothesis</span> objects containing the kinematically fit track parametersNew, unique objects are created for each neutral particle in each kinematically fit <span style="color:#0000FF">DParticleCombo</span>.  
+
* '''DBeamPhoton_factory_KinFit''': Create <span style="color:#0000FF">DBeamPhoton</span> objects containing the kinematically fit track parametersNew, unique objects are created for each beam photon in each kinematically fit <span style="color:#0000FF">DParticleCombo</span>.
+
 
+
=== Post-Kinematic Fit ===
+
 
+
* NOTE: these objects are created regardless of whether a kinematic fit is requested.  
+
* '''DParticleCombo_factory''': Creates a new <span style="color:#0000FF">DParticleCombo</span> object in each <span style="color:#0000FF">DParticleCombo</span> that survived all of the cuts executed in <span style="color:#0000FF">DAnalysisResults_PreKinFit</span>, but with the kinematically fit track parameters (the measured parameters are still available). The combos that fail kinematic fitting are copied from the "PreKinFit" factory and are saved in the output as well.
+
* '''DAnalysisResults_factory''': Loops over the <span style="color:#0000FF">DAnalysisAction</span> objects stored in each <span style="color:#0000FF">DReaction</span>, skipping those that were executed by <span style="color:#0000FF">DAnalysisResults_PreKinFit</span>, and executing the remaining ones on the corresponding <span style="color:#0000FF">DParticleCombo</span> objects created by <span style="color:#0000FF">DParticleCombo_factory</span>. This creates and fills histograms of the number of events and <span style="color:#0000FF">DParticleCombo</span> objects that survive each cut.
+
  
 
== Thrown Factories ==
 
== Thrown Factories ==
Line 51: Line 35:
 
* '''DAnalysisUtilities''': Collection of utility functions used to facilitate physics analyses.  These include methods for calculating invariant mass, missing mass, DOCA, etc.
 
* '''DAnalysisUtilities''': Collection of utility functions used to facilitate physics analyses.  These include methods for calculating invariant mass, missing mass, DOCA, etc.
 
* '''DKinFitter_GlueX''': See [[Mattione_GlueX_Kinematic_Fitting | GlueX Kinematic Fitting]]
 
* '''DKinFitter_GlueX''': See [[Mattione_GlueX_Kinematic_Fitting | GlueX Kinematic Fitting]]
 
== Factories Tree (PostScript) ==
 
* This tree was generated using the b1pi_hists plugin on April 3, 2013. 
 
<!-- [[Image:Mattione_AnalysisFactories_b1piFactoryTree.png|left|600px]] -->
 
[[Image:Mattione_AnalysisFactories_b1piFactoryTree.ps|left|600px]]
 
<br style="clear:both;"/>
 

Revision as of 07:06, 3 November 2017

Reaction Analysis Factories

  • NOTE: Most of these are located in sim-recon/src/libraries/ANALYSIS/

Pre-Selection

  • DNeutralShower_factory_PreSelect: Pre-selects which DNeutralShower objects should be included in analyses.
  • DChargedTrack_factory_PreSelect: Pre-selects which DChargedTrack objects should be included in analyses.

User Input

  • DReaction_factory: Creates DReaction objects to be analyzed. Needs to be created in each analysis plugin.

Combo Construction Factories

  • DTrackTimeBased_factory_Combo: If none of the existing DTrackTimeBased objects for a given reconstructed track have the needed PID for a particle in a DReaction, this creates new DTrackTimeBased objects for them (e.g. e-). This uses the reconstructed momentum from the DTrackTimeBased object with the closest mass.
  • DDetectorMatches_factory_Combo: Stores the matching between each new DTrackTimeBased object (from the "Combo" factory) and the existing shower/hit objects. No need matching is done, it just uses the matching results from the source object. Also stores the matching results from the default factory.
  • DAnalysisResults_factory: Loops over the DAnalysisAction objects stored in each DReaction, and executing them on the corresponding DParticleCombo. This creates and fills histograms of the number of events and DParticleCombo objects that survive each cut.

Combo Construction Classes (not factories)

  • DSourceComboer: Finds all combos of charged tracks / neutral showers necessary to make the desired combos. Calls methods in the other DSourceCombo* classes below as needed. Also is responsible for dE/dx and E/p PID cuts.
  • DSourceComboTimeHandler: Responsible for PID timing cuts, binning photons by vertex-z, and RF bunch selection.
  • DSourceComboVertexHandler: Responsible for finding pre-kinfit vertex positions for the combos. If is photoproduction step, the POCA to the beamline of the tracks with θ closest to 90 degrees. Otherwise, is the POCA between the two closest tracks.
  • DSourceComboP4Handler: Responsible for placing invariant mass and missing mass squared cuts on the combos. Also for reconstructing the P4 of decaying particles as needed.
  • DParticleComboCreator: Takes the results from the DSourceComboer and creates DParticleCombo objects from them, along with new DChargedTrackHypothesis and DNeutralParticleHypothesis objects for the tracks (using the combo-specific vertex position for PID, etc.).

Thrown Factories

  • DReaction_factory_Thrown: Creates a DReaction object representing the thrown reaction. Final state particles listed in DMCThrown are ignored if they have decayed from pions, kaons, or other "typical" final state particles (e.g. muons, electrons, pions, and neutrinos are ignored if they decay from a kaon, etc.). Also, particles not defined in sim-recon/src/libraries/include/particleType.h are ignored.
  • DParticleCombo_factory_Thrown: Creates a DParticleCombo object representing the thrown reaction. The DMCThrown objects are used for the particle data, except pure DKinematicData objects are used for the beam particle and target objects (from DMCReaction). Final state particles listed in DMCThrown are ignored if they have decayed from pions, kaons, or other "typical" final state particles (e.g. muons, electrons, pions, and neutrinos are ignored if they decay from a kaon, etc.). Also, particles not defined in sim-recon/src/libraries/include/particleType.h are ignored.
  • DEventRFBunch_factory_Thrown: Creates a DEventRFBunch object for the simulated event.

Analysis Utilities

  • DParticleID: (Located in the PID library) Collection of functions used to match charged tracks to hits in the BCAL, FCAL, SC, and TOF, and to calculate the PID FOM from the TOF and DC dE/dx information.
  • DMCThrownMatching: Matches reconstructed particles to generated particles. Only the best match for each particle is saved.
    • For neutrals, compares the thrown and reconstructed shower momenta and uses the shower covariance matrix to calculate a match FOM. This FOM is NOT cut, so extremely poor matches are included in the results.
    • For tracks, compares the hits on the track to the thrown hits. First, the % of the track hits on each thrown track is computed (in the DTrackTimeBased factory), and the highest total is set in DTrackTimeBased (as well as the corresponding DMCThrown::myid). In the DMCThrownMatching factory, for each DTrackTimeBased, the number of matched hits is weighted (multiplied) by the track hit-fraction (#-hits-on-track-matched-to-MC / #-hits-on-track). Matches are then recorded in order from highest weighted-#-hits to least, such that each DMCThrown is only matched once (other matches are ignored). Hit fractions less than DMCThrownMatching::dMinTrackMatchHitFraction (default 0.5, set-able on command-line via -PMCMATCH:MIN_TRACK_MATCH) are ignored.
    • Also matches thrown and reconstructed BCAL, FCAL, and TOF hits, although currently only the TOF hits have been vetted.
  • DAnalysisUtilities: Collection of utility functions used to facilitate physics analyses. These include methods for calculating invariant mass, missing mass, DOCA, etc.
  • DKinFitter_GlueX: See GlueX Kinematic Fitting