BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EventPreSelect.cxx
Go to the documentation of this file.
1#include "Gaudi/Sequence.h"
2#include <Gaudi/Property.h>
3#include <GaudiKernel/StatusCode.h>
4#include <string>
5
6class EventPreSelect : public Gaudi::Sequence {
7public:
8 using Gaudi::Sequence::Sequence;
9
10 StatusCode initialize() override {
11 info() << "In initialize()" << endmsg;
12 StatusCode sc = StatusCode::SUCCESS;
13
14 if ( m_writeDst ) sc &= createSubAlgorithm( "EventWriter", "WriteDst", m_writeDstAlg );
15 if ( m_writeRec ) sc &= createSubAlgorithm( "EventWriter", "WriteRec", m_writeRecAlg );
16
17 sc &= createSubAlgorithm( "EventPreSelectAlg", "EventPreSelectAlg", m_evtPreSelAlg );
18 m_evtPreSelAlg->setProperty( "Output", m_output ).ignore();
19 m_evtPreSelAlg->setProperty( "Ecm", m_ecm ).ignore();
20 m_evtPreSelAlg->setProperty( "SelectBhabha", m_selectBhabha ).ignore();
21 m_evtPreSelAlg->setProperty( "SelectDimu", m_selectDimu ).ignore();
22 m_evtPreSelAlg->setProperty( "SelectHadron", m_selectHadron ).ignore();
23 m_evtPreSelAlg->setProperty( "SelectDiphoton", m_selectDiphoton ).ignore();
24 m_evtPreSelAlg->setProperty( "WriteDst", m_writeDst ).ignore();
25 m_evtPreSelAlg->setProperty( "WriteRec", m_writeRec ).ignore();
26 m_evtPreSelAlg->setProperty( "Vr0cut", m_vr0cut ).ignore();
27 m_evtPreSelAlg->setProperty( "Vz0cut", m_vz0cut ).ignore();
28 m_evtPreSelAlg->setProperty( "Pt0HighCut", m_pt0HighCut ).ignore();
29 m_evtPreSelAlg->setProperty( "Pt0LowCut", m_pt0LowCut ).ignore();
30 m_evtPreSelAlg->setProperty( "EnergyThreshold", m_energyThreshold ).ignore();
31 m_evtPreSelAlg->setProperty( "GammaPhiCut", m_gammaPhiCut ).ignore();
32 m_evtPreSelAlg->setProperty( "GammaThetaCut", m_gammaThetaCut ).ignore();
33 m_evtPreSelAlg->setProperty( "BhabhaEmcECut", m_bhabhaEmcECut ).ignore();
34 m_evtPreSelAlg->setProperty( "BhabhaMaxECut", m_bhabhaMaxECut ).ignore();
35 m_evtPreSelAlg->setProperty( "BhabhaSecECut", m_bhabhaSecECut ).ignore();
36 m_evtPreSelAlg->setProperty( "BhabhaDTheCut", m_bhabhaDTheCut ).ignore();
37 m_evtPreSelAlg->setProperty( "BhabhaDPhiCut1", m_bhabhaDPhiCut1 ).ignore();
38 m_evtPreSelAlg->setProperty( "BhabhaDPhiCut2", m_bhabhaDPhiCut2 ).ignore();
39 m_evtPreSelAlg->setProperty( "BhabhaDPhiCut3", m_bhabhaDPhiCut3 ).ignore();
40 m_evtPreSelAlg->setProperty( "BhabhaDPhiCut4", m_bhabhaDPhiCut4 ).ignore();
41 m_evtPreSelAlg->setProperty( "BhabhaMdcHitCutB", m_bhabhaMdcHitCutB ).ignore();
42 m_evtPreSelAlg->setProperty( "BhabhaMdcHitCutE", m_bhabhaMdcHitCutE ).ignore();
43 m_evtPreSelAlg->setProperty( "DimuEHighCut", m_dimuEHighCut ).ignore();
44 m_evtPreSelAlg->setProperty( "DimuELowCut", m_dimuELowCut ).ignore();
45 m_evtPreSelAlg->setProperty( "DimuDTheCut", m_dimuDTheCut ).ignore();
46 m_evtPreSelAlg->setProperty( "DimuDPhiCut", m_dimuDPhiCut ).ignore();
47 m_evtPreSelAlg->setProperty( "HadronChaECut", m_hadronChaECut ).ignore();
48 m_evtPreSelAlg->setProperty( "HadronNeuECut", m_hadronNeuECut ).ignore();
49 m_evtPreSelAlg->setProperty( "DiphotonEmcECut", m_diphotonEmcECut ).ignore();
50 m_evtPreSelAlg->setProperty( "DiphotonSecECut", m_diphotonSecECut ).ignore();
51 m_evtPreSelAlg->setProperty( "DiphotonDTheCut", m_diphotonDTheCut ).ignore();
52 m_evtPreSelAlg->setProperty( "DiphotonDPhiCut1", m_diphotonDPhiCut1 ).ignore();
53 m_evtPreSelAlg->setProperty( "DiphotonDPhiCut2", m_diphotonDPhiCut2 ).ignore();
54
55 sc = Gaudi::Sequence::initialize();
56 if ( sc.isFailure() )
57 {
58 error() << "Failed to initialize EventPreSelect" << endmsg;
59 return sc;
60 }
61
62 return StatusCode::SUCCESS;
63 }
64
65 StatusCode execute( const EventContext& ctx ) const override {
66 info() << "In execute" << endmsg;
67
68 StatusCode sc = StatusCode::SUCCESS;
69
70 if ( m_writeDst ) sc &= m_writeDstAlg->sysExecute( ctx ).ignore();
71 if ( m_writeRec ) sc &= m_writeDstAlg->sysExecute( ctx ).ignore();
72 sc &= m_evtPreSelAlg->sysExecute( ctx );
73
74 return sc;
75 }
76
77private:
78 Algorithm* m_evtPreSelAlg{ nullptr };
79 Algorithm* m_writeDstAlg{ nullptr };
80 Algorithm* m_writeRecAlg{ nullptr };
81
82 /* Properties */
83 BooleanProperty m_output{ this, "Output", false };
84 DoubleProperty m_ecm{ this, "Ecm", 3.686 };
85 BooleanProperty m_selectBhabha{ this, "SelectBhabha", false };
86 BooleanProperty m_selectDimu{ this, "SelectDimu", false };
87 BooleanProperty m_selectHadron{ this, "SelectHadron", false };
88 BooleanProperty m_selectDiphoton{ this, "SelectDiphoton", false };
89 BooleanProperty m_writeDst{ this, "WriteDst", false };
90 BooleanProperty m_writeRec{ this, "WriteRec", false };
91 DoubleProperty m_vr0cut{ this, "Vr0cut", 1.0 };
92 DoubleProperty m_vz0cut{ this, "Vz0cut", 5.0 };
93 DoubleProperty m_pt0HighCut{ this, "Pt0HighCut", 5.0 };
94 DoubleProperty m_pt0LowCut{ this, "Pt0LowCut", 0.05 };
95 DoubleProperty m_energyThreshold{ this, "EnergyThreshold", 0.05 };
96 DoubleProperty m_gammaPhiCut{ this, "GammaPhiCut", 20.0 };
97 DoubleProperty m_gammaThetaCut{ this, "GammaThetaCut", 20.0 };
98
99 DoubleProperty m_bhabhaEmcECut{ this, "BhabhaEmcECut", 0.7 * m_ecm };
100 DoubleProperty m_bhabhaMaxECut{ this, "BhabhaMaxECut", 0.3 * m_ecm };
101 DoubleProperty m_bhabhaSecECut{ this, "BhabhaSecECut", 0.1 * m_ecm };
102 DoubleProperty m_bhabhaDTheCut{ this, "BhabhaDTheCut", 3. };
103 DoubleProperty m_bhabhaDPhiCut1{ this, "BhabhaDPhiCut1", -25. };
104 DoubleProperty m_bhabhaDPhiCut2{ this, "BhabhaDPhiCut2", -4. };
105 DoubleProperty m_bhabhaDPhiCut3{ this, "BhabhaDPhiCut3", 2. };
106 DoubleProperty m_bhabhaDPhiCut4{ this, "BhabhaDPhiCut4", 20. };
107 IntegerProperty m_bhabhaMdcHitCutB{ this, "BhabhaMdcHitCutB", 15 };
108 IntegerProperty m_bhabhaMdcHitCutE{ this, "BhabhaMdcHitCutE", 5 };
109
110 DoubleProperty m_dimuEHighCut{ this, "DimuEHighCut", 0.27 * m_ecm };
111 DoubleProperty m_dimuELowCut{ this, "DimuELowCut", 0.027 * m_ecm };
112 DoubleProperty m_dimuDTheCut{ this, "DimuDTheCut", 3. };
113 DoubleProperty m_dimuDPhiCut{ this, "DimuDPhiCut", 23. };
114
115 DoubleProperty m_hadronChaECut{ this, "HadronChaECut", 0.3 * m_ecm };
116 DoubleProperty m_hadronNeuECut{ this, "HadronNeuECut", 0.3 * m_ecm };
117
118 DoubleProperty m_diphotonEmcECut{ this, "DiphotonEmcECut", 0.7 * m_ecm };
119 DoubleProperty m_diphotonSecECut{ this, "DiphotonSecECut", 0.3 * m_ecm };
120 DoubleProperty m_diphotonDTheCut{ this, "DiphotonDTheCut", 3. };
121 DoubleProperty m_diphotonDPhiCut1{ this, "DiphotonDPhiCut1", -4. };
122 DoubleProperty m_diphotonDPhiCut2{ this, "DiphotonDPhiCut2", 2. };
123};
124
DECLARE_COMPONENT(BesBdkRc)
StatusCode execute(const EventContext &ctx) const override
StatusCode initialize() override