#ifndef _DReaction_ #define _DReaction_ #include #include #include #include "JANA/JObject.h" #include "particleType.h" #include "ANALYSIS/DReactionStep.h" #include "ANALYSIS/DKinFitResults.h" using namespace std; using namespace jana; class DAnalysisAction; class DReaction : public JObject { public: JOBJECT_PUBLIC(DReaction); // CONSTRUCTOR: DReaction(string locReactionName); //User must specify a unique reaction name upon construction // SET OBJECT DATA: inline void Set_KinFitType(DKinFitType locKinFitType){dKinFitType = locKinFitType;} inline void Add_ReactionStep(const DReactionStep* locReactionStep){dReactionSteps.push_back(locReactionStep);} inline void Exclude_DecayingParticleFromP4KinFit(size_t locStepIndex){dDecayingParticlesExcludedFromP4Kinfit.push_back(locStepIndex);} inline void Add_AnalysisAction(DAnalysisAction* locAnalysisAction){dAnalysisActions.push_back(locAnalysisAction);} // SET TRACK SELECTION FACTORIES //Command-line values will override these values inline void Set_ChargedTrackFactoryTag(string locChargedTrackFactoryTag){dChargedTrackFactoryTag = locChargedTrackFactoryTag;} inline void Set_NeutralShowerFactoryTag(string locNeutralShowerFactoryTag){dNeutralShowerFactoryTag = locNeutralShowerFactoryTag;} // SET PRE-DPARTICLECOMBO CUT VALUES //Command-line values will override these values inline void Set_MinIndividualPIDFOM(double locMinIndividualPIDFOM){dMinIndividualPIDFOM = pair(true, locMinIndividualPIDFOM);} inline void Set_MinCombinedPIDFOM(double locMinCombinedPIDFOM){dMinCombinedPIDFOM = pair(true, locMinCombinedPIDFOM);} inline void Set_MinIndividualTrackingFOM(double locMinIndividualTrackingFOM){dMinIndividualTrackingFOM = pair(true, locMinIndividualTrackingFOM);} inline void Set_MinCombinedTrackingFOM(double locMinCombinedTrackingFOM){dMinCombinedTrackingFOM = pair(true, locMinCombinedTrackingFOM);} inline void Set_MaxPhotonRFDeltaT(double locMaxPhotonRFDeltaT){dMaxPhotonRFDeltaT = pair(true, locMaxPhotonRFDeltaT);} inline void Set_MinProtonMomentum(double locMinProtonMomentum){dMinProtonMomentum = pair(true, locMinProtonMomentum);} // GET CONTROL MEMBERS: inline string Get_ReactionName(void) const{return dReactionName;} inline DKinFitType Get_KinFitType(void) const{return dKinFitType;} inline void Get_DecayingParticlesExcludedFromP4Kinfit(deque& locExcludedParticleStepIndices) const{locExcludedParticleStepIndices = dDecayingParticlesExcludedFromP4Kinfit;} // GET REACTION STEPS: inline size_t Get_NumReactionSteps(void) const{return dReactionSteps.size();} const DReactionStep* Get_ReactionStep(size_t locStepIndex) const; void Get_ReactionSteps(Particle_t locInitialPID, deque& locReactionSteps) const; // GET ANALYSIS ACTIONS: inline size_t Get_NumAnalysisActions(void) const{return dAnalysisActions.size();} DAnalysisAction* Get_AnalysisAction(size_t locActionIndex) const; // GET PIDs: void Get_DetectedFinalPIDs(deque& locDetectedPIDs, bool locIncludeDuplicatesFlag = false) const; void Get_DetectedFinalPIDs(deque >& locDetectedPIDs, bool locIncludeDuplicatesFlag = false) const; void Get_DetectedFinalChargedPIDs(deque& locDetectedChargedPIDs, bool locIncludeDuplicatesFlag = false) const; void Get_DetectedFinalChargedPIDs(deque >& locDetectedChargedPIDs, bool locIncludeDuplicatesFlag = false) const; void Get_FinalStatePIDs(deque& locFinalStatePIDs, bool locIncludeDuplicatesFlag = false) const; bool Get_MissingPID(Particle_t& locPID) const; //false if none missing // GET PARTICLE NAME STRINGS: string Get_DetectedParticlesROOTName(void) const; string Get_InitialParticlesROOTName(void) const; void Get_DecayChainFinalParticlesROOTNames(Particle_t locInitialPID, deque& locNames, bool locKinFitResultsFlag = false) const; void Get_DecayChainFinalParticlesROOTNames(Particle_t locInitialPID, deque >& locParticleNames, deque& locNames, bool locKinFitResultsFlag = false) const; // GET TRACK SELECTION FACTORIES //Command-line values will override these values inline string Get_ChargedTrackFactoryTag(void) const{return dChargedTrackFactoryTag;} inline string Get_NeutralShowerFactoryTag(void) const{return dNeutralShowerFactoryTag;} // GET PRE-DPARTICLECOMBO CUT VALUES //Command-line values will override these values inline pair Get_MinIndividualPIDFOM(void) const{return dMinIndividualPIDFOM;} inline pair Get_MinCombinedPIDFOM(void) const{return dMinCombinedPIDFOM;} inline pair Get_MinIndividualTrackingFOM(void) const{return dMinIndividualTrackingFOM;} inline pair Get_MinCombinedTrackingFOM(void) const{return dMinCombinedTrackingFOM;} inline pair Get_MaxPhotonRFDeltaT(void) const{return dMaxPhotonRFDeltaT;} inline pair Get_MinProtonMomentum(void) const{return dMinProtonMomentum;} // ROOT OUTPUT: inline void Enable_TTreeOutput(string locTTreeOutputFileName) { dEnableTTreeOutputFlag = true; dTTreeOutputFileName = locTTreeOutputFileName; } inline string Get_TTreeOutputFileName(void) const{return dTTreeOutputFileName;} inline bool Get_EnableTTreeOutputFlag(void) const{return dEnableTTreeOutputFlag;} // OTHER: bool Check_IsDecayingParticle(Particle_t locPID, size_t locSearchStartIndex = 1) const; bool Check_IfDecayingParticleExcludedFromP4KinFit(size_t locStepIndex) const; bool Check_AreStepsIdentical(const DReaction* locReaction) const; private: // PRIVATE METHODS: DReaction(void); //make default constructor private. MUST set a name upon construction (and must be unique!) void Get_DecayChainFinalParticlesROOTNames(size_t locStepIndex, deque >& locNames, bool locKinFitResultsFlag = false) const; // CONTROL MEMBERS: string dReactionName; //must be unique DKinFitType dKinFitType; //defined in ANALYSIS/DKinFitResults.h deque dDecayingParticlesExcludedFromP4Kinfit; //to exclude decaying particles from the kinematic fit (resonances are automatically excluded) //size_t is step index where it is a parent // ROOT TTREE OUTPUT: bool dEnableTTreeOutputFlag; //default is false string dTTreeOutputFileName; // REACTION AND ANALYSIS MEMBERS: deque dReactionSteps; deque dAnalysisActions; // TRACK SELECTION FACTORIES: //Command-line values will override these values string dChargedTrackFactoryTag; //default is "" string dNeutralShowerFactoryTag; //default is "" // PRE-DPARTICLECOMBO CUT VALUES //bool = true/false for cut enabled/disabled, double = cut value //Command-line values (variable names are below in all-caps) will override these values //all cuts are disabled by default except dMinProtonMomentum: 300 MeV/c (value used during track reconstruction) //note: tracks with no PID information are not cut-by/included-in the PID cuts pair dMinIndividualPIDFOM; //COMBO:MIN_INDIVIDUAL_PID_FOM - the minimum PID FOM for a charged track used for this DReaction pair dMinCombinedPIDFOM; //COMBO:MIN_COMBINED_PID_FOM - the minimum combined PID FOM for all charged tracks used for this DReaction pair dMinIndividualTrackingFOM; //COMBO:MIN_INDIVIDUAL_TRACKING_FOM - the minimum Tracking FOM for a charged track used for this DReaction pair dMinCombinedTrackingFOM; //COMBO:MIN_COMBINED_TRACKING_FOM - the minimum combined Tracking FOM for all charged tracks used for this DReaction pair dMaxPhotonRFDeltaT; //COMBO:MAX_PHOTON_RF_DELTAT - the maximum photon-rf time difference: used for photon selection pair dMinProtonMomentum; //COMBO:MIN_PROTON_MOMENTUM - when testing whether a non-proton DChargedTrackHypothesis could be a proton, this is the minimum momentum it can have }; #endif // _DReaction_