Difference between revisions of "Mattione GlueX Analysis Factories"

From GlueXWiki
Jump to: navigation, search
(User Plugin DReaction Factory)
(User Plugin DReaction Factory)
Line 20: Line 20:
 
  // Make as many DReaction objects as desired
 
  // Make as many DReaction objects as desired
 
  locReaction = new DReaction();
 
  locReaction = new DReaction();
+
locReaction->Set_ReactionName(<span style="color:#0000FF">"Y2175"</span>);
 +
 
 +
 
 
  //<span style="color:#0000FF">g, p -> phi(2175), (p)</span>
 
  //<span style="color:#0000FF">g, p -> phi(2175), (p)</span>
 
  locReactionStep = new DReactionStep();
 
  locReactionStep = new DReactionStep();
Line 27: Line 29:
 
  locReactionStep->Add_FinalParticleID(<span style="color:#0000FF">Unknown</span>); //phi(2175)
 
  locReactionStep->Add_FinalParticleID(<span style="color:#0000FF">Unknown</span>); //phi(2175)
 
  locReactionStep->Add_FinalParticleID(<span style="color:#0000FF">Proton</span>);
 
  locReactionStep->Add_FinalParticleID(<span style="color:#0000FF">Proton</span>);
  locReactionStep->Set_MissingParticleIndex(1); //proton missing
+
  locReactionStep->Set_MissingParticleIndex(<span style="color:#0000FF">1</span>); //proton missing
 
  locReaction->Add_ReactionStep(locReactionStep);
 
  locReaction->Add_ReactionStep(locReactionStep);
 
  dReactionStepPool.push_back(locReactionStep); //prevent memory leak
 
  dReactionStepPool.push_back(locReactionStep); //prevent memory leak
Line 38: Line 40:
 
  locReactionStep->Add_FinalParticleID(<span style="color:#0000FF">PiMinus</span>);
 
  locReactionStep->Add_FinalParticleID(<span style="color:#0000FF">PiMinus</span>);
 
  locReactionStep->Add_FinalParticleID(<span style="color:#0000FF">phiMeson</span>);
 
  locReactionStep->Add_FinalParticleID(<span style="color:#0000FF">phiMeson</span>);
  locReactionStep->Set_MissingParticleIndex(-1); //none missing
+
  locReactionStep->Set_MissingParticleIndex(<span style="color:#0000FF">-1</span>); //none missing
 
  locReaction->Add_ReactionStep(locReactionStep);
 
  locReaction->Add_ReactionStep(locReactionStep);
 
  dReactionStepPool.push_back(locReactionStep); //prevent memory leak
 
  dReactionStepPool.push_back(locReactionStep); //prevent memory leak
Line 48: Line 50:
 
  locReactionStep->Add_FinalParticleID(<span style="color:#0000FF">KPlus</span>);
 
  locReactionStep->Add_FinalParticleID(<span style="color:#0000FF">KPlus</span>);
 
  locReactionStep->Add_FinalParticleID(<span style="color:#0000FF">KMinus</span>);
 
  locReactionStep->Add_FinalParticleID(<span style="color:#0000FF">KMinus</span>);
   locReactionStep->Set_MissingParticleIndex(-1); //none missing
+
   locReactionStep->Set_MissingParticleIndex(<span style="color:#0000FF">-1</span>); //none missing
 
   locReaction->Add_ReactionStep(locReactionStep);
 
   locReaction->Add_ReactionStep(locReactionStep);
 
  dReactionStepPool.push_back(locReactionStep); //prevent memory leak
 
  dReactionStepPool.push_back(locReactionStep); //prevent memory leak

Revision as of 02:12, 12 August 2012

Summary

  • In his/her plugin, a user specifies the reactions he/she wants to study (DReaction objects), then just asks JANA for the results (DTrackCombo objects).
    • Creates all possible track combinations for the desired reaction; user then cuts on the likelihood that those combinations represent the hypothesized reaction.

User Plugin DReaction Factory

  • DReaction.h located in DANA libraries, DReaction_factory.h located in user plugin (along with a factory generator for it).
  • Below shows how to set up DReaction for a Y(2175) analysis.
//------------------
// 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");
 
	//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

	_data.push_back(locReaction);

	return NOERROR;
}

DTrackCombo Factory

  • (Would be) Located in DANA
    • Still finalizing class format, but looks similar to DReaction, except with full particles instead of just PIDs.
  • Generate a DTrackCombo object for each possible combination of detected tracks (DBeamPhotons ignored).
    • 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).

DKinFitTrackCombo Factory

  • (Would be) Located in DANA
    • Still finalizing class format, but looks similar to DReaction, except with full particles instead of just PIDs.
  • Generate a DKinFitTrackCombo object for each possible combination of DTrackCombos and DBeamPhotons (ignore all DBeamPhotons "too far" from RF time).
    • Perform a single, full kinematic fit testing whether the DTrackCombo matches the DReaction: includes all mass, vertex, timing constraints (vertex & timing not yet implemented).

User Plugin DEventProcessor

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 DKinFitTrackCombo*> locKinFitTrackCombos;
	locEventLoop->Get(locKinFitTrackCombos);

	//DO HISTS/CUTS/TUPLES HERE

	return NOERROR;
}

Cutting/Histogramming

  • Coming Soon...

Tupling

  • Haven't gotten this far yet...