You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PWGJE/Core/FastJetUtilities.cxx
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -15,19 +15,19 @@
15
15
16
16
#include<vector>
17
17
18
-
voidfastjetutilities::setFastJetUserInfo(std::vector<fastjet::PseudoJet>& constituents, int index, int status)
18
+
voidfastjetutilities::setFastJetUserInfo(std::vector<fastjet::PseudoJet>& constituents, int index, JetConstituentStatus status)
19
19
{
20
20
fastjet_user_info* user_info = newfastjet_user_info(status, index); // FIXME: can setting this as a pointer be avoided?
21
21
constituents.back().set_user_info(user_info);
22
-
if (index != -99999999) { // FIXME: in principle needed for constituent subtraction, particularly when clusters are added to the subtraction. However since the HF particle is not subtracted then we dont need to check for it in this manner
22
+
if (index != invalidIndex) { // FIXME: in principle needed for constituent subtraction, particularly when clusters are added to the subtraction. However since the HF particle is not subtracted then we dont need to check for it in this manner
23
23
int i = index;
24
-
if (status == static_cast<int>(JetConstituentStatus::track)) {
24
+
if (status == JetConstituentStatus::track) {
25
25
i = i + 1;
26
26
}
27
-
if (status == static_cast<int>(JetConstituentStatus::cluster)) {
27
+
if (status == JetConstituentStatus::cluster) {
28
28
i = -1 * (i + 1);
29
29
}
30
-
if (status == static_cast<int>(JetConstituentStatus::candidate)) {
30
+
if (status == JetConstituentStatus::candidate) {
31
31
i = 0;
32
32
}
33
33
constituents.back().set_user_index(i); // FIXME: needed for constituent subtraction, but need to be quite careful to make sure indices dont overlap between tracks, clusters and HF candidates. Current solution might not be optimal
int status; // the status of each particle (Options are: TrueParticle (final state particles in generator event which arent special), HFParticle (heavy-flavour particle of interest in generator event), ThermalParticle (particles belonging to the thermal backgound), DecaySisterParticle (other particles poduced in the decay resulting in a non-prompt heavy-flavour particle of interest))
42
+
JetConstituentStatus status; // the status of each particle (Options are: TrueParticle (final state particles in generator event which arent special), HFParticle (heavy-flavour particle of interest in generator event), ThermalParticle (particles belonging to the thermal backgound), DecaySisterParticle (other particles poduced in the decay resulting in a non-prompt heavy-flavour particle of interest))
40
43
int index; // a number unique to each particle in the event
41
44
42
45
public:
43
46
fastjet_user_info()
44
47
{
45
-
status = -9;
48
+
status = JetConstituentStatus::invalidStatus;
46
49
index = -9;
47
50
}
48
-
fastjet_user_info(int _status, int _index)
51
+
fastjet_user_info(JetConstituentStatus _status, int _index)
49
52
{
50
53
status = _status;
51
54
index = _index;
52
55
}
53
56
~fastjet_user_info() = default;
54
-
voidsetStatus(int set) { status = set; }
57
+
voidsetStatus(JetConstituentStatus set) { status = set; }
@@ -65,7 +68,7 @@ class fastjet_user_info : public fastjet::PseudoJet::UserInfoBase
65
68
* @param status status of constituent type
66
69
*/
67
70
68
-
voidsetFastJetUserInfo(std::vector<fastjet::PseudoJet>& constituents, int index = -99999999, int status = static_cast<int>(JetConstituentStatus::track));
71
+
voidsetFastJetUserInfo(std::vector<fastjet::PseudoJet>& constituents, int index = invalidIndex, JetConstituentStatus status = JetConstituentStatus::track);
69
72
70
73
/**
71
74
* Add track as a pseudojet object to the fastjet vector
@@ -78,9 +81,9 @@ void setFastJetUserInfo(std::vector<fastjet::PseudoJet>& constituents, int index
78
81
*/
79
82
80
83
template <typename T>
81
-
voidfillTracks(const T& constituent, std::vector<fastjet::PseudoJet>& constituents, int index = -99999999, int status = static_cast<int>(JetConstituentStatus::track), float mass = o2::constants::physics::MassPiPlus)
84
+
voidfillTracks(const T& constituent, std::vector<fastjet::PseudoJet>& constituents, int index = invalidIndex, JetConstituentStatus status = JetConstituentStatus::track, float mass = o2::constants::physics::MassPiPlus)
82
85
{
83
-
if (status == static_cast<int>(JetConstituentStatus::track) || status == static_cast<int>(JetConstituentStatus::candidate)) {
86
+
if (status == JetConstituentStatus::track || status == JetConstituentStatus::candidate) {
84
87
// auto p = std::sqrt((constituent.px() * constituent.px()) + (constituent.py() * constituent.py()) + (constituent.pz() * constituent.pz()));
85
88
auto energy = std::sqrt((constituent.p() * constituent.p()) + (mass * mass));
voidfillClusters(const T& constituent, std::vector<fastjet::PseudoJet>& constituents, int index = -99999999, int hadronicCorrectionType = 0, int status = static_cast<int>(JetConstituentStatus::cluster))
104
+
voidfillClusters(const T& constituent, std::vector<fastjet::PseudoJet>& constituents, int index = invalidIndex, int hadronicCorrectionType = 0, JetConstituentStatus status = JetConstituentStatus::cluster)
102
105
{
103
-
if (status == static_cast<int>(JetConstituentStatus::cluster)) {
selRho = fastjet::SelectorRapRange(bkgEtaMin, bkgEtaMax) && fastjet::SelectorPhiRange(bkgPhiMin, bkgPhiMax) && !fastjet::SelectorNHardest(nHardReject); // here we have to put rap range, to be checked!
54
+
selRho = fastjet::SelectorEtaRange(bkgEtaMin, bkgEtaMax) && fastjet::SelectorPhiRange(bkgPhiMin, bkgPhiMax) && !fastjet::SelectorNHardest(nHardReject); // here we have to put rap range, to be checked!
ghostAreaSpec = fastjet::GhostedAreaSpec(ghostEtaMax, ghostRepeatN, ghostArea, gridScatter, ktScatter, ghostktMean); // the first argument is rapidity not pseudorapidity, to be checked
ghostAreaSpec = fastjet::GhostedAreaSpec(selGhosts, ghostRepeatN, ghostArea, gridScatter, ktScatter, ghostktMean); // the first argument is rapidity not pseudorapidity, to be checked
for (constauto& constituent : jet.constituents()) {
318
-
auto constituentStatus = constituent.templateuser_info<fastjetutilities::fastjet_user_info>().getStatus();
319
-
if (constituentStatus == static_cast<int>(JetConstituentStatus::candidate)) { // note currently we cannot run V0 and HF in the same jet. If we ever need to we can seperate the loops
if (constituentStatus == JetConstituentStatus::candidate) { // note currently we cannot run V0 and HF in the same jet. If we ever need to we can seperate the loops
0 commit comments