diff --git a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h index c96b0617005..0159aeeb74d 100644 --- a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h +++ b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h @@ -159,20 +159,20 @@ int enumMyParticle(int valuePDG) int trackPDGfromEnum(int trackEnum) // reads pdg value and returns particle number as in enumMyParticle { - if (trackEnum == P_ELECTRON) { - return 11; - } else if (trackEnum == P_MUON) { - return 13; - } else if (trackEnum == P_PION) { - return 211; - } else if (trackEnum == P_KAON) { - return 321; - } else if (trackEnum == P_PROTON) { - return 2212; - } else { - printDebugMessage("PDG value not found in enumMyParticle. Returning -1."); - return -1.; - } + if (trackEnum == P_ELECTRON) { + return 11; + } else if (trackEnum == P_MUON) { + return 13; + } else if (trackEnum == P_PION) { + return 211; + } else if (trackEnum == P_KAON) { + return 321; + } else if (trackEnum == P_PROTON) { + return 2212; + } else { + printDebugMessage("PDG value not found in enumMyParticle. Returning -1."); + return -1.; + } } float pt(float px, float py) diff --git a/PWGUD/TableProducer/tauEventTableProducer.cxx b/PWGUD/TableProducer/tauEventTableProducer.cxx index efb06e259d6..4cda2b55a43 100644 --- a/PWGUD/TableProducer/tauEventTableProducer.cxx +++ b/PWGUD/TableProducer/tauEventTableProducer.cxx @@ -73,11 +73,11 @@ struct TauEventTableProducer { Configurable cutTrueGapSideFT0C{"cutTrueGapSideFT0C", 50., "FT0C threshold for SG selector"}; Configurable cutTrueGapSideZDC{"cutTrueGapSideZDC", 10000., "ZDC threshold for SG selector. 0 is <1n, 4.2 is <2n, 6.7 is <3n, 9.5 is <4n, 12.5 is <5n"}; Configurable cutFITtime{"cutFITtime", 40., "Maximum FIT time allowed. Default is 40ns"}; - Configurable cutEvTFb{"cutEvTFb", true, {"Event selection bit kNoTimeFrameBorder"}}; - Configurable cutEvITSROFb{"cutEvITSROFb", true, {"Event selection bit kNoITSROFrameBorder"}}; - Configurable cutEvSbp{"cutEvSbp", true, {"Event selection bit kNoSameBunchPileup"}}; - Configurable cutEvZvtxFT0vPV{"cutEvZvtxFT0vPV", false, {"Event selection bit kIsGoodZvtxFT0vsPV"}}; - Configurable cutEvVtxITSTPC{"cutEvVtxITSTPC", true, {"Event selection bit kIsVertexITSTPC"}}; + Configurable cutEvTFb{"cutEvTFb", true, {"Event selection bit kNoTimeFrameBorder"}}; + Configurable cutEvITSROFb{"cutEvITSROFb", true, {"Event selection bit kNoITSROFrameBorder"}}; + Configurable cutEvSbp{"cutEvSbp", true, {"Event selection bit kNoSameBunchPileup"}}; + Configurable cutEvZvtxFT0vPV{"cutEvZvtxFT0vPV", false, {"Event selection bit kIsGoodZvtxFT0vsPV"}}; + Configurable cutEvVtxITSTPC{"cutEvVtxITSTPC", true, {"Event selection bit kIsVertexITSTPC"}}; Configurable cutEvOccupancy{"cutEvOccupancy", 100000., "Maximum allowed occupancy"}; Configurable cutEvTrs{"cutEvTrs", false, {"Event selection bit kNoCollInTimeRangeStandard"}}; Configurable cutEvTrofs{"cutEvTrofs", false, {"Event selection bit kNoCollInRofStandard"}}; @@ -157,25 +157,25 @@ struct TauEventTableProducer { bool isGoodROFtime(C const& coll) { - // kNoTimeFrameBorder - if (cutSample.cutEvTFb && !coll.tfb()) - return false; + // kNoTimeFrameBorder + if (cutSample.cutEvTFb && !coll.tfb()) + return false; - // kNoITSROFrameBorder - if (cutSample.cutEvITSROFb && !coll.itsROFb()) - return false; + // kNoITSROFrameBorder + if (cutSample.cutEvITSROFb && !coll.itsROFb()) + return false; - // kNoSameBunchPileup - if (cutSample.cutEvSbp && !coll.sbp()) - return false; + // kNoSameBunchPileup + if (cutSample.cutEvSbp && !coll.sbp()) + return false; - // kIsGoodZvtxFT0vsPV - if (cutSample.cutEvZvtxFT0vPV && !coll.zVtxFT0vPV()) - return false; + // kIsGoodZvtxFT0vsPV + if (cutSample.cutEvZvtxFT0vPV && !coll.zVtxFT0vPV()) + return false; - // kIsVertexITSTPC - if (cutSample.cutEvVtxITSTPC && !coll.vtxITSTPC()) - return false; + // kIsVertexITSTPC + if (cutSample.cutEvVtxITSTPC && !coll.vtxITSTPC()) + return false; // Occupancy if (coll.occupancyInTime() > cutSample.cutEvOccupancy) diff --git a/PWGUD/TableProducer/twoTracksEventTableProducer.cxx b/PWGUD/TableProducer/twoTracksEventTableProducer.cxx index fa198b10be5..a15129999e8 100644 --- a/PWGUD/TableProducer/twoTracksEventTableProducer.cxx +++ b/PWGUD/TableProducer/twoTracksEventTableProducer.cxx @@ -17,20 +17,25 @@ // // C++ headers +#include +#include #include #include -#include #include -#include // O2 headers -#include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/O2DatabasePDGPlugin.h" #include "Framework/runDataProcessing.h" // O2Physics headers +#include "PWGUD/Core/SGSelector.h" +#include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" +#include "PWGUD/DataModel/TauEventTables.h" +#include "PWGUD/DataModel/UDTables.h" + #include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/TrackSelectionDefaults.h" @@ -38,10 +43,6 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" -#include "PWGUD/DataModel/UDTables.h" -#include "PWGUD/DataModel/TauEventTables.h" -#include "PWGUD/Core/SGSelector.h" // ROOT #include "Math/Vector4D.h" @@ -60,7 +61,7 @@ struct TauEventTableProducer { // Global varialbes Service pdg; SGSelector sgSelector; - int nSelection{0}; + int nSelection{0}; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -79,11 +80,11 @@ struct TauEventTableProducer { Configurable cutTrueGapSideFT0C{"cutTrueGapSideFT0C", 50., "FT0C threshold for SG selector"}; Configurable cutTrueGapSideZDC{"cutTrueGapSideZDC", 10000., "ZDC threshold for SG selector. 0 is <1n, 4.2 is <2n, 6.7 is <3n, 9.5 is <4n, 12.5 is <5n"}; Configurable cutFITtime{"cutFITtime", 40., "Maximum FIT time allowed. Default is 40ns"}; - Configurable cutEvTFb{"cutEvTFb", true, {"Event selection bit kNoTimeFrameBorder"}}; - Configurable cutEvITSROFb{"cutEvITSROFb", true, {"Event selection bit kNoITSROFrameBorder"}}; - Configurable cutEvSbp{"cutEvSbp", true, {"Event selection bit kNoSameBunchPileup"}}; - Configurable cutEvZvtxFT0vPV{"cutEvZvtxFT0vPV", false, {"Event selection bit kIsGoodZvtxFT0vsPV"}}; - Configurable cutEvVtxITSTPC{"cutEvVtxITSTPC", true, {"Event selection bit kIsVertexITSTPC"}}; + Configurable cutEvTFb{"cutEvTFb", true, {"Event selection bit kNoTimeFrameBorder"}}; + Configurable cutEvITSROFb{"cutEvITSROFb", true, {"Event selection bit kNoITSROFrameBorder"}}; + Configurable cutEvSbp{"cutEvSbp", true, {"Event selection bit kNoSameBunchPileup"}}; + Configurable cutEvZvtxFT0vPV{"cutEvZvtxFT0vPV", false, {"Event selection bit kIsGoodZvtxFT0vsPV"}}; + Configurable cutEvVtxITSTPC{"cutEvVtxITSTPC", true, {"Event selection bit kIsVertexITSTPC"}}; Configurable cutEvOccupancy{"cutEvOccupancy", 100000., "Maximum allowed occupancy"}; Configurable cutEvTrs{"cutEvTrs", false, {"Event selection bit kNoCollInTimeRangeStandard"}}; Configurable cutEvTrofs{"cutEvTrofs", false, {"Event selection bit kNoCollInRofStandard"}}; @@ -113,14 +114,14 @@ struct TauEventTableProducer { } cutGlobalTrack; struct : ConfigurableGroup { - Configurable preselAtLeastOneTOFtrack{"preselAtLeastOneTOFtrack", false, {"At least one track is required to hit TOF."}}; - Configurable preselBothAreTOFtracks{"preselBothAreTOFtracks", false, {"Both tracks are required to hit TOF."}}; - Configurable preselUseMinMomentumOnBothTracks{"preselUseMinMomentumOnBothTracks", false, {"Both tracks are required to fill requirement on minimum momentum."}}; - Configurable preselMinTrackMomentum{"preselMinTrackMomentum", 0.1, {"Requirement on minimum momentum of the track."}}; - Configurable preselSystemPtCut{"preselSystemPtCut", 0.0, {"By default, cut on maximum system pT."}}; - Configurable preselUseOppositeSystemPtCut{"preselUseOppositeSystemPtCut", false, {"Negates the system pT cut (cut on minimum system pT)."}}; - Configurable preselMinInvariantMass{"preselMinInvariantMass", 2.0, {"Requirement on minimum system invariant mass."}}; - Configurable preselMaxInvariantMass{"preselMaxInvariantMass", 5.0, {"Requirement on maximum system invariant mass."}}; + Configurable preselAtLeastOneTOFtrack{"preselAtLeastOneTOFtrack", false, {"At least one track is required to hit TOF."}}; + Configurable preselBothAreTOFtracks{"preselBothAreTOFtracks", false, {"Both tracks are required to hit TOF."}}; + Configurable preselUseMinMomentumOnBothTracks{"preselUseMinMomentumOnBothTracks", false, {"Both tracks are required to fill requirement on minimum momentum."}}; + Configurable preselMinTrackMomentum{"preselMinTrackMomentum", 0.1, {"Requirement on minimum momentum of the track."}}; + Configurable preselSystemPtCut{"preselSystemPtCut", 0.0, {"By default, cut on maximum system pT."}}; + Configurable preselUseOppositeSystemPtCut{"preselUseOppositeSystemPtCut", false, {"Negates the system pT cut (cut on minimum system pT)."}}; + Configurable preselMinInvariantMass{"preselMinInvariantMass", 2.0, {"Requirement on minimum system invariant mass."}}; + Configurable preselMaxInvariantMass{"preselMaxInvariantMass", 5.0, {"Requirement on maximum system invariant mass."}}; } cutPreselect; using FullUDTracks = soa::Join; @@ -138,7 +139,7 @@ struct TauEventTableProducer { mySetITShitsRule(cutGlobalTrack.cutITShitsRule); - histos.add("Reco/hSelections", "Effect of selections;;Number of events (-)", HistType::kTH1D, {{50, 0.5, 50.5}}); + histos.add("Reco/hSelections", "Effect of selections;;Number of events (-)", HistType::kTH1D, {{50, 0.5, 50.5}}); histos.add("Truth/hTroubles", "Counter of unwanted issues;;Number of troubles (-)", HistType::kTH1D, {{15, 0.5, 15.5}}); } // end init @@ -150,14 +151,14 @@ struct TauEventTableProducer { // FTOA if ((std::abs(coll.timeFT0A()) > maxFITtime) && coll.timeFT0A() > -998.) return false; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; // FTOC if ((std::abs(coll.timeFT0C()) > maxFITtime) && coll.timeFT0C() > -998.) return false; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; return true; } @@ -166,59 +167,59 @@ struct TauEventTableProducer { bool isGoodROFtime(C const& coll) { - // kNoTimeFrameBorder - if (cutSample.cutEvTFb && !coll.tfb()) - return false; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; - - // kNoITSROFrameBorder - if (cutSample.cutEvITSROFb && !coll.itsROFb()) - return false; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; - - // kNoSameBunchPileup - if (cutSample.cutEvSbp && !coll.sbp()) - return false; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; - - // kIsGoodZvtxFT0vsPV - if (cutSample.cutEvZvtxFT0vPV && !coll.zVtxFT0vPV()) - return false; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; - - // kIsVertexITSTPC - if (cutSample.cutEvVtxITSTPC && !coll.vtxITSTPC()) - return false; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; + // kNoTimeFrameBorder + if (cutSample.cutEvTFb && !coll.tfb()) + return false; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; + + // kNoITSROFrameBorder + if (cutSample.cutEvITSROFb && !coll.itsROFb()) + return false; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; + + // kNoSameBunchPileup + if (cutSample.cutEvSbp && !coll.sbp()) + return false; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; + + // kIsGoodZvtxFT0vsPV + if (cutSample.cutEvZvtxFT0vPV && !coll.zVtxFT0vPV()) + return false; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; + + // kIsVertexITSTPC + if (cutSample.cutEvVtxITSTPC && !coll.vtxITSTPC()) + return false; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; // Occupancy if (coll.occupancyInTime() > cutSample.cutEvOccupancy) return false; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; // kNoCollInTimeRangeStandard if (cutSample.cutEvTrs && !coll.trs()) return false; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; // kNoCollInRofStandard if (cutSample.cutEvTrofs && !coll.trofs()) return false; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; // kNoHighMultCollInPrevRof if (cutSample.cutEvHmpr && !coll.hmpr()) return false; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; return true; } @@ -321,34 +322,34 @@ struct TauEventTableProducer { return true; } - template - float findRightMass(T const& trk1, T const& trk2) - // choose the right mass for the tracks based on comparing combined sigma - // good for same-type particles decays - { - float nSigmasTPCsqrt[5]; - nSigmasTPCsqrt[P_ELECTRON] = std::sqrt(trk1.tpcNsigmaEl()*trk1.tpcNsigmaEl()+trk2.tpcNsigmaEl()*trk2.tpcNsigmaEl()) - nSigmasTPCsqrt[P_MUON] = std::sqrt(trk1.tpcNsigmaMu()*trk1.tpcNsigmaMu()+trk2.tpcNsigmaMu()*trk2.tpcNsigmaMu()) - nSigmasTPCsqrt[P_PION] = std::sqrt(trk1.tpcNsigmaPi()*trk1.tpcNsigmaPi()+trk2.tpcNsigmaPi()*trk2.tpcNsigmaPi()) - nSigmasTPCsqrt[P_KAON] = std::sqrt(trk1.tpcNsigmaKa()*trk1.tpcNsigmaKa()+trk2.tpcNsigmaKa()*trk2.tpcNsigmaKa()) - nSigmasTPCsqrt[P_PROTON] = std::sqrt(trk1.tpcNsigmaPr()*trk1.tpcNsigmaPr()+trk2.tpcNsigmaPr()*trk2.tpcNsigmaPr()) + template + float findRightMass(T const& trk1, T const& trk2) + // choose the right mass for the tracks based on comparing combined sigma + // good for same-type particles decays + { + float nSigmasTPCsqrt[5]; + nSigmasTPCsqrt[P_ELECTRON] = std::sqrt(trk1.tpcNsigmaEl() * trk1.tpcNsigmaEl() + trk2.tpcNsigmaEl() * trk2.tpcNsigmaEl()) + nSigmasTPCsqrt[P_MUON] = std::sqrt(trk1.tpcNsigmaMu() * trk1.tpcNsigmaMu() + trk2.tpcNsigmaMu() * trk2.tpcNsigmaMu()) + nSigmasTPCsqrt[P_PION] = std::sqrt(trk1.tpcNsigmaPi() * trk1.tpcNsigmaPi() + trk2.tpcNsigmaPi() * trk2.tpcNsigmaPi()) + nSigmasTPCsqrt[P_KAON] = std::sqrt(trk1.tpcNsigmaKa() * trk1.tpcNsigmaKa() + trk2.tpcNsigmaKa() * trk2.tpcNsigmaKa()) + nSigmasTPCsqrt[P_PROTON] = std::sqrt(trk1.tpcNsigmaPr() * trk1.tpcNsigmaPr() + trk2.tpcNsigmaPr() * trk2.tpcNsigmaPr()) - int enumChoiceTPC = std::distance(std::begin(nSigmasTPCsqrt), - std::min_element(std::begin(nSigmasTPCsqrt), std::end(nSigmasTPCsqrt))); + int enumChoiceTPC = std::distance(std::begin(nSigmasTPCsqrt), + std::min_element(std::begin(nSigmasTPCsqrt), std::end(nSigmasTPCsqrt))); - return pdg->Mass(trackPDGfromEnum(enumChoiceTPC)); - } + return pdg->Mass(trackPDGfromEnum(enumChoiceTPC)); + } void processDataSG(FullSGUDCollision const& collision, FullUDTracks const& tracks) { - nSelection = 0; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; + nSelection = 0; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; - if (!isGoodROFtime(collision)) - return; + if (!isGoodROFtime(collision)) + return; int gapSide = collision.gapSide(); int trueGapSide = sgSelector.trueGap(collision, cutSample.cutTrueGapSideFV0, cutSample.cutTrueGapSideFT0A, cutSample.cutTrueGapSideFT0C, cutSample.cutTrueGapSideZDC); @@ -358,21 +359,21 @@ struct TauEventTableProducer { if (gapSide != cutSample.whichGapSide) return; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; if (!isGoodFITtime(collision, cutSample.cutFITtime)) return; if (cutSample.useNumContribs && (collision.numContrib() != cutSample.cutNumContribs)) return; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; if (cutSample.useRecoFlag && (collision.flags() != cutSample.cutRecoFlag)) return; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; int countTracksPerCollision = 0; int countGoodNonPVtracks = 0; @@ -391,60 +392,60 @@ struct TauEventTableProducer { vecTrkIdx.push_back(track.index()); } // Loop over tracks with selections - // Critical selection, without it the rest of the process function will fail - if (countGoodPVtracks != 2) - return; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; + // Critical selection, without it the rest of the process function will fail + if (countGoodPVtracks != 2) + return; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; - const auto& trk1 = tracks.iteratorAt(vecTrkIdx[0]); - const auto& trk2 = tracks.iteratorAt(vecTrkIdx[1]); + const auto& trk1 = tracks.iteratorAt(vecTrkIdx[0]); + const auto& trk2 = tracks.iteratorAt(vecTrkIdx[1]); - float thisMass = findRightMass(trk1,trk2); + float thisMass = findRightMass(trk1, trk2); - // prepare lorentz vectors to create system - ROOT::Math::LorentzVector> twoTrackMother, daug[2]; - daug[0].SetPxPyPzE(trk1.px(), trk1.py(), trk1.pz(), energy(thisMass, trk1.px(), trk1.py(), trk1.pz())); - daug[1].SetPxPyPzE(trk2.px(), trk2.py(), trk2.pz(), energy(thisMass, trk2.px(), trk2.py(), trk2.pz())); - twoTrackMother = daug[1] + daug[2]; - float thisPt = pt(twoTrackMother.px(),twoTrackMother.py()); + // prepare lorentz vectors to create system + ROOT::Math::LorentzVector> twoTrackMother, daug[2]; + daug[0].SetPxPyPzE(trk1.px(), trk1.py(), trk1.pz(), energy(thisMass, trk1.px(), trk1.py(), trk1.pz())); + daug[1].SetPxPyPzE(trk2.px(), trk2.py(), trk2.pz(), energy(thisMass, trk2.px(), trk2.py(), trk2.pz())); + twoTrackMother = daug[1] + daug[2]; + float thisPt = pt(twoTrackMother.px(), twoTrackMother.py()); // Apply system selections - // invariant mass - if (twoTrackMother.M() < cutPreselect.preselMinInvariantMass || twoTrackMother.M() > cutPreselect.preselMaxInvariantMass) - return; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; - - // system pt - if (cutPreselect.preselUseOppositeSystemPtCut ? thisPt < cutPreselect.preselSystemPtCut : thisPt > cutPreselect.preselSystemPtCut) - return; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; - - // one track momentum - if (daug[0].P() < cutPreselect.preselMinTrackMomentum && daug[1].P() < cutPreselect.preselMinTrackMomentum) - return; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; - - // both tracks momentum - if (cutPreselect.preselUseMinMomentumOnBothTracks && (daug[0].P() < cutPreselect.preselMinTrackMomentum || daug[1].P() < cutPreselect.preselMinTrackMomentum)) - return; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; - - // track in TOF - if (cutPreselect.preselAtLeastOneTOFtrack && (!trk1.hasTOF() && !trk2.hasTOF())) - return; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; - - //tracks in TOF - if (cutPreselect.preselBothAreTOFtracks && (!trk1.hasTOF() || !trk2.hasTOF())) - return; - histos.get(HIST("Reco/hSelections"))->Fill(nSelection); - nSelection++; + // invariant mass + if (twoTrackMother.M() < cutPreselect.preselMinInvariantMass || twoTrackMother.M() > cutPreselect.preselMaxInvariantMass) + return; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; + + // system pt + if (cutPreselect.preselUseOppositeSystemPtCut ? thisPt < cutPreselect.preselSystemPtCut : thisPt > cutPreselect.preselSystemPtCut) + return; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; + + // one track momentum + if (daug[0].P() < cutPreselect.preselMinTrackMomentum && daug[1].P() < cutPreselect.preselMinTrackMomentum) + return; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; + + // both tracks momentum + if (cutPreselect.preselUseMinMomentumOnBothTracks && (daug[0].P() < cutPreselect.preselMinTrackMomentum || daug[1].P() < cutPreselect.preselMinTrackMomentum)) + return; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; + + // track in TOF + if (cutPreselect.preselAtLeastOneTOFtrack && (!trk1.hasTOF() && !trk2.hasTOF())) + return; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; + + // tracks in TOF + if (cutPreselect.preselBothAreTOFtracks && (!trk1.hasTOF() || !trk2.hasTOF())) + return; + histos.get(HIST("Reco/hSelections"))->Fill(nSelection); + nSelection++; float px[2] = {trk1.px(), trk2.px()}; float py[2] = {trk1.py(), trk2.py()}; @@ -480,7 +481,6 @@ struct TauEventTableProducer { itsClusterSizesTrk1, itsClusterSizesTrk2, tpcSignal, tpcEl, tpcMu, tpcPi, tpcKa, tpcPr, tpcIP, tofSignal, tofEl, tofMu, tofPi, tofKa, tofPr, tofEP); - } PROCESS_SWITCH(TauEventTableProducer, processDataSG, "Iterate UD tables with measured data created by SG-Candidate-Producer.", false); @@ -758,4 +758,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) adaptAnalysisTask(cfgc)}; } -#pragma clang diagnostic pop \ No newline at end of file +#pragma clang diagnostic pop diff --git a/PWGUD/Tasks/upcTauRl.cxx b/PWGUD/Tasks/upcTauRl.cxx index 17fd34068bd..b2708e64abc 100644 --- a/PWGUD/Tasks/upcTauRl.cxx +++ b/PWGUD/Tasks/upcTauRl.cxx @@ -156,11 +156,11 @@ struct UpcTauRl { Configurable cutTrueGapSideFT0C{"cutTrueGapSideFT0C", 50., "FT0C threshold for SG selector"}; Configurable cutTrueGapSideZDC{"cutTrueGapSideZDC", 0., "ZDC threshold for SG selector. 0 is <1n, 4.2 is <2n, 6.7 is <3n, 9.5 is <4n, 12.5 is <5n"}; Configurable cutFITtime{"cutFITtime", 40., "Maximum FIT time allowed. Default is 40ns"}; - Configurable cutEvTFb{"cutEvTFb", true, {"Event selection bit kNoTimeFrameBorder"}}; - Configurable cutEvITSROFb{"cutEvITSROFb", true, {"Event selection bit kNoITSROFrameBorder"}}; - Configurable cutEvSbp{"cutEvSbp", true, {"Event selection bit kNoSameBunchPileup"}}; - Configurable cutEvZvtxFT0vPV{"cutEvZvtxFT0vPV", false, {"Event selection bit kIsGoodZvtxFT0vsPV"}}; - Configurable cutEvVtxITSTPC{"cutEvVtxITSTPC", true, {"Event selection bit kIsVertexITSTPC"}}; + Configurable cutEvTFb{"cutEvTFb", true, {"Event selection bit kNoTimeFrameBorder"}}; + Configurable cutEvITSROFb{"cutEvITSROFb", true, {"Event selection bit kNoITSROFrameBorder"}}; + Configurable cutEvSbp{"cutEvSbp", true, {"Event selection bit kNoSameBunchPileup"}}; + Configurable cutEvZvtxFT0vPV{"cutEvZvtxFT0vPV", false, {"Event selection bit kIsGoodZvtxFT0vsPV"}}; + Configurable cutEvVtxITSTPC{"cutEvVtxITSTPC", true, {"Event selection bit kIsVertexITSTPC"}}; Configurable cutEvOccupancy{"cutEvOccupancy", 100000., "Maximum allowed occupancy"}; Configurable cutEvTrs{"cutEvTrs", true, {"Event selection bit kNoCollInTimeRangeStandard"}}; Configurable cutEvTrofs{"cutEvTrofs", true, {"Event selection bit kNoCollInRofStandard"}}; @@ -867,25 +867,25 @@ struct UpcTauRl { bool isGoodROFtime(C const& coll) { - // kNoTimeFrameBorder - if (cutSample.cutEvTFb && !coll.tfb()) - return false; + // kNoTimeFrameBorder + if (cutSample.cutEvTFb && !coll.tfb()) + return false; - // kNoITSROFrameBorder - if (cutSample.cutEvITSROFb && !coll.itsROFb()) - return false; + // kNoITSROFrameBorder + if (cutSample.cutEvITSROFb && !coll.itsROFb()) + return false; - // kNoSameBunchPileup - if (cutSample.cutEvSbp && !coll.sbp()) - return false; + // kNoSameBunchPileup + if (cutSample.cutEvSbp && !coll.sbp()) + return false; - // kIsGoodZvtxFT0vsPV - if (cutSample.cutEvZvtxFT0vPV && !coll.zVtxFT0vPV()) - return false; + // kIsGoodZvtxFT0vsPV + if (cutSample.cutEvZvtxFT0vPV && !coll.zVtxFT0vPV()) + return false; - // kIsVertexITSTPC - if (cutSample.cutEvVtxITSTPC && !coll.vtxITSTPC()) - return false; + // kIsVertexITSTPC + if (cutSample.cutEvVtxITSTPC && !coll.vtxITSTPC()) + return false; // Occupancy if (coll.occupancyInTime() > cutSample.cutEvOccupancy) @@ -1037,7 +1037,7 @@ struct UpcTauRl { template bool selectedTauEvent(T const& trkDaug1, T const& trkDaug2) { - ROOT::Math::LorentzVector> mother, daug[2], motherOfPions, pion[2]; + ROOT::Math::LorentzVector> mother, daug[2], motherOfPions, pion[2]; daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); daug[1].SetPxPyPzE(trkDaug2.px(), trkDaug2.py(), trkDaug2.pz(), energy(pdg->Mass(trackPDG(trkDaug2, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug2.px(), trkDaug2.py(), trkDaug2.pz())); if (cutTauEvent.useThresholdsPID) { @@ -1207,7 +1207,7 @@ struct UpcTauRl { histos.get(HIST("Events/hChannels"))->Fill(CH_EMUPI); if (isTwoSelectedTracks && doTwoTracks) { - ROOT::Math::LorentzVector> mother, daug[2], motherOfPions, pion[2], motherOfMuons, muon[2]; + ROOT::Math::LorentzVector> mother, daug[2], motherOfPions, pion[2], motherOfMuons, muon[2]; const auto& trkDaug1 = reconstructedBarrelTracks.iteratorAt(cutTauEvent.useThresholdsPID ? vecPVnewPIDidx[0] : vecPVidx[0]); const auto& trkDaug2 = reconstructedBarrelTracks.iteratorAt(cutTauEvent.useThresholdsPID ? vecPVnewPIDidx[1] : vecPVidx[1]); daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); @@ -1315,7 +1315,7 @@ struct UpcTauRl { const auto& mupionP = (cutTauEvent.useThresholdsPID ? isElectronCandidate(trkDaug1) : enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[1].P() : daug[0].P(); const auto& mupionE = (cutTauEvent.useThresholdsPID ? isElectronCandidate(trkDaug1) : enumMyParticle(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)) == P_ELECTRON) ? daug[1].E() : daug[0].E(); - ROOT::Math::LorentzVector> motherOfPiKaon, kaon; + ROOT::Math::LorentzVector> motherOfPiKaon, kaon; if (isElectronCandidate(trkDaug1)) { kaon.SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(MassKaonCharged, trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); motherOfPiKaon = kaon + daug[1]; @@ -1629,7 +1629,7 @@ struct UpcTauRl { } // Loop over tracks with selections if (countPVGT == 2 && doTwoTracks) { - ROOT::Math::LorentzVector> daug[2], pion[2], muon[2]; + ROOT::Math::LorentzVector> daug[2], pion[2], muon[2]; const auto& trkDaug1 = reconstructedBarrelTracks.iteratorAt(vecPVnoPIDidx[0]); const auto& trkDaug2 = reconstructedBarrelTracks.iteratorAt(vecPVnoPIDidx[1]); daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); @@ -1670,7 +1670,7 @@ struct UpcTauRl { bool isElEl = (cutTauEvent.useThresholdsPID ? countPVGTelectronsAlt == 2 : countPVGTelectrons == 2); bool isElMuPion = (cutTauEvent.useThresholdsPID ? (countPVGTelectronsAlt == 1 && countPVGTmupionsAlt == 1) : ((countPVGTelectrons == 1 && countPVGTmuons == 1) || (countPVGTelectrons == 1 && countPVGTpions == 1))); if (isTwoSelectedTracks && doTwoTracks) { - ROOT::Math::LorentzVector> daug[2], pion[2], muon[2]; + ROOT::Math::LorentzVector> daug[2], pion[2], muon[2]; const auto& trkDaug1 = reconstructedBarrelTracks.iteratorAt(cutTauEvent.useThresholdsPID ? vecPVnewPIDidx[0] : vecPVidx[0]); const auto& trkDaug2 = reconstructedBarrelTracks.iteratorAt(cutTauEvent.useThresholdsPID ? vecPVnewPIDidx[1] : vecPVidx[1]); daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz())); @@ -1869,7 +1869,7 @@ struct UpcTauRl { bool isElEl = (cutTauEvent.useThresholdsPID ? countPVGTelectronsAlt == 2 : countPVGTelectrons == 2); bool isElMuPion = (cutTauEvent.useThresholdsPID ? (countPVGTelectronsAlt == 1 && countPVGTmupionsAlt == 1) : ((countPVGTelectrons == 1 && countPVGTmuons == 1) || (countPVGTelectrons == 1 && countPVGTpions == 1))); if (isTwoSelectedTracks && doTwoTracks) { - ROOT::Math::LorentzVector> daug[2]; + ROOT::Math::LorentzVector> daug[2]; const auto& trkDaug1 = reconstructedBarrelTracks.iteratorAt(cutTauEvent.useThresholdsPID ? vecPVnewPIDidx[0] : vecPVidx[0]); const auto& trkDaug2 = reconstructedBarrelTracks.iteratorAt(cutTauEvent.useThresholdsPID ? vecPVnewPIDidx[1] : vecPVidx[1]); daug[0].SetPxPyPzE(trkDaug1.px(), trkDaug1.py(), trkDaug1.pz(), energy(pdg->Mass(trackPDG(trkDaug1, cutPID.cutSiTPC, cutPID.cutSiTOF, cutPID.usePIDwTOF, cutPID.useScutTOFinTPC)), trkDaug1.px(), trkDaug1.py(), trkDaug1.pz()));