Difference between revisions of "Analysis DReaction"

From GlueXWiki
Jump to: navigation, search
(b1pi Example)
Line 4: Line 4:
 
* '''DReaction_factory''': Users should create the DReaction objects they want to study in this factory, and place it in their plugin.
 
* '''DReaction_factory''': Users should create the DReaction objects they want to study in this factory, and place it in their plugin.
  
== b1pi Example ==
+
== Setting up DReactionStep objects: b1pi Example ==
  
 
<syntaxhighlight>
 
<syntaxhighlight>

Revision as of 00:18, 17 February 2013

Summary

  • DReactionStep: Contains the particle types for an interaction or decay step in a reaction.
  • 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.

Setting up DReactionStep objects: b1pi Example

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);
  dReactionStepPool.push_back(locReactionStep); //prevent memory leak
 
  //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);
  dReactionStepPool.push_back(locReactionStep); //prevent memory leak
 
  //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);
  dReactionStepPool.push_back(locReactionStep); //prevent memory leak
 
  //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);
  dReactionStepPool.push_back(locReactionStep); //prevent memory leak
 
  //pi0 -> gamma, gamma
  locReactionStep = new DReactionStep();
  locReactionStep->Set_InitialParticleID(Pi0);
  locReactionStep->Add_FinalParticleID(Gamma);
  locReactionStep->Add_FinalParticleID(Gamma);
  locReaction->Add_ReactionStep(locReactionStep);
  dReactionStepPool.push_back(locReactionStep); //prevent memory leak
 
  // Set control variables

DReaction

  • Located in src/libraries/ANALYSIS/
  • The user should create a DReaction object in their plugin for each analysis they want to perform (can analyze more than one at once).
  • The particles in a DReaction are setup by creating a DReactionStep for each step in the reaction decay chain (including the photoproduction step) that you want to analyze, and adding them to the DReaction.
    • Particles are then added to the DReactionStep by adding their PID from the Particle_t enum.
      • Particle_t is defined in src/libraries/include/particleType.h
    • 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).
      • For example, you cannot list the Λ decay step before the Λ production step.
        • However, you don't need to add the Λ production step if you don't want to analyze it.
    • To define one of the particles as missing, call DReactionStep::Set_MissingParticleIndex() with the index of the final state particle you want to be missing (or set it to be -1 for none).
  • For an example on how to setup a DReaction, see the "User Plugin DReaction_factory" section below.
  • 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!).
  • 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
};