// $Id$ // // File: DReaction_factory_p3pi.cc // Created: Wed Jan 21 16:43:30 EST 2015 // Creator: jrsteven (on Linux ifarm1401 2.6.32-431.el6.x86_64 x86_64) // #include "DReaction_factory_p3pi.h" //------------------ // init //------------------ jerror_t DReaction_factory_p3pi::init(void) { // Make as many DReaction objects as desired DReactionStep* locReactionStep = NULL; DReaction* locReaction = new DReaction("p3pi"); //needs to be a unique name for each DReaction object, CANNOT (!) be "Thrown" /**************************************************** p3pi 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 -> omega (p) locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Gamma); locReactionStep->Set_TargetParticleID(Proton); locReactionStep->Add_FinalParticleID(omega); 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 // omega -> pi+, pi-, pi0 locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(omega); locReactionStep->Add_FinalParticleID(PiPlus); locReactionStep->Add_FinalParticleID(PiMinus); locReactionStep->Add_FinalParticleID(Pi0); locReactionStep->Set_ApplyKinFitMassConstraintOnInitialParticleFlag(false); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak // pi0 -> g, g locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Pi0); locReactionStep->Add_FinalParticleID(Gamma); locReactionStep->Add_FinalParticleID(Gamma); locReactionStep->Set_ApplyKinFitMassConstraintOnInitialParticleFlag(false); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak /**************************************************** p3pi 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/DKinFitResults.h locReaction->Set_KinFitType(d_P4AndVertexFit); //simultaneously constrain apply four-momentum conservation, invariant masses, and common-vertex constraints // Recommended: Enable ROOT TTree output for this DReaction locReaction->Enable_TTreeOutput("tree_p3pi.root"); //string is file name (must end in ".root"!!): doen't need to be unique, feel free to change /************************************************** p3pi Pre-Combo Custom Cuts *************************************************/ // Highly Recommended: Very loose invariant mass cuts, applied during DParticleComboBlueprint construction // Example: pi0 -> g, g cut // locReaction->Set_InvariantMassCut(Pi0, 0.08, 0.19); /**************************************************** p3pi Analysis Actions ****************************************************/ // Match reco to truth particles (only for MC!) //locReaction->Add_AnalysisAction(new DCutAction_TrueCombo(locReaction, 0.0, true)); // Mock up of FCAL trigger //locReaction->Add_AnalysisAction(new DCustomAction_fcalTrigger(locReaction, false)); // POCA cut on all tracks locReaction->Add_AnalysisAction(new DCutAction_AllVertexZ(locReaction, 50., 80.)); // Pi0 invariant mass locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, Pi0, false,100,0.,1., "PreCut")); // Require 1 photon in FCAL and 1 photon in BCAL //locReaction->Add_AnalysisAction(new DCustomAction_Pi0Cuts(locReaction, false, 1)); // Require 2 photons in FCAL locReaction->Add_AnalysisAction(new DCustomAction_Pi0Cuts(locReaction, false, 2)); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, Pi0, false,100,0.,1., "PostCut")); // PID (not very useful currently) locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); // Custom cut on tagger/SC timing coincidence (2 ns gate currently) locReaction->Add_AnalysisAction(new DCustomAction_taggerCoincidence(locReaction, false, 2.)); // Kinematic Fit Results locReaction->Add_AnalysisAction(new DHistogramAction_KinFitResults(locReaction, 0.05)); // Custom histograms for p2pi (no KinFit cut) locReaction->Add_AnalysisAction(new DCustomAction_p3pi_hists(locReaction, false, "Measured")); locReaction->Add_AnalysisAction(new DCustomAction_p3pi_hists(locReaction, true, "KinFit")); // Require KinFit converges locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.0)); // Pi0 invariant mass plot (after KinFit convergence) locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, Pi0, false,100,0.,1., "Converge")); // Custom histograms for p2pi (after KinFit convergence) locReaction->Add_AnalysisAction(new DCustomAction_p3pi_hists(locReaction, false, "Converge_Measured")); locReaction->Add_AnalysisAction(new DCustomAction_p3pi_hists(locReaction, true, "Converge_KinFit")); // Require KinFit FOM > 0.1 locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.1)); // Pi0 invariant mass plot (after KinFit FOM > 10%) locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, Pi0, false,100,0.,1., "Cut10")); // Custom histograms for p2pi (after KinFit FOM > 10%) locReaction->Add_AnalysisAction(new DCustomAction_p3pi_hists(locReaction, false, "Cut10_Measured")); locReaction->Add_AnalysisAction(new DCustomAction_p3pi_hists(locReaction, true, "Cut10_KinFit")); // Pi0 mass cut locReaction->Add_AnalysisAction(new DCutAction_InvariantMass(locReaction, Pi0, false, 0.05, 0.20)); // Custom histograms for p2pi (after Pi0 mass cut) locReaction->Add_AnalysisAction(new DCustomAction_p3pi_hists(locReaction, false, "CutPi0_Measured")); locReaction->Add_AnalysisAction(new DCustomAction_p3pi_hists(locReaction, true, "CutPi0_KinFit")); // omega and missing mass distributions from default funcitons locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, omega, false, 200, 0., 2., "CutPi0_Measured")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, omega, true, 200, 0., 2., "CutPi0_KinFit")); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction, false, 200, 0., 4., "CutPi0_Measured")); locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction, true, 200, 0., 4., "CutPi0_KinFit")); // Kinematics of final selection locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, true, "KinFit")); locReaction->Add_AnalysisAction(new DHistogramAction_TrackVertexComparison(locReaction)); _data.push_back(locReaction); //Register the DReaction with the factory return NOERROR; } //------------------ // fini //------------------ jerror_t DReaction_factory_p3pi::fini(void) { for(size_t loc_i = 0; loc_i < dReactionStepPool.size(); ++loc_i) delete dReactionStepPool[loc_i]; //cleanup memory return NOERROR; }