Skip to content

Commit fa90cd4

Browse files
committed
First version of the Bs creator
1 parent 2c19742 commit fa90cd4

5 files changed

Lines changed: 474 additions & 0 deletions

File tree

PWGHF/Core/HFSelectorCuts.h

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ enum Code {
2727
kD0 = 421,
2828
kD0bar = -421,
2929
kDPlus = 411,
30+
kDs = 431,
3031
kLambdaCPlus = 4122,
3132
kXiCPlus = 4232,
3233
kXiCCPlusPlus = 4422,
3334
kLambdaB0 = 5122,
3435
kJpsi = 443,
3536
kChic1 = 20443,
3637
kBPlus = 521,
38+
kBs = 531,
3739
kX3872 = 9920443
3840
};
3941
} // namespace pdg
@@ -593,6 +595,62 @@ static const std::vector<std::string> pTBinLabels = {
593595
static const std::vector<std::string> cutVarLabels = {"m", "CPA", "Chi2PCA", "d0 Lc+", "d0 Pi", "pT Lc+", "pT Pi", "Lb decLen", "Lb decLenXY", "Imp. Par. Product", "DeltaMLc", "Cos ThetaStar"};
594596
} // namespace hf_cuts_lb_tolcpi
595597

598+
namespace hf_cuts_bs_todspi
599+
{
600+
static constexpr int npTBins = 12;
601+
static constexpr int nCutVars = 12;
602+
// default values for the pT bin edges (can be used to configure histogram axis)
603+
// offset by 1 from the bin numbers in cuts array
604+
constexpr double pTBins[npTBins + 1] = {
605+
0,
606+
0.5,
607+
1.0,
608+
2.0,
609+
3.0,
610+
4.0,
611+
5.0,
612+
7.0,
613+
10.0,
614+
13.0,
615+
16.0,
616+
20.0,
617+
24.0};
618+
619+
auto pTBins_v = std::vector<double>{pTBins, pTBins + npTBins + 1};
620+
621+
// default values for the cuts
622+
// DeltaM CPA chi2PCA d0Ds d0Pi pTDs pTPi BsDecayLength BsDecayLengthXY IPProd DeltaMDs CthetaStr
623+
constexpr double cuts[npTBins][nCutVars] = {{1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 0 < pt < 0.5 */
624+
{1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 0.5 < pt < 1 */
625+
{1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 1 < pt < 2 */
626+
{1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 2 < pt < 3 */
627+
{1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 3 < pt < 4 */
628+
{1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 4 < pt < 5 */
629+
{1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 5 < pt < 7 */
630+
{1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 7 < pt < 10 */
631+
{1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 10 < pt < 13 */
632+
{1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 13 < pt < 16 */
633+
{1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}, /* 16 < pt < 20 */
634+
{1., 0.8, 1., 0.01, 0.01, 1.0, 0.15, 0.05, 0.05, 0., 0.1, 0.8}}; /* 20 < pt < 24 */
635+
// row labels
636+
static const std::vector<std::string> pTBinLabels = {
637+
"pT bin 0",
638+
"pT bin 1",
639+
"pT bin 2",
640+
"pT bin 3",
641+
"pT bin 4",
642+
"pT bin 5",
643+
"pT bin 6",
644+
"pT bin 7",
645+
"pT bin 8",
646+
"pT bin 9",
647+
"pT bin 10",
648+
"pT bin 11"};
649+
650+
// column labels
651+
static const std::vector<std::string> cutVarLabels = {"m", "CPA", "Chi2PCA", "d0 Ds+", "d0 Pi", "pT Ds+", "pT Pi", "Bs decLen", "Bs decLenXY", "Imp. Par. Product", "DeltaMDs", "Cos ThetaStar"};
652+
} // namespace hf_cuts_lb_tolcpi
653+
596654
namespace hf_cuts_x_tojpsipipi
597655
{
598656
static constexpr int npTBins = 9;

PWGHF/DataModel/HFCandidateSelectionTables.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ DECLARE_SOA_COLUMN(IsSelDplusToPiKPi, isSelDplusToPiKPi, int); //!
9393
DECLARE_SOA_TABLE(HFSelDplusToPiKPiCandidate, "AOD", "HFSELDPLUSCAND", //!
9494
hf_selcandidate_dplus::IsSelDplusToPiKPi);
9595

96+
namespace hf_selcandidate_ds
97+
{
98+
DECLARE_SOA_COLUMN(IsSelDsKKpi, isSelDsKKpi, int); //!
99+
DECLARE_SOA_COLUMN(IsSelDspiKK, isSelDspiKK, int); //!
100+
} // namespace hf_selcandidate_ds
101+
DECLARE_SOA_TABLE(HFSelDsCandidate, "AOD", "HFSELLCCAND", //!
102+
hf_selcandidate_ds::IsSelDsKKpi, hf_selcandidate_ds::IsSelDspiKK);
103+
96104
namespace hf_selcandidate_lc
97105
{
98106
DECLARE_SOA_COLUMN(IsSelLcpKpi, isSelLcpKpi, int); //!
@@ -183,6 +191,13 @@ DECLARE_SOA_COLUMN(IsSelLbToLcPi, isSelLbToLcPi, int); //!
183191
DECLARE_SOA_TABLE(HFSelLbToLcPiCandidate, "AOD", "HFSELLBCAND", //!
184192
hf_selcandidate_lb::IsSelLbToLcPi);
185193

194+
namespace hf_selcandidate_bs
195+
{
196+
DECLARE_SOA_COLUMN(IsSelBsToDsPi, isSelBsToDsPi, int); //!
197+
} // namespace hf_selcandidate_bs
198+
DECLARE_SOA_TABLE(HFSelBsToDsPiCandidate, "AOD", "HFSELBSCAND", //!
199+
hf_selcandidate_bs::IsSelBsToDsPi);
200+
186201
namespace hf_selcandidate_x
187202
{
188203
DECLARE_SOA_COLUMN(IsSelXToJpsiToEEPiPi, isSelXToJpsiToEEPiPi, int); //!

PWGHF/DataModel/HFSecondaryVertex.h

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,18 @@ auto InvMassDPlus(const T& candidate)
644644
return candidate.m(array{RecoDecay::getMassPDG(kPiPlus), RecoDecay::getMassPDG(kKPlus), RecoDecay::getMassPDG(kPiPlus)});
645645
}
646646

647+
template <typename T>
648+
auto InvMassDsKKpi(const T& candidate)
649+
{
650+
return candidate.m(array{RecoDecay::getMassPDG(kKPlus), RecoDecay::getMassPDG(kKMinus), RecoDecay::getMassPDG(kPiPlus)});
651+
}
652+
653+
template <typename T>
654+
auto InvMassDspiKK(const T& candidate)
655+
{
656+
return candidate.m(array{RecoDecay::getMassPDG(kPiPlus), RecoDecay::getMassPDG(kKMinus), RecoDecay::getMassPDG(kKPlus)});
657+
}
658+
647659
// Λc± → p± K∓ π±
648660

649661
template <typename T>
@@ -1206,6 +1218,95 @@ DECLARE_SOA_TABLE(HfCandLbMCRec, "AOD", "HFCANDLBMCREC", //!
12061218
DECLARE_SOA_TABLE(HfCandLbMCGen, "AOD", "HFCANDLBMCGEN", //!
12071219
hf_cand_lb::FlagMCMatchGen,
12081220
hf_cand_lb::OriginMCGen);
1221+
1222+
// specific Bs candidate properties
1223+
namespace hf_cand_bs
1224+
{
1225+
DECLARE_SOA_INDEX_COLUMN_FULL(Index0, index0, int, HfCandProng3, "_0"); // Bs index
1226+
// MC matching result:
1227+
DECLARE_SOA_COLUMN(FlagMCMatchRec, flagMCMatchRec, int8_t); // reconstruction level
1228+
DECLARE_SOA_COLUMN(FlagMCMatchGen, flagMCMatchGen, int8_t); // generator level
1229+
DECLARE_SOA_COLUMN(OriginMCRec, originMCRec, int8_t); // particle origin, reconstruction level
1230+
DECLARE_SOA_COLUMN(OriginMCGen, originMCGen, int8_t); // particle origin, generator level
1231+
DECLARE_SOA_COLUMN(DebugMCRec, debugMCRec, int8_t); // debug flag for mis-association reconstruction level
1232+
// mapping of decay types
1233+
enum DecayType { BsToDsPi }; // move this to a dedicated cascade namespace in the future?
1234+
1235+
// Bs → Ds+ π- → K+ K- π+ π-
1236+
//float massBs = RecoDecay::getMassPDG(pdg::Code::kBs);
1237+
template <typename T>
1238+
auto CtBs(const T& candidate)
1239+
{
1240+
return candidate.ct(RecoDecay::getMassPDG(pdg::Code::kBs));
1241+
}
1242+
1243+
template <typename T>
1244+
auto YBs(const T& candidate)
1245+
{
1246+
return candidate.y(RecoDecay::getMassPDG(pdg::Code::kBs));
1247+
}
1248+
1249+
template <typename T>
1250+
auto EBs(const T& candidate)
1251+
{
1252+
return candidate.e(RecoDecay::getMassPDG(pdg::Code::kBs));
1253+
}
1254+
template <typename T>
1255+
auto InvMassBsToDsPi(const T& candidate)
1256+
{
1257+
return candidate.m(array{RecoDecay::getMassPDG(pdg::Code::kDs), RecoDecay::getMassPDG(kPiMinus)});
1258+
}
1259+
} // namespace hf_cand_bs
1260+
1261+
// declare dedicated Bs candidate table
1262+
DECLARE_SOA_TABLE(HfCandBsBase, "AOD", "HFCANDBSBASE",
1263+
// general columns
1264+
HFCAND_COLUMNS,
1265+
// 3-prong specific columns
1266+
hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0,
1267+
hf_cand::PxProng1, hf_cand::PyProng1, hf_cand::PzProng1,
1268+
hf_cand::ImpactParameter0, hf_cand::ImpactParameter1,
1269+
hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1,
1270+
hf_cand_bs::Index0Id, hf_track_index::Index1Id,
1271+
hf_track_index::HFflag,
1272+
/* dynamic columns */
1273+
hf_cand_prong2::M<hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0, hf_cand::PxProng1, hf_cand::PyProng1, hf_cand::PzProng1>,
1274+
hf_cand_prong2::M2<hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0, hf_cand::PxProng1, hf_cand::PyProng1, hf_cand::PzProng1>,
1275+
hf_cand_prong2::ImpactParameterProduct<hf_cand::ImpactParameter0, hf_cand::ImpactParameter1>,
1276+
/* dynamic columns that use candidate momentum components */
1277+
hf_cand::Pt<hf_cand_prong2::Px, hf_cand_prong2::Py>,
1278+
hf_cand::Pt2<hf_cand_prong2::Px, hf_cand_prong2::Py>,
1279+
hf_cand::P<hf_cand_prong2::Px, hf_cand_prong2::Py, hf_cand_prong2::Pz>,
1280+
hf_cand::P2<hf_cand_prong2::Px, hf_cand_prong2::Py, hf_cand_prong2::Pz>,
1281+
hf_cand::PVector<hf_cand_prong2::Px, hf_cand_prong2::Py, hf_cand_prong2::Pz>,
1282+
hf_cand::CPA<collision::PosX, collision::PosY, collision::PosZ, hf_cand::XSecondaryVertex, hf_cand::YSecondaryVertex, hf_cand::ZSecondaryVertex, hf_cand_prong2::Px, hf_cand_prong2::Py, hf_cand_prong2::Pz>,
1283+
hf_cand::CPAXY<collision::PosX, collision::PosY, hf_cand::XSecondaryVertex, hf_cand::YSecondaryVertex, hf_cand_prong2::Px, hf_cand_prong2::Py>,
1284+
hf_cand::Ct<collision::PosX, collision::PosY, collision::PosZ, hf_cand::XSecondaryVertex, hf_cand::YSecondaryVertex, hf_cand::ZSecondaryVertex, hf_cand_prong2::Px, hf_cand_prong2::Py, hf_cand_prong2::Pz>,
1285+
hf_cand::ImpactParameterXY<collision::PosX, collision::PosY, collision::PosZ, hf_cand::XSecondaryVertex, hf_cand::YSecondaryVertex, hf_cand::ZSecondaryVertex, hf_cand_prong2::Px, hf_cand_prong2::Py, hf_cand_prong2::Pz>,
1286+
hf_cand_prong2::MaxNormalisedDeltaIP<collision::PosX, collision::PosY, hf_cand::XSecondaryVertex, hf_cand::YSecondaryVertex, hf_cand::ErrorDecayLengthXY, hf_cand_prong2::Px, hf_cand_prong2::Py, hf_cand::ImpactParameter0, hf_cand::ErrorImpactParameter0, hf_cand::ImpactParameter1, hf_cand::ErrorImpactParameter1, hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PxProng1, hf_cand::PyProng1>,
1287+
hf_cand::Eta<hf_cand_prong2::Px, hf_cand_prong2::Py, hf_cand_prong2::Pz>,
1288+
hf_cand::Phi<hf_cand_prong2::Px, hf_cand_prong2::Py>,
1289+
hf_cand::Y<hf_cand_prong2::Px, hf_cand_prong2::Py, hf_cand_prong2::Pz>,
1290+
hf_cand::E<hf_cand_prong2::Px, hf_cand_prong2::Py, hf_cand_prong2::Pz>,
1291+
hf_cand::E2<hf_cand_prong2::Px, hf_cand_prong2::Py, hf_cand_prong2::Pz>);
1292+
1293+
// extended table with expression columns that can be used as arguments of dynamic columns
1294+
DECLARE_SOA_EXTENDED_TABLE_USER(HfCandBsExt, HfCandBsBase, "HFCANDBSEXT",
1295+
hf_cand_prong2::Px, hf_cand_prong2::Py, hf_cand_prong2::Pz);
1296+
1297+
using HfCandBs = HfCandBsExt;
1298+
1299+
// table with results of reconstruction level MC matching
1300+
DECLARE_SOA_TABLE(HfCandBsMCRec, "AOD", "HFCANDBSMCREC", //!
1301+
hf_cand_bs::FlagMCMatchRec,
1302+
hf_cand_bs::OriginMCRec,
1303+
hf_cand_bs::DebugMCRec);
1304+
1305+
// table with results of generator level MC matching
1306+
DECLARE_SOA_TABLE(HfCandBsMCGen, "AOD", "HFCANDBSMCGEN", //!
1307+
hf_cand_bs::FlagMCMatchGen,
1308+
hf_cand_bs::OriginMCGen);
1309+
12091310
} // namespace o2::aod
12101311

12111312
#endif // O2_ANALYSIS_HFSECONDARYVERTEX_H_

PWGHF/TableProducer/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ o2physics_add_dpl_workflow(candidate-creator-lb
4949
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG
5050
COMPONENT_NAME Analysis)
5151

52+
o2physics_add_dpl_workflow(candidate-creator-bs
53+
SOURCES HFCandidateCreatorBs.cxx
54+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG
55+
COMPONENT_NAME Analysis)
56+
5257
o2physics_add_dpl_workflow(candidate-creator-x
5358
SOURCES HFCandidateCreatorX.cxx
5459
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing ROOT::EG

0 commit comments

Comments
 (0)