// $Id$ // // File: DReaction_factory_pppmp0.cc // Created: Tue Aug 6 10:51:29 EDT 2013 // Creator: yqiang (on Linux halldw1.jlab.org 2.6.32-358.11.1.el6.x86_64 x86_64) // #include "DReaction_factory_pppmp0.h" //------------------ // init //------------------ jerror_t DReaction_factory_pppmp0::init(void) { // Make as many DReaction objects as desired DReactionStep* locReactionStep = NULL; DReaction* locReaction = new DReaction("pppmp0"); //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 /**************************************************** pppmp0 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 //Example: g, p -> pi+, pi-, pi0, (p) locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Gamma); locReactionStep->Set_TargetParticleID(Proton); locReactionStep->Add_FinalParticleID(PiPlus); locReactionStep->Add_FinalParticleID(PiMinus); locReactionStep->Add_FinalParticleID(Pi0); locReactionStep->Add_FinalParticleID(Proton, true); //true: proton missing locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak //Example: pi0 -> g, g locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Pi0); locReactionStep->Add_FinalParticleID(Gamma); locReactionStep->Add_FinalParticleID(Gamma); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak */ // g p -> pi+ pi- p0 (p) locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Gamma); locReactionStep->Set_TargetParticleID(Proton); locReactionStep->Add_FinalParticleID(PiPlus); locReactionStep->Add_FinalParticleID(PiMinus); locReactionStep->Add_FinalParticleID(Pi0); locReactionStep->Add_FinalParticleID(Proton, true); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); // pi0 -> g g locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Pi0); locReactionStep->Add_FinalParticleID(Gamma); locReactionStep->Add_FinalParticleID(Gamma); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); /**************************************************** pppmp0 Control Variables ****************************************************/ // 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/DKinFitResults.h // locReaction->Set_KinFitType(d_P4AndVertexFit); //simultaneously constrain apply four-momentum conservation, invariant masses, and common-vertex constraints // Optional: When generating particle combinations, reject all combinations with a combined tracking confidence level < 0.1% (or any custom number) // locReaction->Set_MinCombinedTrackingFOM(0.001); // Recommended: Enable ROOT TTree output for this DReaction // locReaction->Enable_TTreeOutput("tree_pppmp0.root"); //string is file name (must end in ".root"!!): doen't need to be unique, feel free to change locReaction->Set_KinFitType(d_P4AndVertexFit); locReaction->Set_MinCombinedPIDFOM(0.001); locReaction->Set_MinCombinedTrackingFOM(0.001); locReaction->Enable_TTreeOutput("tree_pppmp0.root"); /**************************************************** pppmp0 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 DHistogramAction_TruePID(locReaction)); //momentum distributions of tracks with true/false PID (if thrown data available) // Kinematic Fit Results locReaction->Add_AnalysisAction(new DHistogramAction_KinFitResults(locReaction, 0.05)); //5% confidence level cut on pull histograms only // Kinematics locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); //false: fill histograms with measured particle data locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, true, "KinFit")); //true: fill histograms with kinematic-fit particle data //"KinFit": unique name since action type is repeated locReaction->Add_AnalysisAction(new DHistogramAction_TrackVertexComparison(locReaction)); */ // PID locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); locReaction->Add_AnalysisAction(new DHistogramAction_TruePID(locReaction)); locReaction->Add_AnalysisAction(new DCutAction_CombinedPIDFOM(locReaction, 0.01)); //1% locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, Pi0, false, 300, 0, 0.3, "PreKin")); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction, false, 200, 0., 2.0, "PreKin")); // Kin fit results locReaction->Add_AnalysisAction(new DHistogramAction_KinFitResults(locReaction, 0.05)); locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.01)); //1% // Kinematics locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, true, "KinFit")); locReaction->Add_AnalysisAction(new DHistogramAction_TrackVertexComparison(locReaction)); // Mass distribution locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, Pi0, false, 300, 0., 0.3, "PostKin_Measured")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, Pi0, true, 300, 0., 0.3, "PostKin")); _data.push_back(locReaction); //Register the DReaction with the factory return NOERROR; } //------------------ // fini //------------------ jerror_t DReaction_factory_pppmp0::fini(void) { for(size_t loc_i = 0; loc_i < dReactionStepPool.size(); ++loc_i) delete dReactionStepPool[loc_i]; //cleanup memory return NOERROR; }