@@ -125,6 +125,8 @@ struct lambdalambda {
125125 Configurable<bool > cfgEffCor{" cfgEffCor" , false , " flag to apply efficiency correction" };
126126 Configurable<std::string> cfgEffCorPath{" cfgEffCorPath" , " " , " path for pseudo efficiency correction" };
127127
128+ Configurable<bool > cfgRotBkg{" cfgRotBkg" , true , " flag to construct rotational backgrounds" };
129+ Configurable<int > cfgNRotBkg{" cfgNRotBkg" , 10 , " the number of rotational backgrounds" };
128130 Configurable<int > cfgNoMixedEvents{" cfgNoMixedEvents" , 10 , " Number of mixed events per event" };
129131
130132 ConfigurableAxis massAxis{" massAxis" , {110 , 2.22 , 2.33 }, " Invariant mass axis" };
@@ -143,6 +145,8 @@ struct lambdalambda {
143145 float centrality;
144146 TProfile2D* EffMap = nullptr ;
145147
148+ TRandom* rn = new TRandom();
149+
146150 void init (o2::framework::InitContext&)
147151 {
148152 AxisSpec centQaAxis = {80 , 0.0 , 80.0 };
@@ -161,6 +165,12 @@ struct lambdalambda {
161165
162166 histos.add (" h_InvMass_same" , " " , {HistType::kTHnSparseF , {massAxis, ptAxis, centAxis, combAxis}});
163167 histos.add (" h_InvMass_mixed" , " " , {HistType::kTHnSparseF , {massAxis, ptAxis, centAxis, combAxis}});
168+ histos.add (" h_InvMass_rot" , " " , {HistType::kTHnSparseF , {massAxis, ptAxis, centAxis, combAxis}});
169+
170+ histos.add (" h_InvMass_same_sel" , " " , {HistType::kTHnSparseF , {massAxis, ptAxis, centAxis, combAxis}});
171+ histos.add (" h_InvMass_mixed_sel" , " " , {HistType::kTHnSparseF , {massAxis, ptAxis, centAxis, combAxis}});
172+ histos.add (" h_InvMass_rot_sel" , " " , {HistType::kTHnSparseF , {massAxis, ptAxis, centAxis, combAxis}});
173+
164174 if (cfgQAv0) {
165175 histos.add (" QA/CentDist" , " " , {HistType::kTH1F , {centQaAxis}});
166176 histos.add (" QA/PVzDist" , " " , {HistType::kTH1F , {PVzQaAxis}});
@@ -180,6 +190,7 @@ struct lambdalambda {
180190
181191 double massLambda = o2::constants::physics::MassLambda;
182192 ROOT::Math::PxPyPzMVector RecoV01, RecoV02, RecoV0V0;
193+ ROOT::Math::PxPyPzMVector RecoV02Rot, RecoV0V0Rot;
183194
184195 template <typename TCollision>
185196 bool eventSelected (TCollision collision)
@@ -412,6 +423,7 @@ struct lambdalambda {
412423 }
413424
414425 RecoV0V0 = RecoV01 + RecoV02;
426+
415427 if (std::abs (RecoV0V0.Rapidity ()) > cfgV0V0RapMax)
416428 continue ;
417429
@@ -427,14 +439,29 @@ struct lambdalambda {
427439 histos.fill (HIST (" DCA_V0V0_sel" ), RecoV0V0.M (), RecoV0V0.Pt (), getDCAofV0V0 (v01, v02), V01Tag + V02Tag);
428440 }
429441
430- if (cfgV0V0Sel && !isSelectedV0V0 (v01, v02))
431- continue ;
432-
433442 if (doprocessDataSame) {
434443 histos.fill (HIST (" h_InvMass_same" ), RecoV0V0.M (), RecoV0V0.Pt (), centrality, V01Tag + V02Tag);
444+ if (cfgV0V0Sel && isSelectedV0V0 (v01, v02)) {
445+ histos.fill (HIST (" h_InvMass_same_sel" ), RecoV0V0.M (), RecoV0V0.Pt (), centrality, V01Tag + V02Tag);
446+ }
447+ if (cfgRotBkg) {
448+ for (int nr = 0 ; nr < cfgNRotBkg; nr++) {
449+ auto RanPhi = rn->Uniform (o2::constants::math::PI * 5.0 / 6.0 , o2::constants::math::PI * 7.0 / 6.0 );
450+ RanPhi += RecoV02.Phi ();
451+ RecoV02Rot = ROOT::Math::PxPyPzMVector (RecoV02.Pt () * std::cos (RanPhi), RecoV02.Pt () * std::sin (RanPhi), RecoV02.Pz (), RecoV02.M ());
452+ RecoV0V0Rot = RecoV01 + RecoV02Rot;
453+ histos.fill (HIST (" h_InvMass_rot" ), RecoV0V0Rot.M (), RecoV0V0Rot.Pt (), centrality, V01Tag + V02Tag);
454+ if (cfgV0V0Sel && isSelectedV0V0 (v01, v02)) {
455+ histos.fill (HIST (" h_InvMass_rot_sel" ), RecoV0V0Rot.M (), RecoV0V0Rot.Pt (), centrality, V01Tag + V02Tag);
456+ }
457+ }
458+ }
435459 }
436460 if (doprocessDataMixed) {
437461 histos.fill (HIST (" h_InvMass_mixed" ), RecoV0V0.M (), RecoV0V0.Pt (), centrality, V01Tag + V02Tag);
462+ if (cfgV0V0Sel && isSelectedV0V0 (v01, v02)) {
463+ histos.fill (HIST (" h_InvMass_mixed_sel" ), RecoV0V0.M (), RecoV0V0.Pt (), centrality, V01Tag + V02Tag);
464+ }
438465 }
439466 }
440467 }
0 commit comments