Difference between revisions of "Analysis DReaction"

From GlueXWiki
Jump to: navigation, search
(DReactionStep Notes)
(DReactionStep Notes)
Line 59: Line 59:
  
 
<syntaxhighlight>
 
<syntaxhighlight>
  //pi0 -> gamma, gamma
+
//pi0 -> gamma, gamma
  DReaction* locReaction = new DReaction("pi0"); //unique name
+
DReaction* locReaction = new DReaction("pi0"); //unique name
  DReactionStep* locReactionStep = new DReactionStep();
+
DReactionStep* locReactionStep = new DReactionStep();
  locReactionStep->Set_InitialParticleID(Pi0);
+
locReactionStep->Set_InitialParticleID(Pi0);
  locReactionStep->Add_FinalParticleID(Gamma);
+
locReactionStep->Add_FinalParticleID(Gamma);
  locReactionStep->Add_FinalParticleID(Gamma);
+
locReactionStep->Add_FinalParticleID(Gamma);
  locReaction->Add_ReactionStep(locReactionStep);
+
locReaction->Add_ReactionStep(locReactionStep);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
* To define one of the particles as missing, when adding the particle add the optional "true" flag:
 
* To define one of the particles as missing, when adding the particle add the optional "true" flag:
 
<syntaxhighlight>
 
<syntaxhighlight>
  locReactionStep->Add_FinalParticleID(Proton, true); //missing proton
+
locReactionStep->Add_FinalParticleID(Proton, true); //missing proton
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 +
* '''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 <span style="color:#0000FF">DReaction</span> (besides the target) 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!).
 +
 +
== <span style="color:#0000FF">DReaction</span> Notes ==
  
* Located in src/libraries/ANALYSIS/
 
 
* The user should create a <span style="color:#0000FF">DReaction</span> object in their plugin for each analysis they want to perform (can analyze more than one at once).
 
* The user should create a <span style="color:#0000FF">DReaction</span> object in their plugin for each analysis they want to perform (can analyze more than one at once).
  
* '''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 <span style="color:#0000FF">DReaction</span> (besides the target) 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!).
 
  
 
* '''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.  

Revision as of 00:29, 17 February 2013

Summary

  • 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 (besides the target) 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).


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

Source Code

  • C++ code of class members (methods aren't shown):
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)
};
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
};