Skip to content

Commit 885cb77

Browse files
Wooseok HamWooseok Ham
authored andcommitted
PWGJE: modify the delta pT methods to except the zero jet evnets
1 parent 0ff57fc commit 885cb77

File tree

1 file changed

+37
-35
lines changed

1 file changed

+37
-35
lines changed

PWGJE/Tasks/jetBackgroundAnalysis.cxx

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -117,36 +117,38 @@ struct JetBackgroundAnalysisTask {
117117
template <typename TCollisions, typename TJets, typename TTracks>
118118
void bkgFluctuationsRandomCone(TCollisions const& collision, TJets const& jets, TTracks const& tracks, float centrality)
119119
{
120-
TRandom3 randomNumber(0);
121-
float randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR);
122-
float randomConePhi = randomNumber.Uniform(0.0, o2::constants::math::TwoPI);
123-
float randomConePt = 0;
124-
for (auto const& track : tracks) {
125-
if (jetderiveddatautilities::selectTrack(track, trackSelection)) {
126-
float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast<float>(-o2::constants::math::PI));
127-
float dEta = track.eta() - randomConeEta;
128-
if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {
129-
randomConePt += track.pt();
120+
if (jets.size() > 0) { // Since the purpose of the fluctuation measurement is jet correction, events with zero accepted jets (from the jetfinder cuts) are excluded
121+
TRandom3 randomNumber(0);
122+
float randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR);
123+
float randomConePhi = randomNumber.Uniform(0.0, o2::constants::math::TwoPI);
124+
float randomConePt = 0;
125+
for (auto const& track : tracks) {
126+
if (jetderiveddatautilities::selectTrack(track, trackSelection)) {
127+
float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast<float>(-o2::constants::math::PI));
128+
float dEta = track.eta() - randomConeEta;
129+
if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {
130+
randomConePt += track.pt();
131+
}
130132
}
131133
}
132-
}
133-
registry.fill(HIST("h2_centrality_rhorandomcone"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
134+
registry.fill(HIST("h2_centrality_rhorandomcone"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
134135

135-
// randomised eta,phi for tracks, to assess part of fluctuations coming from statistically independently emitted particles
136-
randomConePt = 0;
137-
for (auto const& track : tracks) {
138-
if (jetderiveddatautilities::selectTrack(track, trackSelection)) {
139-
float dPhi = RecoDecay::constrainAngle(randomNumber.Uniform(0.0, o2::constants::math::TwoPI) - randomConePhi, static_cast<float>(-o2::constants::math::PI)); // ignores actual phi of track
140-
float dEta = randomNumber.Uniform(trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track
141-
if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {
142-
randomConePt += track.pt();
136+
// randomised eta,phi for tracks, to assess part of fluctuations coming from statistically independently emitted particles
137+
{
138+
float randomConePt = 0;
139+
for (auto const& track : tracks) {
140+
if (jetderiveddatautilities::selectTrack(track, trackSelection)) {
141+
float dPhi = RecoDecay::constrainAngle(randomNumber.Uniform(0.0, o2::constants::math::TwoPI) - randomConePhi, static_cast<float>(-o2::constants::math::PI)); // ignores actual phi of track
142+
float dEta = randomNumber.Uniform(trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track
143+
if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {
144+
randomConePt += track.pt();
145+
}
146+
}
143147
}
148+
registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirection"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
144149
}
145-
}
146-
registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirection"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
147150

148-
// removing the leading jet from the random cone
149-
if (jets.size() > 0) { // if there are no jets in the acceptance (from the jetfinder cuts) then there can be no leading jet
151+
// removing the leading jet from the random cone
150152
float dPhiLeadingJet = RecoDecay::constrainAngle(jets.iteratorAt(0).phi() - randomConePhi, static_cast<float>(-o2::constants::math::PI));
151153
float dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta;
152154

@@ -169,33 +171,33 @@ struct JetBackgroundAnalysisTask {
169171
}
170172
}
171173
}
172-
}
173-
}
174-
registry.fill(HIST("h2_centrality_rhorandomconewithoutleadingjet"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
174+
}
175+
registry.fill(HIST("h2_centrality_rhorandomconewithoutleadingjet"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
175176

176-
// randomised eta,phi for tracks, to assess part of fluctuations coming from statistically independently emitted particles, removing tracks from 2 leading jets
177-
double randomConePtWithoutOneLeadJet = 0;
178-
double randomConePtWithoutTwoLeadJet = 0;
179-
if (jets.size() > 1) { // if there are no jets, or just one, in the acceptance (from the jetfinder cuts) then one cannot find 2 leading jets
177+
// randomised eta,phi for tracks, to assess part of fluctuations coming from statistically independently emitted particles, removing tracks from 2 leading jets
178+
double randomConePtWithoutOneLeadJet = 0;
179+
double randomConePtWithoutTwoLeadJet = 0;
180180
for (auto const& track : tracks) {
181181
if (jetderiveddatautilities::selectTrack(track, trackSelection)) {
182182
float dPhi = RecoDecay::constrainAngle(randomNumber.Uniform(0.0, o2::constants::math::TwoPI) - randomConePhi, static_cast<float>(-o2::constants::math::PI)); // ignores actual phi of track
183183
float dEta = randomNumber.Uniform(trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track
184184
if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {
185185
if (!trackIsInJet(track, jets.iteratorAt(0))) {
186186
randomConePtWithoutOneLeadJet += track.pt();
187-
if (!trackIsInJet(track, jets.iteratorAt(1))) {
187+
if (jets.size() > 1 && !trackIsInJet(track, jets.iteratorAt(1))) { // if there are jets in the acceptance (from the jetfinder cuts) less than two then one cannot find 2 leading jets
188188
randomConePtWithoutTwoLeadJet += track.pt();
189189
}
190190
}
191191
}
192192
}
193193
}
194+
registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirectionwithoutoneleadingjets"), centrality, randomConePtWithoutOneLeadJet - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
195+
if (jets.size() > 1) {
196+
registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirectionwithouttwoleadingjets"), centrality, randomConePtWithoutTwoLeadJet - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
197+
}
194198
}
195-
registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirectionwithoutoneleadingjets"), centrality, randomConePtWithoutOneLeadJet - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
196-
registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirectionwithouttwoleadingjets"), centrality, randomConePtWithoutTwoLeadJet - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
197199
}
198-
200+
199201
void processRho(soa::Filtered<soa::Join<aod::JetCollisions, aod::BkgChargedRhos>>::iterator const& collision, soa::Filtered<aod::JetTracks> const& tracks)
200202
{
201203
if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents)) {

0 commit comments

Comments
 (0)