Difference between revisions of "GlueX Analysis Software"

From GlueXWiki
Jump to: navigation, search
(More Information)
(Quick Start)
Line 9: Line 9:
  
 
* NOTE: For an example of the below steps, see one of the example plugins below (e.g. b1pi).
 
* NOTE: For an example of the below steps, see one of the example plugins below (e.g. b1pi).
 +
 
* Create a new plugin containing a <span style="color:#0000FF">DEventProcessor</span>, <span style="color:#0000FF">DReaction_factory</span>, and <span style="color:#0000FF">DFactoryGenerator</span> (for the <span style="color:#0000FF">DReaction_factory</span>).  
 
* Create a new plugin containing a <span style="color:#0000FF">DEventProcessor</span>, <span style="color:#0000FF">DReaction_factory</span>, and <span style="color:#0000FF">DFactoryGenerator</span> (for the <span style="color:#0000FF">DReaction_factory</span>).  
 +
 
* Create desired custom <span style="color:#0000FF">DAnalysisAction</span> objects for your analysis (if any).  
 
* Create desired custom <span style="color:#0000FF">DAnalysisAction</span> objects for your analysis (if any).  
 
** See existing analysis actions in sim-recon/src/libraries/ANALYSIS/DHistogramActions.h and sim-recon/src/libraries/ANALYSIS/DCutActions.h for examples.
 
** See existing analysis actions in sim-recon/src/libraries/ANALYSIS/DHistogramActions.h and sim-recon/src/libraries/ANALYSIS/DCutActions.h for examples.
 +
 
* In <span style="color:#0000FF">DReaction_factory</span>::<span style="color:#008000">init</span>(void), create a <span style="color:#0000FF">DReaction</span> object (with a unique name!) for each analysis you want to perform, specify the kinematic fit type for it, specify the <span style="color:#0000FF">DAnalysisActions</span> for each, and add them to <span style="color:#008000">_data</span>.  
 
* In <span style="color:#0000FF">DReaction_factory</span>::<span style="color:#008000">init</span>(void), create a <span style="color:#0000FF">DReaction</span> object (with a unique name!) for each analysis you want to perform, specify the kinematic fit type for it, specify the <span style="color:#0000FF">DAnalysisActions</span> for each, and add them to <span style="color:#008000">_data</span>.  
 
** The <span style="color:#0000FF">DAnalysisAction</span> objects are executed sequentially for each possible particle combination (<span style="color:#0000FF">DParticleCombo</span>) matching the given <span style="color:#0000FF">DReaction</span>, until it fails a cut.  
 
** The <span style="color:#0000FF">DAnalysisAction</span> objects are executed sequentially for each possible particle combination (<span style="color:#0000FF">DParticleCombo</span>) matching the given <span style="color:#0000FF">DReaction</span>, until it fails a cut.  
 
** If more than one <span style="color:#0000FF">DAnalysisAction</span> object of a given type is used in a <span style="color:#0000FF">DReaction</span>, all of their constructors must be called with a unique identifier string (including the default "").  
 
** If more than one <span style="color:#0000FF">DAnalysisAction</span> object of a given type is used in a <span style="color:#0000FF">DReaction</span>, all of their constructors must be called with a unique identifier string (including the default "").  
 
** More details on analysis actions in sim-recon/src/libraries/ANALYSIS/: DAnalysisAction.*, DHistogramActions.*, DCutActions.*
 
** More details on analysis actions in sim-recon/src/libraries/ANALYSIS/: DAnalysisAction.*, DHistogramActions.*, DCutActions.*
 +
 
* Setup the <span style="color:#0000FF">DEventProcessor</span>.   
 
* Setup the <span style="color:#0000FF">DEventProcessor</span>.   
 
** In <span style="color:#0000FF">DEventProcessor</span>, make sure to grab the <span style="color:#0000FF">DAnalysisResults</span> objects from the <span style="color:#0000FF">JEventLoop</span> in the <span style="color:#008000">evnt</span>() method, and to add the <span style="color:#0000FF">DFactoryGenerator</span> to the application in the <span style="color:#008000">InitPlugin</span>() method.  
 
** In <span style="color:#0000FF">DEventProcessor</span>, make sure to grab the <span style="color:#0000FF">DAnalysisResults</span> objects from the <span style="color:#0000FF">JEventLoop</span> in the <span style="color:#008000">evnt</span>() method, and to add the <span style="color:#0000FF">DFactoryGenerator</span> to the application in the <span style="color:#008000">InitPlugin</span>() method.  
 +
 
* Compile and run hd_root with your plugin (preferably on REST data).
 
* Compile and run hd_root with your plugin (preferably on REST data).
  

Revision as of 22:36, 17 February 2013

Summary

  • In his/her plugin, a user specifies the reaction(s) he/she wants to study (DReaction), along with the histograms and cuts to perform (if any) (DAnalysisAction), then just asks JANA for the results (DAnalysisResults).
  • Through this process, the program creates all possible track combinations for the desired reaction (DParticleCombo, tag "PreKinFit"), kinematic fits the event to the reaction (DKinFitResults), and updates the tracks with the new kinfit information (DParticleCombo, no tag).
  • The DAnalysisAction objects encapsulate the setup and execution of an action (e.g. cut, histogram) into a single object.
    • Many common actions are predefined in DANA (see libraries/ANALYSIS/DHistogramActions.h and libraries/ANALYSIS/DCutActions.h), but the user can write custom ones for their analysis in their plugin.
  • The DAnalysisResults objects indicate which DParticleCombo objects have passed/failed the DAnalysisAction cuts for each DReaction.

Quick Start

  • NOTE: For an example of the below steps, see one of the example plugins below (e.g. b1pi).
  • Create a new plugin containing a DEventProcessor, DReaction_factory, and DFactoryGenerator (for the DReaction_factory).
  • Create desired custom DAnalysisAction objects for your analysis (if any).
    • See existing analysis actions in sim-recon/src/libraries/ANALYSIS/DHistogramActions.h and sim-recon/src/libraries/ANALYSIS/DCutActions.h for examples.
  • In DReaction_factory::init(void), create a DReaction object (with a unique name!) for each analysis you want to perform, specify the kinematic fit type for it, specify the DAnalysisActions for each, and add them to _data.
    • The DAnalysisAction objects are executed sequentially for each possible particle combination (DParticleCombo) matching the given DReaction, until it fails a cut.
    • If more than one DAnalysisAction object of a given type is used in a DReaction, all of their constructors must be called with a unique identifier string (including the default "").
    • More details on analysis actions in sim-recon/src/libraries/ANALYSIS/: DAnalysisAction.*, DHistogramActions.*, DCutActions.*
  • Setup the DEventProcessor.
    • In DEventProcessor, make sure to grab the DAnalysisResults objects from the JEventLoop in the evnt() method, and to add the DFactoryGenerator to the application in the InitPlugin() method.
  • Compile and run hd_root with your plugin (preferably on REST data).

Example Plugins

  • b1pi: sim-recon/src/programs/Analysis/plugins/b1pi_hists/
  • monitoring_hists: sim-recon/src/programs/Analysis/plugins/monitoring_hists/

More Information