@@ -93,6 +93,39 @@ enum ResonantChannel : int8_t {
9393 Kstar0K = 2
9494};
9595
96+ namespace o2 ::aod
97+ {
98+ namespace hf_cand_ds_mini
99+ {
100+ DECLARE_SOA_COLUMN (Pt, pt, float ); // ! Transverse momentum of D-meson candidate (GeV/c)
101+ DECLARE_SOA_COLUMN (M, m, float ); // ! Invariant mass of D-meson candidates (GeV/c)
102+ DECLARE_SOA_COLUMN (Centrality, centrality, float ); // ! Centrality of collision
103+ DECLARE_SOA_COLUMN (ImpactParameter, impactParameter, float ); // ! Impact parameter of D-meson candidate
104+ DECLARE_SOA_COLUMN (DecayLength, decayLength, float ); // ! Decay length of D-meson candidate
105+ DECLARE_SOA_COLUMN (DecayLengthXY, decayLengthXY, float ); // ! Transverse decay length of D-meson candidate
106+ DECLARE_SOA_COLUMN (DecayLengthNormalised, decayLengthNormalised, float ); // ! Normalised decay length of D-meson candidate
107+ DECLARE_SOA_COLUMN (DecayLengthXYNormalised, decayLengthXYNormalised, float ); // ! Normalised transverse decay length of D-meson candidate
108+ DECLARE_SOA_COLUMN (FlagMc, flagMc, int ); // ! MC flag (according to DataType enum)
109+ } // namespace hf_cand_ds_mini
110+
111+ DECLARE_SOA_TABLE (HfCandDsMinis, " AOD" , " HFCANDDSMINI" , // ! Table with few Ds properties
112+ hf_cand_ds_mini::M,
113+ hf_cand_ds_mini::Pt,
114+ hf_cand_ds_mini::Centrality);
115+
116+ DECLARE_SOA_TABLE (HfCandDsDlMinis, " AOD" , " HFCANDDSDLMINI" , // ! Table with decay length Ds properties
117+ hf_cand_ds_mini::DecayLength,
118+ hf_cand_ds_mini::DecayLengthXY,
119+ hf_cand_ds_mini::DecayLengthNormalised,
120+ hf_cand_ds_mini::DecayLengthXYNormalised);
121+
122+ DECLARE_SOA_TABLE (HfCandDsD0Minis, " AOD" , " HFCANDDSD0MINI" , // ! Table with impact parameter (d0)
123+ hf_cand_ds_mini::ImpactParameter);
124+
125+ DECLARE_SOA_TABLE (HfCandDsMcMinis, " AOD" , " HFCANDDSMCMINI" , // ! Table with MC decay type check
126+ hf_cand_ds_mini::FlagMc);
127+ } // namespace o2::aod
128+
96129static std::unordered_map<int8_t , std::unordered_map<int8_t , int8_t >> channelsResonant = {{{Mother::Ds, {{ResonantChannel::PhiPi, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToPhiPi}, {ResonantChannel::Kstar0K, hf_decay::hf_cand_3prong::DecayChannelResonant::DsToKstar0K}}},
97130 {Mother::Dplus, {{ResonantChannel::PhiPi, hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToPhiPi}, {ResonantChannel::Kstar0K, hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToKstar0K}}}}};
98131
@@ -104,6 +137,10 @@ concept HasDsMlInfo = requires(T candidate) {
104137
105138// / Ds± analysis task
106139struct HfTaskDs {
140+ Produces<aod::HfCandDsMinis> hfCandDsMinis;
141+ Produces<aod::HfCandDsDlMinis> hfCandDsDlMinis;
142+ Produces<aod::HfCandDsD0Minis> hfCandDsD0Minis;
143+ Produces<aod::HfCandDsMcMinis> hfCandDsMcMinis;
107144
108145 Configurable<int > decayChannel{" decayChannel" , 1 , " Switch between resonant decay channels: 1 for Ds/Dplus->PhiPi->KKpi, 2 for Ds/Dplus->K0*K->KKPi" };
109146 Configurable<bool > fillDplusMc{" fillDplusMc" , true , " Switch to fill Dplus MC information" };
@@ -119,6 +156,11 @@ struct HfTaskDs {
119156 Configurable<bool > storeOccupancy{" storeOccupancy" , false , " Flag to store occupancy information" };
120157 Configurable<int > occEstimator{" occEstimator" , 0 , " Occupancy estimation (None: 0, ITS: 1, FT0C: 2)" };
121158 Configurable<bool > fillMcBkgHistos{" fillMcBkgHistos" , false , " Flag to fill and store histograms for MC background" };
159+ struct : ConfigurableGroup {
160+ Configurable<bool > produceMiniTrees{" produceMiniTrees" , false , " Flag to produce mini trees" };
161+ Configurable<bool > extendWithDecayLength{" extendWithDecayLength" , false , " Flag to extend trees with decay length information" };
162+ Configurable<bool > extendWithImpactParameter{" extendWithImpactParameter" , false , " Flag to extend trees with impact parameter information" };
163+ } miniTrees;
122164
123165 struct : ConfigurableGroup {
124166 Configurable<std::string> ccdburl{" ccdburl" , " http://alice-ccdb.cern.ch" , " The CCDB endpoint url address" };
@@ -542,6 +584,24 @@ struct HfTaskDs {
542584 }
543585 }
544586
587+ template <bool IsMc, typename Coll, typename Cand>
588+ void fillMiniTrees (const Cand& candidate, DataType dataType, FinalState finalState)
589+ {
590+ auto mass = finalState == FinalState::KKPi ? HfHelper::invMassDsToKKPi (candidate) : HfHelper::invMassDsToPiKK (candidate);
591+ auto pt = candidate.pt ();
592+
593+ hfCandDsMinis (mass, pt, evaluateCentralityCand<Coll>(candidate));
594+ if (miniTrees.extendWithDecayLength ) {
595+ hfCandDsDlMinis (candidate.decayLength (), candidate.decayLengthXY (), candidate.decayLengthNormalised (), candidate.decayLengthXYNormalised ());
596+ }
597+ if (miniTrees.extendWithImpactParameter ) {
598+ hfCandDsD0Minis (candidate.impactParameterXY ());
599+ }
600+ if constexpr (IsMc) {
601+ hfCandDsMcMinis (dataType);
602+ }
603+ }
604+
545605 // / Fill histograms of quantities for the KKPi daugther-mass hypothesis
546606 // / \param candidate is candidate
547607 // / \param dataType is data class, as defined in DataType enum
@@ -602,7 +662,9 @@ struct HfTaskDs {
602662 }
603663 fillHisto (candidate, dataType);
604664 fillHistoKKPi<true , Coll>(candidate, dataType);
605-
665+ if (miniTrees.produceMiniTrees ) {
666+ fillMiniTrees<true , Coll>(candidate, dataType, FinalState::KKPi);
667+ }
606668 if (TESTBIT (candidate.isSelDsToKKPi (), aod::SelectionStep::RecoSkims)) {
607669 std::get<TH2Ptr>(histosPtr[dataType][" hPtVsYRecoSkim" ])->Fill (pt, yCand);
608670 }
@@ -620,6 +682,9 @@ struct HfTaskDs {
620682 }
621683 fillHisto (candidate, dataType);
622684 fillHistoPiKK<true , Coll>(candidate, dataType);
685+ if (miniTrees.produceMiniTrees ) {
686+ fillMiniTrees<true , Coll>(candidate, dataType, FinalState::PiKK);
687+ }
623688
624689 if (TESTBIT (candidate.isSelDsToPiKK (), aod::SelectionStep::RecoSkims)) {
625690 std::get<TH2Ptr>(histosPtr[dataType][" hPtVsYRecoSkim" ])->Fill (pt, yCand);
@@ -643,13 +708,19 @@ struct HfTaskDs {
643708 }
644709 fillHisto (candidate, DataType::Data);
645710 fillHistoKKPi<false , Coll>(candidate, DataType::Data);
711+ if (miniTrees.produceMiniTrees ) {
712+ fillMiniTrees<true , Coll>(candidate, DataType::Data, FinalState::KKPi);
713+ }
646714 }
647715 if (candidate.isSelDsToPiKK () >= selectionFlagDs) { // PiKK
648716 if (yCandRecoMax >= 0 . && std::abs (candidate.y (HfHelper::invMassDsToPiKK (candidate))) > yCandRecoMax) {
649717 return ;
650718 }
651719 fillHisto (candidate, DataType::Data);
652720 fillHistoPiKK<false , Coll>(candidate, DataType::Data);
721+ if (miniTrees.produceMiniTrees ) {
722+ fillMiniTrees<true , Coll>(candidate, DataType::Data, FinalState::PiKK);
723+ }
653724 }
654725 }
655726
0 commit comments