@@ -182,6 +182,8 @@ struct JetHadronRecoil {
182182 registry.add (" hDeltaRpTReference" , " jet p_{T} vs #DeltaR;p_{T,jet};#DeltaR" , {HistType::kTH2F , {{500 , -100 , 400 }, dRAxis}}, doSumw);
183183 registry.add (" hDeltaRpTDPhiReference" , " jet p_{T} vs #DeltaR vs #Delta#phi;p_{T,jet};#Delta#phi;#DeltaR" , {HistType::kTH3F , {{500 , -100 , 400 }, {100 , 0 , o2::constants::math::TwoPI}, dRAxis}}, doSumw);
184184 registry.add (" hDeltaRpTDPhiReferenceShifts" , " testing shifts;p_{T,jet};#Delta#phi;#DeltaR;shifts" , {HistType::kTHnSparseD , {{500 , -100 , 400 }, {100 , 0 , o2::constants::math::TwoPI}, dRAxis, {20 , 0.0 , 2.0 }}}, doSumw);
185+ registry.add (" hPtTrackMatched" , " Track p_{T};p_{T};entries" , {HistType::kTH1F , {{200 , 0 , 200 }}}, doSumw);
186+ registry.add (" hPtTrackMatchedToCollisions" , " Track p_{T};p_{T};entries" , {HistType::kTH1F , {{200 , 0 , 200 }}}, doSumw);
185187 }
186188
187189 if (doprocessMCP || doprocessMCPWeighted || doprocessMCPWeightedWithMatchedTracks) {
@@ -265,7 +267,149 @@ struct JetHadronRecoil {
265267 registry.fill (HIST (" hTrack3D" ), track.pt (), track.eta (), track.phi (), weight);
266268 registry.fill (HIST (" hPtTrackPtHard" ), track.pt () / pTHat, track.pt (), weight);
267269 }
270+ if (nTT > 0 ) {
271+ trigNumber = rand->Integer (nTT);
272+ phiTT = phiTTAr[trigNumber];
273+ ptTT = ptTTAr[trigNumber];
274+ if (isSigCol) {
275+ registry.fill (HIST (" hNtrig" ), 1.5 , weight);
276+ registry.fill (HIST (" hSigEventTriggers" ), nTT, weight);
277+ registry.fill (HIST (" hRhoSignal" ), rho, weight);
278+ registry.fill (HIST (" hSignalTriggersPtHard" ), ptTT / pTHat, weight);
279+ }
280+ if (!isSigCol) {
281+ registry.fill (HIST (" hNtrig" ), 0.5 , weight);
282+ registry.fill (HIST (" hRefEventTriggers" ), nTT, weight);
283+ registry.fill (HIST (" hRhoReference" ), rhoReference, weight);
284+ for (double shift = 0.0 ; shift <= 2.0 ; shift += 0.1 ) {
285+ registry.fill (HIST (" hRhoReferenceShift" ), rho + shift, shift, weight);
286+ }
287+ registry.fill (HIST (" hReferenceTriggersPtHard" ), ptTT / pTHat, weight);
288+ }
289+ }
290+ for (const auto & jet : jets) {
291+ if (jet.pt () > leadingJetPt) {
292+ leadingJetPt = jet.pt ();
293+ }
294+ if (jet.pt () > pTHatMaxMCD * pTHat) {
295+ if (outlierRejectEvent) {
296+ return ;
297+ } else {
298+ continue ;
299+ }
300+ }
301+ for (const auto & constituent : jet.template tracks_as <U>()) {
302+ if (constituent.pt () > leadingPT) {
303+ leadingPT = constituent.pt ();
304+ }
305+ registry.fill (HIST (" hConstituents3D" ), constituent.pt (), constituent.eta (), constituent.phi ());
306+ }
307+ if (leadingPT > maxLeadingTrackPt) {
308+ continue ;
309+ }
310+ registry.fill (HIST (" hJetPt" ), jet.pt () - (rho * jet.area ()), weight);
311+ registry.fill (HIST (" hJetEta" ), jet.eta (), weight);
312+ registry.fill (HIST (" hJetPhi" ), jet.phi (), weight);
313+ registry.fill (HIST (" hJet3D" ), jet.pt () - (rho * jet.area ()), jet.eta (), jet.phi (), weight);
268314
315+ if (nTT > 0 ) {
316+ float dphi = RecoDecay::constrainAngle (jet.phi () - phiTT);
317+ double dR = getWTAaxisDifference (jet, tracks);
318+ if (isSigCol) {
319+ if (std::abs (dphi - o2::constants::math::PI) < 0.6 ) {
320+ registry.fill (HIST (" hDeltaRpTSignal" ), jet.pt () - (rho * jet.area ()), dR, weight);
321+ registry.fill (HIST (" hDeltaRSignal" ), dR, weight);
322+ }
323+ registry.fill (HIST (" hDeltaRpTDPhiSignal" ), jet.pt () - (rho * jet.area ()), dphi, dR, weight);
324+ registry.fill (HIST (" hSignalPtDPhi" ), dphi, jet.pt () - (rho * jet.area ()), weight);
325+ if (std::abs (dphi - o2::constants::math::PI) < 0.6 ) {
326+ registry.fill (HIST (" hSignalPt" ), jet.pt () - (rho * jet.area ()), weight);
327+ registry.fill (HIST (" hSignalPtHard" ), jet.pt () - (rho * jet.area ()), ptTT / pTHat, weight);
328+ }
329+ }
330+ if (!isSigCol) {
331+ if (std::abs (dphi - o2::constants::math::PI) < 0.6 ) {
332+ registry.fill (HIST (" hDeltaRpTReference" ), jet.pt () - (rhoReference * jet.area ()), dR, weight);
333+ registry.fill (HIST (" hDeltaRReference" ), dR, weight);
334+ }
335+ registry.fill (HIST (" hDeltaRpTDPhiReference" ), jet.pt () - (rhoReference * jet.area ()), dphi, dR, weight);
336+ for (double shift = 0.0 ; shift <= 2.0 ; shift += 0.1 ) {
337+ registry.fill (HIST (" hDeltaRpTDPhiReferenceShifts" ), jet.pt () - ((rho + shift) * jet.area ()), dphi, dR, shift, weight);
338+ }
339+ registry.fill (HIST (" hReferencePtDPhi" ), dphi, jet.pt () - (rhoReference * jet.area ()), weight);
340+ for (double shift = 0.0 ; shift <= 2.0 ; shift += 0.1 ) {
341+ registry.fill (HIST (" hReferencePtDPhiShifts" ), dphi, jet.pt () - ((rho + shift) * jet.area ()), shift, weight);
342+ }
343+ if (std::abs (dphi - o2::constants::math::PI) < 0.6 ) {
344+ registry.fill (HIST (" hReferencePt" ), jet.pt () - (rhoReference * jet.area ()), weight);
345+ registry.fill (HIST (" hReferencePtHard" ), jet.pt () - (rhoReference * jet.area ()), ptTT / pTHat, weight);
346+ }
347+ }
348+ }
349+ }
350+ registry.fill (HIST (" hTracksvsJets" ), leadingTrackPt, leadingJetPt, pTHat, weight);
351+ }
352+
353+ template <typename T, typename U, typename P>
354+ void fillHistogramsMCD (T const & jets, U const & tracks, P const &, float weight = 1.0 , float rho = 0.0 , float pTHat = 999.0 )
355+ {
356+ bool isSigCol;
357+ std::vector<double > phiTTAr;
358+ std::vector<double > ptTTAr;
359+ double phiTT = 0 ;
360+ double ptTT = 0 ;
361+ int trigNumber = 0 ;
362+ int nTT = 0 ;
363+ double leadingPT = 0 ;
364+ double leadingTrackPt = 0 ;
365+ double leadingJetPt = 0 ;
366+ float rhoReference = rho + rhoReferenceShift;
367+
368+ float dice = rand->Rndm ();
369+ if (dice < fracSig)
370+ isSigCol = true ;
371+ else
372+ isSigCol = false ;
373+
374+ for (const auto & track : tracks) {
375+ if (!jetderiveddatautilities::selectTrack (track, trackSelection)) {
376+ continue ;
377+ }
378+ if (track.pt () > leadingTrackPt) {
379+ leadingTrackPt = track.pt ();
380+ }
381+ if (track.pt () > pTHatTrackMaxMCD * pTHat) {
382+ if (outlierRejectEvent) {
383+ return ;
384+ } else {
385+ continue ;
386+ }
387+ }
388+ if (isSigCol && track.pt () < ptTTsigMax && track.pt () > ptTTsigMin) {
389+ phiTTAr.push_back (track.phi ());
390+ ptTTAr.push_back (track.pt ());
391+ registry.fill (HIST (" hSignalTriggers" ), track.pt (), weight);
392+ nTT++;
393+ }
394+ if (!isSigCol && track.pt () < ptTTrefMax && track.pt () > ptTTrefMin) {
395+ phiTTAr.push_back (track.phi ());
396+ ptTTAr.push_back (track.pt ());
397+ registry.fill (HIST (" hReferenceTriggers" ), track.pt (), weight);
398+ nTT++;
399+ }
400+ registry.fill (HIST (" hPtTrack" ), track.pt (), weight);
401+ registry.fill (HIST (" hEtaTrack" ), track.eta (), weight);
402+ registry.fill (HIST (" hPhiTrack" ), track.phi (), weight);
403+ registry.fill (HIST (" hTrack3D" ), track.pt (), track.eta (), track.phi (), weight);
404+ registry.fill (HIST (" hPtTrackPtHard" ), track.pt () / pTHat, track.pt (), weight);
405+ if (track.has_mcParticle ()) {
406+ registry.fill (HIST (" hPtTrackMatched" ), track.pt (), weight);
407+ auto particle = track.template mcParticle_as <P>();
408+ if (track.collisionId () == particle.mcCollisionId ()) {
409+ registry.fill (HIST (" hPtTrackMatchedToCollisions" ), track.pt (), weight);
410+ }
411+ }
412+ }
269413 if (nTT > 0 ) {
270414 trigNumber = rand->Integer (nTT);
271415 phiTT = phiTTAr[trigNumber];
@@ -765,7 +909,8 @@ struct JetHadronRecoil {
765909 void processMCD (soa::Filtered<soa::Join<aod::JetCollisions, aod::JMcCollisionLbs>>::iterator const & collision,
766910 aod::JMcCollisions const &,
767911 soa::Filtered<soa::Join<aod::ChargedMCDetectorLevelJets, aod::ChargedMCDetectorLevelJetConstituents>> const & jets,
768- soa::Filtered<aod::JetTracks> const & tracks)
912+ soa::Filtered<aod::JetTracksMCD> const & tracks,
913+ soa::Filtered<aod::JetParticles> const & particles)
769914 {
770915 if (!jetderiveddatautilities::selectCollision (collision, eventSelectionBits)) {
771916 return ;
@@ -783,14 +928,15 @@ struct JetHadronRecoil {
783928 return ;
784929 }
785930 registry.fill (HIST (" hZvtxSelected" ), collision.posZ ());
786- fillHistograms (jets, tracks, 1.0 , 0.0 , collision.mcCollision ().ptHard ());
931+ fillHistogramsMCD (jets, tracks, particles , 1.0 , 0.0 , collision.mcCollision ().ptHard ());
787932 }
788933 PROCESS_SWITCH (JetHadronRecoil, processMCD, " process MC detector level" , false );
789934
790935 void processMCDWithRhoSubtraction (soa::Filtered<soa::Join<aod::JetCollisions, aod::BkgChargedRhos, aod::JMcCollisionLbs>>::iterator const & collision,
791936 aod::JMcCollisions const &,
792937 soa::Filtered<soa::Join<aod::ChargedMCDetectorLevelJets, aod::ChargedMCDetectorLevelJetConstituents>> const & jets,
793- soa::Filtered<aod::JetTracks> const & tracks)
938+ soa::Filtered<aod::JetTracksMCD> const & tracks,
939+ soa::Filtered<aod::JetParticles> const & particles)
794940 {
795941 if (!jetderiveddatautilities::selectCollision (collision, eventSelectionBits)) {
796942 return ;
@@ -808,14 +954,15 @@ struct JetHadronRecoil {
808954 return ;
809955 }
810956 registry.fill (HIST (" hZvtxSelected" ), collision.posZ ());
811- fillHistograms (jets, tracks, 1.0 , collision.rho (), collision.mcCollision ().ptHard ());
957+ fillHistogramsMCD (jets, tracks, particles , 1.0 , collision.rho (), collision.mcCollision ().ptHard ());
812958 }
813959 PROCESS_SWITCH (JetHadronRecoil, processMCDWithRhoSubtraction, " process MC detector level with rho subtraction" , false );
814960
815961 void processMCDWeighted (soa::Filtered<soa::Join<aod::JetCollisions, aod::JMcCollisionLbs>>::iterator const & collision,
816962 aod::JMcCollisions const &,
817963 soa::Filtered<soa::Join<aod::ChargedMCDetectorLevelJets, aod::ChargedMCDetectorLevelJetConstituents>> const & jets,
818- soa::Filtered<aod::JetTracks> const & tracks)
964+ soa::Filtered<aod::JetTracksMCD> const & tracks,
965+ soa::Filtered<aod::JetParticles> const & particles)
819966 {
820967 if (!jetderiveddatautilities::selectCollision (collision, eventSelectionBits)) {
821968 return ;
@@ -833,14 +980,15 @@ struct JetHadronRecoil {
833980 return ;
834981 }
835982 registry.fill (HIST (" hZvtxSelected" ), collision.posZ (), collision.mcCollision ().weight ());
836- fillHistograms (jets, tracks, collision.mcCollision ().weight (), 0.0 , collision.mcCollision ().ptHard ());
983+ fillHistogramsMCD (jets, tracks, particles , collision.mcCollision ().weight (), 0.0 , collision.mcCollision ().ptHard ());
837984 }
838985 PROCESS_SWITCH (JetHadronRecoil, processMCDWeighted, " process MC detector level with event weights" , false );
839986
840987 void processMCDWeightedWithRhoSubtraction (soa::Filtered<soa::Join<aod::JetCollisions, aod::JMcCollisionLbs, aod::BkgChargedRhos>>::iterator const & collision,
841988 aod::JMcCollisions const &,
842989 soa::Filtered<soa::Join<aod::ChargedMCDetectorLevelJets, aod::ChargedMCDetectorLevelJetConstituents>> const & jets,
843- soa::Filtered<aod::JetTracks> const & tracks)
990+ soa::Filtered<aod::JetTracksMCD> const & tracks,
991+ soa::Filtered<aod::JetParticles> const & particles)
844992 {
845993 if (!jetderiveddatautilities::selectCollision (collision, eventSelectionBits)) {
846994 return ;
@@ -858,7 +1006,7 @@ struct JetHadronRecoil {
8581006 return ;
8591007 }
8601008 registry.fill (HIST (" hZvtxSelected" ), collision.posZ (), collision.mcCollision ().weight ());
861- fillHistograms (jets, tracks, collision.mcCollision ().weight (), collision.rho (), collision.mcCollision ().ptHard ());
1009+ fillHistogramsMCD (jets, tracks, particles , collision.mcCollision ().weight (), collision.rho (), collision.mcCollision ().ptHard ());
8621010 }
8631011 PROCESS_SWITCH (JetHadronRecoil, processMCDWeightedWithRhoSubtraction, " process MC detector level with event weights and rho subtraction" , false );
8641012
0 commit comments