// $Id$ // // File: DReaction_factory_eta.cc // Created: Tue Apr 26 09:32:58 EDT 2016 // Creator: staylor (on Linux ifarm1401 2.6.32-431.el6.x86_64 x86_64) // #include "DReaction_factory_eta.h" #include "DAnalysisActionEtaPrime.h" #include "DAnalysisActionEta.h" #include "DAnalysisActionEtaDalitz.h" jerror_t DReaction_factory_eta::CreateReaction(vector&final_state_particles, string ReactionName, bool constrain_mass){ DReaction* locReaction=new DReaction(ReactionName); DReactionStep* locReactionStep; //g, p -> p, X locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Gamma); locReactionStep->Set_TargetParticleID(Proton); locReactionStep->Add_FinalParticleID(Proton); locReactionStep->Add_FinalParticleID(Eta); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //prevent memory leak locReactionStep = new DReactionStep(); locReactionStep->Set_InitialParticleID(Eta); if (constrain_mass==false){ locReactionStep->Set_KinFitConstrainInitMassFlag(false); } for (unsigned int i=0;iAdd_FinalParticleID(final_state_particles[i]); } locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //prevent memory leak // Decay of pi0's int num_pi0=0,num_gamma=0,num_pip=0,num_pim=0; for (unsigned int i=0;iSet_InitialParticleID(Pi0); locReactionStep->Add_FinalParticleID(Gamma); locReactionStep->Add_FinalParticleID(Gamma); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //prevent memory leak break; default: break; } } //locReaction->Set_KinFitType(d_P4AndVertexFit); locReaction->Set_KinFitType(d_P4Fit); if (num_pip>0){ locReaction->Set_EventStoreSkims("2q+,q-,q0"); //boolean-AND of skims } if (num_pip==0 && num_pim==0 && num_gamma==3){ locReaction->Set_EventStoreSkims("3q0"); //boolean-AND of skims } if (num_pip==0 && num_pim==0 && num_gamma==4){ locReaction->Set_EventStoreSkims("4q0"); //boolean-AND of skims } if (num_pip==0 && num_pim==0 && num_pi0==0 && num_gamma==2){ locReaction->Set_EventStoreSkims("2q0"); //boolean-AND of skims } if (num_pip==0 && num_pim==0 && num_pi0==0 && num_gamma==6){ locReaction->Set_EventStoreSkims("6q0"); //boolean-AND of skims } locReaction->Set_MaxPhotonRFDeltaT(0.5*dBeamBunchPeriod); locReaction->Set_MaxExtraGoodTracks(0); //locReaction->Set_MaxNumBeamPhotonsInBunch(1); // Highly Recommended: When generating particle combinations, reject all photon candidates with a PID confidence level < 5.73303E-7 (+/- 5-sigma) //locReaction->Set_MinPhotonPIDFOM(5.73303E-7); // Highly Recommended: When generating particle combinations, reject all charged track candidates with a PID confidence level < 5.73303E-7 (+/- 5-sigma) //locReaction->Set_MinChargedPIDFOM(5.73303E-7); // Hist PID locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); // PID Cuts //locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 1.0, Unknown, SYS_NULL)); //false: measured data //Unknown: All PIDs //SYS_NULL: All systems //locReaction->Add_AnalysisAction(new DCutAction_ProtonPiPlusdEdx(locReaction, 2.2, true)); //select p/pi+ above/below 2.2, //true/false: cut all/no proton candidates above p = 1 GeV/c // PID & Kinematics locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 0.75, KPlus, SYS_TOF)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.5, KPlus, SYS_BCAL)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 3.0, KPlus, SYS_FCAL)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.0, PiMinus, SYS_TOF)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 2.5, PiMinus, SYS_BCAL)); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 3.0, PiMinus, SYS_FCAL)); //false: measured data 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, 3.0, Proton, 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")); // Kinematic Fit Results locReaction->Add_AnalysisAction(new DHistogramAction_KinFitResults(locReaction, 0.05)); //5% confidence level cut on pull histograms only locReaction->Add_AnalysisAction(new DCutAction_KinFitFOM(locReaction, 0.01)); // Missing Mass Squared locReaction->Add_AnalysisAction(new DHistogramAction_MissingMassSquared(locReaction, false, 1000, -0.1, 0.1)); locReaction->Add_AnalysisAction(new DCutAction_MissingMassSquared(locReaction, false, -0.1, 0.1)); // Invariant mass if (num_pi0>0){ locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, Pi0, false,500, 0.0, 1.0, "Pi0_PostPID")); } locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, Eta, false, 1250, 0., 2.5, "Eta_PostKinFit")); locReaction->Add_AnalysisAction(new DHistogramAction_InvariantMass(locReaction, Eta, true, 1250, 0., 2.5, "Eta_KinFit")); // Custom actions if (num_pi0==1 && num_gamma==2){ locReaction->Add_AnalysisAction(new DAnalysisActionEta(locReaction)); } if (num_pi0==3 || (num_pi0==1 && num_pim==1 && num_pip==1)){ locReaction->Add_AnalysisAction(new DAnalysisActionEtaDalitz(locReaction)); } //locReaction->Add_AnalysisAction(new DAnalysisActionEtaPrime(locReaction)); locReaction->Enable_TTreeOutput("tree_eta.root"); //string is file name (must end in ".root"!!): doen't need to be unique, feel free to change _data.push_back(locReaction); return NOERROR; } //------------------ // brun //------------------ jerror_t DReaction_factory_eta::brun(JEventLoop* locEventLoop, int32_t locRunNumber) { vector locBeamPeriodVector; locEventLoop->GetCalib("PHOTON_BEAM/RF/beam_period", locBeamPeriodVector); dBeamBunchPeriod = locBeamPeriodVector[0]; return NOERROR; } //------------------ // evnt //------------------ jerror_t DReaction_factory_eta::evnt(JEventLoop* locEventLoop, uint64_t locEventNumber) { vectorfinal_state_particles; final_state_particles.clear(); final_state_particles.push_back(Gamma); final_state_particles.push_back(Gamma); final_state_particles.push_back(Gamma); final_state_particles.push_back(Gamma); CreateReaction(final_state_particles,"eta_4g"); final_state_particles.clear(); final_state_particles.push_back(Gamma); final_state_particles.push_back(Gamma); final_state_particles.push_back(Gamma); CreateReaction(final_state_particles,"eta_3g"); /* final_state_particles.clear(); for (unsigned int i=0;i<6;i++){ final_state_particles.push_back(Gamma); } CreateReaction(final_state_particles,"eta_6g"); */ final_state_particles.clear(); final_state_particles.push_back(Pi0); final_state_particles.push_back(PiPlus); final_state_particles.push_back(PiMinus); CreateReaction(final_state_particles,"eta_pi0pi+pi-"); final_state_particles.clear(); final_state_particles.push_back(Pi0); final_state_particles.push_back(PiPlus); final_state_particles.push_back(PiMinus); CreateReaction(final_state_particles,"eta_pi0pi+pi-_constrained",true); final_state_particles.clear(); final_state_particles.push_back(Gamma); final_state_particles.push_back(PiPlus); final_state_particles.push_back(PiMinus); CreateReaction(final_state_particles,"eta_gpi+pi-"); final_state_particles.clear(); final_state_particles.push_back(Gamma); final_state_particles.push_back(Gamma); CreateReaction(final_state_particles,"eta_2g"); return NOERROR; } //------------------ // fini //------------------ jerror_t DReaction_factory_eta::fini(void) { for(size_t loc_i = 0; loc_i < dReactionStepPool.size(); ++loc_i) delete dReactionStepPool[loc_i]; //cleanup memory return NOERROR; }