// $Id$ // // File: DReaction_factory_sdobbs_pi0_dalitz.cc // Created: Wed Mar 11 20:34:22 EDT 2015 // #include "DReaction_factory_sdobbs_pi0_dalitz.h" #include "DCustomAction_sdobbs_pi0_dalitz.h" #include "DCustomAction_dEdxCut.h" //------------------ // brun //------------------ jerror_t DReaction_factory_sdobbs_pi0_dalitz::brun(JEventLoop* locEventLoop, int32_t locRunNumber) { vector locBeamPeriodVector; locEventLoop->GetCalib("PHOTON_BEAM/RF/beam_period", locBeamPeriodVector); dBeamBunchPeriod = locBeamPeriodVector[0]; return NOERROR; } //------------------ // init //------------------ //jerror_t DReaction_factory_sdobbs_pi0_dalitz::init(void) jerror_t DReaction_factory_sdobbs_pi0_dalitz::evnt(JEventLoop* locEventLoop, uint64_t locEventNumber) { // Make as many DReaction objects as desired DReactionStep* locReactionStep = NULL; DReaction* locReaction; // DOCUMENTATION: // ANALYSIS library: https://halldweb1.jlab.org/wiki/index.php/GlueX_Analysis_Software // DReaction factory: https://halldweb1.jlab.org/wiki/index.php/Analysis_DReaction /**************************************************** dalitz_preco Reaction Steps ****************************************************/ locReaction = new DReaction("pi0_dalitz_preco"); //needs to be a unique name for each DReaction object, CANNOT (!) be "Thrown" // g, p -> pi0, p locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Gamma); locReactionStep->Set_TargetParticleID(Proton); locReactionStep->Add_FinalParticleID(Pi0); locReactionStep->Add_FinalParticleID(Proton); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak // pi0 -> e+ e- gamma locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Pi0); locReactionStep->Add_FinalParticleID(Electron); locReactionStep->Add_FinalParticleID(Positron); locReactionStep->Add_FinalParticleID(Gamma); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak /**************************************************** dalitz_preco Control Settings ****************************************************/ locReaction->Set_KinFitType(d_P4AndVertexFit); //simultaneously constrain apply four-momentum conservation, invariant masses, and common-vertex constraints locReaction->Set_EventStoreSkims("ee"); //boolean-AND of skims // 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 // 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(5); // Highly Recommended: Enable ROOT TTree output for this DReaction locReaction->Enable_TTreeOutput("tree_sdobbs_pi0_dalitz.root"); //string is file name (must end in ".root"!!): doen't need to be unique, feel free to change /************************************************** dalitz_preco Pre-Combo Custom Cuts *************************************************/ // Highly Recommended: Very loose invariant mass cuts, applied during DParticleComboBlueprint construction locReaction->Set_InvariantMassCut(Pi0, 0.05, 0.3); // Highly Recommended: Very loose DAnalysisAction cuts, applied just after creating the combination (before saving it) // Example: Missing mass squared of proton locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMassSquared(locReaction, false, -0.1, 0.1)); locReaction->Add_ComboPreSelectionAction(new DCutAction_AllVertexZ(locReaction, 40, 100)); /**************************************************** dalitz_preco Analysis Actions ****************************************************/ // PID locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.5, Proton, SYS_TOF)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.5, Proton, SYS_BCAL)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.5, Proton, SYS_FCAL)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 1.0, Electron, SYS_TOF)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.5, Electron, SYS_BCAL)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.4, Electron, SYS_FCAL)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 1.0, Positron, SYS_TOF)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.5, Positron, SYS_BCAL)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.4, Positron, SYS_FCAL)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 3.0, Gamma, SYS_BCAL)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.5, Gamma, SYS_FCAL)); //false: measured data locReaction->Add_AnalysisAction(new DCustomAction_dEdxCut(locReaction, false)); //false: focus on keeping signal locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction, "PostPIDCuts")); //Kinematics Pre-Pi0Cut //locReaction->Add_AnalysisAction(new DHistogramAction_TrackVertexComparison(locReaction)); //locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false)); // Missing Pt locReaction->Add_AnalysisAction(new DHistogramAction_MissingTransverseMomentum(locReaction, false, 500, 0.0, 1.0)); locReaction->Add_AnalysisAction(new DCutAction_TransverseMomentum(locReaction, 0.4)); // Missing Mass Squared (Hist and Cut) locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 600, -0.06, 0.06)); locReaction->Add_AnalysisAction(new DCutAction_MissingMassSquared(locReaction, false, -0.03, 0.03)); // Omega Mass (Hist and Cut) locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, Pi0, true, 500, 0.0, 1.0, "pi0_NoKinfit")); //locReaction->Add_AnalysisAction(new DCutAction_InvariantMass(locReaction, Pi0, true, 0.1, 0.16)); //locReaction->Add_AnalysisAction(new DCustomAction_sdobbs_pi0_dalitz(locReaction, false)); locReaction->Add_AnalysisAction(new DHistogramAction_KinFitResults(locReaction,0.05)); //See what results look like pre-KF // Kinematics of final selection locReaction->Add_AnalysisAction(new DHistogramAction_ParticleComboKinematics(locReaction, false, "Final")); //false: fill histograms with measured particle data _data.push_back(locReaction); //Register the DReaction with the factory return NOERROR; } //------------------ // fini //------------------ jerror_t DReaction_factory_sdobbs_pi0_dalitz::fini(void) { for(size_t loc_i = 0; loc_i < dReactionStepPool.size(); ++loc_i) delete dReactionStepPool[loc_i]; //cleanup memory return NOERROR; }