// $Id$ // // File: DReaction_factory_etapr_eeg.cc // Created: Fri Jul 22 19:08:49 EDT 2016 // Creator: cfanelli (on Linux ifarm1401 2.6.32-431.el6.x86_64 x86_64) // #include "DReaction_factory_etapr_eeg.h" //------------------ // brun //------------------ jerror_t DReaction_factory_etapr_eeg::brun(JEventLoop* locEventLoop, int32_t locRunNumber) { vector locBeamPeriodVector; locEventLoop->GetCalib("PHOTON_BEAM/RF/beam_period", locBeamPeriodVector); dBeamBunchPeriod = locBeamPeriodVector[0]; return NOERROR; } //------------------ // evnt //------------------ jerror_t DReaction_factory_etapr_eeg::evnt(JEventLoop* locEventLoop, uint64_t locEventNumber) { // Make as many DReaction objects as desired DReactionStep* locReactionStep = NULL; DReaction* locReaction = NULL; //create with 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 //=========================================================================== // REACTIONS WITH NO MASS CONSTRAINTS (they both valid for eta and eta prime) //=========================================================================== /************************************************** etapr_eeg_noMKF Reaction Definition *************************************************/ locReaction = new DReaction("etapr_eeg_noMKF"); //Example: g, p -> eta', (p) locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Gamma); locReactionStep->Set_TargetParticleID(Proton); locReactionStep->Add_FinalParticleID(EtaPrime); locReactionStep->Add_FinalParticleID(Proton); //false); //true: proton missing locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //eta->Positron Electron Gamma locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(EtaPrime); locReactionStep->Set_KinFitConstrainInitMassFlag(false); //this should allow to study pi0->e+e-g too. locReactionStep->Add_FinalParticleID(Positron); locReactionStep->Add_FinalParticleID(Electron); locReactionStep->Add_FinalParticleID(Gamma); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); /**************************************************** etapr_eeg_noMKF Control Settings ****************************************************/ // 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("myskim1,myskim2,myskim3"); //boolean-AND of skims locReaction->Set_EventStoreSkims("2q+,q-,q0"); // Recommended: Type of kinematic fit to perform (default is d_NoFit) //fit types are of type DKinFitType, an enum defined in sim-recon/src/libraries/ANALYSIS/DReaction.h //Options: d_NoFit (default), d_P4Fit, d_VertexFit, d_P4AndVertexFit //P4 fits automatically constrain decaying particle masses, unless they are manually disabled locReaction->Set_KinFitType(d_P4AndVertexFit); // Highly Recommended: When generating particle combinations, reject all beam photons that match to a different RF bunch locReaction->Set_MaxPhotonRFDeltaT(0.5*dBeamBunchPeriod); //should be minimum cut value // Optional: When generating particle combinations, reject all photon candidates with a PID confidence level < 5.73303E-7 (+/- 5-sigma) // Make sure PID errors are calculated correctly before using. //locReaction->Set_MinPhotonPIDFOM(5.73303E-7); // Optional: When generating particle combinations, reject all charged track candidates with a PID confidence level < 5.73303E-7 (+/- 5-sigma) // Make sure PID errors are calculated correctly before using. //locReaction->Set_MinChargedPIDFOM(5.73303E-7); // Highly Recommended: Cut on number of extra "good" tracks. "Good" tracks are ones that survive the "PreSelect" (or user custom) factory. // Important: Keep cut large: Can have many ghost and accidental tracks that look "good" locReaction->Set_MaxExtraGoodTracks(4); // Highly Recommended: Enable ROOT TTree output for this DReaction locReaction->Enable_TTreeOutput("tree_etapr_eeg_noMKF.root"); //string is file name (must end in ".root"!!): doen't need to be unique, feel free to change /************************************************** etapr_eeg_noMKF Pre-Combo Custom Cuts *************************************************/ // Highly Recommended: Very loose invariant mass cuts, applied during DParticleComboBlueprint construction // Example: pi0 -> g, g cut locReaction->Set_InvariantMassCut(EtaPrime, 0.0, 2.0); // Highly Recommended: Very loose DAnalysisAction cuts, applied just after creating the combination (before saving it) // Example: Missing mass of proton // locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMass(locReaction, false, 0.7, 1.2)); locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMassSquared(locReaction, false, -0.025, 0.025)); /**************************************************** etapr_eeg_noMKF 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 //If a histogram action is repeated, it should be created with a unique name (string) to distinguish them // HISTOGRAM PID locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); // CUT PID // SYS_TOF, SYS_BCAL, SYS_FCAL, ...: DetectorSystem_t: Defined in libraries/include/GlueX.h //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,2.5,Proton,SYS_BCAL)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,2.5,Gamma,SYS_FCAL)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,1.0,Electron,SYS_TOF)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,1.0,Positron,SYS_TOF)); locReaction->Add_AnalysisAction(new DCutAction_BeamEnergy(locReaction, false, 3.0, 12.0)); //add cut on FCAL charged particles (only e+e- selected if E/p>0.85) //cut to remove pi+/pi- mis-identified as e+/e- locReaction->Add_AnalysisAction(new DCutAction_TrackFCALShowerEOverP(locReaction,false,0.70)); //originally 0.85, lowered //HISTOGRAMS BEFORE FIT locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); //false: fill histograms with measured particle data //invariant mass before fit locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction,false,1500,-1.5,1.5)); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, EtaPrime, false, 2000, 0.0,2.0, "EtaPrime_PreKinFit")); //============== // KINEMATIC FIT //============== locReaction->Add_AnalysisAction(new DHistogramAction_KinFitResults(locReaction, 0.05)); //5% confidence level cut on pull histograms only locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, -1.0)); // confidence level cut //-1: require kinematic fit converges //HISTOGRAMS POST FIT locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction,false,1500,-1.5,1.5,"MissM_PostKinFit")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, EtaPrime, false, 2000, 0.0, 2.0, "EtaPrime_PostKinFit")); // Kinematics locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); //false: measured data locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, true, "KinFit")); //true: kinematic-fit data locReaction->Add_AnalysisAction(new DHistogramAction_TrackVertexComparison(locReaction)); _data.push_back(locReaction); //Register the DReaction with the factory //Start new reaction /**************************************************** Missing proton and no constraint on EtaPrime Mass ****************************************************/ locReaction = new DReaction("etapr_eeg_noMKF_pmiss"); //Example: g, p -> eta, (p) locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Gamma); locReactionStep->Set_TargetParticleID(Proton); locReactionStep->Add_FinalParticleID(EtaPrime); locReactionStep->Add_FinalParticleID(Proton,true); //false); //true: proton missing locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //eta->Positron Electron Gamma locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(EtaPrime); locReactionStep->Set_KinFitConstrainInitMassFlag(false); //this should allow to study pi0->e+e-g too. locReactionStep->Add_FinalParticleID(Positron); locReactionStep->Add_FinalParticleID(Electron); locReactionStep->Add_FinalParticleID(Gamma); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); /**************************************************** etapr_eeg_noMKF_pmiss Control Settings ****************************************************/ locReaction->Set_EventStoreSkims("q+,q-,q0"); locReaction->Set_KinFitType(d_P4AndVertexFit); locReaction->Set_MaxPhotonRFDeltaT(0.5*dBeamBunchPeriod); locReaction->Set_MaxExtraGoodTracks(4); // Highly Recommended: Enable ROOT TTree output for this DReaction locReaction->Enable_TTreeOutput("tree_etapr_eeg_noMKF_pmiss.root"); //string is file name (must end in ".root"!!): doen't need to be unique, feel free to change /************************************************** etapr_eeg noMKF pmiss Pre-Combo Custom Cuts *************************************************/ // Highly Recommended: Very loose invariant mass cuts, applied during DParticleComboBlueprint construction // Example: pi0 -> g, g cut locReaction->Set_InvariantMassCut(EtaPrime, 0.0, 2.0); // Highly Recommended: Very loose DAnalysisAction cuts, applied just after creating the combination (before saving it) // Example: Missing mass of proton (let's keep some extra pions x10 statistics) locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMass(locReaction, false, 0.7, 2.0)); //locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMassSquared(locReaction, false, -0.025, 0.025)); /**************************************************** etapr_eeg noMKF pmiss Analysis Actions ****************************************************/ // HISTOGRAM PID locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,2.0,Unknown,SYS_NULL,"LooseDeltaTCut")); locReaction->Add_AnalysisAction(new DCutAction_BeamEnergy(locReaction, false, 6.0, 12.0)); //add cut on FCAL charged particles (only e+e- selected if E/p>0.85) //cut to remove pi+/pi- mis-identified as e+/e- locReaction->Add_AnalysisAction(new DCutAction_TrackFCALShowerEOverP(locReaction,false,0.75)); //originally 0.85, lowered //HISTOGRAMS BEFORE FIT locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); //false: fill histograms with measured particle data //invariant mass before fit locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction,false,2000,0.0,2.0)); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, EtaPrime, false, 2000, 0.0,2.0, "EtaPrime_PreKinFit")); //============== // KINEMATIC FIT //============== locReaction->Add_AnalysisAction(new DHistogramAction_KinFitResults(locReaction, 0.05)); //5% confidence level cut on pull histograms only locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, -1.0)); // confidence level cut //-1: require kinematic fit converges //HISTOGRAMS POST FIT locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction,false,2000,0.0,2.0,"MissM_PostKinFit")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, EtaPrime, false, 2000, 0.0, 2.0, "EtaPrime_PostKinFit")); // Kinematics locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); //false: measured data locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, true, "KinFit")); //true: kinematic-fit data locReaction->Add_AnalysisAction(new DHistogramAction_TrackVertexComparison(locReaction)); _data.push_back(locReaction); //Register the DReaction with the factory //================================================================== // REACTIONS WITH MASS CONSTRAINTS (different for eta and eta-prime) //================================================================== //Eta (preco and pmiss) //Start new reaction /**************************************************** Require mass constraint ****************************************************/ locReaction = new DReaction("eta_eeg_MKF"); //Example: g, p -> eta, (p) locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Gamma); locReactionStep->Set_TargetParticleID(Proton); locReactionStep->Add_FinalParticleID(Eta); locReactionStep->Add_FinalParticleID(Proton); //false); //true: proton missing locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //eta->Positron Electron Gamma locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Eta); locReactionStep->Set_KinFitConstrainInitMassFlag(true); locReactionStep->Add_FinalParticleID(Positron); locReactionStep->Add_FinalParticleID(Electron); locReactionStep->Add_FinalParticleID(Gamma); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); /**************************************************** eta_eeg Control Settings ****************************************************/ // Recommended: Type of kinematic fit to perform (default is d_NoFit) //fit types are of type DKinFitType, an enum defined in sim-recon/src/libraries/ANALYSIS/DReaction.h //Options: d_NoFit (default), d_P4Fit, d_VertexFit, d_P4AndVertexFit //P4 fits automatically constrain decaying particle masses, unless they are manually disabled locReaction->Set_KinFitType(d_P4AndVertexFit); // 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("2q+,q-,q0"); //("2q+,lambda") boolean-AND of skims // Highly Recommended: When generating particle combinations, reject all beam photons that match to a different RF bunch (delta_t > 1.002 ns) locReaction->Set_MaxPhotonRFDeltaT(0.5*dBeamBunchPeriod); //should be minimum cut value // Optional: When generating particle combinations, reject all photon candidates with a PID confidence level < 5.73303E-7 (+/- 5-sigma) // Make sure PID errors are calculated correctly before using. //locReaction->Set_MinPhotonPIDFOM(5.73303E-7); // Optional: When generating particle combinations, reject all charged track candidates with a PID confidence level < 5.73303E-7 (+/- 5-sigma) // Make sure PID errors are calculated correctly before using. //locReaction->Set_MinChargedPIDFOM(5.73303E-7); // Highly Recommended: Cut on number of extra "good" tracks. "Good" tracks are ones that survive the "PreSelect" (or user custom) factory. // Important: Keep cut large: Can have many ghost and accidental tracks that look "good" locReaction->Set_MaxExtraGoodTracks(4); // Highly Recommended: Enable ROOT TTree output for this DReaction locReaction->Enable_TTreeOutput("tree_eta_eeg_MKF.root"); //string is file name (must end in ".root"!!): doen't need to be unique, feel free to change /************************************************** eta_eeg Pre-Combo Custom Cuts *************************************************/ // Highly Recommended: Very loose invariant mass cuts, applied during DParticleComboBlueprint construction // Example: pi0 -> g, g cut locReaction->Set_InvariantMassCut(Eta, 0.2, 1.0); // Highly Recommended: Very loose DAnalysisAction cuts, applied just after creating the combination (before saving it) // Example: Missing mass of proton //locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMass(locReaction, false, 0.7, 1.2)); locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMassSquared(locReaction, false, -0.025, 0.025)); /**************************************************** eta_eeg 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 //If a histogram action is repeated, it should be created with a unique name (string) to distinguish them // HISTOGRAM PID locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); // CUT PID // SYS_TOF, SYS_BCAL, SYS_FCAL, ...: DetectorSystem_t: Defined in libraries/include/GlueX.h // locReaction->Add_AnalysisAction(new DCutAction_EachPIDFOM(locReaction, 5.73303E-7)); // locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 1.0, Proton, SYS_TOF)); //cut at delta-t +/- 1.0 //false: measured data // locReaction->Add_AnalysisAction(new DCutAction_PIDTimingBeta(locReaction, 0.0, 0.9, Neutron, SYS_BCAL)); //min/max beta cut for neutrons // locReaction->Add_AnalysisAction(new DCutAction_NoPIDHit(locReaction, KPlus)); //for K+ candidates, cut tracks with no PID hit // HISTOGRAM MASSES //false/true: measured/kinfit data //locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, Eta, false, 1000, 0.0, 1.0, "Eta_PreKinFit")); //locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction, false, 1000, 0.7, 1.2, "PreKinFit")); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,2.5,Proton,SYS_BCAL)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,2.5,Gamma,SYS_FCAL)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,1.0,Electron,SYS_TOF)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,1.0,Positron,SYS_TOF)); //locReaction->Add_AnalysisAction(new DCutAction_BeamEnergy(locReaction, false, 8.4, 9.0)); locReaction->Add_AnalysisAction(new DCutAction_BeamEnergy(locReaction, false, 3.0, 12.0)); //add cut on FCAL charged particles (only e+e- selected if E/p>0.85) //cut to remove pi+/pi- mis-identified as e+/e- locReaction->Add_AnalysisAction(new DCutAction_TrackFCALShowerEOverP(locReaction,false,0.70)); //originally 0.85, lowered //HISTOGRAMS BEFORE FIT locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); //false: fill histograms with measured particle data //invariant mass before fit locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction,false,1500,-1.5,1.5)); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, Eta, false, 2000, 0.0,1.0, "Eta_PreKinFit")); //============== // KINEMATIC FIT //============== locReaction->Add_AnalysisAction(new DHistogramAction_KinFitResults(locReaction, 0.05)); //5% confidence level cut on pull histograms only locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, -1.0)); // confidence level cut //-1: require kinematic fit converges //HISTOGRAMS POST FIT locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction,false,1500,-1.5,1.5,"MissM_PostKinFit")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, Eta, false, 2000, 0.0, 1.0, "Eta_PostKinFit")); // Kinematics locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); //false: measured data locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, true, "KinFit")); //true: kinematic-fit data locReaction->Add_AnalysisAction(new DHistogramAction_TrackVertexComparison(locReaction)); _data.push_back(locReaction); //Register the DReaction with the factory //Start new reaction /**************************************************** Missing proton and no constraint on Eta Mass ****************************************************/ locReaction = new DReaction("eta_eeg_MKF_pmiss"); //Example: g, p -> eta, (p) locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Gamma); locReactionStep->Set_TargetParticleID(Proton); locReactionStep->Add_FinalParticleID(Eta); locReactionStep->Add_FinalParticleID(Proton,true); //false); //true: proton missing locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //eta->Positron Electron Gamma locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Eta); locReactionStep->Set_KinFitConstrainInitMassFlag(true); locReactionStep->Add_FinalParticleID(Positron); locReactionStep->Add_FinalParticleID(Electron); locReactionStep->Add_FinalParticleID(Gamma); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); /**************************************************** eta_eeg Control Settings ****************************************************/ // Recommended: Type of kinematic fit to perform (default is d_NoFit) //fit types are of type DKinFitType, an enum defined in sim-recon/src/libraries/ANALYSIS/DReaction.h //Options: d_NoFit (default), d_P4Fit, d_VertexFit, d_P4AndVertexFit //P4 fits automatically constrain decaying particle masses, unless they are manually disabled locReaction->Set_KinFitType(d_P4AndVertexFit); // 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("q+,q-,q0"); //("2q+,lambda") boolean-AND of skims // Highly Recommended: When generating particle combinations, reject all beam photons that match to a different RF bunch (delta_t > 1.002 ns) locReaction->Set_MaxPhotonRFDeltaT(0.5*dBeamBunchPeriod); //should be minimum cut value // Optional: When generating particle combinations, reject all photon candidates with a PID confidence level < 5.73303E-7 (+/- 5-sigma) // Make sure PID errors are calculated correctly before using. //locReaction->Set_MinPhotonPIDFOM(5.73303E-7); // Optional: When generating particle combinations, reject all charged track candidates with a PID confidence level < 5.73303E-7 (+/- 5-sigma) // Make sure PID errors are calculated correctly before using. //locReaction->Set_MinChargedPIDFOM(5.73303E-7); // Highly Recommended: Cut on number of extra "good" tracks. "Good" tracks are ones that survive the "PreSelect" (or user custom) factory. // Important: Keep cut large: Can have many ghost and accidental tracks that look "good" locReaction->Set_MaxExtraGoodTracks(4); // Highly Recommended: Enable ROOT TTree output for this DReaction locReaction->Enable_TTreeOutput("tree_eta_eeg_MKF_pmiss.root"); //string is file name (must end in ".root"!!): doen't need to be unique, feel free to change /************************************************** eta_eeg Pre-Combo Custom Cuts *************************************************/ // Highly Recommended: Very loose invariant mass cuts, applied during DParticleComboBlueprint construction // Example: pi0 -> g, g cut locReaction->Set_InvariantMassCut(Eta, 0.2, 1.0); // Highly Recommended: Very loose DAnalysisAction cuts, applied just after creating the combination (before saving it) // Example: Missing mass of proton (let's keep some extra pions x10 statistics) locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMass(locReaction, false, 0.7, 2.0)); //locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMassSquared(locReaction, false, -0.025, 0.025)); /**************************************************** eta_eeg 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 //If a histogram action is repeated, it should be created with a unique name (string) to distinguish them // HISTOGRAM PID locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); // CUT PID // SYS_TOF, SYS_BCAL, SYS_FCAL, ...: DetectorSystem_t: Defined in libraries/include/GlueX.h // locReaction->Add_AnalysisAction(new DCutAction_EachPIDFOM(locReaction, 5.73303E-7)); // locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 1.0, Proton, SYS_TOF)); //cut at delta-t +/- 1.0 //false: measured data // locReaction->Add_AnalysisAction(new DCutAction_PIDTimingBeta(locReaction, 0.0, 0.9, Neutron, SYS_BCAL)); //min/max beta cut for neutrons // locReaction->Add_AnalysisAction(new DCutAction_NoPIDHit(locReaction, KPlus)); //for K+ candidates, cut tracks with no PID hit // HISTOGRAM MASSES //false/true: measured/kinfit data //locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, Eta, false, 1000, 0.0, 1.0, "Eta_PreKinFit")); //locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction, false, 1000, 0.7, 1.2, "PreKinFit")); //false: measured data //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,10.0,Gamma,SYS_FCAL)); //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,1.0,Electron,SYS_TOF)); //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,1.0,Positron,SYS_TOF)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,2.0,Unknown,SYS_NULL,"LooseDeltaTCut")); //locReaction->Add_AnalysisAction(new DCutAction_BeamEnergy(locReaction, false, 8.4, 9.0)); locReaction->Add_AnalysisAction(new DCutAction_BeamEnergy(locReaction, false, 6.0, 12.0)); //add cut on FCAL charged particles (only e+e- selected if E/p>0.85) //cut to remove pi+/pi- mis-identified as e+/e- locReaction->Add_AnalysisAction(new DCutAction_TrackFCALShowerEOverP(locReaction,false,0.75)); //originally 0.85, lowered //HISTOGRAMS BEFORE FIT locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); //false: fill histograms with measured particle data //invariant mass before fit locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction,false,2000,0.,2.0)); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, Eta, false, 2000, 0.0,1.0, "Eta_PreKinFit")); //============== // KINEMATIC FIT //============== locReaction->Add_AnalysisAction(new DHistogramAction_KinFitResults(locReaction, 0.05)); //5% confidence level cut on pull histograms only locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, -1.0)); // confidence level cut //-1: require kinematic fit converges //HISTOGRAMS POST FIT locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction,false,2000,0.,2.,"MissM_PostKinFit")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, Eta, false, 2000, 0.0, 1.0, "Eta_PostKinFit")); // Kinematics locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); //false: measured data locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, true, "KinFit")); //true: kinematic-fit data locReaction->Add_AnalysisAction(new DHistogramAction_TrackVertexComparison(locReaction)); _data.push_back(locReaction); //Register the DReaction with the factory //Eta-prime (preco and pmiss) //Start new reaction /**************************************************** Require mass constraint ****************************************************/ locReaction = new DReaction("etapr_eeg_MKF"); //Example: g, p -> eta, (p) locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Gamma); locReactionStep->Set_TargetParticleID(Proton); locReactionStep->Add_FinalParticleID(EtaPrime); locReactionStep->Add_FinalParticleID(Proton); //false); //true: proton missing locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //eta->Positron Electron Gamma locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(EtaPrime); locReactionStep->Set_KinFitConstrainInitMassFlag(true); locReactionStep->Add_FinalParticleID(Positron); locReactionStep->Add_FinalParticleID(Electron); locReactionStep->Add_FinalParticleID(Gamma); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); /**************************************************** etapr_eeg_MKF Control Settings ****************************************************/ // Recommended: Type of kinematic fit to perform (default is d_NoFit) //fit types are of type DKinFitType, an enum defined in sim-recon/src/libraries/ANALYSIS/DReaction.h //Options: d_NoFit (default), d_P4Fit, d_VertexFit, d_P4AndVertexFit //P4 fits automatically constrain decaying particle masses, unless they are manually disabled locReaction->Set_KinFitType(d_P4AndVertexFit); // 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("2q+,q-,q0"); //("2q+,lambda") boolean-AND of skims // Highly Recommended: When generating particle combinations, reject all beam photons that match to a different RF bunch (delta_t > 1.002 ns) locReaction->Set_MaxPhotonRFDeltaT(0.5*dBeamBunchPeriod); //should be minimum cut value // Optional: When generating particle combinations, reject all photon candidates with a PID confidence level < 5.73303E-7 (+/- 5-sigma) // Make sure PID errors are calculated correctly before using. //locReaction->Set_MinPhotonPIDFOM(5.73303E-7); // Optional: When generating particle combinations, reject all charged track candidates with a PID confidence level < 5.73303E-7 (+/- 5-sigma) // Make sure PID errors are calculated correctly before using. //locReaction->Set_MinChargedPIDFOM(5.73303E-7); // Highly Recommended: Cut on number of extra "good" tracks. "Good" tracks are ones that survive the "PreSelect" (or user custom) factory. // Important: Keep cut large: Can have many ghost and accidental tracks that look "good" locReaction->Set_MaxExtraGoodTracks(4); // Highly Recommended: Enable ROOT TTree output for this DReaction locReaction->Enable_TTreeOutput("tree_etapr_eeg_MKF.root"); //string is file name (must end in ".root"!!): doen't need to be unique, feel free to change /************************************************** etapr_eeg Pre-Combo Custom Cuts *************************************************/ // Highly Recommended: Very loose invariant mass cuts, applied during DParticleComboBlueprint construction // Example: pi0 -> g, g cut locReaction->Set_InvariantMassCut(EtaPrime, 0.7, 1.2); // Highly Recommended: Very loose DAnalysisAction cuts, applied just after creating the combination (before saving it) // Example: Missing mass of proton //locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMass(locReaction, false, 0.7, 1.2)); locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMassSquared(locReaction, false, -0.025, 0.025)); /**************************************************** etapr_eeg_MKF Analysis Actions ****************************************************/ // HISTOGRAM PID locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,2.5,Proton,SYS_BCAL)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,2.5,Gamma,SYS_FCAL)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,1.0,Electron,SYS_TOF)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,1.0,Positron,SYS_TOF)); locReaction->Add_AnalysisAction(new DCutAction_BeamEnergy(locReaction, false, 3.0, 12.0)); //cut to remove pi+/pi- mis-identified as e+/e- locReaction->Add_AnalysisAction(new DCutAction_TrackFCALShowerEOverP(locReaction,false,0.70)); //originally 0.85, lowered //HISTOGRAMS BEFORE FIT locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); //false: fill histograms with measured particle data //invariant mass before fit locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction,false,1500,-1.5,1.5)); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, EtaPrime, false, 2000, 0.0,2.0, "EtaPrime_PreKinFit")); //============== // KINEMATIC FIT //============== locReaction->Add_AnalysisAction(new DHistogramAction_KinFitResults(locReaction, 0.05)); //5% confidence level cut on pull histograms only locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, -1.0)); // confidence level cut //-1: require kinematic fit converges //HISTOGRAMS POST FIT locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction,false,1500,-1.5,1.5,"MissM_PostKinFit")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, EtaPrime, false, 2000, 0.0, 2.0, "EtaPrime_PostKinFit")); // Kinematics locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); //false: measured data locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, true, "KinFit")); //true: kinematic-fit data locReaction->Add_AnalysisAction(new DHistogramAction_TrackVertexComparison(locReaction)); _data.push_back(locReaction); //Register the DReaction with the factory //Start new reaction /**************************************************** Missing proton and constraint on EtaPrime Mass ****************************************************/ locReaction = new DReaction("etapr_eeg_MKF_pmiss"); //Example: g, p -> eta, (p) locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Gamma); locReactionStep->Set_TargetParticleID(Proton); locReactionStep->Add_FinalParticleID(EtaPrime); locReactionStep->Add_FinalParticleID(Proton,true); //false); //true: proton missing locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //eta->Positron Electron Gamma locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(EtaPrime); locReactionStep->Set_KinFitConstrainInitMassFlag(true); locReactionStep->Add_FinalParticleID(Positron); locReactionStep->Add_FinalParticleID(Electron); locReactionStep->Add_FinalParticleID(Gamma); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); /**************************************************** etapr_eeg Missing proton and constraint on EtaPrime Mass Control Settings ****************************************************/ locReaction->Set_EventStoreSkims("q+,q-,q0"); locReaction->Set_KinFitType(d_P4AndVertexFit); locReaction->Set_MaxPhotonRFDeltaT(0.5*dBeamBunchPeriod); locReaction->Set_MaxExtraGoodTracks(4); // Highly Recommended: Enable ROOT TTree output for this DReaction locReaction->Enable_TTreeOutput("tree_etapr_eeg_MKF_pmiss.root"); //string is file name (must end in ".root"!!): doen't need to be unique, feel free to change /************************************************** etapr_eeg Pre-Combo Custom Cuts *************************************************/ // Highly Recommended: Very loose invariant mass cuts, applied during DParticleComboBlueprint construction locReaction->Set_InvariantMassCut(EtaPrime, 0.7, 1.2); // Highly Recommended: Very loose DAnalysisAction cuts, applied just after creating the combination (before saving it) // Example: Missing mass of proton (let's keep some extra pions x10 statistics) locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMass(locReaction, false, 0.7, 2.0)); //locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMassSquared(locReaction, false, -0.025, 0.025)); /**************************************************** etapr_eeg Analysis Actions ****************************************************/ // HISTOGRAM PID locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false,2.0,Unknown,SYS_NULL,"LooseDeltaTCut")); locReaction->Add_AnalysisAction(new DCutAction_BeamEnergy(locReaction, false, 6.0, 12.0)); //cut to remove pi+/pi- mis-identified as e+/e- locReaction->Add_AnalysisAction(new DCutAction_TrackFCALShowerEOverP(locReaction,false,0.75)); //originally 0.85, lowered //HISTOGRAMS BEFORE FIT locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); //false: fill histograms with measured particle data //invariant mass before fit locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction,false,2000,0.,2.0)); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, EtaPrime, false, 2000, 0.0,2.0, "EtaPrime_PreKinFit")); //============== // KINEMATIC FIT //============== locReaction->Add_AnalysisAction(new DHistogramAction_KinFitResults(locReaction, 0.05)); //5% confidence level cut on pull histograms only locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, -1.0)); // confidence level cut //-1: require kinematic fit converges //HISTOGRAMS POST FIT locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction,false,2000,0.,2.,"MissM_PostKinFit")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, EtaPrime, false, 2000, 0.0, 2.0, "EtaPrime_PostKinFit")); // Kinematics locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); //false: measured data locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, true, "KinFit")); //true: kinematic-fit data locReaction->Add_AnalysisAction(new DHistogramAction_TrackVertexComparison(locReaction)); _data.push_back(locReaction); //Register the DReaction with the factory return NOERROR; } //------------------ // fini //------------------ jerror_t DReaction_factory_etapr_eeg::fini(void) { for(size_t loc_i = 0; loc_i < dReactionStepPool.size(); ++loc_i) delete dReactionStepPool[loc_i]; //cleanup memory return NOERROR; }