Skip to content

Commit 7456d10

Browse files
committed
[PWGEM/Dilepton] update taggingHFE.cxx for ITSib requirement
1 parent 224139f commit 7456d10

1 file changed

Lines changed: 62 additions & 13 deletions

File tree

PWGEM/Dilepton/Tasks/taggingHFE.cxx

Lines changed: 62 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ struct taggingHFE {
199199
Configurable<float> cfg_max_chi2its{"cfg_max_chi2its", 36.0, "max chi2/NclsITS"};
200200
Configurable<int> cfg_min_ncluster_its{"cfg_min_ncluster_its", 2, "min ncluster its"};
201201
Configurable<int> cfg_min_ncluster_itsib{"cfg_min_ncluster_itsib", 0, "min ncluster itsib"};
202+
Configurable<int> cfg_itsib_type{"cfg_itsib_type", 0, "0:free, 1:OR, 2:AND between 2 legs, else:free"};
202203
Configurable<float> cfg_min_dcaxy{"cfg_min_dcaxy", 0.1, "min dca XY for v0 legs in cm"};
203-
204204
Configurable<float> cfg_max_alpha_veto{"cfg_max_alpha_veto", 0.95, "max alpha for photon conversion rejection"};
205205
Configurable<float> cfg_max_qt_veto{"cfg_max_qt_veto", 0.01, "max qT for photon conversion rejection"};
206206

@@ -241,6 +241,12 @@ struct taggingHFE {
241241
Configurable<float> cfg_min_dcaxy_v0leg{"cfg_min_dcaxy_v0leg", 0.1, "min dca XY for v0 legs in cm"};
242242
Configurable<float> cfg_min_dcaxy_bachelor{"cfg_min_dcaxy_bachelor", 0.05, "min dca XY for bachelor in cm"};
243243
Configurable<float> cfg_min_dcaxy_v0{"cfg_min_dcaxy_v0", 0.0, "min dca XY for V0 in cm"};
244+
245+
Configurable<int> cfg_itsib_type{"cfg_itsib_type", 0, "0:free, 1:OR, 2:AND between 2 legs, else:free"};
246+
Configurable<int> cfg_min_ncluster_its_v0leg{"cfg_min_ncluster_its_v0leg", 2, "min ncluster its"};
247+
Configurable<int> cfg_min_ncluster_itsib_v0leg{"cfg_min_ncluster_itsib_v0leg", 0, "min ncluster itsib"};
248+
Configurable<int> cfg_min_ncluster_its_bachelor{"cfg_min_ncluster_its_bachelor", 2, "min ncluster its"};
249+
Configurable<int> cfg_min_ncluster_itsib_bachelor{"cfg_min_ncluster_itsib_bachelor", 0, "min ncluster itsib"};
244250
} cascadeCut;
245251

246252
struct : ConfigurableGroup {
@@ -768,9 +774,10 @@ struct taggingHFE {
768774
return (cascadeCut.cfg_min_mass_Omega < cascade.mOmega() && cascade.mOmega() < cascadeCut.cfg_max_mass_Omega) && (cascade.mXi() < cascadeCut.cfg_min_mass_Xi_veto || cascadeCut.cfg_max_mass_Xi_veto < cascade.mXi());
769775
}
770776

771-
template <bool isMC = true, typename TTrack>
777+
template <int trackType = 0, bool isMC = true, typename TTrack>
772778
bool isSelectedV0Leg(TTrack const& track)
773779
{
780+
// trackType = 0:v0leg, 1:v0leg in cascade, 2:bachelor of cascade only for ITS requirements
774781
if constexpr (isMC) {
775782
if (!track.has_mcParticle()) {
776783
return false;
@@ -781,15 +788,21 @@ struct taggingHFE {
781788
return false;
782789
}
783790

784-
if (track.itsChi2NCl() > v0Cut.cfg_max_chi2its) {
785-
return false;
786-
}
787-
788-
if (track.itsNCls() < v0Cut.cfg_min_ncluster_its) {
789-
return false;
791+
if constexpr (trackType == 0) {
792+
if (track.itsNCls() < v0Cut.cfg_min_ncluster_its) { // must be 2
793+
return false;
794+
}
795+
} else if constexpr (trackType == 1) {
796+
if (track.itsNCls() < cascadeCut.cfg_min_ncluster_its_v0leg) { // must be 2
797+
return false;
798+
}
799+
} else if constexpr (trackType == 2) {
800+
if (track.itsNCls() < cascadeCut.cfg_min_ncluster_its_bachelor) { // must be 2
801+
return false;
802+
}
790803
}
791804

792-
if (track.itsNClsInnerBarrel() < v0Cut.cfg_min_ncluster_itsib) {
805+
if (track.itsChi2NCl() > v0Cut.cfg_max_chi2its) {
793806
return false;
794807
}
795808

@@ -816,6 +829,35 @@ struct taggingHFE {
816829
return true;
817830
}
818831

832+
template <int typeSV, typename TTrack>
833+
bool checkITSibForV0Legs(TTrack const& t1, TTrack const& t2)
834+
{
835+
// typeSV = 0:v0, 1:cascade
836+
if constexpr (typeSV == 0) { // V0 legs
837+
if (v0Cut.cfg_itsib_type == 0) { // free
838+
return true;
839+
} else if (v0Cut.cfg_itsib_type == 1) { // OR
840+
return t1.itsNClsInnerBarrel() >= v0Cut.cfg_min_ncluster_itsib || t2.itsNClsInnerBarrel() >= v0Cut.cfg_min_ncluster_itsib;
841+
} else if (v0Cut.cfg_itsib_type == 2) { // AND
842+
return t1.itsNClsInnerBarrel() >= v0Cut.cfg_min_ncluster_itsib && t2.itsNClsInnerBarrel() >= v0Cut.cfg_min_ncluster_itsib;
843+
} else {
844+
return true;
845+
}
846+
} else if constexpr (typeSV == 1) { // V0 legs in cascade
847+
if (cascadeCut.cfg_itsib_type == 0) { // free
848+
return true;
849+
} else if (cascadeCut.cfg_itsib_type == 1) { // OR
850+
return t1.itsNClsInnerBarrel() >= cascadeCut.cfg_min_ncluster_itsib_v0leg || t2.itsNClsInnerBarrel() >= cascadeCut.cfg_min_ncluster_itsib_v0leg;
851+
} else if (cascadeCut.cfg_itsib_type == 2) { // AND
852+
return t1.itsNClsInnerBarrel() >= cascadeCut.cfg_min_ncluster_itsib_v0leg && t2.itsNClsInnerBarrel() >= cascadeCut.cfg_min_ncluster_itsib_v0leg;
853+
} else {
854+
return true;
855+
}
856+
} else {
857+
return true;
858+
}
859+
}
860+
819861
template <typename TCollision>
820862
void fillEventHistograms(TCollision const& collision)
821863
{
@@ -1180,7 +1222,7 @@ struct taggingHFE {
11801222
if (pos.sign() * neg.sign() > 0) {
11811223
continue;
11821224
}
1183-
if (!isSelectedV0Leg(pos) || !isSelectedV0Leg(neg)) {
1225+
if (!isSelectedV0Leg<0, true>(pos) || !isSelectedV0Leg<0, true>(neg)) {
11841226
continue;
11851227
}
11861228

@@ -1257,7 +1299,7 @@ struct taggingHFE {
12571299
continue;
12581300
}
12591301

1260-
if (!isSelectedV0Leg(pos) || !isSelectedV0Leg(neg) || !isSelectedV0Leg(bachelor)) {
1302+
if (!isSelectedV0Leg<1, true>(pos) || !isSelectedV0Leg<1, true>(neg) || !isSelectedV0Leg<2, true>(bachelor)) {
12611303
continue;
12621304
}
12631305

@@ -1517,7 +1559,11 @@ struct taggingHFE {
15171559
for (const auto& v0 : v0s_per_coll) {
15181560
auto pos = v0.template posTrack_as<TTracks>();
15191561
auto neg = v0.template negTrack_as<TTracks>();
1520-
if (!isSelectedV0Leg<isMC>(pos) || !isSelectedV0Leg<isMC>(neg)) {
1562+
if (!isSelectedV0Leg<0, isMC>(pos) || !isSelectedV0Leg<0, isMC>(neg)) {
1563+
continue;
1564+
}
1565+
1566+
if (!checkITSibForV0Legs<0>(pos, neg)) {
15211567
continue;
15221568
}
15231569

@@ -1570,7 +1616,10 @@ struct taggingHFE {
15701616
continue;
15711617
}
15721618

1573-
if (!isSelectedV0Leg<isMC>(pos) || !isSelectedV0Leg<isMC>(neg) || !isSelectedV0Leg<isMC>(bachelor)) {
1619+
if (!isSelectedV0Leg<1, isMC>(pos) || !isSelectedV0Leg<1, isMC>(neg) || !isSelectedV0Leg<2, isMC>(bachelor)) {
1620+
continue;
1621+
}
1622+
if (!checkITSibForV0Legs<1>(pos, neg)) {
15741623
continue;
15751624
}
15761625

0 commit comments

Comments
 (0)