diff --git a/PWGLF/Tasks/Resonances/phitutorial.cxx b/PWGLF/Tasks/Resonances/phitutorial.cxx index 1001b85268a..9034004daa6 100644 --- a/PWGLF/Tasks/Resonances/phitutorial.cxx +++ b/PWGLF/Tasks/Resonances/phitutorial.cxx @@ -57,7 +57,7 @@ struct phitutorial { histos.add("Nch_pT", "Nch_pT", kTH1F, {ptAxis}); histos.add("Nch_USS_Minv", "Nch_USS_Minv", kTH1F, {MinvAxis}); histos.add("Nch_LSS_Minv", "Nch_LSS_Minv", kTH1F, {MinvAxis}); - + histos.add("Nch_ME_Minv", "Nch_ME_Minv", kTH1F, {MinvAxis}); }; // end of init diff --git a/PWGLF/Tasks/Resonances/phitutorial_step0.cxx b/PWGLF/Tasks/Resonances/phitutorial_step0.cxx index 480b653e5c6..25a66f53a98 100644 --- a/PWGLF/Tasks/Resonances/phitutorial_step0.cxx +++ b/PWGLF/Tasks/Resonances/phitutorial_step0.cxx @@ -71,14 +71,13 @@ struct phitutorial_step0 { template bool eventSelection(const EventType event) { - if (!event.sel8()) //This is required to extract good events + if (!event.sel8()) // This is required to extract good events return false; - + return true; }; //********************************************// - //Space for more helper functions! - + // Space for more helper functions! //********************************************// // HELPER FCNS COMPLETE, NOW WE DO PROCESS FCNS @@ -86,7 +85,8 @@ struct phitutorial_step0 { // SAME EVENT int nEvents = 0; - void processDataSameEvent(EventCandidates::iterator const& collision, TrackCandidates const& tracks){ + void processDataSameEvent(EventCandidates::iterator const& collision, TrackCandidates const& tracks) + { nEvents++; if ((nEvents + 1) % 10000 == 0) { std::cout << "Processed Data Events: " << nEvents << std::endl; @@ -99,16 +99,16 @@ struct phitutorial_step0 { // Keep in mind that: // M_inv = sqrt( (E1+E2)^2 - |P1 + P2|^2 ) // Where you use the energies and momenta of the individual Kaons. - + // You should fill: histos.fill(HIST("Minv"), M_inv), calculated as above. - - //Usefull tips: - // E = sqrt(p^2 + m^2). The Kaon mass is found above in the constant massKa - // pz = pT*sinh(eta) - // track.pt() - // track.eta(); - // std::sinh(x) - + + // Usefull tips: + // E = sqrt(p^2 + m^2). The Kaon mass is found above in the constant massKa + // pz = pT*sinh(eta) + // track.pt() + // track.eta(); + // std::sinh(x) + // For more concise techinques, check out: // ROOT::Math::PxPyPzMVector //Check google // combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy.... //check ALICE O2 documentation @@ -120,14 +120,12 @@ struct phitutorial_step0 { //.. } - } // proccessSameEvent PROCESS_SWITCH(phitutorial_step0, processDataSameEvent, "process Data Same Event", false); -//***************************************// -// TASK COMPLETE! -//**************************************// - + //***************************************// + // TASK COMPLETE! + //**************************************// }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGLF/Tasks/Resonances/phitutorial_step1.cxx b/PWGLF/Tasks/Resonances/phitutorial_step1.cxx index 3d510ea8cb8..fdfe69538f4 100644 --- a/PWGLF/Tasks/Resonances/phitutorial_step1.cxx +++ b/PWGLF/Tasks/Resonances/phitutorial_step1.cxx @@ -72,14 +72,13 @@ struct phitutorial_step1 { template bool eventSelection(const EventType event) { - if (!event.sel8()) //This is required to extract good events + if (!event.sel8()) // This is required to extract good events return false; - + return true; }; //********************************************// - //Space for more helper functions! - + // Space for more helper functions! //********************************************// // HELPER FCNS COMPLETE, NOW WE DO PROCESS FCNS @@ -102,14 +101,14 @@ struct phitutorial_step1 { // track.isGlobalTrack() <.... this menas that it is a good track // track.pt() >0.15 <.... we want to remove really low momentum tracks // -0.8 0.15f; // then you have to modify the subscription // soa::Filtered const& tracks - + for (const auto& track : tracks) { histos.fill(HIST("Nch_pT"), track.pt()); } @@ -130,10 +129,9 @@ struct phitutorial_step1 { } // proccessSameEvent PROCESS_SWITCH(phitutorial_step1, processDataSameEvent, "process Data Same Event", false); -//***************************************// -// TASK COMPLETE! -//**************************************// - + //***************************************// + // TASK COMPLETE! + //**************************************// }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGLF/Tasks/Resonances/phitutorial_step2.cxx b/PWGLF/Tasks/Resonances/phitutorial_step2.cxx index 06f98893a6d..c4e238a6b7f 100644 --- a/PWGLF/Tasks/Resonances/phitutorial_step2.cxx +++ b/PWGLF/Tasks/Resonances/phitutorial_step2.cxx @@ -72,9 +72,9 @@ struct phitutorial_step2 { template bool eventSelection(const EventType event) { - if (!event.sel8()) //This is required to extract good events + if (!event.sel8()) // This is required to extract good events return false; - + return true; }; //********************************************// @@ -89,9 +89,9 @@ struct phitutorial_step2 { return false; return true; - }; - //Space for more helper functions! - //********************************************// + }; + // Space for more helper functions! + //********************************************// //********************************************// // HELPER FCNS COMPLETE, NOW WE DO PROCESS FCNS @@ -112,20 +112,19 @@ struct phitutorial_step2 { // Now, we want to add some PID to ensure that we are with a higher likelhood pairing Kaons. // Three ways to do this: // 1.) Directly cut on the tracks in the looping functions (not recommended) - + // 2.) Create a helper function above similar to trackSelection - + // 3.) Partition your tracks with a preselection by adding this outside of your process function: // Partition kaon (nabs(aod::pidtpc::tpcNSigmaKa) <= X); // X is a cfg value or a hardcoded integer. // Then inside the function: auto tracks1 = kaon->sliceByCached(aod::track::collisionId, collision1.globalIndex(), cache); Do the same for tracks2. + // Getters for PID: + // tracks.tpcNSigmaKa() + // tracks.tofNSigmaKa() + // Good starting value for the selected nsigma value is "3". + // You might not want to have a STRICT TOF cut, a lot of tracks with good TPC PID does not have TOF information. You can make a conditional cut on TOF by only implementing the TOF cut if track.hasTOF() returns TRUE. - //Getters for PID: - // tracks.tpcNSigmaKa() - // tracks.tofNSigmaKa() - // Good starting value for the selected nsigma value is "3". - // You might not want to have a STRICT TOF cut, a lot of tracks with good TPC PID does not have TOF information. You can make a conditional cut on TOF by only implementing the TOF cut if track.hasTOF() returns TRUE. - for (const auto& track : tracks) { if (!trackSelection(track)) { continue; @@ -151,10 +150,9 @@ struct phitutorial_step2 { } // proccessSameEvent PROCESS_SWITCH(phitutorial_step2, processDataSameEvent, "process Data Same Event", false); -//***************************************// -// TASK COMPLETE! -//**************************************// - + //***************************************// + // TASK COMPLETE! + //**************************************// }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGLF/Tasks/Resonances/phitutorial_step3.cxx b/PWGLF/Tasks/Resonances/phitutorial_step3.cxx index 566cee136a9..2c488381e17 100644 --- a/PWGLF/Tasks/Resonances/phitutorial_step3.cxx +++ b/PWGLF/Tasks/Resonances/phitutorial_step3.cxx @@ -58,9 +58,8 @@ struct phitutorial_step3 { histos.add("Nch_USS_Minv", "Nch_USS_Minv", kTH1F, {MinvAxis}); histos.add("Nch_LSS_Minv", "Nch_LSS_Minv", kTH1F, {MinvAxis}); - - histos.add("Nch_ME_Minv", "Nch_ME_Minv", kTH1F, {MinvAxis}); + histos.add("Nch_ME_Minv", "Nch_ME_Minv", kTH1F, {MinvAxis}); }; // end of init @@ -77,9 +76,9 @@ struct phitutorial_step3 { template bool eventSelection(const EventType event) { - if (!event.sel8()) //This is required to extract good events + if (!event.sel8()) // This is required to extract good events return false; - + return true; }; //********************************************// @@ -96,7 +95,7 @@ struct phitutorial_step3 { return true; }; - //********************************************// + //********************************************// template bool trackPIDKaon(const TrackPID& candidate) @@ -136,11 +135,11 @@ struct phitutorial_step3 { if (!eventSelection(collision)) return; - //Last step, we want to remove the cominbatorial background to get a clean peak. We want to fill our new two booked historams, Nch_LSS_Minv and Nch_ME_Minv + // Last step, we want to remove the cominbatorial background to get a clean peak. We want to fill our new two booked historams, Nch_LSS_Minv and Nch_ME_Minv + + // LSS is easy, you simply need to fill the histogram if the conjugate argument below is NOT true. + // For event mixing, we have to now copy our logic into a new process function below, and iterate over track pairs between different events! - //LSS is easy, you simply need to fill the histogram if the conjugate argument below is NOT true. - // For event mixing, we have to now copy our logic into a new process function below, and iterate over track pairs between different events! - for (const auto& track : tracks) { if (!trackSelection(track)) { continue; @@ -178,32 +177,31 @@ struct phitutorial_step3 { // DEFINITION OF SLICE CACHE, BINNING AND MIXING STRUCTURE //*********************************************************// Preslice perCollision = aod::track::collisionId; - //We ensure here that we mix events that have relatively similar characteristics. + // We ensure here that we mix events that have relatively similar characteristics. std::vector zBins{10, -10, 10}; std::vector multBins{VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 100.1}; using BinningType = ColumnBinningPolicy; BinningType binning{{zBins, multBins}, true}; SameKindPair pair{binning, 5, -1, &cache}; - void processDataMixedEvent(EventCandidates const& collisions, TrackCandidates const& tracks)//notice the collisions subscrition, it is not an iterator here! + void processDataMixedEvent(EventCandidates const& collisions, TrackCandidates const& tracks) // notice the collisions subscrition, it is not an iterator here! { - + for (const auto& [c1, tracks1, c2, tracks2] : pair) { if (!eventSelection(c1) || !eventSelection(c2)) continue; - //Fill your event mixing logic here. + // Fill your event mixing logic here. //.. //.. //.. - } //pairs + } // pairs } // processMixedEvent PROCESS_SWITCH(phitutorial_step3, processDataMixedEvent, "process Data Mixed Event", false); - -//***************************************// -// TASK COMPLETE! -//**************************************// + //***************************************// + // TASK COMPLETE! + //**************************************// }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) {