1+ // Copyright CERN and copyright holders of ALICE O2. This software is
2+ // distributed under the terms of the GNU General Public License v3 (GPL
3+ // Version 3), copied verbatim in the file "COPYING".
4+ //
5+ // See http://alice-o2.web.cern.ch/license for full licensing information.
6+ //
7+ // In applying this license CERN does not waive the privileges and immunities
8+ // granted to it by virtue of its status as an Intergovernmental Organization
9+ // or submit itself to any jurisdiction.
10+
11+ // / \file FemtoDreamDetaDphiStar.h
12+ // / \brief Definition of the FemtoDreamDetaDphiStar Container for math calculations math calculations of CPR quantities
13+ // / \author Valentina Mantovani Sarti, TU München, valentina.mantovani-sarti@ph.tum.de
14+
15+ #ifndef ANALYSIS_TASKS_PWGCF_FEMTODREAM_FEMTODREAMDETADPHISTAR_H_
16+ #define ANALYSIS_TASKS_PWGCF_FEMTODREAM_FEMTODREAMDETADPHISTAR_H_
17+
18+ #include " Math/Vector4D.h"
19+ #include " Math/Boost.h"
20+ #include " TLorentzVector.h"
21+ #include " TMath.h"
22+ #include < numbers>
23+
24+ #include < iostream>
25+
26+ namespace o2 ::analysis
27+ {
28+ namespace femtoDream
29+ {
30+
31+ // / \class FemtoDreamDetaDphiStar
32+ // / \brief Container for math calculations of CPR quantities
33+
34+ class FemtoDreamDetaDphiStar
35+ {
36+ public:
37+ static const float PiGreek = TMath::Pi();
38+
39+ template <typename T>
40+ static void PhiAtRadiiTPC (const T& part, const float magfield, std::vector<float > tmpRadiiTPC, std::vector<float > tmpVec)
41+ {
42+ // ISSUE: We do not have the magnetic field in the Collisions femtotable;
43+ // since in the PairTask we have the col, we can just define in the process:
44+ // float magfield = col.Bfield();
45+ float phi0 = part->phi ();
46+ float charge = (part->sign ()); // so we will need a Join table with FemtodreamParticles and FEMTODEBUGPARTS
47+ float pt = part->pt ();
48+ for (size_t i = 0 ; i < tmpRadiiTPC.size (); i++) {
49+ tmpVec.push_back (phi0 - std::asin (0.3 * charge * 0.1 * magfield * tmpRadiiTPC.at (i) * 0.01 / (2 . * pt)));
50+ }
51+ }
52+
53+ static float AveragePhiStar (std::vector<float > tmpVec1, std::vector<float > tmpVec2)
54+ {
55+ const int num = tmpVec1.size ();
56+ float dPhiAvg = 0 ;
57+ for (size_t i = 0 ; i < num; i++) {
58+ float dphi = tmpVec1.at (i) - tmpVec2.at (i);
59+ if (dphi > PiGreek) {
60+ dphi += -2 * PiGreek;
61+ } else if (dphi < - PiGreek) {
62+ dphi += 2 * PiGreek;
63+ }
64+ dphi = TVector2::Phi_mpi_pi (dphi);
65+ dPhiAvg += dphi;
66+ }
67+ return (dPhiAvg / (float )num);
68+ }
69+
70+ template <typename T>
71+ static float DeltaEta (const T& part1, const T& part2) {
72+ return (part1->eta () - part2->eta ());
73+ }
74+
75+
76+ };
77+
78+ } /* namespace femtoDream */
79+ } /* namespace o2::analysis */
80+
81+ #endif /* ANALYSIS_TASKS_PWGCF_FEMTODREAM_FEMTODREAMDETADPHISTAR_H_ */
0 commit comments