#ifndef _DParticleComboBlueprint_factory_ #define _DParticleComboBlueprint_factory_ #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace jana; class DParticleComboBlueprint_factory : public jana::JFactory { public: DParticleComboBlueprint_factory(){}; ~DParticleComboBlueprint_factory(){}; void Reset_Pools(void); private: jerror_t init(void); ///< Called once at program start. jerror_t brun(jana::JEventLoop* locEventLoop, int runnumber); ///< Called everytime a new run number is detected. jerror_t evnt(jana::JEventLoop* locEventLoop, int eventnumber); ///< Called every event. jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called. jerror_t fini(void); ///< Called after last event of last event source has been processed. jerror_t Build_ParticleComboBlueprints(JEventLoop* locEventLoop, const DReaction* locReaction); bool Setup_ComboLoop(const DReaction* locReaction, int locNumDetectedNeutralParticles, int locNumDetectedChargedParticles, int locNumDetectedPositiveParticles, int locNumDetectedNegativeParticles, deque >& locResumeAtIndexDeque, deque >& locNumPossibilitiesDeque); void Find_Combos(const DReaction* locReaction, deque& locNeutralShowerDeque, deque& locChargedTrackDeque_Positive, deque& locChargedTrackDeque_Negative, deque >& locResumeAtIndexDeque, const deque >& locNumPossibilitiesDeque, vector& locParticleComboBlueprints); bool Handle_EndOfReactionStep(const DReaction* locReaction, DParticleComboBlueprint*& locParticleComboBlueprint, DParticleComboBlueprintStep*& locParticleComboBlueprintStep, int& locStepIndex, int& locParticleIndex, deque >& locResumeAtIndexDeque, const deque >& locNumPossibilitiesDeque, vector& locParticleComboBlueprints); bool Handle_Decursion(DParticleComboBlueprint* locParticleComboBlueprint, deque >& locResumeAtIndexDeque, const deque >& locNumPossibilitiesDeque, int& locParticleIndex, int& locStepIndex, DParticleComboBlueprintStep*& locParticleComboBlueprintStep); bool Check_IfDuplicateStepCombo(const DReaction* locReaction, int locStepIndex, deque >& locResumeAtIndexDeque, const deque >& locNumPossibilitiesDeque) const; int Grab_DecayingParticle(DParticleComboBlueprint* locParticleComboBlueprint, Particle_t locAnalysisPID, int& locResumeAtIndex, const DReaction* locReaction, int locStepIndex, int locParticleIndex, DParticleComboBlueprintStep* locParticleComboBlueprintStep); const JObject* Grab_DetectedTrack(DParticleComboBlueprint* locParticleComboBlueprint, Particle_t locAnalysisPID, int& locResumeAtIndex, deque& locNeutralShowerDeque, deque& locChargedTrackDeque_Positive, deque& locChargedTrackDeque_Negative); const JObject* Choose_SourceObject(const DReaction* locReaction, Particle_t locAnalysisPID, DParticleComboBlueprint* locParticleComboBlueprint, deque& locSourceObjects, int& locResumeAtIndex) const; bool Cut_PIDFOM(const DReaction* locReaction, const DChargedTrackHypothesis* locChargedTrackHypothesis) const; bool Cut_TrackingFOM(const DReaction* locReaction, const DChargedTrackHypothesis* locChargedTrackHypothesis) const; DParticleComboBlueprintStep* Get_ParticleComboBlueprintStepResource(void); DParticleComboBlueprint* Clone_ParticleComboBlueprint(const DParticleComboBlueprint* locParticleComboBlueprint); inline void Recycle_ParticleComboBlueprintStep(DParticleComboBlueprintStep* locParticleComboBlueprintStep){dParticleComboBlueprintStepPool_Available.push_back(locParticleComboBlueprintStep);} deque dParticleComboBlueprintStepPool_All; deque dParticleComboBlueprintStepPool_Available; unsigned int dDebugLevel; size_t MAX_DParticleComboBlueprintStepPoolSize; // PRE-DPARTICLECOMBO CUT VALUES //bool = true/false for cut enabled/disabled, double = cut value //Command-line values will override these values pair dMinIndividualChargedPIDFOM; //the minimum PID FOM for a charged track used for this DReaction pair dMinIndividualTrackingFOM; //the minimum Tracking FOM for a charged track used for this DReaction pair dMinProtonMomentum; //when testing whether a non-proton DChargedTrackHypothesis could be a proton, this is the minimum momentum it can have }; #endif // _DParticleComboBlueprint_factory_