Difference between revisions of "Mattione GlueX Analysis Factories"
From GlueXWiki
(→User Plugin DReaction Factory) |
(→User Plugin DReaction Factory) |
||
Line 6: | Line 6: | ||
* DReaction.h located in DANA libraries, DReaction_factory.h located in user plugin (along with a factory generator for it). | * 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. | * Below shows how to set up DReaction for a Y(2175) analysis. | ||
− | + | //------------------ | |
− | + | // init | |
− | //------------------ | + | //------------------ |
jerror_t DReaction_factory::init(void) | 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(); | |
− | + | ||
− | + | //g, p -> phi(2175), (p) | |
− | + | locReactionStep = new DReactionStep(); | |
− | + | locReactionStep->Set_InitialParticleID(<span style="color:#0000FF">Gamma</span>); | |
− | + | locReactionStep->Set_TargetParticleID(<span style="color:#0000FF">Proton</span>); | |
− | + | locReactionStep->Add_FinalParticleID(<span style="color:#0000FF">Unknown</span>); //phi(2175) | |
− | + | locReactionStep->Add_FinalParticleID(<span style="color:#0000FF">Proton</span>); | |
− | + | 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 == | == DTrackCombo Factory == |
Revision as of 02:06, 12 August 2012
Contents
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(); //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...