// $Id$ // // File: DReaction_factory_p2k2pi_hists.cc // Created: Wed Mar 11 20:34:14 EDT 2015 // Creator: jrsteven (on Linux halldw1.jlab.org 2.6.32-504.8.1.el6.x86_64 x86_64) // #include "DReaction_factory_p2k2pi_hists.h" // #include "DCustomAction_kskl_hists.h" #include "DCustomAction_dEdxCut.h" //------------------ // brun //------------------ jerror_t DReaction_factory_p2k2pi_hists::brun(JEventLoop* locEventLoop, int32_t locRunNumber) { vector locBeamPeriodVector; locEventLoop->GetCalib("PHOTON_BEAM/RF/beam_period", locBeamPeriodVector); dBeamBunchPeriod = locBeamPeriodVector[0]; return NOERROR; } //------------------ // init //------------------ jerror_t DReaction_factory_p2k2pi_hists::init(void) { // Make as many DReaction objects as desired DReactionStep* locReactionStep = NULL; DReaction* locReaction = new DReaction("phi_2k_preco"); //needs to be a unique name for each DReaction object, CANNOT (!) be "Thrown" // DOCUMENTATION: // ANALYSIS library: https://halldweb1.jlab.org/wiki/index.php/GlueX_Analysis_Software // DReaction factory: https://halldweb1.jlab.org/wiki/index.php/Analysis_DReaction /**************************************************** phi_2k_preco Reaction Steps ****************************************************/ //locReaction = new DReaction("phi_2k_preco"); //needs to be a unique name for each DReaction object, CANNOT (!) be "Thrown" //g, p -> phi, p //locReactionStep = new DReactionStep(); //locReactionStep->Set_InitialParticleID(Gamma); //locReactionStep->Set_TargetParticleID(Proton); //locReactionStep->Add_FinalParticleID(phiMeson); //locReactionStep->Add_FinalParticleID(Proton); //locReaction->Add_ReactionStep(locReactionStep); //dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak //phi -> K+, K- //locReactionStep = new DReactionStep(); //locReactionStep->Set_InitialParticleID(phiMeson); //locReactionStep->Add_FinalParticleID(KPlus); //locReactionStep->Add_FinalParticleID(KMinus); //locReaction->Add_ReactionStep(locReactionStep); //dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak /**************************************************** phi_2k_preco Control Settings ****************************************************/ //locReaction->Set_KinFitType(d_P4AndVertexFit); //simultaneously constrain apply four-momentum conservation, invariant masses, and common-vertex constraints //locReaction->Set_MaxPhotonRFDeltaT(0.5*4.008); //beam bunches are every 4.008 ns, (2.004 should be minimum cut value) //locReaction->Set_MaxExtraGoodTracks(4); // Recommended: Enable ROOT TTree output for this DReaction //locReaction->Enable_TTreeOutput("tree_phi_2k.root"); //string is file name (must end in ".root"!!): doen't need to be unique, feel free to change /************************************************** phi_2k_preco Pre-Combo Custom Cuts *************************************************/ // Highly Recommended: Very loose invariant mass cuts, applied during DParticleComboBlueprint construction // Example: pi0 -> g, g cut //locReaction->Set_InvariantMassCut(phiMeson, 0.9, 1.1); // Highly Recommended: Very loose DAnalysisAction cuts, applied just after creating the combination (before saving it) // Example: Missing mass squared of proton //locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMassSquared(locReaction, false, -0.1, 0.1)); //locReaction->Add_ComboPreSelectionAction(new DCutAction_AllVertexZ(locReaction, 50, 80)); /**************************************************** phi_2k_preco Analysis Actions ****************************************************/ // Recommended: Analysis actions automatically performed by the DAnalysisResults factories to histogram useful quantities. //These actions are executed sequentially, and are executed on each surviving (non-cut) particle combination //Pre-defined actions can be found in ANALYSIS/DHistogramActions.h and ANALYSIS/DCutActions.h // PID //locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 0.5, KPlus, SYS_TOF)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 1.0, KPlus, SYS_BCAL)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.0, KPlus, SYS_FCAL)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 0.5, KMinus, SYS_TOF)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 1.0, KMinus, SYS_BCAL)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.0, KMinus, SYS_FCAL)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 1.0, Proton, SYS_TOF)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 1.0, Proton, SYS_BCAL)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.0, Proton, SYS_FCAL)); //false: measured data //locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction, "PostTimingCuts")); // Custom histograms for phi_2k (no KinFit cut) //locReaction->Add_AnalysisAction(new DCustomAction_phi_2k_hists(locReaction, false, "NoKinFit_Measured")); // Transverse Momentum //Recommended for no-missing-particle reactions only! //locReaction->Add_AnalysisAction(new DHistogramAction_MissingTransverseMomentum(locReaction, false, 1000, 0.0, 1.0)); //false: fill histograms with measured particle data //locReaction->Add_AnalysisAction(new DCutAction_TransverseMomentum(locReaction, 0.2)); //Max Missing Pt of 0.2 GeV // masses before kinematic fit //locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 1000, -0.5, 0.5)); //locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, false, 1000, 0.9, 1.1, "phi")); // Kinematic Fit Results //locReaction->Add_AnalysisAction(new DHistogramAction_KinFitResults(locReaction, 0.05)); //5% confidence level cut on pull histograms only // Require KinFit converges //locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.0)); //require kinematic fit converges // Masses (KinFit converges) //locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 1000, -0.5, 0.5, "PostKinFit_Meas")); //locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, true, 1000, -0.5, 0.5, "PostKinFit")); //locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, false, 1000, 0.9, 1.1, "phi_KinFit_Meas")); //locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, true, 1000, 0.9, 1.1, "phi_KinFit")); // Require loose KinFit cut //locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 1e-8)); // Masses (KinFit converges) //locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 1000, -0.5, 0.5, "LooseKinFitCut_Meas")); //locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, true, 1000, -0.5, 0.5, "LooseKinFitCut")); //locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, false, 1000, 0.9, 1.1, "phi_LooseKinFitCut_Meas")); //locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, true, 1000, 0.9, 1.1, "phi_LooseKinFitCut")); // Require loose KinFit cut //locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.001)); // 0.01% CL // Masses (KinFit converges) //locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 1000, -0.5, 0.5, "TighterKinFitCut_Meas")); //locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, true, 1000, -0.5, 0.5, "TighterKinFitCut")); //locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, false, 1000, 0.9, 1.1, "phi_TighterKinFitCut_Meas")); //locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, true, 1000, 0.9, 1.1, "phi_TighterKinFit")); // Require loose KinFit cut //locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.01)); // 1% CL // Masses (KinFit converges) //locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 1000, -0.5, 0.5, "TightKinFitCut_Meas")); //locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, true, 1000, -0.5, 0.5, "TightKinFitCut")); //locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, false, 1000, 0.9, 1.1, "phi_TightKinFitCut_Meas")); //locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, true, 1000, 0.9, 1.1, "phi_TightKinFit")); // Kinematics of final selection //locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); //false: fill histograms with measured particle data //locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction, "Final")); //_data.push_back(locReaction); //Register the DReaction with the factory /**************************************************** phi_kskl_preco Reaction Steps ****************************************************/ //locReaction = new DReaction("phi_kskl_preco"); //needs to be a unique name for each DReaction object, CANNOT (!) be "Thrown" //g, p -> phi, p //locReactionStep = new DReactionStep(); //locReactionStep->Set_InitialParticleID(Gamma); //locReactionStep->Set_TargetParticleID(Proton); //locReactionStep->Add_FinalParticleID(phiMeson); //locReactionStep->Add_FinalParticleID(Proton); //locReaction->Add_ReactionStep(locReactionStep); //dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak //phi -> KS, KL //locReactionStep = new DReactionStep(); //locReactionStep->Set_InitialParticleID(phiMeson); //locReactionStep->Add_FinalParticleID(KShort); //locReactionStep->Add_FinalParticleID(KLong, true); //true: missing particle //locReaction->Add_ReactionStep(locReactionStep); //dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak //KS -> pi+, pi- //locReactionStep = new DReactionStep(); //locReactionStep->Set_InitialParticleID(KShort); //locReactionStep->Add_FinalParticleID(PiPlus); //locReactionStep->Add_FinalParticleID(PiMinus); //locReaction->Add_ReactionStep(locReactionStep); //dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak /**************************************************** phi_kskl_preco Control Settings ****************************************************/ //locReaction->Set_KinFitType(d_P4AndVertexFit); //simultaneously constrain apply four-momentum conservation, invariant masses, and common-vertex constraints //locReaction->Set_MaxPhotonRFDeltaT(0.5*4.008); //beam bunches are every 4.008 ns, (2.004 should be minimum cut value) //locReaction->Set_MaxExtraGoodTracks(4); // Recommended: Enable ROOT TTree output for this DReaction //locReaction->Enable_TTreeOutput("tree_phi_kskl.root"); //string is file name (must end in ".root"!!): doen't need to be unique, feel free to change /************************************************** phi_kskl_preco Pre-Combo Custom Cuts *************************************************/ // Highly Recommended: Very loose invariant mass cuts, applied during DParticleComboBlueprint construction // Example: pi0 -> g, g cut //locReaction->Set_InvariantMassCut(KShort, 0.42, 0.58); // Highly Recommended: Very loose DAnalysisAction cuts, applied just after creating the combination (before saving it) // Example: Missing mass squared of proton //locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMass(locReaction, false, 0.2, 1.0)); /**************************************************** phi_kskl_preco Analysis Actions ****************************************************/ // Recommended: Analysis actions automatically performed by the DAnalysisResults factories to histogram useful quantities. //These actions are executed sequentially, and are executed on each surviving (non-cut) particle combination //Pre-defined actions can be found in ANALYSIS/DHistogramActions.h and ANALYSIS/DCutActions.h // PID //locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 0.5, PiPlus, SYS_TOF)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 1.0, PiPlus, SYS_BCAL)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.0, PiPlus, SYS_FCAL)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 0.5, PiMinus, SYS_TOF)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 1.0, PiMinus, SYS_BCAL)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.0, PiMinus, SYS_FCAL)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 1.0, Proton, SYS_TOF)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 1.0, Proton, SYS_BCAL)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.0, Proton, SYS_FCAL)); //false: measured data //locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction, "PostTimingCuts")); // Custom histograms for phi_2k (no KinFit cut) //locReaction->Add_AnalysisAction(new DCustomAction_phi_2k_hists(locReaction, false, "NoKinFit_Measured")); // masses before kinematic fit //locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction, false, 750, 0., 1.5)); //locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, false, 1000, 0.4, 0.6, "phi")); // Kinematic Fit Results //locReaction->Add_AnalysisAction(new DHistogramAction_KinFitResults(locReaction, 0.05)); //5% confidence level cut on pull histograms only // Require KinFit converges //locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.0)); //require kinematic fit converges /* // Masses (KinFit converges) locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction, false, 750, 0., 1.5, "PostKinFit")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, false, 1000, 0.4, 0.6, "phi_KinFit_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, true, 1000, 0.4, 0.6, "phi_KinFit")); // Require loose KinFit cut locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 1e-8)); // Masses (KinFit converges) locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction, false, 750, 0., 1.5, "LooseKinFitCut")); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction, true, 750, 0., 1.5, "LooseKinFitCut_KinFit")); locReaction->Add_AnalysisAction(new DCutAction_MissingMass(locReaction, false, 0.4, 0.6)); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, false, 1000, 0.4, 0.6, "phi_LooseKinFitCut_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, true, 1000, 0.4, 0.6, "phi_LooseKinFitCut")); // tighter missing mass cut locReaction->Add_AnalysisAction(new DCutAction_MissingMass(locReaction, true, 0.45, 0.55)); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, false, 1000, 0.4, 0.6, "phi_LooseKinFitCut_TightMMCut_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, true, 1000, 0.4, 0.6, "phi_LooseKinFitCut_TightMMCut")); // even tighter missing mass cut locReaction->Add_AnalysisAction(new DCutAction_MissingMass(locReaction, true, 0.48, 0.52)); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, false, 1000, 0.4, 0.6, "phi_LooseKinFitCut_TighterMMCut_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, true, 1000, 0.4, 0.6, "phi_LooseKinFitCut_TighterMMCut")); // Require loose KinFit cut locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.001)); // 0.01% CL // Masses (KinFit converges) locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction, false, 750, 0., 1.5), "TighterKinFitCut"); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, false, 1000, 0.4, 0.6, "phi_TighterKinFitCut_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, true, 1000, 0.4, 0.6, "phi_TighterKinFit")); // Require loose KinFit cut locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.01)); // 1% CL // Masses (KinFit converges) locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction, false, 750, 0., 1.5), "TightKinFitCut"); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, false, 1000, 0.4, 0.6, "phi_TightKinFitCut_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, true, 1000, 0.4, 0.6, "phi_TightKinFit")); */ // Kinematics of final selection //locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); //false: fill histograms with measured particle data //locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction, "Final")); //_data.push_back(locReaction); //Register the DReaction with the factory /**************************************************** phipipi_2k_preco Reaction Steps ****************************************************/ locReaction = new DReaction("phipipi_2k_preco"); //needs to be a unique name for each DReaction object, CANNOT (!) be "Thrown" //g, p -> phi, p locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Gamma); locReactionStep->Set_TargetParticleID(Proton); locReactionStep->Add_FinalParticleID(phiMeson); locReactionStep->Add_FinalParticleID(Proton); locReactionStep->Add_FinalParticleID(PiPlus); locReactionStep->Add_FinalParticleID(PiMinus); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak //phi -> K+, K- locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(phiMeson); locReactionStep->Add_FinalParticleID(KPlus); locReactionStep->Add_FinalParticleID(KMinus); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak /**************************************************** phipipi_2k_preco Control Settings ****************************************************/ locReaction->Set_KinFitType(d_P4AndVertexFit); //simultaneously constrain apply four-momentum conservation, invariant masses, and common-vertex constraints locReaction->Set_MaxPhotonRFDeltaT(0.5*dBeamBunchPeriod); //beam bunches are every 4.008 ns, (2.004 should be minimum cut value) locReaction->Set_MaxExtraGoodTracks(6); // Highly Recommended: Set EventStore skim query (use with "eventstore" source) // This will skip creating particle combos for events that aren't in the skims you list // Query should be comma-separated list of skims to boolean-AND together locReaction->Set_EventStoreSkims("3q+,2q-"); //boolean-AND of skims // Recommended: Enable ROOT TTree output for this DReaction locReaction->Enable_TTreeOutput("tree_sdobbs_kkpipi.root"); //string is file name (must end in ".root"!!): doen't need to be unique, feel free to change /************************************************** phipipi_2k_preco Pre-Combo Custom Cuts *************************************************/ // Highly Recommended: Very loose invariant mass cuts, applied during DParticleComboBlueprint construction // Example: pi0 -> g, g cut //locReaction->Set_InvariantMassCut(phiMeson, 0.99, 1.1); locReaction->Set_InvariantMassCut(phiMeson, 0.90, 1.60); // Highly Recommended: Very loose DAnalysisAction cuts, applied just after creating the combination (before saving it) // Example: Missing mass squared of proton locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMassSquared(locReaction, false, -0.1, 0.1)); locReaction->Add_ComboPreSelectionAction(new DCutAction_AllVertexZ(locReaction, 50, 80)); /**************************************************** phipipi_2k_preco Analysis Actions ****************************************************/ // Recommended: Analysis actions automatically performed by the DAnalysisResults factories to histogram useful quantities. //These actions are executed sequentially, and are executed on each surviving (non-cut) particle combination //Pre-defined actions can be found in ANALYSIS/DHistogramActions.h and ANALYSIS/DCutActions.h // PID locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 0.75, KPlus, SYS_TOF)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.5, KPlus, SYS_BCAL)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.0, KPlus, SYS_FCAL)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 0.75, KMinus, SYS_TOF)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.5, KMinus, SYS_BCAL)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.0, KMinus, SYS_FCAL)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.0, Proton, SYS_TOF)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.5, Proton, SYS_BCAL)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.5, Proton, SYS_FCAL)); //false: measured data locReaction->Add_AnalysisAction(new DCustomAction_dEdxCut(locReaction, false)); //false: focus on keeping signal locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction, "PostTimingCuts")); // Custom histograms for phi_2k (no KinFit cut) //locReaction->Add_AnalysisAction(new DCustomAction_phi_2k_hists(locReaction, false, "NoKinFit_Measured")); // Transverse Momentum //Recommended for no-missing-particle reactions only! locReaction->Add_AnalysisAction(new DHistogramAction_MissingTransverseMomentum(locReaction, false, 1000, 0.0, 1.0)); //false: fill histograms with measured particle data locReaction->Add_AnalysisAction(new DCutAction_TransverseMomentum(locReaction, 0.3)); //Max Missing Pt of 0.3 GeV // masses before kinematic fit locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 1000, -0.5, 0.5)); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, false, 1000, 0.9, 1.1, "phi")); //locReaction->Add_AnalysisAction(new DCustomAction_kskl_hists(locReaction, false, "PreKinFit")); // Kinematic Fit Results locReaction->Add_AnalysisAction(new DHistogramAction_KinFitResults(locReaction, 0.05)); //5% confidence level cut on pull histograms only // Require KinFit converges //locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.0)); //require kinematic fit converges locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, -1.0)); //require kinematic fit converges // Select phi events //locReaction->Add_AnalysisAction(new DCutAction_InvariantMass(locReaction, phiMeson, true, 0.90, 1.53)); /* deque finalStatePIDs; finalStatePIDs.push_back(PiPlus); finalStatePIDs.push_back(PiMinus); finalStatePIDs.push_back(phiMeson); // Masses (KinFit converges) locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 1000, -0.5, 0.5, "PostKinFit_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, true, 1000, -0.5, 0.5, "PostKinFit")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, false, 1000, 0.9, 1.1, "phi_KinFit_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, true, 1000, 0.9, 1.1, "phi_KinFit")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, 0, finalStatePIDs, false, 1000, 1., 3., "phipipi_KinFit_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, 0, finalStatePIDs, true, 1000, 1., 3., "phipipi_KinFit")); //locReaction->Add_AnalysisAction(new DCustomAction_kskl_hists(locReaction, false, "PostKinFit_Meas")); //locReaction->Add_AnalysisAction(new DCustomAction_kskl_hists(locReaction, true, "PostKinFit")); // Require loose KinFit cut locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 1e-8)); // Masses (KinFit converges) locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 1000, -0.5, 0.5, "LooseKinFitCut_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, true, 1000, -0.5, 0.5, "LooseKinFitCut")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, false, 1000, 0.9, 1.1, "phi_LooseKinFitCut_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, true, 1000, 0.9, 1.1, "phi_LooseKinFitCut")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, 0, finalStatePIDs, false, 1000, 1., 3., "phipipi_KinFitCut_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, 0, finalStatePIDs, true, 1000, 1., 3., "phipipi_KinFitCut")); //locReaction->Add_AnalysisAction(new DCustomAction_kskl_hists(locReaction, false, "LooseKinFitCut_Meas")); //locReaction->Add_AnalysisAction(new DCustomAction_kskl_hists(locReaction, true, "LooseKinFitCut")); // Require loose KinFit cut locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.001)); // 0.01% CL // Masses (KinFit converges) locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 1000, -0.5, 0.5, "TighterKinFitCut_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, true, 1000, -0.5, 0.5, "TighterKinFitCut")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, false, 1000, 0.9, 1.1, "phi_TighterKinFitCut_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, true, 1000, 0.9, 1.1, "phi_TighterKinFitCut")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, 0, finalStatePIDs, false, 1000, 1., 3., "phipipi_TighterKinFitCut_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, 0, finalStatePIDs, true, 1000, 1., 3., "phipipi_TighterKinFitCut")); //locReaction->Add_AnalysisAction(new DCustomAction_kskl_hists(locReaction, false, "TighterKinFitCut_Meas")); //locReaction->Add_AnalysisAction(new DCustomAction_kskl_hists(locReaction, true, "TighterKinFitCut")); // Require loose KinFit cut locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.01)); // 1% CL // Masses (KinFit converges) locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 1000, -0.5, 0.5, "TightKinFitCut_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, true, 1000, -0.5, 0.5, "TightKinFitCut")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, false, 1000, 0.9, 1.1, "phi_TightKinFitCut_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, phiMeson, true, 1000, 0.9, 1.1, "phi_TightKinFitCut")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, 0, finalStatePIDs, false, 1000, 1., 3., "phipipi_TightKinFitCut_Meas")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, 0, finalStatePIDs, true, 1000, 1., 3., "phipipi_TightKinFitCut")); //locReaction->Add_AnalysisAction(new DCustomAction_kskl_hists(locReaction, false, "TightKinFitCut_Meas")); //locReaction->Add_AnalysisAction(new DCustomAction_kskl_hists(locReaction, true, "TightKinFitCut")); */ // Kinematics of final selection locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); //false: fill histograms with measured particle data locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction, "Final")); _data.push_back(locReaction); //Register the DReaction with the factory /**************************************************** k_miss Reaction Steps ****************************************************/ //locReaction = new DReaction("k_miss"); //needs to be a unique name for each DReaction object, CANNOT (!) be "Thrown" //g, p -> K+ + X //locReactionStep = new DReactionStep(); //locReactionStep->Set_InitialParticleID(Gamma); //locReactionStep->Set_TargetParticleID(Proton); //locReactionStep->Add_FinalParticleID(KPlus); //locReactionStep->Add_FinalParticleID(Unknown, true); //locReaction->Add_ReactionStep(locReactionStep); //dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak /**************************************************** k_miss Control Settings ****************************************************/ //locReaction->Set_KinFitType(d_NoFit); //simultaneously constrain apply four-momentum conservation, invariant masses, and common-vertex constraints //locReaction->Set_MaxPhotonRFDeltaT(0.5*4.008); //beam bunches are every 4.008 ns, (2.004 should be minimum cut value) /**************************************************** k_miss Analysis Actions ****************************************************/ //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 0.3, KPlus, SYS_TOF)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 0.0, KPlus, SYS_BCAL)); //false: measured data // NO BCAL Hits //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.0, KPlus, SYS_FCAL)); //false: measured data // missing mass scan //locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction, false, 1500, 0., 3.)); // _data.push_back(locReaction); //Register the DReaction with the factory /**************************************************** 2k_miss Reaction Steps ****************************************************/ //locReaction = new DReaction("2k_miss"); //needs to be a unique name for each DReaction object, CANNOT (!) be "Thrown" //g, p -> K+ + X //locReactionStep = new DReactionStep(); //locReactionStep->Set_InitialParticleID(Gamma); //locReactionStep->Set_TargetParticleID(Proton); //locReactionStep->Add_FinalParticleID(KPlus); //locReactionStep->Add_FinalParticleID(KMinus); //locReactionStep->Add_FinalParticleID(Unknown, true); //locReaction->Add_ReactionStep(locReactionStep); //dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak /**************************************************** 2k_miss Control Settings ****************************************************/ //locReaction->Set_KinFitType(d_NoFit); //simultaneously constrain apply four-momentum conservation, invariant masses, and common-vertex constraints //ocReaction->Set_MaxPhotonRFDeltaT(0.5*4.008); //beam bunches are every 4.008 ns, (2.004 should be minimum cut value) /**************************************************** 2k_miss Analysis Actions ****************************************************/ //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 0.3, KPlus, SYS_TOF)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 0.0, KPlus, SYS_BCAL)); //false: measured data // NO BCAL Hits //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.0, KPlus, SYS_FCAL)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 0.3, KMinus, SYS_TOF)); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 1.0, KMinus, SYS_BCAL)); //false: measured data // NO BCAL Hits //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.0, KMinus, SYS_FCAL)); //false: measured data // missing mass scan //locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction, false, 1500, 0., 3.)); // _data.push_back(locReaction); //Register the DReaction with the factory return NOERROR; } //------------------ // fini //------------------ jerror_t DReaction_factory_p2k2pi_hists::fini(void) { for(size_t loc_i = 0; loc_i < dReactionStepPool.size(); ++loc_i) delete dReactionStepPool[loc_i]; //cleanup memory return NOERROR; }