9#include <analysis/ContinuumSuppression/ContinuumSuppression.h>
10#include <analysis/ContinuumSuppression/Thrust.h>
11#include <analysis/ContinuumSuppression/KsfwMoments.h>
12#include <analysis/ContinuumSuppression/FoxWolfram.h>
13#include <analysis/ContinuumSuppression/CleoCones.h>
14#include <analysis/dataobjects/RestOfEvent.h>
15#include <analysis/dataobjects/ContinuumSuppression.h>
16#include <analysis/utility/PCmsLabTransform.h>
17#include <framework/datastore/StoreArray.h>
18#include <framework/logging/Logger.h>
21#include <Math/Vector3D.h>
39 std::vector<ROOT::Math::XYZVector> p3_cms_sigB, p3_cms_roe, p3_cms_all;
41 std::vector<std::pair<ROOT::Math::XYZVector, int>> p3_cms_q_sigA;
42 std::vector<std::pair<ROOT::Math::XYZVector, int>> p3_cms_q_sigB;
43 std::vector<std::pair<ROOT::Math::XYZVector, int>> p3_cms_q_roe;
45 std::vector<float> ksfwFS0;
46 std::vector<float> ksfwFS1;
48 std::vector<float> cleoConesAll;
49 std::vector<float> cleoConesROE;
53 ROOT::Math::XYZVector thrustB;
54 ROOT::Math::XYZVector thrustO;
67 ROOT::Math::PxPyPzEVector p_cms_missA(0, 0, 0, 2 * BeamEnergy);
68 ROOT::Math::PxPyPzEVector p_cms_missB(0, 0, 0, 2 * BeamEnergy);
72 std::vector<Belle2::Particle*> signalDaughters = particle->
getDaughters();
75 ROOT::Math::PxPyPzEVector p_cms = T.
rotateLabToCms() * sigFS0->get4Vector();
77 p3_cms_q_sigA.emplace_back(p_cms.Vect(), sigFS0->getCharge());
87 ROOT::Math::PxPyPzEVector p_cms = T.
rotateLabToCms() * sigFS1->get4Vector();
89 p3_cms_all.push_back(p_cms.Vect());
90 p3_cms_sigB.push_back(p_cms.Vect());
92 p3_cms_q_sigB.emplace_back(p_cms.Vect(), sigFS1->getCharge());
107 for (
const Particle* chargedROEParticle : chargedROEParticles) {
112 ROOT::Math::PxPyPzEVector p_cms = T.
rotateLabToCms() * chargedROEParticle->get4Vector();
114 p3_cms_all.push_back(p_cms.Vect());
115 p3_cms_roe.push_back(p_cms.Vect());
117 p3_cms_q_roe.emplace_back(p_cms.Vect(), chargedROEParticle->getCharge());
119 p_cms_missA -= p_cms;
120 p_cms_missB -= p_cms;
127 std::vector<const Particle*> roePhotons = roe->
getPhotons(maskName);
129 for (
const Particle* photon : roePhotons) {
133 ROOT::Math::PxPyPzEVector p_cms = T.
rotateLabToCms() * photon->get4Vector();
134 p3_cms_all.push_back(p_cms.Vect());
135 p3_cms_roe.push_back(p_cms.Vect());
137 p3_cms_q_roe.emplace_back(p_cms.Vect(), photon->getCharge());
139 p_cms_missA -= p_cms;
140 p_cms_missB -= p_cms;
149 thrustBm = thrustB.R();
150 thrustOm = thrustO.R();
151 cosTBTO = fabs(thrustB.Unit().Dot(thrustO.Unit()));
152 cosTBz = fabs(cos(thrustB.Theta()));
155 CleoCones cc(p3_cms_all, p3_cms_roe, thrustB,
true,
true);
156 cleoConesAll = cc.cleo_cone_with_all();
157 cleoConesROE = cc.cleo_cone_with_roe();
166 double Hso0_max(2 * (2 * BeamEnergy - p_cms_B.E()));
176 ksfwFS0.push_back(KsfwM.
mm2());
177 ksfwFS0.push_back(KsfwM.
et());
178 ksfwFS0.push_back(KsfwM.
Hso(0, 0));
179 ksfwFS0.push_back(KsfwM.
Hso(0, 1));
180 ksfwFS0.push_back(KsfwM.
Hso(0, 2));
181 ksfwFS0.push_back(KsfwM.
Hso(0, 3));
182 ksfwFS0.push_back(KsfwM.
Hso(0, 4));
183 ksfwFS0.push_back(KsfwM.
Hso(1, 0));
184 ksfwFS0.push_back(KsfwM.
Hso(1, 2));
185 ksfwFS0.push_back(KsfwM.
Hso(1, 4));
186 ksfwFS0.push_back(KsfwM.
Hso(2, 0));
187 ksfwFS0.push_back(KsfwM.
Hso(2, 2));
188 ksfwFS0.push_back(KsfwM.
Hso(2, 4));
189 ksfwFS0.push_back(KsfwM.
Hoo(0));
190 ksfwFS0.push_back(KsfwM.
Hoo(1));
191 ksfwFS0.push_back(KsfwM.
Hoo(2));
192 ksfwFS0.push_back(KsfwM.
Hoo(3));
193 ksfwFS0.push_back(KsfwM.
Hoo(4));
196 ksfwFS1.push_back(KsfwM.
mm2());
197 ksfwFS1.push_back(KsfwM.
et());
198 ksfwFS1.push_back(KsfwM.
Hso(0, 0));
199 ksfwFS1.push_back(KsfwM.
Hso(0, 1));
200 ksfwFS1.push_back(KsfwM.
Hso(0, 2));
201 ksfwFS1.push_back(KsfwM.
Hso(0, 3));
202 ksfwFS1.push_back(KsfwM.
Hso(0, 4));
203 ksfwFS1.push_back(KsfwM.
Hso(1, 0));
204 ksfwFS1.push_back(KsfwM.
Hso(1, 2));
205 ksfwFS1.push_back(KsfwM.
Hso(1, 4));
206 ksfwFS1.push_back(KsfwM.
Hso(2, 0));
207 ksfwFS1.push_back(KsfwM.
Hso(2, 2));
208 ksfwFS1.push_back(KsfwM.
Hso(2, 4));
209 ksfwFS1.push_back(KsfwM.
Hoo(0));
210 ksfwFS1.push_back(KsfwM.
Hoo(1));
211 ksfwFS1.push_back(KsfwM.
Hoo(2));
212 ksfwFS1.push_back(KsfwM.
Hoo(3));
213 ksfwFS1.push_back(KsfwM.
Hoo(4));
Class to calculate the Cleo clone variables.
This is a class for collecting variables used in continuum suppression.
void addR2(float R2)
Add reduced Fox-Wolfram moment R2.
void addThrustBm(float thrustBm)
Add magnitude of B thrust axis.
void addCleoConesALL(const std::vector< float > &cleoConesALL)
Add vector of Cleo Cones constructed of all final state particles.
void addCleoConesROE(const std::vector< float > &cleoConesROE)
Add vector of Cleo Cones constructed of only ROE particles.
void addThrustB(const ROOT::Math::XYZVector &thrustB)
Add ROE thrust axis.
void addCosTBz(float cosTBz)
Add cosine of the angle between the thrust axis of the B and the z-axis.
void addThrustOm(float thrustOm)
Add magnitude of ROE thrust axis.
void addKsfwFS0(const std::vector< float > &ksfwFS0)
Add vector of KSFW moments, Et, and mm2 for final state = 0.
void addThrustO(const ROOT::Math::XYZVector &thrustO)
Add ROE thrust axis.
void addKsfwFS1(const std::vector< float > &ksfwFS1)
Add vector of KSFW moments, Et, and mm2 for final state = 1.
void addCosTBTO(float cosTBTO)
Add cosine of the angle between the thrust axis of the B and the thrust axis of the ROE.
@ c_nPhotons
CR is split into n photons (N1)
Class to calculate the Fox-Wolfram moments up to order 8.
double getR(int i) const
Returns the i-th moment normalized to the 0th-order moment.
void calculateBasicMoments()
Method to perform the calculation of the moments up to order 4, which are the most relevant ones.
Moment-calculation of the k_sfw improved Super-Fox-Wolfram moments.
int usefinal(int uf)
Sets the flag that specifiies we are using the finalstate for signal.
double et(int uf=-1) const
Returns calculated transverse energy.
double Hso(int i, int j, int uf=-1) const
Returns calculated KSFW Moments.
double mm2(int uf=-1) const
Returns calculated missing mass squared.
double Hoo(int i, int uf=-1) const
Returns calculated KSFW Moments.
Class to store reconstructed particles.
std::vector< const Belle2::Particle * > getFinalStateDaughters() const
Returns a vector of pointers to Final State daughter particles.
std::vector< Belle2::Particle * > getDaughters() const
Returns a vector of pointers to daughter particles.
ROOT::Math::PxPyPzEVector get4Vector() const
Returns Lorentz vector.
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).
T * getRelated(const std::string &name="", const std::string &namedRelation="") const
Get the object to or from which this object has a relation.
This is a general purpose class for collecting reconstructed MDST data objects that are not used in r...
std::vector< const Particle * > getChargedParticles(const std::string &maskName=c_defaultMaskName, unsigned int pdg=0, bool unpackComposite=true) const
Get charged particles from ROE mask.
std::vector< const Particle * > getPhotons(const std::string &maskName=c_defaultMaskName, bool unpackComposite=true) const
Get photons from ROE mask.
Accessor to arrays stored in the data store.
T * appendNew()
Construct a new T object at the end of the array.
static ROOT::Math::XYZVector calculateThrust(const std::vector< ROOT::Math::XYZVector > &momenta)
calculates the thrust axis
void addContinuumSuppression(const Particle *particle, const std::string &maskName)
Adds continuum suppression variables.
Abstract base class for different kinds of events.