// $Id$ // // File: DReaction_factory_incl_jpsi_lp.cc // Created: Tue Nov 1 11:08:05 EDT 2016 // Creator: pentchev (on Linux ifarm1102 2.6.32-431.el6.x86_64 x86_64) // #include "DReaction_factory_incl_jpsi_lp.h" //#include "DCustomAction_jpsi_hists.h" //------------------ // brun //------------------ jerror_t DReaction_factory_incl_jpsi_lp::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_incl_jpsi_lp::evnt(JEventLoop* locEventLoop, uint64_t locEventNumber) { // Make as many DReaction objects as desired DReactionStep* locReactionStep = NULL; DReaction* locReaction = NULL; //create with a unique name for each DReaction object. CANNOT (!) be "Thrown" // DOCUMENTATION: // ANALYSIS library: https://halldweb1.jlab.org/wiki/index.php/GlueX_Analysis_Software // DReaction factory: https://halldweb1.jlab.org/wiki/index.php/Analysis_DReaction /************************************************** incl_jpsi_lp_em (missing electron) Reaction Definition *************************************************/ locReaction = new DReaction("incl_jpsi_lp_em"); //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(); //initial locReactionStep->Set_InitialParticleID(Gamma); locReactionStep->Set_TargetParticleID(Proton); //final locReactionStep->Add_FinalParticleID(Proton); locReactionStep->Add_FinalParticleID(Positron); locReactionStep->Add_FinalParticleID(Electron,true); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak /**************************************************** incl_jpsi_lp Control Settings ****************************************************/ locReaction->Set_KinFitType(d_P4AndVertexFit); // 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(6); // Highly Recommended: Enable ROOT TTree output for this DReaction // string is file name (must end in ".root"!!): doen't need to be unique, feel free to change locReaction->Enable_TTreeOutput("tree_incl_jpsi_lp_em.root", true); //true/false: do/don't save unused hypotheses /************************************************** incl_jpsi_lp Pre-Combo Custom Cuts *************************************************/ // Highly Recommended: Very loose DAnalysisAction cuts, applied just after creating the combination (before saving it) // Example: Missing mass of proton locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMassSquared(locReaction, false, -1.00, 1.00)); /**************************************************** incl_jpsi_lp Analysis Actions ****************************************************/ // HISTOGRAM PID locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); // CUT PID // SYS_TOF, SYS_BCAL, SYS_FCAL, ...: DetectorSystem_t: Defined in libraries/include/GlueX.h // locReaction->Add_AnalysisAction(new DCutAction_EachPIDFOM(locReaction, 5.73303E-7)); // locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 1.0, Proton, SYS_TOF)); //cut at delta-t +/- 1.0 //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)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false, 2.5, Proton, SYS_FCAL)); 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)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false, 2.5, Electron, SYS_FCAL)); 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)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false, 2.5, Positron, SYS_FCAL)); //cold locReaction->Add_AnalysisAction(new DCutAction_TransverseMomentum(locReaction, 0.4)); //Max Missing Pt of 0.4 GeV locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction, 0, Proton, false, 100, 0, 5, "pre")); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_MissingMass(locReaction, 0, Proton, false, 2.2, 3.5, "rec. miss. mass cut")); //false: measured data //cold DCutAction_MissingMass(locReaction, 0, Proton, false, 0.8, 3.5, "rec. miss. mass cut")); //false: measured data locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction, 0, Proton, false, 100, 0, 5, "post")); //false: measured data //cold locReaction->Add_AnalysisAction(new DCustomAction_jpsi_hists(locReaction, false, "E/p cut")); locReaction->Add_AnalysisAction(new DCutAction_TrackShowerEOverP(locReaction, false, SYS_FCAL, Positron, 0.7, "EOverPcut")); locReaction->Add_AnalysisAction(new DCutAction_TrackShowerEOverP(locReaction, false, SYS_BCAL, Positron, 0.7, "EOverPcut")); _data.push_back(locReaction); //Register the DReaction with the factory /************************************************** incl_jpsi_lp_ep (missing positron) Reaction Definition *************************************************/ locReaction = new DReaction("incl_jpsi_lp_ep"); //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(); //initial locReactionStep->Set_InitialParticleID(Gamma); locReactionStep->Set_TargetParticleID(Proton); //final locReactionStep->Add_FinalParticleID(Proton); locReactionStep->Add_FinalParticleID(Electron); locReactionStep->Add_FinalParticleID(Positron,true); locReaction->Add_ReactionStep(locReactionStep); dReactionStepPool.push_back(locReactionStep); //register so will be deleted later: prevent memory leak /**************************************************** incl_jpsi_lp Control Settings ****************************************************/ locReaction->Set_KinFitType(d_P4AndVertexFit); // 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(6); // Highly Recommended: Enable ROOT TTree output for this DReaction // string is file name (must end in ".root"!!): doen't need to be unique, feel free to change locReaction->Enable_TTreeOutput("tree_incl_jpsi_lp_ep.root", true); //true/false: do/don't save unused hypotheses /************************************************** incl_jpsi_lp Pre-Combo Custom Cuts *************************************************/ // Highly Recommended: Very loose DAnalysisAction cuts, applied just after creating the combination (before saving it) // Example: Missing mass of proton //cold locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMassSquared(locReaction, false, -0.25, 0.25)); locReaction->Add_ComboPreSelectionAction(new DCutAction_MissingMassSquared(locReaction, false, -1.00, 1.00)); /**************************************************** incl_jpsi_lp Analysis Actions ****************************************************/ // HISTOGRAM PID locReaction->Add_AnalysisAction(new DHistogramAction_PID(locReaction)); // CUT PID // SYS_TOF, SYS_BCAL, SYS_FCAL, ...: DetectorSystem_t: Defined in libraries/include/GlueX.h // locReaction->Add_AnalysisAction(new DCutAction_EachPIDFOM(locReaction, 5.73303E-7)); // locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction, false, 1.0, Proton, SYS_TOF)); //cut at delta-t +/- 1.0 //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)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false, 2.5, Proton, SYS_FCAL)); 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)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false, 2.5, Electron, SYS_FCAL)); 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)); locReaction->Add_AnalysisAction(new DCutAction_PIDDeltaT(locReaction,false, 2.5, Positron, SYS_FCAL)); //cold locReaction->Add_AnalysisAction(new DCutAction_TransverseMomentum(locReaction, 0.4)); //Max Missing Pt of 0.4 GeV locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction, 0, Proton, false, 100, 0, 5, "pre")); //false: measured data locReaction->Add_AnalysisAction(new DCutAction_MissingMass(locReaction, 0, Proton, false, 2.2, 3.5, "rec. miss. mass cut")); //false: measured data //cold DCutAction_MissingMass(locReaction, 0, Proton, false, 0.8, 3.5, "rec. miss. mass cut")); //false: measured data locReaction->Add_AnalysisAction(new DHistogramAction_MissingMass(locReaction, 0, Proton, false, 100, 0, 5, "post")); //false: measured data //cold locReaction->Add_AnalysisAction(new DCustomAction_jpsi_hists(locReaction, false, "E/p cut")); locReaction->Add_AnalysisAction(new DCutAction_TrackShowerEOverP(locReaction, false, SYS_FCAL, Electron, 0.7, "EOverPcut")); locReaction->Add_AnalysisAction(new DCutAction_TrackShowerEOverP(locReaction, false, SYS_BCAL, Electron, 0.7, "EOverPcut")); _data.push_back(locReaction); //Register the DReaction with the factory return NOERROR; } //------------------ // fini //------------------ jerror_t DReaction_factory_incl_jpsi_lp::fini(void) { for(size_t loc_i = 0; loc_i < dReactionStepPool.size(); ++loc_i) delete dReactionStepPool[loc_i]; //cleanup memory return NOERROR; }