@@ -157,6 +157,8 @@ constexpr char PrefixLambdaCascade[] = "LambdaCascadeQa/";
157157constexpr std::string_view AnalysisDir = " Kinematics/" ;
158158constexpr std::string_view QaDir = " QA/" ;
159159
160+ constexpr int AbsChargeDaughters = 1 ;
161+
160162// / \class FemtoDreamEventHisto
161163// / \brief Class for histogramming event properties
162164// template <femtomodes::Mode mode>
@@ -171,47 +173,128 @@ class CascadeHistManager
171173 CascadeHistManager () = default ;
172174 ~CascadeHistManager () = default ;
173175
174- template <modes::Mode mode>
176+ template <modes::Mode mode, typename T >
175177 void init (o2::framework::HistogramRegistry* registry,
176178 std::map<CascadeHist, std::vector<o2::framework::AxisSpec>> const & cascadeSpecs,
179+ T const & ConfCascadeSelection,
177180 std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const & BachelorSpecs,
178181 std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const & PosDauSpecs,
179182 std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const & NegDauSpecs)
180183 {
181184 mHistogramRegistry = registry;
182- mBachelorManager .template init <mode>(registry, BachelorSpecs);
183- mPosDauManager .template init <mode>(registry, PosDauSpecs);
184- mNegDauManager .template init <mode>(registry, NegDauSpecs);
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+
185229 if constexpr (modes::isFlagSet (mode, modes::Mode::kAnalysis )) {
186230 initAnalysis (cascadeSpecs);
187231 }
188- if constexpr (modes::isFlagSet (mode, modes::Mode::kQa )) {
189- initQa (cascadeSpecs);
190- }
191232 }
192233
193- template <typename T1, typename T2, typename T3, typename T4>
194- void enableOptionalHistograms (T1 const & CascadeConfBinningQa, T2 const & BachelorConfBinningQa, T3 const & PosDauConfBinningQa, T4 const & NegDauConfBinningQa)
195- {
196- mBachelorManager .enableOptionalHistograms (BachelorConfBinningQa);
197- mPosDauManager .enableOptionalHistograms (PosDauConfBinningQa);
198- mNegDauManager .enableOptionalHistograms (NegDauConfBinningQa);
199- mPlot2d = CascadeConfBinningQa.plot2d .value ;
200- }
201-
202- 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>
203235 void init (o2::framework::HistogramRegistry* registry,
204236 std::map<CascadeHist, std::vector<o2::framework::AxisSpec>> const & cascadeSpecs,
205- T1 const & CascadeConfBinningQa,
237+ T1 const & ConfCascadeSelection,
238+ T2 const & ConfCascadeBinningQa,
206239 std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const & BachelorSpecs,
207- T2 const & BachelorConfBinningQa ,
240+ T3 const & ConfBachelorQaBinning ,
208241 std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const & PosDauSpecs,
209- T3 const & PosDauConfBinningQa ,
242+ T4& ConfPosDauQaBinning ,
210243 std::map<trackhistmanager::TrackHist, std::vector<o2::framework::AxisSpec>> const & NegDauSpecs,
211- T4 const & NegDauConfBinningQa )
244+ T5& ConfNegDauQaBinning )
212245 {
213- enableOptionalHistograms (CascadeConfBinningQa, BachelorConfBinningQa, PosDauConfBinningQa, NegDauConfBinningQa);
214- this ->template init <mode>(registry, cascadeSpecs, BachelorSpecs, PosDauSpecs, NegDauSpecs);
246+ mHistogramRegistry = registry;
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+
292+ if constexpr (modes::isFlagSet (mode, modes::Mode::kAnalysis )) {
293+ initAnalysis (cascadeSpecs);
294+ }
295+ if constexpr (modes::isFlagSet (mode, modes::Mode::kQa )) {
296+ initQa (cascadeSpecs);
297+ }
215298 }
216299
217300 template <modes::Mode mode, typename T1, typename T2>
@@ -237,6 +320,12 @@ class CascadeHistManager
237320 }
238321
239322 private:
323+ template <typename T>
324+ void enableOptionalHistograms (T const & CascadeConfBinningQa)
325+ {
326+ mPlot2d = CascadeConfBinningQa.plot2d .value ;
327+ }
328+
240329 void initAnalysis (std::map<CascadeHist, std::vector<o2::framework::AxisSpec>> const & cascadeSpecs)
241330 {
242331 std::string analysisDir = std::string (cascadePrefix) + std::string (AnalysisDir);
@@ -313,6 +402,7 @@ class CascadeHistManager
313402 trackhistmanager::TrackHistManager<bachelorPrefix> mBachelorManager ;
314403 trackhistmanager::TrackHistManager<posDauPrefix> mPosDauManager ;
315404 trackhistmanager::TrackHistManager<negDauPrefix> mNegDauManager ;
405+ int mPdgCode = 0 ;
316406};
317407}; // namespace cascadehistmanager
318408}; // namespace o2::analysis::femto
0 commit comments