-
Notifications
You must be signed in to change notification settings - Fork 488
PWGHF: Jpsi to e+e- task and candidate selection for HF #5085
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7dcee41
Jpsi task and candidate selection for HF
zhangbiao-phy 7ef6f7a
restore code
zhangbiao-phy e7b50f5
restore code
zhangbiao-phy 08de70c
rename task
zhangbiao-phy 23f4f2d
disable the TPC PID
zhangbiao-phy dde8b53
Adding flag selection
zhangbiao-phy ccf040d
Adding flag selection
zhangbiao-phy 25d6761
rename task and address the comments
zhangbiao-phy 5f32c9d
Adreess comments
zhangbiao-phy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,210 @@ | ||
| // Copyright CERN and copyright holders of ALICE O2. This software is | ||
| // distributed under the terms of the GNU General Public License v3 (GPL | ||
| // Version 3), copied verbatim in the file "COPYING". | ||
| // | ||
| // See http://alice-o2.web.cern.ch/license for full licensing information. | ||
| // | ||
| // In applying this license CERN does not waive the privileges and immunities | ||
| // granted to it by virtue of its status as an Intergovernmental Organization | ||
| // or submit itself to any jurisdiction. | ||
|
|
||
| /// \file HFJpsiToEECandidateSelector.cxx | ||
| /// \brief Jpsi selection task. | ||
| /// \author Biao Zhang <[email protected]>, CCNU | ||
| /// \author Nima Zardoshti <[email protected]>, CERN | ||
|
|
||
| #include "Framework/runDataProcessing.h" | ||
| #include "Framework/AnalysisTask.h" | ||
| #include "AnalysisDataModel/HFSecondaryVertex.h" | ||
| #include "AnalysisDataModel/HFCandidateSelectionTables.h" | ||
| using namespace o2; | ||
| using namespace o2::framework; | ||
| using namespace o2::aod::hf_cand_prong2; | ||
|
|
||
| static const int npTBins = 9; | ||
| static const int nCutVars = 4; | ||
| //temporary until 2D array in configurable is solved - then move to json | ||
| // mass dcaxy dcaz pt_e | ||
| constexpr double cuts[npTBins][nCutVars] = | ||
| {{0.5, 0.2, 0.4, 1}, /* pt<0.5 */ | ||
| {0.5, 0.2, 0.4, 1}, /* 0.5<pt<1 */ | ||
| {0.5, 0.2, 0.4, 1}, /* 1<pt<2 */ | ||
| {0.5, 0.2, 0.4, 1}, /* 2<pt<3 */ | ||
| {0.5, 0.2, 0.4, 1}, /* 3<pt<4 */ | ||
| {0.5, 0.2, 0.4, 1}, /* 4<pt<5 */ | ||
| {0.5, 0.2, 0.4, 1}, /* 5<pt<7 */ | ||
| {0.5, 0.2, 0.4, 1}, /* 7<pt<10 */ | ||
| {0.5, 0.2, 0.4, 1}}; /* 10<pt<15 */ | ||
|
|
||
| /// Struct for applying Jpsi selection cuts | ||
|
|
||
| struct HFJpsiToEECandidateSelector { | ||
|
|
||
| Produces<aod::HFSelJpsiToEECandidate> hfSelJpsiToEECandidate; | ||
|
|
||
| Configurable<double> d_pTCandMin{"d_pTCandMin", 0., "Lower bound of candidate pT"}; | ||
| Configurable<double> d_pTCandMax{"d_pTCandMax", 50., "Upper bound of candidate pT"}; | ||
|
|
||
| Configurable<double> d_pidTPCMinpT{"d_pidTPCMinpT", 0.15, "Lower bound of track pT for TPC PID"}; | ||
| Configurable<double> d_pidTPCMaxpT{"d_pidTPCMaxpT", 10., "Upper bound of track pT for TPC PID"}; | ||
|
|
||
| Configurable<double> d_TPCNClsFindablePIDCut{"d_TPCNClsFindablePIDCut", 70., "Lower bound of TPC findable clusters for good PID"}; | ||
| Configurable<double> d_nSigmaTPC{"d_nSigmaTPC", 3., "Nsigma cut on TPC only"}; | ||
|
|
||
| /// Gets corresponding pT bin from cut file array | ||
| /// \param candpT is the pT of the candidate | ||
| /// \return corresponding bin number of array | ||
| template <typename T> | ||
| int getpTBin(T candpT) | ||
| { | ||
| double pTBins[npTBins + 1] = {0, 0.5, 1., 2., 3., 4., 5., 7., 10., 15.}; | ||
| if (candpT < pTBins[0] || candpT >= pTBins[npTBins]) { | ||
| return -1; | ||
| } | ||
| for (int i = 0; i < npTBins; i++) { | ||
| if (candpT < pTBins[i + 1]) { | ||
| return i; | ||
| } | ||
| } | ||
| return -1; | ||
| } | ||
|
|
||
| /// Selection on goodness of daughter tracks | ||
| /// \note should be applied at candidate selection | ||
| /// \param track is daughter track | ||
| /// \return true if track is good | ||
| template <typename T> | ||
| bool daughterSelection(const T& track) | ||
| { | ||
| if (track.charge() == 0) { | ||
| return false; | ||
| } | ||
| if (track.tpcNClsFound() == 0) { | ||
| return false; //is it clusters findable or found - need to check | ||
| } | ||
| return true; | ||
| } | ||
|
|
||
| /// Conjugate independent toplogical cuts | ||
| /// \param hfCandProng2 is candidate | ||
| /// \param trackPositron is the track with the positron hypothesis | ||
| /// \param trackElectron is the track with the electron hypothesis | ||
| /// \return true if candidate passes all cuts | ||
| template <typename T1, typename T2> | ||
| bool selectionTopol(const T1& hfCandProng2, const T2& trackPositron, const T2& trackElectron) | ||
| { | ||
| auto candpT = hfCandProng2.pt(); | ||
| int pTBin = getpTBin(candpT); | ||
| if (pTBin == -1) { | ||
| return false; | ||
| } | ||
|
|
||
| if (candpT < d_pTCandMin || candpT >= d_pTCandMax) { | ||
| return false; //check that the candidate pT is within the analysis range | ||
| } | ||
|
|
||
| if (TMath::Abs(InvMassJpsiToEE(hfCandProng2) - RecoDecay::getMassPDG(443)) > cuts[pTBin][0]) { | ||
| return false; | ||
| } | ||
|
|
||
| if ((trackElectron.pt() < cuts[pTBin][3]) || (trackPositron.pt() < cuts[pTBin][3])) { | ||
| return false; //cut on daughter pT | ||
| } | ||
| if (TMath::Abs(trackElectron.dcaPrim0()) > cuts[pTBin][1] || TMath::Abs(trackPositron.dcaPrim0()) > cuts[pTBin][1]) { | ||
| return false; //cut on daughter dca - need to add secondary vertex constraint here | ||
| } | ||
| if (TMath::Abs(trackElectron.dcaPrim1()) > cuts[pTBin][2] || TMath::Abs(trackPositron.dcaPrim1()) > cuts[pTBin][2]) { | ||
| return false; //cut on daughter dca - need to add secondary vertex constraint here | ||
| } | ||
|
|
||
| return true; | ||
| } | ||
|
|
||
| /// Check if track is ok for TPC PID | ||
| /// \param track is the track | ||
| /// \note function to be expanded | ||
| /// \return true if track is ok for TPC PID | ||
| template <typename T> | ||
| bool validTPCPID(const T& track) | ||
| { | ||
| if (TMath::Abs(track.pt()) < d_pidTPCMinpT || TMath::Abs(track.pt()) >= d_pidTPCMaxpT) { | ||
| return false; | ||
| } | ||
| //if (track.TPCNClsFindable() < d_TPCNClsFindablePIDCut) return false; | ||
| return true; | ||
| } | ||
|
|
||
| /// Check if track is compatible with given TPC Nsigma cut for a given flavour hypothesis | ||
| /// \param track is the track | ||
| /// \param nPDG is the flavour hypothesis PDG number | ||
| /// \param nSigmaCut is the nsigma threshold to test against | ||
| /// \note nPDG=11 electron | ||
| /// \return true if track satisfies TPC PID hypothesis for given Nsigma cut | ||
| template <typename T> | ||
| bool selectionPIDTPC(const T& track, int nSigmaCut) | ||
| { | ||
| return track.tpcNSigmaEl() < nSigmaCut; | ||
| } | ||
|
|
||
| /// PID selection on daughter track | ||
| /// \param track is the daughter track | ||
| /// \param nPDG is the PDG code of the flavour hypothesis | ||
| /// \note nPDG=11 electron | ||
| /// \return 1 if successful PID match, 0 if successful PID rejection, -1 if no PID info | ||
| template <typename T> | ||
| int selectionPID(const T& track) | ||
| { | ||
|
|
||
| if (validTPCPID(track)) { | ||
| if (!selectionPIDTPC(track, d_nSigmaTPC)) { | ||
|
|
||
| return 0; //rejected by PID | ||
| } else { | ||
| return 1; //positive PID | ||
| } | ||
| } else { | ||
| return -1; //no PID info | ||
| } | ||
| } | ||
| void process(aod::HfCandProng2 const& hfCandProng2s, aod::BigTracksPID const& tracks) | ||
| { | ||
|
|
||
| for (auto& hfCandProng2 : hfCandProng2s) { //looping over 2 prong candidates | ||
|
|
||
| auto trackPos = hfCandProng2.index0_as<aod::BigTracksPID>(); //positive daughter | ||
| auto trackNeg = hfCandProng2.index1_as<aod::BigTracksPID>(); //negative daughter | ||
|
|
||
| if (!(hfCandProng2.hfflag() & 1 << JpsiToEE)) { | ||
| hfSelJpsiToEECandidate(0); | ||
| continue; | ||
| } | ||
|
|
||
| // daughter track validity selection | ||
| if (!daughterSelection(trackPos) || !daughterSelection(trackNeg)) { | ||
| hfSelJpsiToEECandidate(0); | ||
| continue; | ||
| } | ||
|
|
||
| //implement filter bit 4 cut - should be done before this task at the track selection level | ||
| //need to add special cuts (additional cuts on decay length and d0 norm) | ||
|
|
||
| if (!selectionTopol(hfCandProng2, trackPos, trackNeg)) { | ||
| hfSelJpsiToEECandidate(0); | ||
| continue; | ||
| } | ||
|
|
||
| if (selectionPID(trackPos) == 0 || selectionPID(trackNeg) == 0) { | ||
| hfSelJpsiToEECandidate(0); | ||
| continue; | ||
| } | ||
|
|
||
| hfSelJpsiToEECandidate(1); | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| WorkflowSpec defineDataProcessing(ConfigContext const&) | ||
| { | ||
| return WorkflowSpec{ | ||
| adaptAnalysisTask<HFJpsiToEECandidateSelector>("hf-jpsi-toee-candidate-selector")}; | ||
zhangbiao-phy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.