@@ -142,6 +142,32 @@ enum CentEstimator {
142142 kCentFV0A
143143};
144144
145+ enum JetAlgorithm {
146+ kKt = 0 ,
147+ kCambridgeAachen ,
148+ kAntiKt
149+ };
150+
151+ enum JetRecombScheme {
152+ kEScheme = 0 ,
153+ kPtScheme = 1 ,
154+ kPt2Scheme = 2 ,
155+ kWTAScheme = 7
156+ };
157+
158+ enum JetType {
159+ kChargedJet = 0 ,
160+ kFullJet ,
161+ kPhotonJet ,
162+ kZJet
163+ };
164+
165+ enum BkgSubtraction {
166+ kNoSubtraction = 0 ,
167+ kAreaBased ,
168+ kConstituentBased
169+ };
170+
145171// ////////////////////////////////////////////
146172struct lambdajetpolarizationions {
147173
@@ -397,11 +423,13 @@ struct lambdajetpolarizationions {
397423 Configurable<double > radiusJet{" radiusJet" , 0 .4f , " Jet resolution parameter (R)" }; // (TODO: check if the JE people don't define this as a rescaled int to not lose precision for stricter selections)
398424 // Notice that the maximum Eta of the jet will then be 0.9 - R to keep the jet contained within the ITS+TPC barrel.
399425
400- Configurable<int > jetAlgorithm{" jetAlgorithm" , 2 , " jet clustering algorithm. 0 = kT, 1 = C/A, 2 = Anti-kT" };
401- Configurable<int > jetRecombScheme{" jetRecombScheme" , 0 , " Jet recombination scheme: E_scheme (0), pT-scheme (1), pt2-scheme (2), WTA_pt_scheme (7) " }; // See PWGJE/JetFinders/jetFinder.h for more info.
402- Configurable<bool > bkgSubtraction{" bkgSubtraction" , false , " Jet background subtraction: No subtraction (false), Area (true), Constituent (TODO)" }; // Selection bool for background subtraction strategy
426+ Configurable<int > jetAlgorithm{" jetAlgorithm" , kAntiKt , " jet clustering algorithm. 0 = kT, 1 = C/A, 2 = Anti-kT" };
427+ Configurable<int > jetRecombScheme{" jetRecombScheme" , kEScheme , " Jet recombination scheme: 0: E_scheme, 1: pT-scheme, 2: pt2-scheme, 7: WTA_pt_scheme " }; // See PWGJE/JetFinders/jetFinder.h for more info.
428+ Configurable<int > bkgSubtraction{" bkgSubtraction" , kNoSubtraction , " Jet background subtraction: No subtraction (false), Area (true), Constituent (TODO)" }; // Selection bool for background subtraction strategy
403429 Configurable<float > GhostedAreaSpecRapidity{" GhostedAreaSpecRapidity" , 1.1 , " Max ghost particle rapidity for jet area estimates" }; // At least 1.0 for tracks and jets within the |eta| < 0.9 window of ITS+TPC
404- Configurable<int > jetType{" jetType" , 0 , " Jet type: Charged Jet (0), Full Jet (1), Photon-tagged (2), Z-tagged (3)" }; // (TODO: create a reasonable track selection for full jets and photon/Z-tagged jet tracks, including detector angular acceptance parameters for EMCal)
430+ // Using an enum for readability:
431+ Configurable<int > jetType{" jetType" , kChargedJet , " Jet type: 0: Charged Jet, 1: Full Jet, 2: Photon-tagged, 3: Z-tagged" };
432+ // (TODO: create a reasonable track selection for full jets and photon/Z-tagged jet tracks, including detector angular acceptance parameters for EMCal)
405433
406434 // // Configurables from JE PWG:
407435 // // (TODO: check the maximum pT of jets used in my analyses! If it is way too hard, it might not be the best jet to use!)
@@ -496,7 +524,7 @@ struct lambdajetpolarizationions {
496524 rctFlagsChecker.init (rctConfigurations.cfgRCTLabel .value , rctConfigurations.cfgCheckZDC , rctConfigurations.cfgTreatLimitedAcceptanceAsBad );
497525
498526 // Event Counters
499- histos.add (" hEventSelection" , " hEventSelection" , kTH1D , {{21 , -0 .5f , +20 .5f }});
527+ histos.add (" hEventSelection" , " hEventSelection" , kTH1D , {{23 , -0 .5f , +20 .5f }});
500528 histos.get <TH1>(HIST (" hEventSelection" ))->GetXaxis ()->SetBinLabel (1 , " All collisions" );
501529 histos.get <TH1>(HIST (" hEventSelection" ))->GetXaxis ()->SetBinLabel (2 , " sel8 cut" );
502530 histos.get <TH1>(HIST (" hEventSelection" ))->GetXaxis ()->SetBinLabel (3 , " kIsTriggerTVX" );
@@ -523,11 +551,15 @@ struct lambdajetpolarizationions {
523551 histos.get <TH1>(HIST (" hEventSelection" ))->GetXaxis ()->SetBinLabel (19 , " Below min IR" );
524552 histos.get <TH1>(HIST (" hEventSelection" ))->GetXaxis ()->SetBinLabel (20 , " Above max IR" );
525553 histos.get <TH1>(HIST (" hEventSelection" ))->GetXaxis ()->SetBinLabel (21 , " RCT flags" );
554+ histos.get <TH1>(HIST (" hEventSelection" ))->GetXaxis ()->SetBinLabel (22 , " hasRingJet" );
555+ histos.get <TH1>(HIST (" hEventSelection" ))->GetXaxis ()->SetBinLabel (23 , " hasRingV0" );
556+ // (notice we lack a hasRingJet AND hasRingV0 bin because the tasks run separately on all events!)
557+ // (this QA number can be obtained at derived data level with ease)
526558
527559 histos.add (" Centrality/hEventCentrality" , " hEventCentrality" , kTH1D , {{101 , 0 .0f , 101 .0f }});
528560 histos.add (" Centrality/hCentralityVsNch" , " hCentralityVsNch" , kTH2D , {{101 , 0 .0f , 101 .0f }, axisConfigurations.axisNch });
529561 if (doEventQA) {
530- histos.add (" hEventSelectionVsCentrality" , " hEventSelectionVsCentrality" , kTH2D , {{21 , -0 .5f , +20 .5f }, {101 , 0 .0f , 101 .0f }});
562+ histos.add (" hEventSelectionVsCentrality" , " hEventSelectionVsCentrality" , kTH2D , {{23 , -0 .5f , +20 .5f }, {101 , 0 .0f , 101 .0f }});
531563 histos.get <TH2>(HIST (" hEventSelectionVsCentrality" ))->GetXaxis ()->SetBinLabel (1 , " All collisions" );
532564 histos.get <TH2>(HIST (" hEventSelectionVsCentrality" ))->GetXaxis ()->SetBinLabel (2 , " sel8 cut" );
533565 histos.get <TH2>(HIST (" hEventSelectionVsCentrality" ))->GetXaxis ()->SetBinLabel (3 , " kIsTriggerTVX" );
@@ -554,7 +586,10 @@ struct lambdajetpolarizationions {
554586 histos.get <TH2>(HIST (" hEventSelectionVsCentrality" ))->GetXaxis ()->SetBinLabel (19 , " Below min IR" );
555587 histos.get <TH2>(HIST (" hEventSelectionVsCentrality" ))->GetXaxis ()->SetBinLabel (20 , " Above max IR" );
556588 histos.get <TH2>(HIST (" hEventSelectionVsCentrality" ))->GetXaxis ()->SetBinLabel (21 , " RCT flags" );
589+ histos.get <TH2>(HIST (" hEventSelectionVsCentrality" ))->GetXaxis ()->SetBinLabel (22 , " hasRingJet" );
590+ histos.get <TH2>(HIST (" hEventSelectionVsCentrality" ))->GetXaxis ()->SetBinLabel (23 , " hasRingV0" );
557591
592+ // Centrality:
558593 histos.add (" Centrality/hCentralityVsNGlobal" , " hCentralityVsNGlobal" , kTH2D , {{101 , 0 .0f , 101 .0f }, axisConfigurations.axisNch });
559594 histos.add (" Centrality/hEventCentVsMultFT0M" , " hEventCentVsMultFT0M" , kTH2D , {{101 , 0 .0f , 101 .0f }, axisConfigurations.axisMultFT0M });
560595 histos.add (" Centrality/hEventCentVsMultFT0C" , " hEventCentVsMultFT0C" , kTH2D , {{101 , 0 .0f , 101 .0f }, axisConfigurations.axisMultFT0C });
@@ -1275,6 +1310,11 @@ struct lambdajetpolarizationions {
12751310 void processJetsData (SelCollisionsSimple::iterator const & collision, PseudoJetTracks const & tracks, aod::BCsWithTimestamps const & bcs){ // Uses BCsWithTimestamps to get timestamps for rejectTPCsectorBoundary
12761311 float centrality = -1 .0f ; // Just a placeholder
12771312
1313+ // For event QA the last two indices never change for NEv_withJets and NEv_withV0s
1314+ // (Not the best way to initialize this: runs once per collision! TODO: think of a better way to do it)
1315+ int lastBinEvSel = histos.get <TH1>(HIST (" hEventSelection" ))->GetXaxis ()->GetNbins ();
1316+ bool validJetAlreadyFound = false ; // Do not fill Event QA more than once
1317+
12781318 auto bc = bcs.iteratorAt (collision.bcId ()); // Got the iteratorAt() idea from O2Physics/PWGUD/Core/UDHelpers.h
12791319 if (!isEventAccepted (collision, bc, centrality, false )) return ; // Uses return instead of continue, as there is no explicit loop here
12801320 const uint64_t collIdx = collision.globalIndex ();
@@ -1306,7 +1346,7 @@ struct lambdajetpolarizationions {
13061346 // Cluster particles using the anti-kt algorithm
13071347 fastjet::JetDefinition jetDef (mapFJAlgorithm (jetConfigurations.jetAlgorithm ), jetConfigurations.radiusJet , mapFJRecombScheme (jetConfigurations.jetRecombScheme ));
13081348 // std::vector<float> jets_pt, jets_eta, jets_phi; // Not worth it to store 4-vectors: the tracks assume pion mass hypothesis, so energy and rapidity are not right.
1309- if (jetConfigurations.bkgSubtraction ){
1349+ if (jetConfigurations.bkgSubtraction == kAreaBased ){
13101350 fastjet::AreaDefinition areaDef (fastjet::active_area, fastjet::GhostedAreaSpec (jetConfigurations.GhostedAreaSpecRapidity ));
13111351 fastjet::ClusterSequenceArea clustSeq (fjParticles, jetDef, areaDef); // Attributes an area for each pseudojet in the list
13121352 std::vector<fastjet::PseudoJet> jets = fastjet::sorted_by_pt (clustSeq.inclusive_jets ()); // No minimum pt before background subtraction
@@ -1351,6 +1391,9 @@ struct lambdajetpolarizationions {
13511391 histos.fill (HIST (" hJetsPerEvent" ), selectedJets);
13521392 if (selectedJets == 0 ) return ;
13531393 histos.fill (HIST (" hEventsWithJet" ), 0.5 );
1394+ // Another version of this counter, which is already integrated in the Event Selection flow:
1395+ if (doEventQA && !validJetAlreadyFound) fillEventSelectionQA (lastBinEvSel-1 , centrality); // hasRingJet passes
1396+ validJetAlreadyFound = true ;
13541397
13551398 if (doJetKinematicsQA){
13561399 histos.fill (HIST (" JetKinematicsQA/hLeadingJetPt" ), leadingJetSub.pt ());
@@ -1433,6 +1476,9 @@ struct lambdajetpolarizationions {
14331476
14341477 if (jetsInEvent == 0 ) return ;
14351478 histos.fill (HIST (" hEventsWithJet" ), 0.5 );
1479+ // Another version of this counter, which is already integrated in the Event Selection flow:
1480+ if (doEventQA && !validJetAlreadyFound) fillEventSelectionQA (lastBinEvSel-1 , centrality); // hasRingJet passes
1481+ validJetAlreadyFound = true ;
14361482
14371483 const auto & leadingJet = jets[0 ];
14381484 for (const auto & jet : jets){
@@ -1524,9 +1570,16 @@ struct lambdajetpolarizationions {
15241570 }
15251571 }
15261572
1527- // Had to include DauTracks in subscription, even though I don't loop in it, for the indices to resolve, avoiding " Exception while running: Index pointing to Tracks is not bound!"
1573+ // Had to include DauTracks in subscription, even though I don't loop in it, for the indices
1574+ // to resolve, avoiding " Exception while running: Index pointing to Tracks is not bound!"
15281575 void processV0sData (SelCollisions::iterator const & collision, V0CandidatesWithTOF const & fullV0s, aod::BCsWithTimestamps const & bcs, DauTracks const & V0DauTracks){
15291576 float centrality = getCentrality (collision);
1577+
1578+ // For event QA the last two indices never change for NEv_withJets and NEv_withV0s
1579+ // (Not the best way to initialize this: runs once per collision! TODO: think of a better way to do it)
1580+ int lastBinEvSel = histos.get <TH1>(HIST (" hEventSelection" ))->GetXaxis ()->GetNbins ();
1581+ bool validV0AlreadyFound = false ;
1582+
15301583 histos.fill (HIST (" hEventSelection" ), 0 . /* all collisions */ );
15311584 histos.fill (HIST (" hEventSelectionVsCentrality" ), 0 . /* all collisions */ , centrality);
15321585
@@ -1537,6 +1590,9 @@ struct lambdajetpolarizationions {
15371590 const uint64_t collIdx = collision.globalIndex ();
15381591 if (v0Selections.rejectTPCsectorBoundary ) initCCDB (bc); // Substituted call from collision to bc for raw data
15391592
1593+ // Fill event table:
1594+ tableCollisions (collIdx, centrality); // (TODO: add InteractionRate info and other useful cuts for later on in the analysis!)
1595+
15401596 // bool hasValidV0 = false; // Bool to know if event information can be saved.
15411597 for (auto const & v0 : fullV0s){
15421598 V0SelCounter.resetForNewV0 ();
@@ -1558,6 +1614,8 @@ struct lambdajetpolarizationions {
15581614 if (doArmenterosQA) histos.fill (HIST (" GeneralQA/h2dArmenterosSelected" ), v0.alpha (), v0.qtarm ()); // cross-check
15591615 if (isLambda && isAntiLambda) histos.fill (HIST (" hAmbiguousLambdaCandidates" ), 0 );
15601616
1617+ if (doEventQA) fillEventSelectionQA (lastBinEvSel, centrality); // hasRingV0 passes
1618+
15611619 // // Extra competing mass rejection of Lambdas // (TODO: test competing mass cuts)
15621620 // v0.mLambda()
15631621
@@ -1595,7 +1653,9 @@ struct lambdajetpolarizationions {
15951653 v0.negativeeta (),
15961654 v0.negativephi ()
15971655 );
1598-
1656+ if (doEventQA && !validV0AlreadyFound) fillEventSelectionQA (lastBinEvSel, centrality); // hasRingV0 passes
1657+ validV0AlreadyFound = true ;
1658+
15991659 if (doV0KinematicQA){
16001660 // Cache kinematics once
16011661 const float v0y = v0.yLambda ();
@@ -1742,8 +1802,8 @@ struct lambdajetpolarizationions {
17421802 // Only fills collision when there is a valid V0 in it: (TODO: could probably do the same for the jets table)
17431803 // if (hasValidV0){
17441804 // LOG(INFO) << "Filling tableCollisions";
1745- // Current logic now fills tables independently of collision having V0s, for the Jets table to match correctly
1746- tableCollisions (collIdx, centrality); // (TODO: add InteractionRate info and other useful cuts for later on in the analysis!)
1805+ // Current logic now fills tables independently of collision having V0s, for the Jets table to match correctly, at the START of the code
1806+ // tableCollisions(collIdx, centrality);
17471807 // }
17481808 }
17491809
0 commit comments