Analysis Examples

From GlueXWiki
Revision as of 16:39, 5 January 2014 by Pmatt (Talk | contribs) (Thorough: Using an Analysis Action)

Jump to: navigation, search

Histogramming b1(1235)+ Invariant Mass in b1pi

  • Assumes the DReaction has been setup as shown in: DReaction

Minimal/Simplest

  • Minimal: No check against double-counting, using kinematic fit data only.
    • Not best practice: intended only as a simple illustration.
  • In your DEventProcessor class definition (header):
TH1D* dHist_omegaMass;
  • In your DEventProcessor init() method:
dHist_omegaMass = new TH1D("B1InvariantMass", ";#pi^{+}#omega Invariant Mass (GeV/c^{2})", 600, 0.6, 1.8);
  • In your DEventProcessor evnt() method:
vector<const DParticleCombo*> locParticleCombos;
locEventLoop->Get(locParticleCombos);
 
for(size_t loc_i = 0; loc_i < locParticleCombos.size(); ++loc_i)
{
  if(locParticleCombos[loc_i]->Get_Reaction()->Get_ReactionName() != "b1pi")
    continue; //wrong DReaction
 
  // get omega combo step //0 is photoproduction, 1 is omega decay, 2 is pi0 decay
  const DParticleComboStep* locParticleComboStep0 = locParticleCombo->Get_ParticleComboStep(0);
  const DParticleComboStep* locParticleComboStep1 = locParticleCombo->Get_ParticleComboStep(1);
 
  // calculate b1+ p4 with kinematic fit data
  TLorentzVector locP4;
  locP4 += locParticleComboStep0->Get_FinalParticle(2)->lorentzMomentum(); //pi+
  locP4 += locParticleComboStep1->Get_FinalParticle(0)->lorentzMomentum(); //pi+
  locP4 += locParticleComboStep1->Get_FinalParticle(1)->lorentzMomentum(); //pi-
  locP4 += locParticleComboStep1->Get_FinalParticle(2)->lorentzMomentum(); //pi0
 
  Get_Application()->RootWriteLock(); //ACQUIRE ROOT LOCK!!
  {
    dHist_omegaMass->Fill(locP4.M());
  }
  Get_Application()->RootUnLock(); //RELEASE ROOT LOCK!!
  break;
}

Thorough: Using an Analysis Action

  • Checks against double-counting, shows/allows histogramming measured or kinfit data.
  • See DCustomAction_HistMass_b1_1235 in the b1pi Plugin
  • Add to your DReaction anywhere in the analysis chain:
locReaction->Add_AnalysisAction(new DCustomAction_HistMass_b1_1235(locReaction, false)); //false: measured data
locReaction->Add_AnalysisAction(new DCustomAction_HistMass_b1_1235(locReaction, true, "KinFit")); //true: kinfit data //"KinFit:" a unique, distinguishing string (could have been anything)

Kinematic Fit Confidence Level

  • In your DEventProcessor evnt() method:
vector<const DParticleCombo*> locParticleCombos;
locEventLoop->Get(locParticleCombos);
 
for(size_t loc_i = 0; loc_i < locParticleCombos.size(); ++loc_i)
{
  if(locParticleCombos[loc_i]->Get_Reaction()->Get_ReactionName() != "b1pi")
    continue; //wrong DReaction
  const DKinFitResults* locKinFitResults = locParticleCombos[loc_i]->Get_KinFitResults();
  double locConfidenceLevel = locKinFitResults->Get_ConfidenceLevel();
}

Getting the Thrown Track Topology

  • There are several ways of getting the thrown track information. The most direct way of getting it is to ask JANA for the DMCThrown particles (see below). The DMCThrown::parentid member variable matches the DMCThrown::myid member variable that the particle decayed from. If it did not decay from any particle (e.g. was directly photoproduced by the generator) then the DMCThrown::parentid member will equal 0.
vector<const DMCThrown*> locMCThrowns;
locEventLoop->Get(locMCThrowns);
  • An easier way of getting the information is by asking JANA for the thrown DReaction and DParticleCombo objects. These are accessible by requesting these objects with the "Thrown" tag (see below). These contain the PIDs (DReaction) and track kinematics (DParticleCombo) of the thrown particles, organized by the event's decay chain.
    • NOTE: when producing these, any decays of kaons, pions, muons, and neutrons are ignored.
    • NOTE: if a particle type is not defined in sim-recon/src/libraries/include/particleType.h, then it is ignored when generating these objects.
vector<const DReaction*> locThrownReactions;
locEventLoop->Get(locThrownReactions, "Thrown");
const DReaction* locThrownReaction = locThrownReactions[0];
deque<Particle_t> locThrownPIDs;
locThrownReaction->Get_DetectedFinalPIDs(locThrownPIDs, true); //true tells it to include duplicates (so if two pi-'s, list it twice).  
 
vector<const DParticleCombo*> locThrownParticleCombos;
locEventLoop->Get(locThrownParticleCombos, "Thrown");
const DParticleCombo* locThrownParticleCombo = locThrownParticleCombos[0];