// $Id$ // // File: DReaction_factory_n3pi_skim.cc // Created: Tue Apr 15 21:00:39 EDT 2014 // Creator: pmatt (on Darwin pmattLaptop 10.8.0 i386) // #include "DReaction_factory_n3pi_skim.h" #include "DCustomAction_TrackPStudies.h" #include "DCustomAction_CutCombinedPID_NoBCAL.h" //------------------ // init //------------------ jerror_t DReaction_factory_n3pi_skim::init(void) { // Make as many DReaction objects as desired DReactionStep* locReactionStep = NULL; DReaction* locReaction = new DReaction("n3pi_skim"); //unique name, feel free to change // DOCUMENTATION: // ANALYSIS library: https://halldweb1.jlab.org/wiki/index.php/GlueX_Analysis_Software // DReaction factory: https://halldweb1.jlab.org/wiki/index.php/Analysis_DReaction /**************************************************** n3pi_skim Reaction Steps ****************************************************/ //Required: DReactionSteps to specify the channel and decay chain you want to study //Particles are of type Particle_t, an enum defined in sim-recon/src/libraries/include/particleType.h //g, p -> pi+, pi+, pi-, (n) locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Gamma); locReactionStep->Set_TargetParticleID(Proton); locReactionStep->Add_FinalParticleID(PiPlus); locReactionStep->Add_FinalParticleID(PiPlus); locReactionStep->Add_FinalParticleID(PiMinus); locReactionStep->Add_FinalParticleID(Neutron, true); //true: neutron missing locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak /**************************************************** n3pi_skim Control Variables ****************************************************/ // Optional: When generating particle combinations, reject all combinations with a combined tracking confidence level < +/- 5 sigma (or any custom number) locReaction->Set_MinCombinedTrackingFOM(5.73303E-7); // +/- 5 sigma // Optional: When generating particle combinations, reject all combinations with a combined particle ID confidence level < +/- 5 sigma (or any custom number) locReaction->Set_MinCombinedPIDFOM(5.73303E-7); // +/- 5 sigma /**************************************************** n3pi_skim 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 locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0)); locReaction->Add_AnalysisAction(new DCutAction_MissingMassSquared(locReaction, false, -2.0, 4.0)); locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false, "Cut_MassPeak")); //false: fill histograms with measured particle data locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); // _data.push_back(locReaction); //Register the DReaction with the factory /**************************************************** n3pi_skim_true Reaction Steps ****************************************************/ locReaction = new DReaction("n3pi_skim_true"); //unique name, feel free to change //Required: DReactionSteps to specify the channel and decay chain you want to study //Particles are of type Particle_t, an enum defined in sim-recon/src/libraries/include/particleType.h //g, p -> pi+, pi+, pi-, (n) locReaction->Add_ReactionStep(locReactionStep); /**************************************************** n3pi_skim_true Control Settings ****************************************************/ locReaction->Set_KinFitType(d_P4AndVertexFit); /**************************************************** n3pi_skim_true 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 locReaction->Add_AnalysisAction(new DCutAction_AllTruePID(locReaction, 5.73303E-7)); locReaction->Add_AnalysisAction(new DCutAction_ThrownTopology(locReaction, true)); //true: require exact match locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0, "PostCheat")); locReaction->Add_AnalysisAction(new DCutAction_MissingMassSquared(locReaction, false, -3.0, 5.0)); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0, "PostLooseMassCut")); locReaction->Add_AnalysisAction(new DCutAction_CombinedTrackingFOM(locReaction, 5.73303E-7)); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0, "PostTrackCut5Sigma")); locReaction->Add_AnalysisAction(new DCutAction_CombinedTrackingFOM(locReaction, 0.0027)); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0, "PostTrackCut3Sigma")); locReaction->Add_AnalysisAction(new DCutAction_AllTracksHaveDetectorMatch(locReaction)); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0, "PostDetectorMatches")); locReaction->Add_AnalysisAction(new DCustomAction_CutCombinedPID_NoBCAL(locReaction, 5.73303E-7)); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0, "PostPIDCut5Sigma")); locReaction->Add_AnalysisAction(new DCustomAction_CutCombinedPID_NoBCAL(locReaction, 0.0027)); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0, "PostPIDCut3Sigma")); locReaction->Add_AnalysisAction(new DHistogramAction_KinFitResults(locReaction, 0.05)); locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.0)); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0, "KinFitConverges")); locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.01)); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0, "PostKinFitCut1")); locReaction->Add_AnalysisAction(new DCustomAction_TrackPStudies(locReaction)); locReaction->Add_AnalysisAction(new DCutAction_MissingMassSquared(locReaction, false, 0.0, 1.9)); locReaction->Add_AnalysisAction(new DCustomAction_TrackPStudies(locReaction, "PostTightMassCuts")); _data.push_back(locReaction); //Register the DReaction with the factory /**************************************************** n3pi_skim_recon Reaction Steps ****************************************************/ locReaction = new DReaction("n3pi_skim_recon"); //unique name, feel free to change //Required: DReactionSteps to specify the channel and decay chain you want to study //Particles are of type Particle_t, an enum defined in sim-recon/src/libraries/include/particleType.h //g, p -> pi+, pi+, pi-, (n) locReaction->Add_ReactionStep(locReactionStep); /**************************************************** n3pi_skim_recon Control Settings ****************************************************/ locReaction->Set_KinFitType(d_P4AndVertexFit); /**************************************************** n3pi_skim_recon 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 locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0)); locReaction->Add_AnalysisAction(new DHistogramAction_NumParticleCombos(locReaction)); locReaction->Add_AnalysisAction(new DCutAction_MissingMassSquared(locReaction, false, -3.0, 5.0)); locReaction->Add_AnalysisAction(new DHistogramAction_NumParticleCombos(locReaction, "PostLooseMassCut")); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0, "PostLooseMassCut")); locReaction->Add_AnalysisAction(new DCutAction_CombinedTrackingFOM(locReaction, 5.73303E-7)); locReaction->Add_AnalysisAction(new DHistogramAction_NumParticleCombos(locReaction, "PostTrackCut5Sigma")); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0, "PostTrackCut5Sigma")); locReaction->Add_AnalysisAction(new DCutAction_CombinedTrackingFOM(locReaction, 0.0027)); locReaction->Add_AnalysisAction(new DHistogramAction_NumParticleCombos(locReaction, "PostTrackCut3Sigma")); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0, "PostTrackCut3Sigma")); locReaction->Add_AnalysisAction(new DCutAction_AllTracksHaveDetectorMatch(locReaction)); locReaction->Add_AnalysisAction(new DHistogramAction_NumParticleCombos(locReaction, "PostDetectorMatches")); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0, "PostDetectorMatches")); locReaction->Add_AnalysisAction(new DCustomAction_CutCombinedPID_NoBCAL(locReaction, 5.73303E-7)); locReaction->Add_AnalysisAction(new DHistogramAction_NumParticleCombos(locReaction, "PostPIDCut5Sigma")); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0, "PostPIDCut5Sigma")); locReaction->Add_AnalysisAction(new DCustomAction_CutCombinedPID_NoBCAL(locReaction, 0.0027)); locReaction->Add_AnalysisAction(new DHistogramAction_NumParticleCombos(locReaction, "PostPIDCut3Sigma")); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0, "PostPIDCut3Sigma")); locReaction->Add_AnalysisAction(new DHistogramAction_KinFitResults(locReaction, 0.05)); locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.0)); locReaction->Add_AnalysisAction(new DHistogramAction_NumParticleCombos(locReaction, "KinFitConverges")); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0, "KinFitConverges")); locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.01)); locReaction->Add_AnalysisAction(new DHistogramAction_NumParticleCombos(locReaction, "PostKinFitCut1")); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 4000, -3.0, 5.0, "PostKinFitCut1")); locReaction->Add_AnalysisAction(new DCustomAction_TrackPStudies(locReaction)); locReaction->Add_AnalysisAction(new DCutAction_MissingMassSquared(locReaction, false, 0.0, 1.9)); locReaction->Add_AnalysisAction(new DHistogramAction_NumParticleCombos(locReaction, "PostTightMassCuts")); locReaction->Add_AnalysisAction(new DCustomAction_TrackPStudies(locReaction, "PostTightMassCuts")); _data.push_back(locReaction); //Register the DReaction with the factory return NOERROR; } //------------------ // fini //------------------ jerror_t DReaction_factory_n3pi_skim::fini(void) { for(size_t loc_i = 0; loc_i < dReactionStepPool.size(); ++loc_i) delete dReactionStepPool[loc_i]; //cleanup memory return NOERROR; }