Skip to content

Commit 2139b76

Browse files
committed
Draft of class to calculate DEtaDPhiStar
1 parent 1922ab4 commit 2139b76

File tree

2 files changed

+98
-0
lines changed

2 files changed

+98
-0
lines changed

Analysis/Tasks/PWGCF/FemtoDream/include/FemtoDream/FemtoDreamContainer.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class FemtoDreamContainer
5858
mHistogramRegistry->add("relPairkstarkT", ("; " + femtoObs + "; #it{k}_{T} (GeV/#it{c})").c_str(), o2::framework::kTH2F, {femtoObsAxis, kTAxis});
5959
mHistogramRegistry->add("relPairkstarmT", ("; " + femtoObs + "; #it{m}_{T} (GeV/#it{c}^{2})").c_str(), o2::framework::kTH2F, {femtoObsAxis, mTAxis});
6060
mHistogramRegistry->add("relPairkstarMult", ("; " + femtoObs + "; Multiplicity").c_str(), o2::framework::kTH2F, {femtoObsAxis, multAxis});
61+
mHistogramRegistry->add("DEtaDPhiAvgStar", "; #Delta#it{#eta}; <#Delta#it{#phi*}", o2::framework::kTH2F, {{400,-0.2,0.2}, {300,-0.15,0.15}});
6162
}
6263

6364
void setPDGCodes(const int pdg1, const int pdg2)
@@ -85,6 +86,22 @@ class FemtoDreamContainer
8586
}
8687
}
8788

89+
template <typename T, typename F>
90+
void setDetaDphiStarHistos(T const& part1, T const& part2, const float magfield, F const& RadiiTPC) {
91+
//Should be work in principle both for SE and ME
92+
std::vector<float> vecPhiPart1;
93+
std::vector<float> vecPhiPart2;
94+
std::vector<double> tmpVecRadii = RadiiTPC;
95+
PhiAtRadiiTPC(part1, magfield, tmpVecRadii, vecPhiPart1);
96+
PhiAtRadiiTPC(part2, magfield, tmpVecRadii, vecPhiPart2);
97+
float AvgPhiStar = AveragePhiStar(vecPhiPart1, vecPhiPart2);
98+
float deltaeta = DeltaEta(part1, part2);
99+
100+
if(mHistogramRegistry) {
101+
mHistogramRegistry->fill(HIST("DEtaDPhiAvgStar"), deltaeta, AvgPhiStar);
102+
}
103+
}
104+
88105
protected:
89106
femtoDreamContainer::Observable mFemtoObs = femtoDreamContainer::Observable::kstar;
90107
o2::framework::HistogramRegistry* mHistogramRegistry = nullptr;
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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

Comments
 (0)