Difference between revisions of "Analysis DReaction"

From GlueXWiki
Jump to: navigation, search
(DReaction Notes)
(Source Code)
Line 84: Line 84:
 
** Perform different DAnalysisActions to compare the results from having different cuts.  
 
** Perform different DAnalysisActions to compare the results from having different cuts.  
  
* '''IMPORTANT NOTE FOR DEVELOPERS''': Grabbing the <span style="color:#0000FF">DReaction</span> objects from JANA is tricky, because a user may have several factories per plugin, or may be running several plugins at once.  See <span style="color:#0000FF">DParticleComboBlueprint_factory</span>::<span style="color:#008000">evnt</span>() for an example on how to correctly grab all <span style="color:#0000FF">DReaction</span> objects from JANA.  
+
* '''IMPORTANT NOTE FOR DEVELOPERS''': Grabbing the <span style="color:#0000FF">DReaction</span> objects from JANA is tricky, because a user may have several factories per plugin, or may be running several plugins at once.  See <span style="color:#0000FF">DParticleComboBlueprint_factory</span>::<span style="color:#008000">evnt</span>() for an example on how to correctly grab all <span style="color:#0000FF">DReaction</span> objects from JANA.
 
+
=== Source Code ===
+
* C++ code of class members (methods aren't shown):
+
<syntaxhighlight>
+
class DReactionStep
+
{
+
  private:
+
    // PID MEMBERS:
+
    Particle_t dInitialParticleID; //e.g. lambda, gamma
+
    Particle_t dTargetParticleID; //Unknown for no target
+
    deque<Particle_t> dFinalParticleIDs;
+
 
+
    // CONTROL MEMBERS:
+
    int dMissingParticleIndex; //-1 for no missing particles, else final state particle at this index is missing (0 -> x)
+
};
+
</syntaxhighlight>
+
 
+
<syntaxhighlight>
+
class DReaction : public JObject
+
{
+
  private:
+
    // REACTION AND ANALYSIS MEMBERS:
+
    deque<const DReactionStep*> dReactionSteps;
+
    deque<DAnalysisAction*> dAnalysisActions;
+
 
+
    // CONTROL MEMBERS:
+
    string dReactionName; //must be unique
+
    DKinFitType dKinFitType; //defined in ANALYSIS/DKinFitResults.h
+
    deque<size_t> dDecayingParticlesExcludedFromP4Kinfit; //to exclude decaying particles from the kinematic fit (resonances are automatically excluded) //size_t is step index where it is a parent
+
};
+
</syntaxhighlight>
+

Revision as of 00:37, 17 February 2013

Summary

  • Note: The objects (not the factory) are located in: src/libraries/ANALYSIS/
  • DReactionStep: Contains the particle types for an interaction or decay step in a reaction.
    • The particle types are from the Particle_t enum defined in sim-recon/src/libraries/include/particleType.h
  • DReaction: Contains the DReactionStep objects for a reaction, along with (optional) analysis actions/instructions.
  • DReaction_factory: Users should create the DReaction objects they want to study in this factory, and place it in their plugin.

Example: Setting up DReactionStep: b1pi

jerror_t DReaction_factory::init(void)
{
  DReactionStep* locReactionStep;
 
  DReaction* locReaction = new DReaction("b1pi"); //unique name
 
/**************************************************** b1pi Steps ****************************************************/
 
  //g, p -> X(2000), (p)
  locReactionStep = new DReactionStep();
  locReactionStep->Set_InitialParticleID(Gamma);
  locReactionStep->Set_TargetParticleID(Proton);
  locReactionStep->Add_FinalParticleID(Unknown); //x(2000)
  locReactionStep->Add_FinalParticleID(Proton, true); //proton missing
  locReaction->Add_ReactionStep(locReactionStep);
 
  //x(2000) -> b1(1235)+, pi-
  locReactionStep = new DReactionStep();
  locReactionStep->Set_InitialParticleID(Unknown); //x(2000)
  locReactionStep->Add_FinalParticleID(b1_1235_Plus);
  locReactionStep->Add_FinalParticleID(PiMinus);
  locReaction->Add_ReactionStep(locReactionStep);
 
  //b1(1235)+ -> omega, pi+
  locReactionStep = new DReactionStep();
  locReactionStep->Set_InitialParticleID(b1_1235_Plus);
  locReactionStep->Add_FinalParticleID(omega);
  locReactionStep->Add_FinalParticleID(PiPlus);
  locReaction->Add_ReactionStep(locReactionStep);
 
  //omega -> pi+, pi-, pi0
  locReactionStep = new DReactionStep();
  locReactionStep->Set_InitialParticleID(omega);
  locReactionStep->Add_FinalParticleID(PiPlus);
  locReactionStep->Add_FinalParticleID(PiMinus);
  locReactionStep->Add_FinalParticleID(Pi0);
  locReaction->Add_ReactionStep(locReactionStep);
 
  //pi0 -> gamma, gamma
  locReactionStep = new DReactionStep();
  locReactionStep->Set_InitialParticleID(Pi0);
  locReactionStep->Add_FinalParticleID(Gamma);
  locReactionStep->Add_FinalParticleID(Gamma);
  locReaction->Add_ReactionStep(locReactionStep);

DReactionStep Notes

  • The DReactionStep objects must be added to the DReaction in the correct order: the decay step for a particle must always be after its production step (it can be anywhere after it, but it must be after it).
    • However, you can study (for example) π0 decays without a π0 production step if you don't care how they're produced. E.g.:
//pi0 -> gamma, gamma
DReaction* locReaction = new DReaction("pi0"); //unique name
DReactionStep* locReactionStep = new DReactionStep();
locReactionStep->Set_InitialParticleID(Pi0);
locReactionStep->Add_FinalParticleID(Gamma);
locReactionStep->Add_FinalParticleID(Gamma);
locReaction->Add_ReactionStep(locReactionStep);
  • To define one of the particles as missing, when adding the particle add the optional "true" flag:
locReactionStep->Add_FinalParticleID(Proton, true); //missing proton
  • IMPORTANT NOTE FOR ANALYZERS: If a PID you need to use for your analysis is not defined by Particle_t, you can use "Unknown" instead (e.g. a rare resonance) (if you don't need its mass or charge). However, only one PID per DReaction can have the Particle_t of "Unknown" (e.g. the resonance you are studying), because the framework will not distinguish between the two. If you need more than one PID that is not included in Particle_t, then add all of the PIDs you need but one to particleType.h (along with their charges, masses, names, etc.) and check in the update (because other people may need those particles too!).

DReaction Notes

  • The user should create a DReaction object in their plugin for each analysis they want to perform (can analyze more than one at once). For example, by creating additional DReaction objects you can:
    • Analyze different reactions in the same plugin.
    • Treat different particles as missing in the same reaction (or have no particles missing).
    • Perform different kinematic fits to the same reaction (e.g. compare results from p4-only and vertex-p4 fits)
    • Perform different DAnalysisActions to compare the results from having different cuts.
  • IMPORTANT NOTE FOR DEVELOPERS: Grabbing the DReaction objects from JANA is tricky, because a user may have several factories per plugin, or may be running several plugins at once. See DParticleComboBlueprint_factory::evnt() for an example on how to correctly grab all DReaction objects from JANA.