// $Id$ // // File: DCustomAction_InvariantMassDifference.h // Created: Fri Jul 7 15:51:45 EDT 2017 // Creator: aaustreg (on Linux ifarm1402.jlab.org 3.10.0-327.el7.x86_64 x86_64) // #ifndef _DCustomAction_InvariantMassDifference_ #define _DCustomAction_InvariantMassDifference_ #include #include #include "JANA/JEventLoop.h" #include "JANA/JApplication.h" #include "ANALYSIS/DAnalysisAction.h" #include "ANALYSIS/DReaction.h" #include "ANALYSIS/DParticleCombo.h" #include "ANALYSIS/DAnalysisUtilities.h" #include #include using namespace std; using namespace jana; class DCustomAction_InvariantMassDifference : public DAnalysisAction { public: DCustomAction_InvariantMassDifference(const DReaction* locReaction, size_t locStepIndex, deque locToIncludePIDs_Mother, Particle_t locDaughter, bool locUseKinFitResultsFlag, unsigned int locNumMassBins, double locMinMass, double locMaxMass, string locActionUniqueString = "") : DAnalysisAction(locReaction, "Custom_InvariantMassDifference", locUseKinFitResultsFlag, locActionUniqueString), dMother(Unknown), dDaughter(locDaughter), dStepIndex(locStepIndex), dToIncludePIDs_Mother(locToIncludePIDs_Mother), dToIncludePIDs_Daughter(deque()), dNumMassBins(locNumMassBins), dMinMass(locMinMass), dMaxMass(locMaxMass), dNum2DMassBins(locNumMassBins/2), dNum2DBeamEBins(600), dMinBeamE(0.0), dMaxBeamE(12.0) {} DCustomAction_InvariantMassDifference(const DReaction* locReaction, size_t locStepIndex, deque locToIncludePIDs_Mother, deque locToIncludePIDs_Daughter, bool locUseKinFitResultsFlag, unsigned int locNumMassBins, double locMinMass, double locMaxMass, string locActionUniqueString = "") : DAnalysisAction(locReaction, "Custom_InvariantMassDifference", locUseKinFitResultsFlag, locActionUniqueString), dMother(Unknown), dDaughter(Unknown), dStepIndex(locStepIndex), dToIncludePIDs_Mother(locToIncludePIDs_Mother), dToIncludePIDs_Daughter(locToIncludePIDs_Daughter), dNumMassBins(locNumMassBins), dMinMass(locMinMass), dMaxMass(locMaxMass), dNum2DMassBins(locNumMassBins/2), dNum2DBeamEBins(600), dMinBeamE(0.0), dMaxBeamE(12.0) {} void Initialize(JEventLoop* locEventLoop); void Reset_NewEvent(void){dPreviousSourceObjects_Couple.clear();}; //RESET HISTOGRAM DUPLICATE-CHECK TRACKING HERE!! private: bool Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo); Particle_t dMother; Particle_t dDaughter; int dStepIndex; deque dToIncludePIDs_Mother; deque dToIncludePIDs_Daughter; unsigned int dNumMassBins; double dMinMass, dMaxMass; public: unsigned int dNum2DMassBins, dNum2DBeamEBins; double dMinBeamE, dMaxBeamE; private: const DAnalysisUtilities* dAnalysisUtilities = nullptr; TH1I* dHist_InvariantMassDifference; TH2D* dHist_InvariantMassDifferenceVsBeamE; using SourcePIDPair = pair; set, set>> dPreviousSourceObjects_Couple; set, set, const JObject*>> dPreviousSourceObjects_Beam; }; #endif // _DCustomAction_InvariantMassDifference_