Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion PWGJE/Tasks/jetBackgroundAnalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
// histogram definitions

if (doprocessRho) {
registry.add("h2_leadingjet_pt_rho", "; #it{p}_{T, leading jet} (GeV/#it{c}); #it{rho} (GeV/area);", {HistType::kTH2F, {{200, 0., 200.0}, {400, 0.0, 400.0}}});
registry.add("h2_centrality_ntracks", "; centrality; N_{tracks};", {HistType::kTH2F, {{1100, 0., 110.0}, {10000, 0.0, 10000.0}}});
registry.add("h2_ntracks_rho", "; N_{tracks}; #it{rho} (GeV/area);", {HistType::kTH2F, {{10000, 0.0, 10000.0}, {400, 0.0, 400.0}}});
registry.add("h2_ntracks_rhom", "; N_{tracks}; #it{rho}_{m} (GeV/area);", {HistType::kTH2F, {{10000, 0.0, 10000.0}, {100, 0.0, 100.0}}});
Expand All @@ -90,9 +91,14 @@
}

if (doprocessBkgFluctuationsData || doprocessBkgFluctuationsMCD) {
registry.add("h2_leadingjet_pt_rhorandomcone", "; #it{p}_{T, leading jet} (GeV/#it{c}); #it{rho} (GeV/area);", {HistType::kTH2F, {{200, 0., 200.0}, {400, 0.0, 400.0}}});
registry.add("h2_centrality_rhorandomcone", "; centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho} (GeV/c);", {HistType::kTH2F, {{1100, 0., 110.}, bkgFluctuationsAxis}});
registry.add("h2_leadingjet_pt_rhorandomconerandomtrackdirection", "; #it{p}_{T, leading jet} (GeV/#it{c}); #it{rho} (GeV/area);", {HistType::kTH2F, {{200, 0., 200.0}, {400, 0.0, 400.0}}});
registry.add("h2_centrality_rhorandomconerandomtrackdirection", "; centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho} (GeV/c);", {HistType::kTH2F, {{1100, 0., 110.}, bkgFluctuationsAxis}});
registry.add("h2_leadingjet_pt_rhorandomconewithoutleadingjet", "; #it{p}_{T, leading jet} (GeV/#it{c}); #it{rho} (GeV/area);", {HistType::kTH2F, {{200, 0., 200.0}, {400, 0.0, 400.0}}});
registry.add("h2_centrality_rhorandomconewithoutleadingjet", "; centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho} (GeV/c);", {HistType::kTH2F, {{1100, 0., 110.}, bkgFluctuationsAxis}});
registry.add("h2_leadingjet_pt_rhorandomconerandomtrackdirectionwithoutoneleadingjets", "; #it{p}_{T, leading jet} (GeV/#it{c}); #it{rho} (GeV/area);", {HistType::kTH2F, {{200, 0., 200.0}, {400, 0.0, 400.0}}});
registry.add("h2_leadingjet_pt_rhorandomconerandomtrackdirectionwithouttwoleadingjets", "; #it{p}_{T, leading jet} (GeV/#it{c}); #it{rho} (GeV/area);", {HistType::kTH2F, {{200, 0., 200.0}, {400, 0.0, 400.0}}});
registry.add("h2_centrality_rhorandomconerandomtrackdirectionwithoutoneleadingjets", "; centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho} (GeV/c);", {HistType::kTH2F, {{1100, 0., 110.}, bkgFluctuationsAxis}});
registry.add("h2_centrality_rhorandomconerandomtrackdirectionwithouttwoleadingjets", "; centrality; #it{p}_{T,random cone} - #it{area, random cone} * #it{rho} (GeV/c);", {HistType::kTH2F, {{1100, 0., 110.}, bkgFluctuationsAxis}});
}
Expand All @@ -117,30 +123,40 @@
{
TRandom3 randomNumber(0);
float randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR);
float randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI);

Check failure on line 126 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
float randomConePt = 0;
for (auto const& track : tracks) {
if (jetderiveddatautilities::selectTrack(track, trackSelection)) {
float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast<float>(-M_PI));

Check failure on line 130 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
float dEta = track.eta() - randomConeEta;
if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {

Check failure on line 132 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
randomConePt += track.pt();
}
}
}

// Check if jets exist before accessing them
std::cout << "bkg fluctuations jets size: " << jets.size() << std::endl;
if (jets.size() > 0) {
std::cout << "leading jet pt random cone: " << jets.iteratorAt(0).pt() << std::endl;
registry.fill(HIST("h2_leadingjet_pt_rhorandomcone"), jets.iteratorAt(0).pt(), randomConePt - M_PI * randomConeR * randomConeR * collision.rho());

Check failure on line 142 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
}
registry.fill(HIST("h2_centrality_rhorandomcone"), collision.centFT0M(), randomConePt - M_PI * randomConeR * randomConeR * collision.rho());

Check failure on line 144 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.

// randomised eta,phi for tracks, to assess part of fluctuations coming from statistically independently emitted particles
randomConePt = 0;
for (auto const& track : tracks) {
if (jetderiveddatautilities::selectTrack(track, trackSelection)) {
float dPhi = RecoDecay::constrainAngle(randomNumber.Uniform(0.0, 2 * M_PI) - randomConePhi, static_cast<float>(-M_PI)); // ignores actual phi of track

Check failure on line 150 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
float dEta = randomNumber.Uniform(trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track
if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {

Check failure on line 152 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
randomConePt += track.pt();
}
}
}
if (jets.size() > 0) {
registry.fill(HIST("h2_leadingjet_pt_rhorandomconerandomtrackdirection"), jets.iteratorAt(0).pt(), randomConePt - M_PI * randomConeR * randomConeR * collision.rho());
}
registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirection"), collision.centFT0M(), randomConePt - M_PI * randomConeR * randomConeR * collision.rho());

// removing the leading jet from the random cone
Expand All @@ -149,7 +165,7 @@
float dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta;

bool jetWasInCone = false;
while ((randomConeLeadJetDeltaR <= 0 && (TMath::Sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < jets.iteratorAt(0).r() / 100.0 + randomConeR)) || (randomConeLeadJetDeltaR > 0 && (TMath::Sqrt(dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < randomConeLeadJetDeltaR))) {

Check failure on line 168 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
jetWasInCone = true;
randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR);
randomConePhi = randomNumber.Uniform(0.0, 2 * M_PI);
Expand All @@ -162,13 +178,16 @@
if (jetderiveddatautilities::selectTrack(track, trackSelection)) { // if track selection is uniformTrack, dcaXY and dcaZ cuts need to be added as they aren't in the selection so that they can be studied here
float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast<float>(-M_PI));
float dEta = track.eta() - randomConeEta;
if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {

Check failure on line 181 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
randomConePt += track.pt();
}
}
}
}
}
if (jets.size() > 0) {
registry.fill(HIST("h2_leadingjet_pt_rhorandomconewithoutleadingjet"), jets.iteratorAt(0).pt(), randomConePt - M_PI * randomConeR * randomConeR * collision.rho());
}
registry.fill(HIST("h2_centrality_rhorandomconewithoutleadingjet"), collision.centFT0M(), randomConePt - M_PI * randomConeR * randomConeR * collision.rho());

// randomised eta,phi for tracks, to assess part of fluctuations coming from statistically independently emitted particles, removing tracks from 2 leading jets
Expand All @@ -179,7 +198,7 @@
if (jetderiveddatautilities::selectTrack(track, trackSelection)) {
float dPhi = RecoDecay::constrainAngle(randomNumber.Uniform(0.0, 2 * M_PI) - randomConePhi, static_cast<float>(-M_PI)); // ignores actual phi of track
float dEta = randomNumber.Uniform(trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track
if (TMath::Sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {

Check failure on line 201 in PWGJE/Tasks/jetBackgroundAnalysis.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
if (!trackIsInJet(track, jets.iteratorAt(0))) {
randomConePtWithoutOneLeadJet += track.pt();
if (!trackIsInJet(track, jets.iteratorAt(1))) {
Expand All @@ -190,11 +209,15 @@
}
}
}
if (jets.size() > 0) {
registry.fill(HIST("h2_leadingjet_pt_rhorandomconerandomtrackdirectionwithoutoneleadingjets"), jets.iteratorAt(0).pt(), randomConePtWithoutOneLeadJet - M_PI * randomConeR * randomConeR * collision.rho());
registry.fill(HIST("h2_leadingjet_pt_rhorandomconerandomtrackdirectionwithouttwoleadingjets"), jets.iteratorAt(0).pt(), randomConePtWithoutTwoLeadJet - M_PI * randomConeR * randomConeR * collision.rho());
}
registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirectionwithoutoneleadingjets"), collision.centFT0M(), randomConePtWithoutOneLeadJet - M_PI * randomConeR * randomConeR * collision.rho());
registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirectionwithouttwoleadingjets"), collision.centFT0M(), randomConePtWithoutTwoLeadJet - M_PI * randomConeR * randomConeR * collision.rho());
}

void processRho(soa::Filtered<soa::Join<aod::JetCollisions, aod::BkgChargedRhos>>::iterator const& collision, soa::Filtered<aod::JetTracks> const& tracks)
void processRho(soa::Filtered<soa::Join<aod::JetCollisions, aod::BkgChargedRhos>>::iterator const& collision, soa::Filtered<aod::JetTracks> const& tracks, aod::ChargedJets const& jets)
{
if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents)) {
return;
Expand All @@ -208,6 +231,11 @@
nTracks++;
}
}
std::cout << "process rho jets size: " << jets.size() << std::endl;
if (jets.size() > 0) {
std::cout << "leading jet pt rho: " << jets.iteratorAt(0).pt() << std::endl;
registry.fill(HIST("h2_leadingjet_pt_rho"), jets.iteratorAt(0).pt(), collision.rho());
}
registry.fill(HIST("h2_centrality_ntracks"), collision.centFT0M(), nTracks);
registry.fill(HIST("h2_ntracks_rho"), nTracks, collision.rho());
registry.fill(HIST("h2_ntracks_rhom"), nTracks, collision.rhoM());
Expand Down
Loading