88// In applying this license CERN does not waive the privileges and immunities
99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
11-
12- // jet finder QA task
1311//
1412// / \author Aimeric Landou <aimeric.landou@cern.ch>
1513// / \author Nima Zardoshti <nima.zardoshti@cern.ch>
14+ // / \author Yubiao Wang <yubiao.wang@cern.ch>
15+ // / \file JetBackgroundAnalysisTask.cxx
16+ // / \brief This file contains the implementation for the Charged Jet v2 analysis in the ALICE experiment
1617
1718#include " RecoDecay.h"
1819
@@ -49,6 +50,7 @@ struct JetBackgroundAnalysisTask {
4950 Configurable<float > vertexZCut{" vertexZCut" , 10 .0f , " Accepted z-vertex range for collisions" };
5051 Configurable<float > centralityMin{" centralityMin" , -999.0 , " minimum centrality for collisions" };
5152 Configurable<float > centralityMax{" centralityMax" , 999.0 , " maximum centrality for collisions" };
53+ Configurable<bool > checkCentFT0M{" checkCentFT0M" , false , " 0: centFT0C as default, 1: use centFT0M estimator" };
5254 Configurable<int > trackOccupancyInTimeRangeMax{" trackOccupancyInTimeRangeMax" , 999999 , " maximum track occupancy of collisions in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)" };
5355 Configurable<int > trackOccupancyInTimeRangeMin{" trackOccupancyInTimeRangeMin" , -999999 , " minimum track occupancy of collisions in neighbouring collisions in a given time range; only applied to reconstructed collisions (data and mcd jets), not mc collisions (mcp jets)" };
5456 Configurable<bool > skipMBGapEvents{" skipMBGapEvents" , false , " flag to choose to reject min. bias gap events" };
@@ -99,7 +101,7 @@ struct JetBackgroundAnalysisTask {
99101 }
100102
101103 Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax);
102- Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && aod::jcollision::centFT0M >= centralityMin && aod::jcollision::centFT0M < centralityMax );
104+ Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut);
103105
104106 template <typename TTracks, typename TJets>
105107 bool trackIsInJet (TTracks const & track, TJets const & jet)
@@ -113,73 +115,73 @@ struct JetBackgroundAnalysisTask {
113115 }
114116
115117 template <typename TCollisions, typename TJets, typename TTracks>
116- void bkgFluctuationsRandomCone (TCollisions const & collision, TJets const & jets, TTracks const & tracks)
118+ void bkgFluctuationsRandomCone (TCollisions const & collision, TJets const & jets, TTracks const & tracks, float centrality )
117119 {
118120 TRandom3 randomNumber (0 );
119121 float randomConeEta = randomNumber.Uniform (trackEtaMin + randomConeR, trackEtaMax - randomConeR);
120- float randomConePhi = randomNumber.Uniform (0.0 , 2 * M_PI );
122+ float randomConePhi = randomNumber.Uniform (0.0 , o2::constants::math::TwoPI );
121123 float randomConePt = 0 ;
122124 for (auto const & track : tracks) {
123125 if (jetderiveddatautilities::selectTrack (track, trackSelection)) {
124- float dPhi = RecoDecay::constrainAngle (track.phi () - randomConePhi, static_cast <float >(-M_PI ));
126+ float dPhi = RecoDecay::constrainAngle (track.phi () - randomConePhi, static_cast <float >(-o2::constants::math::PI ));
125127 float dEta = track.eta () - randomConeEta;
126- if (TMath::Sqrt (dEta * dEta + dPhi * dPhi) < randomConeR) {
128+ if (std::sqrt (dEta * dEta + dPhi * dPhi) < randomConeR) {
127129 randomConePt += track.pt ();
128130 }
129131 }
130132 }
131- registry.fill (HIST (" h2_centrality_rhorandomcone" ), collision. centFT0M () , randomConePt - M_PI * randomConeR * randomConeR * collision.rho ());
133+ registry.fill (HIST (" h2_centrality_rhorandomcone" ), centrality , randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho ());
132134
133135 // randomised eta,phi for tracks, to assess part of fluctuations coming from statistically independently emitted particles
134136 randomConePt = 0 ;
135137 for (auto const & track : tracks) {
136138 if (jetderiveddatautilities::selectTrack (track, trackSelection)) {
137- float dPhi = RecoDecay::constrainAngle (randomNumber.Uniform (0.0 , 2 * M_PI ) - randomConePhi, static_cast <float >(-M_PI )); // ignores actual phi of track
138- float dEta = randomNumber.Uniform (trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track
139- if (TMath::Sqrt (dEta * dEta + dPhi * dPhi) < randomConeR) {
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) {
140142 randomConePt += track.pt ();
141143 }
142144 }
143145 }
144- registry.fill (HIST (" h2_centrality_rhorandomconerandomtrackdirection" ), collision. centFT0M () , randomConePt - M_PI * randomConeR * randomConeR * collision.rho ());
146+ registry.fill (HIST (" h2_centrality_rhorandomconerandomtrackdirection" ), centrality , randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho ());
145147
146148 // removing the leading jet from the random cone
147149 if (jets.size () > 0 ) { // if there are no jets in the acceptance (from the jetfinder cuts) then there can be no leading jet
148- float dPhiLeadingJet = RecoDecay::constrainAngle (jets.iteratorAt (0 ).phi () - randomConePhi, static_cast <float >(-M_PI ));
150+ float dPhiLeadingJet = RecoDecay::constrainAngle (jets.iteratorAt (0 ).phi () - randomConePhi, static_cast <float >(-o2::constants::math::PI ));
149151 float dEtaLeadingJet = jets.iteratorAt (0 ).eta () - randomConeEta;
150152
151153 bool jetWasInCone = false ;
152- 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))) {
154+ while ((randomConeLeadJetDeltaR <= 0 && (std::sqrt (dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < jets.iteratorAt (0 ).r () / 100.0 + randomConeR)) || (randomConeLeadJetDeltaR > 0 && (std::sqrt (dEtaLeadingJet * dEtaLeadingJet + dPhiLeadingJet * dPhiLeadingJet) < randomConeLeadJetDeltaR))) {
153155 jetWasInCone = true ;
154156 randomConeEta = randomNumber.Uniform (trackEtaMin + randomConeR, trackEtaMax - randomConeR);
155- randomConePhi = randomNumber.Uniform (0.0 , 2 * M_PI );
156- dPhiLeadingJet = RecoDecay::constrainAngle (jets.iteratorAt (0 ).phi () - randomConePhi, static_cast <float >(-M_PI ));
157+ randomConePhi = randomNumber.Uniform (0.0 , o2::constants::math::TwoPI );
158+ dPhiLeadingJet = RecoDecay::constrainAngle (jets.iteratorAt (0 ).phi () - randomConePhi, static_cast <float >(-o2::constants::math::PI ));
157159 dEtaLeadingJet = jets.iteratorAt (0 ).eta () - randomConeEta;
158160 }
159161 if (jetWasInCone) {
160162 randomConePt = 0.0 ;
161163 for (auto const & track : tracks) {
162164 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
163- float dPhi = RecoDecay::constrainAngle (track.phi () - randomConePhi, static_cast <float >(-M_PI ));
165+ float dPhi = RecoDecay::constrainAngle (track.phi () - randomConePhi, static_cast <float >(-o2::constants::math::PI ));
164166 float dEta = track.eta () - randomConeEta;
165- if (TMath::Sqrt (dEta * dEta + dPhi * dPhi) < randomConeR) {
167+ if (std::sqrt (dEta * dEta + dPhi * dPhi) < randomConeR) {
166168 randomConePt += track.pt ();
167169 }
168170 }
169171 }
170172 }
171173 }
172- registry.fill (HIST (" h2_centrality_rhorandomconewithoutleadingjet" ), collision. centFT0M () , randomConePt - M_PI * randomConeR * randomConeR * collision.rho ());
174+ registry.fill (HIST (" h2_centrality_rhorandomconewithoutleadingjet" ), centrality , randomConePt - o2::constants::math::PI * randomConeR * randomConeR * collision.rho ());
173175
174176 // randomised eta,phi for tracks, to assess part of fluctuations coming from statistically independently emitted particles, removing tracks from 2 leading jets
175177 double randomConePtWithoutOneLeadJet = 0 ;
176178 double randomConePtWithoutTwoLeadJet = 0 ;
177179 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
178180 for (auto const & track : tracks) {
179181 if (jetderiveddatautilities::selectTrack (track, trackSelection)) {
180- float dPhi = RecoDecay::constrainAngle (randomNumber.Uniform (0.0 , 2 * M_PI ) - randomConePhi, static_cast <float >(-M_PI )); // ignores actual phi of track
181- float dEta = randomNumber.Uniform (trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track
182- if (TMath::Sqrt (dEta * dEta + dPhi * dPhi) < randomConeR) {
182+ 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
183+ float dEta = randomNumber.Uniform (trackEtaMin, trackEtaMax) - randomConeEta; // ignores actual eta of track
184+ if (std::sqrt (dEta * dEta + dPhi * dPhi) < randomConeR) {
183185 if (!trackIsInJet (track, jets.iteratorAt (0 ))) {
184186 randomConePtWithoutOneLeadJet += track.pt ();
185187 if (!trackIsInJet (track, jets.iteratorAt (1 ))) {
@@ -190,8 +192,8 @@ struct JetBackgroundAnalysisTask {
190192 }
191193 }
192194 }
193- registry.fill (HIST (" h2_centrality_rhorandomconerandomtrackdirectionwithoutoneleadingjets" ), collision. centFT0M () , randomConePtWithoutOneLeadJet - M_PI * randomConeR * randomConeR * collision.rho ());
194- registry.fill (HIST (" h2_centrality_rhorandomconerandomtrackdirectionwithouttwoleadingjets" ), collision. centFT0M () , randomConePtWithoutTwoLeadJet - M_PI * randomConeR * randomConeR * collision.rho ());
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 ());
195197 }
196198
197199 void processRho (soa::Filtered<soa::Join<aod::JetCollisions, aod::BkgChargedRhos>>::iterator const & collision, soa::Filtered<aod::JetTracks> const & tracks)
@@ -202,17 +204,22 @@ struct JetBackgroundAnalysisTask {
202204 if (collision.trackOccupancyInTimeRange () < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange ()) {
203205 return ;
204206 }
207+ float centrality = checkCentFT0M ? collision.centFT0M () : collision.centFT0C ();
208+ if (centrality < centralityMin || centralityMax < centrality) {
209+ return ;
210+ }
211+
205212 int nTracks = 0 ;
206213 for (auto const & track : tracks) {
207214 if (jetderiveddatautilities::selectTrack (track, trackSelection)) {
208215 nTracks++;
209216 }
210217 }
211- registry.fill (HIST (" h2_centrality_ntracks" ), collision. centFT0M () , nTracks);
218+ registry.fill (HIST (" h2_centrality_ntracks" ), centrality , nTracks);
212219 registry.fill (HIST (" h2_ntracks_rho" ), nTracks, collision.rho ());
213220 registry.fill (HIST (" h2_ntracks_rhom" ), nTracks, collision.rhoM ());
214- registry.fill (HIST (" h2_centrality_rho" ), collision. centFT0M () , collision.rho ());
215- registry.fill (HIST (" h2_centrality_rhom" ), collision. centFT0M () , collision.rhoM ());
221+ registry.fill (HIST (" h2_centrality_rho" ), centrality , collision.rho ());
222+ registry.fill (HIST (" h2_centrality_rhom" ), centrality , collision.rhoM ());
216223 }
217224 PROCESS_SWITCH (JetBackgroundAnalysisTask, processRho, " QA for rho-area subtracted jets" , false );
218225
@@ -224,7 +231,12 @@ struct JetBackgroundAnalysisTask {
224231 if (collision.trackOccupancyInTimeRange () < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange ()) {
225232 return ;
226233 }
227- bkgFluctuationsRandomCone (collision, jets, tracks);
234+ float centrality = checkCentFT0M ? collision.centFT0M () : collision.centFT0C ();
235+ if (centrality < centralityMin || centralityMax < centrality) {
236+ return ;
237+ }
238+
239+ bkgFluctuationsRandomCone (collision, jets, tracks, centrality);
228240 }
229241 PROCESS_SWITCH (JetBackgroundAnalysisTask, processBkgFluctuationsData, " QA for random cone estimation of background fluctuations in data" , false );
230242
@@ -236,9 +248,17 @@ struct JetBackgroundAnalysisTask {
236248 if (collision.trackOccupancyInTimeRange () < trackOccupancyInTimeRangeMin || trackOccupancyInTimeRangeMax < collision.trackOccupancyInTimeRange ()) {
237249 return ;
238250 }
239- bkgFluctuationsRandomCone (collision, jets, tracks);
251+ float centrality = checkCentFT0M ? collision.centFT0M () : collision.centFT0C ();
252+ if (centrality < centralityMin || centralityMax < centrality) {
253+ return ;
254+ }
255+
256+ bkgFluctuationsRandomCone (collision, jets, tracks, centrality);
240257 }
241258 PROCESS_SWITCH (JetBackgroundAnalysisTask, processBkgFluctuationsMCD, " QA for random cone estimation of background fluctuations in mcd" , false );
242259};
243260
244- WorkflowSpec defineDataProcessing (ConfigContext const & cfgc) { return WorkflowSpec{adaptAnalysisTask<JetBackgroundAnalysisTask>(cfgc, TaskName{" jet-background-analysis" })}; }
261+ WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
262+ {
263+ return WorkflowSpec{adaptAnalysisTask<JetBackgroundAnalysisTask>(cfgc)};
264+ }
0 commit comments