Skip to content

Commit b571a11

Browse files
committed
addapting configurables and adding rejection counters
1 parent ce7c8d5 commit b571a11

1 file changed

Lines changed: 118 additions & 5 deletions

File tree

PWGUD/Tasks/upcTauRl.cxx

Lines changed: 118 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,17 @@ struct UpcTauRl {
213213
Configurable<float> cutElectronPt{"cutElectronPt", 0.9, {"Pt, where PiKaon invariant mass histos will split."}};
214214
} cutTauEvent;
215215

216+
struct : ConfigurableGroup {
217+
Configurable<float> cutCanMinElectronNsigmaEl{"cutCanMinElectronNsigmaEl", 4.0, {"Good el candidate hypo in. Upper n sigma cut on el hypo of selected electron. What is more goes away."}};
218+
Configurable<float> cutCanMaxElectronNsigmaEl{"cutCanMaxElectronNsigmaEl", -2.0, {"Good el candidate hypo in. Lower n sigma cut on el hypo of selected electron. What is less goes away."}};
219+
Configurable<bool> cutCanElectronHasTOF{"cutCanElectronHasTOF", true, {"Electron candidated is required to hit TOF."}};
220+
Configurable<float> cutCanMinPionNsigmaEl{"cutCanMinPionNsigmaEl", 5.0, {"Good pi candidate hypo in. Upper n sigma cut on pi hypo of selected electron. What is more goes away."}};
221+
Configurable<float> cutCanMaxPionNsigmaEl{"cutCanMaxPionNsigmaEl", -5.0, {"Good pi candidate hypo in. Lower n sigma cut on pi hypo of selected electron. What is less goes away."}};
222+
Configurable<float> cutCanMinMuonNsigmaEl{"cutCanMinMuonNsigmaEl", 5.0, {"Good pi candidate hypo in. Upper n sigma cut on pi hypo of selected electron. What is more goes away."}};
223+
Configurable<float> cutCanMaxMuonNsigmaEl{"cutCanMaxMuonNsigmaEl", -5.0, {"Good pi candidate hypo in. Lower n sigma cut on pi hypo of selected electron. What is less goes away."}};
224+
Configurable<bool> cutCanMupionHasTOF{"cutCanMupionHasTOF", true, {"Mupion candidate is required to hit TOF."}};
225+
} cutPreselect;
226+
216227
struct : ConfigurableGroup {
217228
Configurable<bool> usePIDwTOF{"usePIDwTOF", false, {"Determine whether also TOF should be used in testPIDhypothesis"}};
218229
Configurable<bool> useScutTOFinTPC{"useScutTOFinTPC", true, {"Determine whether cut on TOF n sigma should be used after TPC-based decision in testPIDhypothesis"}};
@@ -252,6 +263,8 @@ struct UpcTauRl {
252263
ConfigurableAxis zzAxisFITamplitude{"zzAxisFITamplitude", {1000, 0., 1000.}, "FIT amplitude"};
253264

254265
AxisSpec zzAxisChannels{CH_ENUM_COUNTER, -0.5, +CH_ENUM_COUNTER - 0.5, "Channels (-)"};
266+
AxisSpec zzAxisSelections{10, -0.5, 9.5, "Selections (-)"};
267+
255268
} confAxis;
256269

257270
using FullUDTracks = soa::Join<aod::UDTracks, aod::UDTracksExtra, aod::UDTracksDCA, aod::UDTracksPID, aod::UDTracksFlags>;
@@ -632,6 +645,14 @@ struct UpcTauRl {
632645
histos.add("Tracks/Truth/hPionEta", ";Pion #eta (-);Number of events (-)", HistType::kTH1D, {confAxis.zzAxisEta});
633646
}
634647

648+
histos.add("ProcessDataDG/hSelections", ";Selection (-);Number of passed collision (-)", HistType::kTH1D, {confAxis.zzAxisSelections});
649+
histos.add("ProcessDataSG/hSelections", ";Selection (-);Number of passed collision (-)", HistType::kTH1D, {confAxis.zzAxisSelections});
650+
histos.add("ProcessMCrecDG/hSelections", ";Selection (-);Number of passed collision (-)", HistType::kTH1D, {confAxis.zzAxisSelections});
651+
histos.add("ProcessMCrecSG/hSelections", ";Selection (-);Number of passed collision (-)", HistType::kTH1D, {confAxis.zzAxisSelections});
652+
histos.add("ProcessMCgen/hSelections", ";Selection (-);Number of passed collision (-)", HistType::kTH1D, {confAxis.zzAxisSelections});
653+
histos.add("OutputTable/hSelections", ";Selection (-);Number of passed collision (-)", HistType::kTH1D, {confAxis.zzAxisSelections});
654+
histos.add("OutputTable/hRejections", ";Rejections (-);Number of passed collision (-)", HistType::kTH1D, {confAxis.zzAxisSelections});
655+
635656
} // end init
636657

637658
// run (always called before process :( )
@@ -849,28 +870,56 @@ struct UpcTauRl {
849870
return true;
850871
}
851872

873+
unsigned int bitsRejection = 0;
874+
unsigned int bitsRejectElCan = 0;
875+
unsigned int bitsRejectMuPiCan = 0;
876+
877+
template <typename T>
878+
void fillRejectElectronCandidate(T const& electronCandidate)
879+
// Fill reasons of rejecting electron candidate
880+
{
881+
if (electronCandidate.tpcNSigmaEl() < cutPreselect.cutCanMaxElectronNsigmaEl || electronCandidate.tpcNSigmaEl() > cutPreselect.cutCanMinElectronNsigmaEl)
882+
bitsRejectElCan |= (1 << 0);
883+
if (cutPreselect.cutCanElectronHasTOF && !electronCandidate.hasTOF())
884+
bitsRejectElCan |= (1 << 1);
885+
}
886+
852887
template <typename T>
853888
bool isElectronCandidate(T const& electronCandidate)
854889
// Loose criterium to find electron-like particle
855890
// Requiring TOF to avoid double-counting pions/electrons and for better timing
856891
{
857-
if (electronCandidate.tpcNSigmaEl() < -2.0 || electronCandidate.tpcNSigmaEl() > 4.0)
892+
fillRejectElectronCandidate(electronCandidate);
893+
if (electronCandidate.tpcNSigmaEl() < cutPreselect.cutCanMaxElectronNsigmaEl || electronCandidate.tpcNSigmaEl() > cutPreselect.cutCanMinElectronNsigmaEl)
858894
return false;
859-
if (!electronCandidate.hasTOF())
895+
if (cutPreselect.cutCanElectronHasTOF && !electronCandidate.hasTOF())
860896
return false;
861897
return true;
862898
}
863899

900+
template <typename T>
901+
bool fillRejectMuPionCandidate(T const& muPionCandidate)
902+
// Fill reasons of rejecting mupion candidate
903+
{
904+
if (muPionCandidate.tpcNSigmaMu() < cutPreselect.cutCanMaxMuonNsigmaEl || muPionCandidate.tpcNSigmaMu() > cutPreselect.cutCanMinMuonNsigmaEl)
905+
bitsRejectMuPiCan |= (1 << 0);
906+
if (muPionCandidate.tpcNSigmaPi() < cutPreselect.cutCanMaxPionNsigmaEl || muPionCandidate.tpcNSigmaPi() > cutPreselect.cutCanMinPionNsigmaEl)
907+
bitsRejectMuPiCan |= (1 << 1);
908+
if (cutPreselect.cutCanMupionHasTOF && !muPionCandidate.hasTOF())
909+
bitsRejectMuPiCan |= (1 << 2);
910+
return true;
911+
}
912+
864913
template <typename T>
865914
bool isMuPionCandidate(T const& muPionCandidate)
866915
// Loose criterium to find muon/pion-like particle
867916
// Requiring TOF for better timing
868917
{
869-
if (muPionCandidate.tpcNSigmaMu() < -5.0 || muPionCandidate.tpcNSigmaMu() > 5.0)
918+
if (muPionCandidate.tpcNSigmaMu() < cutPreselect.cutCanMaxMuonNsigmaEl || muPionCandidate.tpcNSigmaMu() > cutPreselect.cutCanMinMuonNsigmaEl)
870919
return false;
871-
if (muPionCandidate.tpcNSigmaPi() < -5.0 || muPionCandidate.tpcNSigmaPi() > 5.0)
920+
if (muPionCandidate.tpcNSigmaPi() < cutPreselect.cutCanMaxPionNsigmaEl || muPionCandidate.tpcNSigmaPi() > cutPreselect.cutCanMinPionNsigmaEl)
872921
return false;
873-
if (!muPionCandidate.hasTOF())
922+
if (cutPreselect.cutCanMupionHasTOF && !muPionCandidate.hasTOF())
874923
return false;
875924
return true;
876925
}
@@ -2060,9 +2109,70 @@ struct UpcTauRl {
20602109
}
20612110
}
20622111

2112+
template <typename C>
2113+
void fillRejectionReasonDG(C const& collision)
2114+
{
2115+
if (!isGoodROFtime(collision))
2116+
bitsRejection |= (1 << 1);
2117+
2118+
if (!isGoodFITtime(collision, cutSample.cutFITtime))
2119+
bitsRejection |= (1 << 2);
2120+
2121+
if (cutSample.useNumContribs && (collision.numContrib() != cutSample.cutNumContribs))
2122+
bitsRejection |= (1 << 3);
2123+
2124+
if (cutSample.useRecoFlag && (collision.flags() != cutSample.cutRecoFlag))
2125+
bitsRejection |= (1 << 4);
2126+
}
2127+
2128+
template <typename C>
2129+
void fillRejectionReasonSG(C const& collision)
2130+
{
2131+
int gapSide = collision.gapSide();
2132+
2133+
if (cutSample.useTrueGap)
2134+
gapSide = sgSelector.trueGap(collision, cutSample.cutTrueGapSideFV0, cutSample.cutTrueGapSideFT0A, cutSample.cutTrueGapSideFT0C, cutSample.cutTrueGapSideZDC);
2135+
2136+
if (gapSide != cutSample.whichGapSide)
2137+
bitsRejection |= (1 << 0);
2138+
2139+
if (!isGoodROFtime(collision))
2140+
bitsRejection |= (1 << 1);
2141+
2142+
if (!isGoodFITtime(collision, cutSample.cutFITtime))
2143+
bitsRejection |= (1 << 2);
2144+
2145+
if (cutSample.useNumContribs && (collision.numContrib() != cutSample.cutNumContribs))
2146+
bitsRejection |= (1 << 3);
2147+
2148+
if (cutSample.useRecoFlag && (collision.flags() != cutSample.cutRecoFlag))
2149+
bitsRejection |= (1 << 4);
2150+
}
2151+
2152+
template <typename C>
2153+
void fillRejectionReasonMCSG(C const& collision)
2154+
{
2155+
if (collision.gapSide() != cutSample.whichGapSide)
2156+
bitsRejection |= (1 << 0);
2157+
2158+
if (!isGoodROFtime(collision))
2159+
bitsRejection |= (1 << 1);
2160+
2161+
if (!isGoodFITtime(collision, cutSample.cutFITtime))
2162+
bitsRejection |= (1 << 2);
2163+
2164+
if (cutSample.useNumContribs && (collision.numContrib() != cutSample.cutNumContribs))
2165+
bitsRejection |= (1 << 3);
2166+
2167+
if (cutSample.useRecoFlag && (collision.flags() != cutSample.cutRecoFlag))
2168+
bitsRejection |= (1 << 4);
2169+
}
2170+
2171+
20632172
void processDataDG(FullUDCollision const& reconstructedCollision,
20642173
FullUDTracks const& reconstructedBarrelTracks)
20652174
{
2175+
fillRejectionReasonDG(reconstructedCollision);
20662176

20672177
if (!isGoodROFtime(reconstructedCollision))
20682178
return;
@@ -2092,6 +2202,7 @@ struct UpcTauRl {
20922202
void processDataSG(FullSGUDCollision const& reconstructedCollision,
20932203
FullUDTracks const& reconstructedBarrelTracks)
20942204
{
2205+
fillRejectionReasonSG(reconstructedCollision);
20952206

20962207
int gapSide = reconstructedCollision.gapSide();
20972208
int trueGapSide = sgSelector.trueGap(reconstructedCollision, cutSample.cutTrueGapSideFV0, cutSample.cutTrueGapSideFT0A, cutSample.cutTrueGapSideFT0C, cutSample.cutTrueGapSideZDC);
@@ -2134,6 +2245,7 @@ struct UpcTauRl {
21342245
aod::UDMcParticles const&)
21352246
{
21362247
isMC = true;
2248+
fillRejectionReasonDG(reconstructedCollision);
21372249

21382250
if (!isGoodROFtime(reconstructedCollision))
21392251
return;
@@ -2176,6 +2288,7 @@ struct UpcTauRl {
21762288
aod::UDMcParticles const&)
21772289
{
21782290
isMC = true;
2291+
fillRejectionReasonMCSG(reconstructedCollision);
21792292

21802293
int gapSide = reconstructedCollision.gapSide();
21812294

0 commit comments

Comments
 (0)