Difference between revisions of "Mattione GlueX Analysis Factories"

From GlueXWiki
Jump to: navigation, search
(Reaction Analysis Factories)
 
(32 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Reaction Analysis Factories ==
 
== Reaction Analysis Factories ==
* NOTE: These are located in sim-recon/src/libraries/ANALYSIS/
+
* NOTE: Most of these are located in sim-recon/src/libraries/ANALYSIS/
 +
 
 +
=== Pre-Selection ===
 +
* '''DNeutralShower_factory_PreSelect''': Pre-selects which <span style="color:#0000FF">DNeutralShower</span> objects should be included in analyses.
 +
* '''DChargedTrack_factory_PreSelect''': Pre-selects which <span style="color:#0000FF">DChargedTrack</span> objects should be included in analyses.
 +
 
 +
=== User Input ===
 
* '''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.   
* '''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. e<sup>-</sup>, or if one of the default PIDs (e.g. &pi;<sup>+</sup>) fails reconstruction while the others don't (e.g. K<sup>+</sup>)). This uses the reconstructed momentum from the <span style="color:#0000FF">DTrackTimeBased</span> object with the closest mass, and re-swims the track.  
+
=== Combo Construction Factories ===
* '''DEventRFBunch_factory_Combo''': Determines the RF bunch that corresponds to each <span style="color:#0000FF">DParticleComboBlueprint</span> (currently always t = 0).  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. Uses the weighted average of the track and shower times (shower-vertex-z determined from weighted average of track vertex-z's) at their POCA to the beamline to determine the RF bunch.  
+
* '''DTrackTimeBased_factory_Combo''': If a charged PID is needed for an analysis for which a corresponding <span style="color:#0000FF">DTrackTimeBased</span> is not present in the data, a new one is created. E.g. if mu+/- are requested. This uses the reconstructed momentum from the <span style="color:#0000FF">DTrackTimeBased</span> object with the closest mass.  
* '''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_Reaction</span>.
+
* '''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 new matching is done, it just uses the matching results from the source object. Also stores the matching results from the default factory.  
* '''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 measured <span style="color:#0000FF">DChargedTrackHypothesis</span>, <span style="color:#0000FF">DNeutralParticleHypothesis</span>, and <span style="color:#0000FF">DBeamPhoton</span> objects. A loose timing cut is placed between the <span style="color:#0000FF">DEventRFBunch</span> time and the <span style="color:#0000FF">DBeamPhoton</span> objects, and additional <span style="color:#0000FF">DParticleCombo</span> objects are created if more than one <span style="color:#0000FF">DBeamPhoton</span> object survives the cut.
+
* '''DAnalysisResults_factory''': Creates the combos via the DSourceComboer class (detailed below). 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.
* '''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>() == true). This allows <span style="color:#0000FF">DAnalysisAction</span> objects to reject background combinations prior to kinematic fitting to save time and memory.  This 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.  
+
 
* '''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. 
+
=== Combo Construction Classes (not factories) ===
* '''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>.  
+
* '''DSourceComboer''': Finds all combos of charged tracks / neutral showers necessary to make the desired combosCalls methods in the other DSourceCombo* classes below as neededAlso is responsible for dE/dx and E/p PID cuts.  
* '''DNeutralParticleHypothesis_factory_KinFit''': Create <span style="color:#0000FF">DNeutralParticleHypothesis</span> objects containing the kinematically fit track parameters.  New, unique objects are created for each neutral particle in each kinematically fit <span style="color:#0000FF">DParticleCombo</span>.  
+
* '''DSourceComboTimeHandler''': Responsible for PID timing cuts, binning photons by vertex-z, and RF bunch selection.
* '''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>.  
+
* '''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 degrees.  Otherwise, is the POCA between the two closest tracks.  
* '''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 containing the kinematically fit track parameters (in addition to the original, measured parameters).  
+
* '''DSourceComboP4Handler''': Responsible for placing invariant mass and missing mass squared cuts on the combos.  Also for reconstructing the P4 of decaying particles as needed.  
* '''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.
+
* '''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 ==
 
== Thrown Factories ==
 
* '''DReaction_factory_Thrown''': Creates a <span style="color:#0000FF">DReaction</span> object representing the thrown reaction.  Final state particles listed in <span style="color:#0000FF">DMCThrown</span> 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.  
 
* '''DReaction_factory_Thrown''': Creates a <span style="color:#0000FF">DReaction</span> object representing the thrown reaction.  Final state particles listed in <span style="color:#0000FF">DMCThrown</span> 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 <span style="color:#0000FF">DParticleCombo</span> object representing the thrown reaction.  The <span style="color:#0000FF">DMCThrown</span> objects are used for the particle data, except pure <span style="color:#0000FF">DKinematicData</span> objects are used for the beam particle and target objects (from <span style="color:#0000FF">DMCReaction</span>). Final state particles listed in <span style="color:#0000FF">DMCThrown</span> 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 <span style="color:#0000FF">DParticleCombo</span> object representing the thrown reaction.  The <span style="color:#0000FF">DMCThrown</span> objects are used for the particle data, except pure <span style="color:#0000FF">DKinematicData</span> objects are used for the beam particle and target objects (from <span style="color:#0000FF">DMCReaction</span>). Final state particles listed in <span style="color:#0000FF">DMCThrown</span> 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 <span style="color:#0000FF">DEventRFBunch</span> object for the simulated event.
  
 
== Analysis Utilities ==
 
== 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.
 
* '''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.  Also matches thrown and reconstructed BCAL, FCAL, and TOF hits, although currently only the TOF hits have been vetted.   
+
* '''DMCThrownMatching''': Matches reconstructed particles to generated particles. Only the best match for each particle is saved.
* '''DAnalysisUtilities''': Collection of utility functions used to facilitate physics analyses.  These include methods for calculating invariant mass, missing mass, DOCA, etc., as well as methods for determining whether a <span style="color:#0000FF">DParticleCombo</span> is in some ways similar to other <span style="color:#0000FF">DParticleCombo</span> objects (e.g. the same track hypotheses make up a given decay chain) (useful for preventing double-counting when histogramming (e.g. invariant mass)).  
+
** 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 <span style="color:#0000FF">DTrackTimeBased</span> factory), and the highest total is set in <span style="color:#0000FF">DTrackTimeBased</span> (as well as the corresponding <span style="color:#0000FF">DMCThrown</span>::<span style="color:#008000">myid</span>). In the <span style="color:#0000FF">DMCThrownMatching</span> factory, for each <span style="color:#0000FF">DTrackTimeBased</span>, 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 <span style="color:#0000FF">DMCThrown</span> is only matched once (other matches are ignored)Hit fractions less than <span style="color:#0000FF">DMCThrownMatching</span>::<span style="color:#008000">dMinTrackMatchHitFraction</span> (default <span style="color:Red">0.5</span>, set-able on command-line via <span style="color:Red">-PMCMATCH:MIN_TRACK_MATCH</span>) 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 [[Mattione_GlueX_Kinematic_Fitting | GlueX Kinematic Fitting]]
 
* '''DKinFitter_GlueX''': See [[Mattione_GlueX_Kinematic_Fitting | GlueX Kinematic Fitting]]
 
== Factories Tree ==
 
* This tree was generated using the b1pi_hists plugin on December 8, 2012. 
 
[[Image:Mattione_AnalysisFactories_b1piFactoryTree.png|left|600px]]
 
<br style="clear:both;"/>
 

Latest revision as of 07:41, 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 a charged PID is needed for an analysis for which a corresponding DTrackTimeBased is not present in the data, a new one is created. E.g. if mu+/- are requested. 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 new matching is done, it just uses the matching results from the source object. Also stores the matching results from the default factory.
  • DAnalysisResults_factory: Creates the combos via the DSourceComboer class (detailed below). 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