@@ -173,41 +173,122 @@ class CascadeHistManager
173173 CascadeHistManager () = default ;
174174 ~CascadeHistManager () = default ;
175175
176- template <modes::Mode mode>
176+ template <modes::Mode mode, typename T >
177177 void init (o2::framework::HistogramRegistry* registry,
178178 std::map<CascadeHist, std::vector<o2::framework::AxisSpec>> const & cascadeSpecs,
179+ T const & ConfCascadeSelection,
179180 std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const & BachelorSpecs,
180181 std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const & PosDauSpecs,
181182 std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const & NegDauSpecs)
182183 {
183184 mHistogramRegistry = registry;
184- mBachelorManager .template init <mode>(registry, BachelorSpecs, AbsChargeDaughters);
185- mPosDauManager .template init <mode>(registry, PosDauSpecs, AbsChargeDaughters);
186- mNegDauManager .template init <mode>(registry, NegDauSpecs, AbsChargeDaughters);
185+ mPdgCode = std::abs (ConfCascadeSelection.pdgCodeAbs .value );
186+
187+ int bachelorPdgCodeAbs = 0 ;
188+ int posDauPdgCodeAbs = 0 ;
189+ int negDauPdgCodeAbs = 0 ;
190+ const int absCharge = 1 ;
191+ int signBachelor = 0 ;
192+ const int signPlus = 1 ;
193+ const int signMinus = -1 ;
194+
195+ if (mPdgCode == PDG_t::kXiMinus ) {
196+ if (ConfCascadeSelection.sign .value < 0 ) {
197+ bachelorPdgCodeAbs = std::abs (PDG_t::kPiMinus );
198+ signBachelor = -1 ;
199+ posDauPdgCodeAbs = std::abs (PDG_t::kProton );
200+ negDauPdgCodeAbs = std::abs (PDG_t::kPiMinus );
201+ } else {
202+ mPdgCode = -1 * mPdgCode ; // Xi+ has negative pdg code
203+ bachelorPdgCodeAbs = std::abs (PDG_t::kPiPlus );
204+ signBachelor = 1 ;
205+ posDauPdgCodeAbs = std::abs (PDG_t::kPiPlus );
206+ negDauPdgCodeAbs = std::abs (PDG_t::kProtonBar );
207+ }
208+ } else if (mPdgCode == PDG_t::kOmegaMinus ) {
209+ if (ConfCascadeSelection.sign .value < 0 ) {
210+ bachelorPdgCodeAbs = std::abs (PDG_t::kKMinus );
211+ signBachelor = -1 ;
212+ posDauPdgCodeAbs = std::abs (PDG_t::kProton );
213+ negDauPdgCodeAbs = std::abs (PDG_t::kPiMinus );
214+ } else {
215+ mPdgCode = -1 * mPdgCode ; // Omega+ has negative pdg code
216+ bachelorPdgCodeAbs = std::abs (PDG_t::kKPlus );
217+ signBachelor = 1 ;
218+ posDauPdgCodeAbs = std::abs (PDG_t::kPiPlus );
219+ negDauPdgCodeAbs = std::abs (PDG_t::kProtonBar );
220+ }
221+ } else {
222+ LOG (fatal) << " PDG code for Cascade has to be either Xi or Omega" ;
223+ }
224+
225+ mBachelorManager .template init <mode>(registry, BachelorSpecs, absCharge, signBachelor, bachelorPdgCodeAbs);
226+ mPosDauManager .template init <mode>(registry, PosDauSpecs, absCharge, signPlus, posDauPdgCodeAbs);
227+ mNegDauManager .template init <mode>(registry, NegDauSpecs, absCharge, signMinus, negDauPdgCodeAbs);
228+
187229 if constexpr (modes::isFlagSet (mode, modes::Mode::kAnalysis )) {
188230 initAnalysis (cascadeSpecs);
189231 }
190- if constexpr (modes::isFlagSet (mode, modes::Mode::kQa )) {
191- initQa (cascadeSpecs);
192- }
193232 }
194233
195- template <modes::Mode mode, typename T1, typename T2, typename T3, typename T4>
234+ template <modes::Mode mode, typename T1, typename T2, typename T3, typename T4, typename T5 >
196235 void init (o2::framework::HistogramRegistry* registry,
197236 std::map<CascadeHist, std::vector<o2::framework::AxisSpec>> const & cascadeSpecs,
198- T1 const & CascadeConfBinningQa,
237+ T1 const & ConfCascadeSelection,
238+ T2 const & ConfCascadeBinningQa,
199239 std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const & BachelorSpecs,
200- T2 const & BachelorConfBinningQa ,
240+ T3 const & ConfBachelorQaBinning ,
201241 std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const & PosDauSpecs,
202- T3 const & PosDauConfBinningQa ,
242+ T4& ConfPosDauQaBinning ,
203243 std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const & NegDauSpecs,
204- T4 const & NegDauConfBinningQa )
244+ T5& ConfNegDauQaBinning )
205245 {
206246 mHistogramRegistry = registry;
207- mBachelorManager .template init <mode>(registry, BachelorSpecs, BachelorConfBinningQa, AbsChargeDaughters);
208- mPosDauManager .template init <mode>(registry, PosDauSpecs, PosDauConfBinningQa, AbsChargeDaughters);
209- mNegDauManager .template init <mode>(registry, NegDauSpecs, NegDauConfBinningQa, AbsChargeDaughters);
210- this ->enableOptionalHistograms (CascadeConfBinningQa);
247+ mPdgCode = std::abs (ConfCascadeSelection.pdgCodeAbs .value );
248+ this ->enableOptionalHistograms (ConfCascadeBinningQa);
249+
250+ int bachelorPdgCodeAbs = 0 ;
251+ int posDauPdgCodeAbs = 0 ;
252+ int negDauPdgCodeAbs = 0 ;
253+ const int absCharge = 1 ;
254+ int signBachelor = 0 ;
255+ const int signPlus = 1 ;
256+ const int signMinus = -1 ;
257+
258+ if (mPdgCode == PDG_t::kXiMinus ) {
259+ if (ConfCascadeSelection.sign .value < 0 ) {
260+ bachelorPdgCodeAbs = std::abs (PDG_t::kPiMinus );
261+ signBachelor = -1 ;
262+ posDauPdgCodeAbs = std::abs (PDG_t::kProton );
263+ negDauPdgCodeAbs = std::abs (PDG_t::kPiMinus );
264+ } else {
265+ mPdgCode = -1 * mPdgCode ; // Xi+ has negative pdg code
266+ bachelorPdgCodeAbs = std::abs (PDG_t::kPiPlus );
267+ signBachelor = 1 ;
268+ posDauPdgCodeAbs = std::abs (PDG_t::kPiPlus );
269+ negDauPdgCodeAbs = std::abs (PDG_t::kProtonBar );
270+ }
271+ } else if (mPdgCode == PDG_t::kOmegaMinus ) {
272+ if (ConfCascadeSelection.sign .value < 0 ) {
273+ bachelorPdgCodeAbs = std::abs (PDG_t::kKMinus );
274+ signBachelor = -1 ;
275+ posDauPdgCodeAbs = std::abs (PDG_t::kProton );
276+ negDauPdgCodeAbs = std::abs (PDG_t::kPiMinus );
277+ } else {
278+ mPdgCode = -1 * mPdgCode ; // Omega+ has negative pdg code
279+ bachelorPdgCodeAbs = std::abs (PDG_t::kKPlus );
280+ signBachelor = 1 ;
281+ posDauPdgCodeAbs = std::abs (PDG_t::kPiPlus );
282+ negDauPdgCodeAbs = std::abs (PDG_t::kProtonBar );
283+ }
284+ } else {
285+ LOG (fatal) << " PDG code for Cascade has to be either Xi or Omega" ;
286+ }
287+
288+ mBachelorManager .template init <mode>(registry, BachelorSpecs, absCharge, signBachelor, bachelorPdgCodeAbs, ConfBachelorQaBinning);
289+ mPosDauManager .template init <mode>(registry, PosDauSpecs, absCharge, signPlus, posDauPdgCodeAbs, ConfPosDauQaBinning);
290+ mNegDauManager .template init <mode>(registry, NegDauSpecs, absCharge, signMinus, negDauPdgCodeAbs, ConfNegDauQaBinning);
291+
211292 if constexpr (modes::isFlagSet (mode, modes::Mode::kAnalysis )) {
212293 initAnalysis (cascadeSpecs);
213294 }
@@ -321,6 +402,7 @@ class CascadeHistManager
321402 trackhistmanager::TrackHistManager<bachelorPrefix> mBachelorManager ;
322403 trackhistmanager::TrackHistManager<posDauPrefix> mPosDauManager ;
323404 trackhistmanager::TrackHistManager<negDauPrefix> mNegDauManager ;
405+ int mPdgCode = 0 ;
324406};
325407}; // namespace cascadehistmanager
326408}; // namespace o2::analysis::femto
0 commit comments