// $Id$ // // File: DReaction_factory_KsHunt.cc // Created: Wed Jan 21 16:28:09 EST 2015 // Creator: jrsteven (on Linux ifarm1401 2.6.32-431.el6.x86_64 x86_64) // #include "DReaction_factory_KsHunt.h" //------------------ // init //------------------ jerror_t DReaction_factory_KsHunt::init(void) { // Make as many DReaction objects as desired DReactionStep* locReactionStep = NULL; DReaction* locReaction = new DReaction("KsHunt"); //needs to be a unique name for each DReaction object, CANNOT (!) be "Thrown" /**************************************************** KsHunt 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- X locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Gamma); locReactionStep->Set_TargetParticleID(Proton); locReactionStep->Add_FinalParticleID(PiPlus); locReactionStep->Add_FinalParticleID(PiMinus); locReactionStep->Add_FinalParticleID(Unknown, true); //true: proton missing locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak /**************************************************** KsHunt 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_KsHunt.root"); //string is file name (must end in ".root"!!): doen't need to be unique, feel free to change /************************************************** KsHunt 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); /**************************************************** KsHunt Analysis Actions ****************************************************/ // POCA cut on all tracks // locReaction->Add_AnalysisAction(new DCutAction_AllVertexZ(locReaction, 50., 80.)); // PID (not very useful currently) locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); // Custom cut on tagger/SC timing coincidence (5 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 KsHunt (no KinFit cut) locReaction->Add_AnalysisAction(new DCustomAction_KsHunt_hists(locReaction, false, "Measured")); locReaction->Add_AnalysisAction(new DCustomAction_KsHunt_hists(locReaction, true, "KinFit")); // Require KinFit converges // locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.0)); // Custom histograms for KsHunt (after KinFit convergence) locReaction->Add_AnalysisAction(new DCustomAction_KsHunt_hists(locReaction, false, "Converge_Measured")); locReaction->Add_AnalysisAction(new DCustomAction_KsHunt_hists(locReaction, true, "Converge_KinFit")); // Require KinFit FOM > 0.1 // locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.1)); // Custom histograms for KsHunt (after KinFit FOM > 10%) locReaction->Add_AnalysisAction(new DCustomAction_KsHunt_hists(locReaction, false, "Cut10_Measured")); locReaction->Add_AnalysisAction(new DCustomAction_KsHunt_hists(locReaction, true, "Cut10_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_KsHunt::fini(void) { for(size_t loc_i = 0; loc_i < dReactionStepPool.size(); ++loc_i) delete dReactionStepPool[loc_i]; //cleanup memory return NOERROR; }