Difference between revisions of "Mattione GlueX Analysis Factories"

From GlueXWiki
Jump to: navigation, search
(Cutting & Histogramming: DAnalysisAction, DAnalysisResults)
Line 1: Line 1:
 
== Summary ==
 
== Summary ==
 
* In his/her plugin, a user specifies the reactions he/she wants to study (<span style="color:#0000FF">DReaction</span>), along with the histograms and cuts to perform (<span style="color:#0000FF">DAnalysisAction</span>), then just asks JANA for the results (<span style="color:#0000FF">DAnalysisResults</span>).
 
* In his/her plugin, a user specifies the reactions he/she wants to study (<span style="color:#0000FF">DReaction</span>), along with the histograms and cuts to perform (<span style="color:#0000FF">DAnalysisAction</span>), then just asks JANA for the results (<span style="color:#0000FF">DAnalysisResults</span>).
* Through this process, the program creates all possible track combinations for the desired reaction (<span style="color:#0000FF">DTrackCombo</span>, tag <span style="color:#0000FF">"PreKinFit"</span>), kinematic fits the event to the reaction (<span style="color:#0000FF">DKinFitResults</span>), and updates the tracks with the new kinfit information (<span style="color:#0000FF">DTrackCombo</span>, no tag).
+
* Through this process, the program creates all possible track combinations for the desired reaction (<span style="color:#0000FF">DParticleCombo</span>, tag <span style="color:#0000FF">"PreKinFit"</span>), kinematic fits the event to the reaction (<span style="color:#0000FF">DKinFitResults</span>), and updates the tracks with the new kinfit information (<span style="color:#0000FF">DParticleCombo</span>, no tag).
 
* The <span style="color:#0000FF">DAnalysisAction</span> objects encapsulate the setup and execution of an action (e.g. cut, histogram) into a single object.  
 
* The <span style="color:#0000FF">DAnalysisAction</span> objects encapsulate the setup and execution of an action (e.g. cut, histogram) into a single object.  
 
** Many common actions will be 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.  
 
** Many common actions will be 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 <span style="color:#0000FF">DAnalysisResults</span> objects indicate which DTrackCombo objects have passed/failed the DAnalysisAction cuts for each DReaction.
+
* The <span style="color:#0000FF">DAnalysisResults</span> objects indicate which DParticleCombo objects have passed/failed the DAnalysisAction cuts for each DReaction.
  
 
== DReaction ==
 
== DReaction ==
Line 33: Line 33:
 
  };
 
  };
  
== DTrackCombo ==
+
== DParticleCombo ==
 
* Located in src/libraries/ANALYSIS
 
* Located in src/libraries/ANALYSIS
* <span style="color:#0000FF">DTrackCombo_factory_PreKinFit</span>: Generates a DTrackCombo object for each possible combination of detected tracks and DBeamPhotons (configurable time cut used to eliminate way-out-of-time photons).  
+
* <span style="color:#0000FF">DParticleCombo_factory_PreKinFit</span>: Generates a DParticleCombo object for each possible combination of detected tracks and DBeamPhotons (configurable time cut used to eliminate way-out-of-time photons).  
 
** PID is NOT assumed, all possibilities are tested: For each q = +/-/0 particle in a given DReaction, all detected q = +/-/0 tracks are tested as to whether or not they are that particle.  
 
** PID is NOT assumed, all possibilities are tested: For each q = +/-/0 particle in a given DReaction, all detected q = +/-/0 tracks are tested as to whether or not they are that particle.  
* <span style="color:#0000FF">DKinFitResults_factory</span>: Performs a single kinematic fit testing whether each DTrackCombo matches the DReaction: includes all mass, vertex, timing constraints if requested.
+
* <span style="color:#0000FF">DKinFitResults_factory</span>: Performs a single kinematic fit testing whether each DParticleCombo matches the DReaction: includes all mass, vertex, timing constraints if requested.
* <span style="color:#0000FF">DTrackCombo_factory</span>: Create new DTrackCombo objects, using the kinematic fit track information and results.  
+
* <span style="color:#0000FF">DParticleCombo_factory</span>: Create new DParticleCombo objects, using the kinematic fit track information and results.  
  
  class <span style="color:#0000FF">DTrackCombo</span> : public <span style="color:#0000FF">JObject</span>
+
  class <span style="color:#0000FF">DParticleCombo</span> : public <span style="color:#0000FF">JObject</span>
 
  {
 
  {
 
  private:
 
  private:
 
  <span style="color:#0000FF">//REACTION AND ANALYSIS:</span>
 
  <span style="color:#0000FF">//REACTION AND ANALYSIS:</span>
 
  const DReaction* <span style="color:#0000FF">dReaction</span>;
 
  const DReaction* <span style="color:#0000FF">dReaction</span>;
  deque<const DTrackComboStep*> <span style="color:#0000FF">dTrackComboSteps</span>;
+
  deque<const DParticleComboStep*> <span style="color:#0000FF">dParticleComboSteps</span>;
 
  const DKinFitResults* <span style="color:#0000FF">dKinFitResults</span>;
 
  const DKinFitResults* <span style="color:#0000FF">dKinFitResults</span>;
 
   
 
   
Line 54: Line 54:
 
  };
 
  };
  
  class <span style="color:#0000FF">DTrackComboStep</span>
+
  class <span style="color:#0000FF">DParticleComboStep</span>
 
  {
 
  {
 
  private:
 
  private:
Line 73: Line 73:
 
   
 
   
 
  <span style="color:#0000FF">//CONTROL VARIABLES:</span>
 
  <span style="color:#0000FF">//CONTROL VARIABLES:</span>
  int <span style="color:#0000FF">dInitialParticleDecayFromStepIndex</span>; //points to which DTrackComboStep represents the production of the initial particle (e.g. Lambda)
+
  int <span style="color:#0000FF">dInitialParticleDecayFromStepIndex</span>; //points to which DParticleComboStep represents the production of the initial particle (e.g. Lambda)
  deque<int> <span style="color:#0000FF">dDecayStepIndices</span>; //let's you know whether a final state particle is decaying, missing, or detected.  if decaying, points to which DTrackComboStep represents its decay
+
  deque<int> <span style="color:#0000FF">dDecayStepIndices</span>; //let's you know whether a final state particle is decaying, missing, or detected.  if decaying, points to which DParticleComboStep represents its decay
 
  };
 
  };
  
 
== Cutting & Histogramming: DAnalysisAction, DAnalysisResults ==
 
== Cutting & Histogramming: DAnalysisAction, DAnalysisResults ==
 
=== DAnalysisAction ===
 
=== DAnalysisAction ===
* Virtual base class that encapsulates the setup (e.g. histogram creation) and execution (cut, hist, etc.) of the contained action for each DTrackCombo that has passed all previous cuts.
+
* Virtual base class that encapsulates the setup (e.g. histogram creation) and execution (cut, hist, etc.) of the contained action for each DParticleCombo that has passed all previous cuts.
 
** Many common actions (e.g. histogramming kinfit pulls, comparing thrown and reconstructed MC data, etc.) are pre-defined in src/libraries/ANALYSIS/ (see DHistogramActions.h and DCutActions.h)
 
** Many common actions (e.g. histogramming kinfit pulls, comparing thrown and reconstructed MC data, etc.) are pre-defined in src/libraries/ANALYSIS/ (see DHistogramActions.h and DCutActions.h)
 
** Custom, analysis-specific actions can be created and stored in the plugin, along with any custom factories you need for them (e.g.: studying the background).   
 
** Custom, analysis-specific actions can be created and stored in the plugin, along with any custom factories you need for them (e.g.: studying the background).   
Line 87: Line 87:
 
  public:
 
  public:
 
  //returns true/false if passes/fails cut/hist/etc.
 
  //returns true/false if passes/fails cut/hist/etc.
  virtual bool <span style="color:#0000FF">operator()</span>(JEventLoop* locEventLoop, map<const DTrackCombo*, bool>& locTrackCombos) const = 0;
+
  virtual bool <span style="color:#0000FF">operator()</span>(JEventLoop* locEventLoop, map<const DParticleCombo*, bool>& locParticleCombos) const = 0;
 
  };
 
  };
  
 
=== DAnalysisResults ===
 
=== DAnalysisResults ===
* Loops over all DReaction objects, executing the DAnalysisAction objects for each one.  Returns the cut status of each DTrackCombo (which cut they failed on, if any).
+
* Loops over all DReaction objects, executing the DAnalysisAction objects for each one.  Returns the cut status of each DParticleCombo (which cut they failed on, if any).
 
  class <span style="color:#0000FF">DAnalysisResults</span> : public <span style="color:#0000FF">JObject</span>
 
  class <span style="color:#0000FF">DAnalysisResults</span> : public <span style="color:#0000FF">JObject</span>
 
  {
 
  {
 
  private:
 
  private:
 
  DReaction* <span style="color:#0000FF">dReaction</span>;
 
  DReaction* <span style="color:#0000FF">dReaction</span>;
  map<const DTrackCombo*, size_t> <span style="color:#0000FF">dFailedTrackComboMap</span>; //indicates at which action these DTrackCombo failed to pass the cut
+
  map<const DParticleCombo*, size_t> <span style="color:#0000FF">dFailedParticleComboMap</span>; //indicates at which action these DParticleCombo failed to pass the cut
  deque<const DTrackCombo*> <span style="color:#0000FF">dPassedTrackCombos</span>; //DTrackCombo objects that passed all DAnalysisAction cuts.  
+
  deque<const DParticleCombo*> <span style="color:#0000FF">dPassedParticleCombos</span>; //DParticleCombo objects that passed all DAnalysisAction cuts.  
 
  };
 
  };
  
Line 109: Line 109:
 
  <span style="color:#0000FF">DAnalysisAction_KinFitFOM</span>(double locMinimumConfidenceLevel) : dMinimumConfidenceLevel(locMinimumConfidenceLevel) {} //cut setup upon construction
 
  <span style="color:#0000FF">DAnalysisAction_KinFitFOM</span>(double locMinimumConfidenceLevel) : dMinimumConfidenceLevel(locMinimumConfidenceLevel) {} //cut setup upon construction
 
   
 
   
  bool <span style="color:#0000FF">operator()</span>(JEventLoop* locEventLoop, map<const DTrackCombo*, bool>& locTrackComboStatusMap) const
+
  bool <span style="color:#0000FF">operator()</span>(JEventLoop* locEventLoop, map<const DParticleCombo*, bool>& locParticleComboStatusMap) const
 
  {
 
  {
 
  bool locEventPassedCutFlag = false;
 
  bool locEventPassedCutFlag = false;
  <span style="color:#0000FF">//loop over all track combos and perform the cut (unless already failed a previous cut)</span>
+
  <span style="color:#0000FF">//loop over all particle combos and perform the cut (unless already failed a previous cut)</span>
  for(map<const DTrackCombo*, bool>::iterator locIterator = locTrackComboStatusMap(); locIterator != locTrackComboStatusMap(); ++locIterator)
+
  for(map<const DParticleCombo*, bool>::iterator locIterator = locParticleComboStatusMap(); locIterator != locParticleComboStatusMap(); ++locIterator)
 
  {
 
  {
 
  if(!locIterator->second)
 
  if(!locIterator->second)
  <span style="color:#0000FF">continue</span>; //track combo failed a previous cut!
+
  <span style="color:#0000FF">continue</span>; //particle combo failed a previous cut!
 
   
 
   
  const DTrackCombo* locTrackCombo = locIterator->first;
+
  const DParticleCombo* locParticleCombo = locIterator->first;
  DKinFitResults* locKinFitResults = locTrackCombo->Get_KinFitResults();
+
  DKinFitResults* locKinFitResults = locParticleCombo->Get_KinFitResults();
 
  double <span style="color:#0000FF">locConfidenceLevel</span> = locKinFitResults->Get_ConfidenceLevel();
 
  double <span style="color:#0000FF">locConfidenceLevel</span> = locKinFitResults->Get_ConfidenceLevel();
 
   
 
   
 
  <span style="color:#0000FF">if(locConfidenceLevel > dMinimumConfidenceLevel)</span>
 
  <span style="color:#0000FF">if(locConfidenceLevel > dMinimumConfidenceLevel)</span>
  locTrackCombos[locTrackCombo] = <span style="color:#0000FF">false</span>; //mark the DTrackCombo as having failed the cut
+
  locParticleCombos[locParticleCombo] = <span style="color:#0000FF">false</span>; //mark the DParticleCombo as having failed the cut
 
  else
 
  else
  locEventPassedCutFlag = <span style="color:#0000FF">true</span>; //at least once DTrackCombo passed the cut  
+
  locEventPassedCutFlag = <span style="color:#0000FF">true</span>; //at least once DParticleCombo passed the cut  
 
  }
 
  }
 
  return locEventPassedCutFlag;
 
  return locEventPassedCutFlag;
Line 191: Line 191:
 
   
 
   
 
  <span style="color:#0000FF">//Vertex reconstruction and cuts of tracks with bogus vertex-z</span>
 
  <span style="color:#0000FF">//Vertex reconstruction and cuts of tracks with bogus vertex-z</span>
  dReaction->Add_AnalysisAction(new DHistogramFunctor_TrackComboKinematics(1)); //1: initial data
+
  dReaction->Add_AnalysisAction(new DHistogramFunctor_ParticleComboKinematics(1)); //1: initial data
 
  dReaction->Add_AnalysisAction(new DCutFunctor_AllVertexZ(45.0, 85.0));
 
  dReaction->Add_AnalysisAction(new DCutFunctor_AllVertexZ(45.0, 85.0));
 
  dReaction->Add_AnalysisAction(new DHistogramFunctor_TrackVertexComparison());
 
  dReaction->Add_AnalysisAction(new DHistogramFunctor_TrackVertexComparison());
Line 219: Line 219:
 
   
 
   
 
  <span style="color:#0000FF">//Final track kinematics & PID Check</span>
 
  <span style="color:#0000FF">//Final track kinematics & PID Check</span>
  dReaction->Add_AnalysisAction(new DHistogramFunctor_TrackComboKinematics(2)); //2: final data
+
  dReaction->Add_AnalysisAction(new DHistogramFunctor_ParticleComboKinematics(2)); //2: final data
 
  dReaction->Add_AnalysisAction(new DHistogramFunctor_TruePID());
 
  dReaction->Add_AnalysisAction(new DHistogramFunctor_TruePID());
 
   
 
   
Line 244: Line 244:
 
  locEventLoop->Get(locAnalysisResultsVector);
 
  locEventLoop->Get(locAnalysisResultsVector);
 
   
 
   
  //SAVE PROGRAM OUTPUT HERE (e.g. surviving DTrackCombo objects, custom tuples, etc. (format undetermined)
+
  //SAVE PROGRAM OUTPUT HERE (e.g. surviving DParticleCombo objects, custom tuples, etc. (format undetermined)
 
   
 
   
 
  return NOERROR;
 
  return NOERROR;

Revision as of 00:12, 9 October 2012

Summary

  • In his/her plugin, a user specifies the reactions he/she wants to study (DReaction), along with the histograms and cuts to perform (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 will be 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.

DReaction

  • Located in src/libraries/ANALYSIS
  • The factory needs to be defined in your plugin (see DReaction_factory section below)
  • User creates one of these in their plugin for each reaction they want to analyze (example shown later below) (can analyze more than one at once).
class DReaction : public JObject
{
	private:
		//REACTION AND ANALYSIS:
		string dReactionName; //must be unique: e.g. "Y2175"
		deque<const DReactionStep*> dReactionSteps;
		deque<const DAnalysisAction*> dAnalysisActions;

		//CONTROL VARIABLES:
		DKinFitType dKinFitType; //defined in ANALYSIS/DKinFitResults.h
		deque<size_t> dDecayingParticlesExcludedFromKinfit; //to exclude decaying particles from the kinematic fit (resonances are automatically excluded)
};
class DReactionStep
{
	private:
		Particle_t dInitialParticleID; //e.g. lambda, phi, gamma
		Particle_t dTargetParticleID; //Unknown for no target
		deque<Particle_t> dFinalParticleIDs;

		int dMissingParticleIndex; //-1 for no missing particles, else final state particle at this index is missing (0 -> x)
};

DParticleCombo

  • Located in src/libraries/ANALYSIS
  • DParticleCombo_factory_PreKinFit: Generates a DParticleCombo object for each possible combination of detected tracks and DBeamPhotons (configurable time cut used to eliminate way-out-of-time photons).
    • PID is NOT assumed, all possibilities are tested: For each q = +/-/0 particle in a given DReaction, all detected q = +/-/0 tracks are tested as to whether or not they are that particle.
  • DKinFitResults_factory: Performs a single kinematic fit testing whether each DParticleCombo matches the DReaction: includes all mass, vertex, timing constraints if requested.
  • DParticleCombo_factory: Create new DParticleCombo objects, using the kinematic fit track information and results.
class DParticleCombo : public JObject
{
	private:
		//REACTION AND ANALYSIS:
		const DReaction* dReaction;
		deque<const DParticleComboStep*> dParticleComboSteps;
		const DKinFitResults* dKinFitResults;

		//UNUSED TRACKS:
		deque<const DChargedTrack*> dUnusedPositiveTracks;
		deque<const DChargedTrack*> dUnusedNegativeTracks;
		deque<const DNeutralShower*> dUnusedNeutralShowers;
};
class DParticleComboStep
{
	private:
		//PIDS:
		Particle_t dInitialParticleID; //e.g. lambda, phi, gamma
		Particle_t dTargetParticleID; //Unknown for no target
		deque<Particle_t> dFinalParticleIDs;

		//INITIAL PARTICLES:
		DKinematicData* dInitialParticle; //kinfit result, else measured
		DKinematicData* dInitialParticle_Measured; //e.g. DBeamPhoton
		DKinematicData* dTargetParticle; //NULL for no target

		//FINAL PARTICLES:
		deque<const DKinematicData*> dFinalParticles; //kinfit result, else measured //e.g. DChargedTrackHypothesis, DNeutralParticleHypothesis
		deque<const DKinematicData*> dFinalParticles_Measured; //e.g. DChargedTrackHypothesis, DNeutralParticleHypothesis
		deque<const JObject*> dFinalParticleSourceObjects; //original DChargedTrack or DNeutralShower objects

		//CONTROL VARIABLES:
		int dInitialParticleDecayFromStepIndex; //points to which DParticleComboStep represents the production of the initial particle (e.g. Lambda)
		deque<int> dDecayStepIndices; //let's you know whether a final state particle is decaying, missing, or detected.  if decaying, points to which DParticleComboStep represents its decay
};

Cutting & Histogramming: DAnalysisAction, DAnalysisResults

DAnalysisAction

  • Virtual base class that encapsulates the setup (e.g. histogram creation) and execution (cut, hist, etc.) of the contained action for each DParticleCombo that has passed all previous cuts.
    • Many common actions (e.g. histogramming kinfit pulls, comparing thrown and reconstructed MC data, etc.) are pre-defined in src/libraries/ANALYSIS/ (see DHistogramActions.h and DCutActions.h)
    • Custom, analysis-specific actions can be created and stored in the plugin, along with any custom factories you need for them (e.g.: studying the background).
    • These actions should be added to the DReaction objects in the order that they will be executed.
class DAnalysisAction
{
	public:
		//returns true/false if passes/fails cut/hist/etc.
		virtual bool operator()(JEventLoop* locEventLoop, map<const DParticleCombo*, bool>& locParticleCombos) const = 0;
};

DAnalysisResults

  • Loops over all DReaction objects, executing the DAnalysisAction objects for each one. Returns the cut status of each DParticleCombo (which cut they failed on, if any).
class DAnalysisResults : public JObject
{
	private:
		DReaction* dReaction;
		map<const DParticleCombo*, size_t> dFailedParticleComboMap; //indicates at which action these DParticleCombo failed to pass the cut
		deque<const DParticleCombo*> dPassedParticleCombos; //DParticleCombo objects that passed all DAnalysisAction cuts. 
};

Simple Example

  • Cutting the confidence level of a kinematic fit:
class DAnalysisAction_KinFitFOM : public DAnalysisAction
{
 	public:
		double dMinimumConfidenceLevel; //e.g. 0.01

		DAnalysisAction_KinFitFOM(double locMinimumConfidenceLevel) : dMinimumConfidenceLevel(locMinimumConfidenceLevel) {} //cut setup upon construction

		bool operator()(JEventLoop* locEventLoop, map<const DParticleCombo*, bool>& locParticleComboStatusMap) const
		{
			bool locEventPassedCutFlag = false;
			//loop over all particle combos and perform the cut (unless already failed a previous cut)
			for(map<const DParticleCombo*, bool>::iterator locIterator = locParticleComboStatusMap(); locIterator != locParticleComboStatusMap(); ++locIterator)
			{
				if(!locIterator->second)
					continue; //particle combo failed a previous cut!

				const DParticleCombo* locParticleCombo = locIterator->first;
				DKinFitResults* locKinFitResults = locParticleCombo->Get_KinFitResults();
				double locConfidenceLevel = locKinFitResults->Get_ConfidenceLevel();

				if(locConfidenceLevel > dMinimumConfidenceLevel)
					locParticleCombos[locParticleCombo] = false; //mark the DParticleCombo as having failed the cut
				else
					locEventPassedCutFlag = true; //at least once DParticleCombo passed the cut 
			}
			return locEventPassedCutFlag;
		}
};

User Plugin DReaction Factory

  • Below shows how to set up DReaction for a Y(2175) analysis.
  • Note that while most of the analysis actions are pre-defined, built-in ones (e.g. histogramming kinfit results), some are custom to the plugin (for now) (e.g. histogramming phi invariant mass).
//------------------
// init
//------------------
jerror_t DReaction_factory::init(void)
{
	// Setting the PERSISTANT prevents JANA from deleting
	// the objects every event so we only create them once.
	SetFactoryFlag(PERSISTANT);

	DReaction* locReaction;
	DReactionStep* locReactionStep;

	// Make as many DReaction objects as desired
	locReaction = new DReaction();
	locReaction->Set_ReactionName("Y2175");
	locReaction->Set_FitTypeFlag(3); //kinfit p4, v, & t simultaneously (0 is no kinfit)
 
 	//SETUP REACTION

	//g, p -> phi(2175), (p)
	locReactionStep = new DReactionStep();
	locReactionStep->Set_InitialParticleID(Gamma);
	locReactionStep->Set_TargetParticleID(Proton);
	locReactionStep->Add_FinalParticleID(Unknown); //phi(2175)
	locReactionStep->Add_FinalParticleID(Proton);
	locReactionStep->Set_MissingParticleIndex(1); //proton missing
	locReaction->Add_ReactionStep(locReactionStep);
	dReactionStepPool.push_back(locReactionStep); //prevent memory leak

	//phi(2175) -> pi+, pi-, phi
	locReactionStep = new DReactionStep();
	locReactionStep->Set_InitialParticleID(Unknown); //phi(2175)
	locReactionStep->Set_TargetParticleID(Unknown); //no target for this step
	locReactionStep->Add_FinalParticleID(PiPlus);
	locReactionStep->Add_FinalParticleID(PiMinus);
	locReactionStep->Add_FinalParticleID(phiMeson);
	locReactionStep->Set_MissingParticleIndex(-1); //none missing
	locReaction->Add_ReactionStep(locReactionStep);
	dReactionStepPool.push_back(locReactionStep); //prevent memory leak

	//phi -> K+, K-
	locReactionStep = new DReactionStep();
	locReactionStep->Set_InitialParticleID(Unknown); //phi(2175)
	locReactionStep->Set_TargetParticleID(Unknown); //no target for this step
	locReactionStep->Add_FinalParticleID(KPlus);
	locReactionStep->Add_FinalParticleID(KMinus);
 	locReactionStep->Set_MissingParticleIndex(-1); //none missing
 	locReaction->Add_ReactionStep(locReactionStep);
	dReactionStepPool.push_back(locReactionStep); //prevent memory leak
 
 	//SETUP ANALYSIS ACTIONS

	//Track reconstruction quality/multiplicity
	dReaction->Add_AnalysisAction(new DHistogramFunctor_TrackMultiplicity());
	dReaction->Add_AnalysisAction(new DHistogramFunctor_GenReconTrackComparison());

	//Vertex reconstruction and cuts of tracks with bogus vertex-z
	dReaction->Add_AnalysisAction(new DHistogramFunctor_ParticleComboKinematics(1)); //1: initial data
	dReaction->Add_AnalysisAction(new DCutFunctor_AllVertexZ(45.0, 85.0));
	dReaction->Add_AnalysisAction(new DHistogramFunctor_TrackVertexComparison());

	//PID
	dReaction->Add_AnalysisAction(new DHistogramFunctor_PID());
	dReaction->Add_AnalysisAction(new DCutFunctor_AllPID(0.01, 1)); //1%, all charged tracks
	dReaction->Add_AnalysisAction(new DHistogramFunctor_TruePID());

	//Phi Invariant Mass Cut & PID Check
	dReaction->Add_AnalysisAction(new DHistogramFunctor_PhiMass(1)); //1: initial data
	dReaction->Add_AnalysisAction(new DCutFunctor_InvariantMass(phiMeson, 1, 1.004, 1.04)); //~3sigma
	dReaction->Add_AnalysisAction(new DHistogramFunctor_TruePID());

	//Initial Proton and Y2175 Mass Distributions
	dReaction->Add_AnalysisAction(new DHistogramFunctor_ProtonMass(1)); //1: initial data
	dReaction->Add_AnalysisAction(new DHistogramFunctor_Phi2175Mass(1)); //1: initial data

	//Missing Proton Kinematic Fit
	dReaction->Add_AnalysisAction(new DHistogramFunctor_KinFitResults(0.1));
	dReaction->Add_AnalysisAction(new DCutFunctor_KinFitFOM(0.01); //1%

	//Final Proton and Y2175 Mass Distributions
	dReaction->Add_AnalysisAction(new DHistogramFunctor_ProtonMass(1)); //1: initial data
	dReaction->Add_AnalysisAction(new DHistogramFunctor_Phi2175Mass(1)); //1: initial data
	dReaction->Add_AnalysisAction(new DHistogramFunctor_Phi2175Mass(2)); //2: final data

	//Final track kinematics & PID Check
	dReaction->Add_AnalysisAction(new DHistogramFunctor_ParticleComboKinematics(2)); //2: final data
	dReaction->Add_AnalysisAction(new DHistogramFunctor_TruePID());

	_data.push_back(locReaction);

	return NOERROR;
}

User Plugin DEventProcessor

  • The DEventProcessor itself is extremely minimal in content:
extern "C" 
{
	void InitPlugin(JApplication *app)
	{
		InitJANAPlugin(app);
		app->AddProcessor(new DEventProcessor_Y2175());
		app->AddFactoryGenerator(new DFactoryGenerator_DReaction());
	}
} // "C"

jerror_t DEventProcessor_Y2175::evnt(JEventLoop *locEventLoop, int eventnumber)
{
	vector<const DAnalysisResults*> locAnalysisResultsVector;
	locEventLoop->Get(locAnalysisResultsVector);

	//SAVE PROGRAM OUTPUT HERE (e.g. surviving DParticleCombo objects, custom tuples, etc. (format undetermined)

	return NOERROR;
}

Program Output

  • Other than histograms, I haven't really gotten this far yet...