-
Notifications
You must be signed in to change notification settings - Fork 650
[PWGCF] added a process function for mixed event combinatorial bkg for phi #15710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,20 @@ | |
| // #define FLOAT_PRECISION 0xFFFFFFF0 | ||
| #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable<TYPE> NAME{#NAME, DEFAULT, HELP}; | ||
|
|
||
| namespace o2::aod | ||
| { | ||
| namespace cfmultiplicity | ||
| { | ||
| DECLARE_SOA_COLUMN(Multiplicity, multiplicity, float); | ||
| } | ||
| DECLARE_SOA_TABLE(CFMultiplicities, "AOD", "CFMULTIPLICITY", cfmultiplicity::Multiplicity); | ||
|
|
||
| using CFMultiplicity = CFMultiplicities::iterator; | ||
| } // namespace o2::aod | ||
|
|
||
| struct Filter2Prong { | ||
| SliceCache cache; | ||
|
|
||
| O2_DEFINE_CONFIGURABLE(cfgVerbosity, int, 0, "Verbosity level (0 = major, 1 = per collision)") | ||
| O2_DEFINE_CONFIGURABLE(cfgYMax, float, -1.0f, "Maximum candidate rapidity") | ||
| O2_DEFINE_CONFIGURABLE(cfgImPart1Mass, float, o2::constants::physics::MassKPlus, "Daughter particle 1 mass in GeV") | ||
|
|
@@ -146,6 +159,10 @@ | |
| O2_DEFINE_CONFIGURABLE(applyTOF, bool, false, "Flag for applying TOF"); | ||
| } grpPhi; | ||
|
|
||
| O2_DEFINE_CONFIGURABLE(cfgNoMixedEvents, int, 5, "Number of mixed events per event for mixed phi building") | ||
| ConfigurableAxis axisVertexMix{"axisVertexMix", {7, -7, 7}, "vertex axis for phi event mixing"}; | ||
| ConfigurableAxis axisMultiplicityMix{"axisMultiplicityMix", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 100.1}, "multiplicity axis for phi event mixing"}; | ||
|
|
||
| HfHelper hfHelper; | ||
| Produces<aod::CF2ProngTracks> output2ProngTracks; | ||
| Produces<aod::CF2ProngTrackmls> output2ProngTrackmls; | ||
|
|
@@ -225,10 +242,10 @@ | |
| prongCFId[0], prongCFId[1], c.pt(), c.eta(), c.phi(), hfHelper.invMassD0ToPiK(c), aod::cf2prongtrack::D0ToPiK); | ||
| if constexpr (std::experimental::is_detected<HasMLProb, typename HFCandidatesType::iterator>::value) { | ||
| mlvecd.clear(); | ||
| for (const float val : c.mlProbD0()) | ||
| mlvecd.push_back(val); | ||
| mlvecdbar.clear(); | ||
| for (const float val : c.mlProbD0bar()) | ||
| mlvecdbar.push_back(val); | ||
| output2ProngTrackmls(cfcollisions.begin().globalIndex(), mlvecd, mlvecdbar); | ||
| } | ||
|
|
@@ -772,6 +789,106 @@ | |
| } | ||
| PROCESS_SWITCH(Filter2Prong, processDataPhiV0, "Process data Phi and V0 candidates with invariant mass method", false); | ||
|
|
||
| using DerivedCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::CFMultiplicities>; | ||
| void processDataPhiMixed(DerivedCollisions const& collisions, Filter2Prong::PIDTrack const& tracksP, aod::CFTrackRefs const& cftracks) | ||
| { | ||
| auto getMultiplicity = [](auto const& col) { | ||
| return col.multiplicity(); | ||
| }; | ||
| using BinningTypeDerived = FlexibleBinningPolicy<std::tuple<decltype(getMultiplicity)>, aod::collision::PosZ, decltype(getMultiplicity)>; | ||
| BinningTypeDerived configurableBinningDerived{{getMultiplicity}, {axisVertexMix, axisMultiplicityMix}, true}; | ||
| auto tracksTuple = std::make_tuple(cftracks, cftracks); | ||
| using TA = std::tuple_element<0, decltype(tracksTuple)>::type; | ||
| using TB = std::tuple_element<std::tuple_size_v<decltype(tracksTuple)> - 1, decltype(tracksTuple)>::type; | ||
| Pair<DerivedCollisions, TA, TB, BinningTypeDerived> pairs{configurableBinningDerived, cfgNoMixedEvents, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip | ||
|
|
||
| o2::aod::ITSResponse itsResponse; | ||
|
|
||
| for (auto it = pairs.begin(); it != pairs.end(); it++) { | ||
| auto& [collision1, tracks1, collision2, tracks2] = *it; | ||
| // float multiplicity = getMultiplicity(collision1); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the commented lines
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok |
||
| // int bin = configurableBinningDerived.getBin(std::tuple(collision1.posZ(), multiplicity)); | ||
| // float eventWeight = 1.0f / it.currentWindowNeighbours(); | ||
| if (!(collision1.sel8() && | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may later need to run it with a larger
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes currently I am using the same set of event cuts as we applied for the same events....do you want to remove these? |
||
| collision1.selection_bit(aod::evsel::kNoSameBunchPileup) && | ||
| collision1.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) && | ||
| collision1.selection_bit(aod::evsel::kIsGoodITSLayersAll))) { | ||
| continue; | ||
| } | ||
|
|
||
| if (!(collision2.sel8() && | ||
| collision2.selection_bit(aod::evsel::kNoSameBunchPileup) && | ||
| collision2.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) && | ||
| collision2.selection_bit(aod::evsel::kIsGoodITSLayersAll))) { | ||
| continue; | ||
| } | ||
|
|
||
| for (const auto& cftrack1 : tracks1) { | ||
| const auto& p1 = tracksP.iteratorAt(cftrack1.trackId() - tracksP.begin().globalIndex()); | ||
|
|
||
| if (p1.sign() != 1) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it works but as I am using the p1 for the rest of the logic (tracks cuts, pid...) i am using this object consistently
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
| continue; | ||
| } | ||
| if (!selectionTrack(p1)) { | ||
| continue; | ||
| } | ||
| if (grpPhi.ITSPIDSelection && | ||
| p1.p() < grpPhi.ITSPIDPthreshold.value && | ||
| !(itsResponse.nSigmaITS<o2::track::PID::Kaon>(p1) > grpPhi.lowITSPIDNsigma.value && | ||
| itsResponse.nSigmaITS<o2::track::PID::Kaon>(p1) < grpPhi.highITSPIDNsigma.value)) { | ||
| continue; | ||
| } | ||
| if (grpPhi.removefaketrack && isFakeTrack(p1)) { | ||
| continue; | ||
| } | ||
|
|
||
| for (const auto& cftrack2 : tracks2) { | ||
| const auto& p2 = tracksP.iteratorAt(cftrack2.trackId() - tracksP.begin().globalIndex()); | ||
|
|
||
| if (p2.sign() != -1) { | ||
| continue; | ||
| } | ||
| if (!selectionTrack(p2)) { | ||
| continue; | ||
| } | ||
| if (grpPhi.ITSPIDSelection && | ||
| p2.p() < grpPhi.ITSPIDPthreshold.value && | ||
| !(itsResponse.nSigmaITS<o2::track::PID::Kaon>(p2) > grpPhi.lowITSPIDNsigma.value && | ||
| itsResponse.nSigmaITS<o2::track::PID::Kaon>(p2) < grpPhi.highITSPIDNsigma.value)) { | ||
| continue; | ||
| } | ||
| if (grpPhi.removefaketrack && isFakeTrack(p2)) { | ||
| continue; | ||
| } | ||
| if (!selectionPair(p1, p2)) { | ||
| continue; | ||
| } | ||
|
|
||
| ROOT::Math::PtEtaPhiMVector vec1(p1.pt(), p1.eta(), p1.phi(), cfgImPart1Mass); | ||
| ROOT::Math::PtEtaPhiMVector vec2(p2.pt(), p2.eta(), p2.phi(), cfgImPart2Mass); | ||
| ROOT::Math::PtEtaPhiMVector s = vec1 + vec2; | ||
|
|
||
| if (s.M() < grpPhi.ImMinInvMassPhiMeson || s.M() > grpPhi.ImMaxInvMassPhiMeson) { | ||
| continue; | ||
| } | ||
|
|
||
| float phi = RecoDecay::constrainAngle(s.Phi(), 0.0f); | ||
|
|
||
| if (selectionPID3(p1) && selectionPID3(p2)) { | ||
| if (selectionSys(p1, false, false) && selectionSys(p2, false, false)) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move the selections before the computations (line 867)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok |
||
| output2ProngTracks(collision1.globalIndex(), | ||
| cftrack1.globalIndex(), cftrack2.globalIndex(), | ||
| s.pt(), s.eta(), phi, s.M(), | ||
| aod::cf2prongtrack::PhiToKKPID3Mixed); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| PROCESS_SWITCH(Filter2Prong, processDataPhiMixed, "Process mixed-event phi candidates using O2 framework", false); | ||
|
|
||
| // Phi and V0s invariant mass method candidate finder. Only works for non-identical daughters of opposite charge for now. | ||
| void processDataV0(aod::Collisions::iterator const& collision, aod::BCsWithTimestamps const&, aod::CFCollRefs const& cfcollisions, aod::CFTrackRefs const& cftracks, Filter2Prong::PIDTrack const&, aod::V0Datas const& V0s) | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this to the data model, then we do not need to have it twice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok