Belle II Software  release-08-01-10
CleoCones.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include <analysis/ContinuumSuppression/CleoCones.h>
10 
11 
12 namespace Belle2 {
18  CleoCones::CleoCones(const std::vector<ROOT::Math::XYZVector>& p3_cms_all,
19  const std::vector<ROOT::Math::XYZVector>& p3_cms_roe,
20  const ROOT::Math::XYZVector& thrustB,
21  bool calc_CleoCones_with_all,
22  bool calc_CleoCones_with_roe
23  )
24  {
25  m_cleo_cone_with_all.clear();
26  m_cleo_cone_with_roe.clear();
27 
28  // ----------------------------------------------------------------------
29  // Calculate momentum flow in 9 cones for all particles in event
30  // ----------------------------------------------------------------------
31  if (calc_CleoCones_with_all == true) {
32  for (int i = 1; i <= 9; i++) {
33  float momentum_flow_all = 0;
34  for (auto& iter0 : p3_cms_all) {
35 
36  /* Use the following intervals
37  0*10<= <1*10 0- 10 170-180 180-1*10< <=180-0*10
38  1*10<= <2*10 10- 20 160-170 180-2*10< <=180-1*10
39  2*10<= <3*10 20- 30 150-160 180-3*10< <=180-2*10
40  3*10<= <4*10 30- 40 140-150 180-4*10< <=180-3*10
41  4*10<= <5*10 40- 50 130-140 180-5*10< <=180-4*10
42  5*10<= <6*10 50- 60 120-130 180-6*10< <=180-5*10
43  6*10<= <7*10 60- 70 110-120 180-7*10< <=180-6*10
44  7*10<= <8*10 70- 80 100-110 180-8*10< <=180-7*10
45  8*10<= <9*10 80- 90 90-100 180-9*10< <=180-8*10
46  ==90 */
47 
48  float angle = ((180 * acos(thrustB.Unit().Dot(iter0.Unit()))) / M_PI);
49  if (((((i - 1) * 10) <= angle) && (angle < (i * 10))) || (((180 - (i * 10)) < angle) && (angle <= (180 - ((i - 1) * 10))))) {
50  momentum_flow_all += iter0.R();
51  // B2DEBUG(19, "interval " << ((i-1)*10) << " to " << (i*10) << " and " << (180-(i*10)) << " to " << (180-((i-1)*10)) << " has value " << (180*(thrustB.angle(*iter0)))/M_PI << ", momentum flow is " << momentum_flow );
52  }
53  if ((i == 9) && (angle == 90)) {
54  momentum_flow_all += iter0.R();
55  }
56  }
57  m_cleo_cone_with_all.push_back(momentum_flow_all);
58  }
59  }
60 
61  // ----------------------------------------------------------------------
62  // Calculate momentum flow in 9 cones for all particles in rest of event
63  // ----------------------------------------------------------------------
64  if (calc_CleoCones_with_roe == true) {
65  for (int i = 1; i <= 9; i++) {
66  float momentum_flow_roe = 0;
67  for (auto& iter1 : p3_cms_roe) {
68  float angle = ((180 * acos(thrustB.Unit().Dot(iter1.Unit()))) / M_PI);
69  if (((((i - 1) * 10) <= angle) && (angle < (i * 10))) || (((180 - (i * 10)) < angle) && (angle <= (180 - ((i - 1) * 10))))) {
70  momentum_flow_roe += iter1.R();
71  }
72  if ((i == 9) && (angle == 90)) {
73  momentum_flow_roe += iter1.R();
74  }
75  }
76  m_cleo_cone_with_roe.push_back(momentum_flow_roe);
77  }
78  }
79  }
80 
82 } // Belle2 namespace
std::vector< float > m_cleo_cone_with_roe
Cleo Cones calculated from only ROE tracks.
Definition: CleoCones.h:50
std::vector< float > m_cleo_cone_with_all
Cleo Cones calculated from all tracks.
Definition: CleoCones.h:49
CleoCones(const std::vector< ROOT::Math::XYZVector > &p3_cms_all, const std::vector< ROOT::Math::XYZVector > &p3_cms_roe, const ROOT::Math::XYZVector &thrustB, bool calc_CleoCones_with_all, bool calc_CleoCones_with_roe)
Constructor.
Definition: CleoCones.cc:18
Abstract base class for different kinds of events.