Skip to content

Commit b5a10f8

Browse files
HamwooseokWooseok Ham
andauthored
[PWGJE] modify the delta pT method to include jetless events (#15286)
Co-authored-by: Wooseok Ham <ham@Wooseokui-MacBookPro-298.local>
1 parent 60d431b commit b5a10f8

File tree

1 file changed

+43
-38
lines changed

1 file changed

+43
-38
lines changed

PWGJE/Tasks/jetBackgroundAnalysis.cxx

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -119,37 +119,38 @@ struct JetBackgroundAnalysisTask {
119119
template <typename TCollisions, typename TJets, typename TTracks>
120120
void bkgFluctuationsRandomCone(TCollisions const& collision, TJets const& jets, TTracks const& tracks, float centrality)
121121
{
122-
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
123-
float randomConeEta = randomNumber.Uniform(trackEtaMin + randomConeR, trackEtaMax - randomConeR);
124-
float randomConePhi = randomNumber.Uniform(0.0, o2::constants::math::TwoPI);
125-
float randomConePt = 0;
126-
for (auto const& track : tracks) {
127-
if (jetderiveddatautilities::selectTrack(track, trackSelection)) {
128-
float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast<float>(-o2::constants::math::PI));
129-
float dEta = track.eta() - randomConeEta;
130-
if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {
131-
randomConePt += track.pt();
132-
}
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();
133131
}
134132
}
135-
registry.fill(HIST("h2_centrality_rhorandomcone"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
133+
}
134+
registry.fill(HIST("h2_centrality_rhorandomcone"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
136135

137-
// randomised eta,phi for tracks, to assess part of fluctuations coming from statistically independently emitted particles
138-
{
139-
float randomConePt = 0;
140-
for (auto const& track : tracks) {
141-
if (jetderiveddatautilities::selectTrack(track, trackSelection)) {
142-
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
143-
float dEta = randomNumber.Uniform(trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track
144-
if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {
145-
randomConePt += track.pt();
146-
}
147-
}
136+
// randomised eta,phi for tracks, to assess part of fluctuations coming from statistically independently emitted particles
137+
float randomConePtRandomTrackDirection = 0;
138+
for (auto const& track : tracks) {
139+
if (jetderiveddatautilities::selectTrack(track, trackSelection)) {
140+
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
141+
float dEta = randomNumber.Uniform(trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track
142+
if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {
143+
randomConePtRandomTrackDirection += track.pt();
148144
}
149-
registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirection"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
150145
}
146+
}
147+
registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirection"), centrality, randomConePtRandomTrackDirection - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
151148

152-
// removing the leading jet from the random cone
149+
// removing the leading jet from the random cone
150+
const bool hasLead = jets.size() >= 1;
151+
const bool hasSub = jets.size() >= 2;
152+
float randomConePtWithoutLeadingJet = randomConePt;
153+
if (hasLead) {
153154
float dPhiLeadingJet = RecoDecay::constrainAngle(jets.iteratorAt(0).phi() - randomConePhi, static_cast<float>(-o2::constants::math::PI));
154155
float dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta;
155156

@@ -162,41 +163,45 @@ struct JetBackgroundAnalysisTask {
162163
dEtaLeadingJet = jets.iteratorAt(0).eta() - randomConeEta;
163164
}
164165
if (jetWasInCone) {
165-
randomConePt = 0.0;
166+
randomConePtWithoutLeadingJet = 0.0;
166167
for (auto const& track : tracks) {
167168
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
168169
float dPhi = RecoDecay::constrainAngle(track.phi() - randomConePhi, static_cast<float>(-o2::constants::math::PI));
169170
float dEta = track.eta() - randomConeEta;
170171
if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {
171-
randomConePt += track.pt();
172+
randomConePtWithoutLeadingJet += track.pt();
172173
}
173174
}
174175
}
175176
}
176-
registry.fill(HIST("h2_centrality_rhorandomconewithoutleadingjet"), centrality, randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
177-
178-
// randomised eta,phi for tracks, to assess part of fluctuations coming from statistically independently emitted particles, removing tracks from 2 leading jets
179-
double randomConePtWithoutOneLeadJet = 0;
180-
double randomConePtWithoutTwoLeadJet = 0;
177+
}
178+
registry.fill(HIST("h2_centrality_rhorandomconewithoutleadingjet"), centrality, randomConePtWithoutLeadingJet - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
179+
180+
// randomised eta,phi for tracks, to assess part of fluctuations coming from statistically independently emitted particles, removing tracks from 2 leading jets
181+
double randomConePtWithoutOneLeadJet = randomConePtRandomTrackDirection;
182+
double randomConePtWithoutTwoLeadJet = randomConePtRandomTrackDirection;
183+
if (hasLead) {
184+
randomConePtWithoutOneLeadJet = 0.0;
185+
randomConePtWithoutTwoLeadJet = 0.0;
181186
for (auto const& track : tracks) {
182187
if (jetderiveddatautilities::selectTrack(track, trackSelection)) {
183188
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
184189
float dEta = randomNumber.Uniform(trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track
185190
if (std::sqrt(dEta * dEta + dPhi * dPhi) < randomConeR) {
186-
if (!trackIsInJet(track, jets.iteratorAt(0))) {
191+
const bool inLead = hasLead && trackIsInJet(track, jets.iteratorAt(0));
192+
const bool inSub = hasSub && trackIsInJet(track, jets.iteratorAt(1));
193+
if (!inLead) {
187194
randomConePtWithoutOneLeadJet += track.pt();
188-
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
195+
if (!hasSub || !inSub) {
189196
randomConePtWithoutTwoLeadJet += track.pt();
190197
}
191198
}
192199
}
193200
}
194201
}
195-
registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirectionwithoutoneleadingjets"), centrality, randomConePtWithoutOneLeadJet - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
196-
if (jets.size() > 1) {
197-
registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirectionwithouttwoleadingjets"), centrality, randomConePtWithoutTwoLeadJet - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
198-
}
199202
}
203+
registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirectionwithoutoneleadingjets"), centrality, randomConePtWithoutOneLeadJet - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
204+
registry.fill(HIST("h2_centrality_rhorandomconerandomtrackdirectionwithouttwoleadingjets"), centrality, randomConePtWithoutTwoLeadJet - o2::constants::math::PI * randomConeR * randomConeR * collision.rho());
200205
}
201206

202207
void processRho(soa::Filtered<soa::Join<aod::JetCollisions, aod::BkgChargedRhos>>::iterator const& collision, soa::Filtered<aod::JetTracks> const& tracks)

0 commit comments

Comments
 (0)