@@ -41,32 +41,33 @@ class FemtoDreamDetaDphiStar
4141 // / Destructor
4242 virtual ~FemtoDreamDetaDphiStar () = default ;
4343 // / Initialization of the histograms and setting required values
44- void init (HistogramRegistry* registry, HistogramRegistry* registryQA, float ldeltaPhiMax, float ldeltaEtaMax, bool lplotForEveryRadii)
44+ void init (HistogramRegistry* registry, HistogramRegistry* registryQA, float ldeltaPhiMax, float ldeltaEtaMax, bool lplotForEveryRadii, int meORse = 0 , bool oldversion = true )
4545 {
4646 deltaPhiMax = ldeltaPhiMax;
4747 deltaEtaMax = ldeltaEtaMax;
4848 plotForEveryRadii = lplotForEveryRadii;
49+ runOldVersion = oldversion;
4950 mHistogramRegistry = registry;
5051 mHistogramRegistryQA = registryQA;
5152
5253 if constexpr (mPartOneType == o2::aod::femtodreamparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtodreamparticle::ParticleType::kTrack ) {
5354 std::string dirName = static_cast <std::string>(dirNames[0 ]);
54- histdetadpi[0 ][0 ] = mHistogramRegistry ->add <TH2>((dirName + static_cast <std::string>(histNames[0 ][0 ])).c_str (), " ; #Delta #eta; #Delta #phi" , kTH2F , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }});
55- histdetadpi[0 ][1 ] = mHistogramRegistry ->add <TH2>((dirName + static_cast <std::string>(histNames[1 ][0 ])).c_str (), " ; #Delta #eta; #Delta #phi" , kTH2F , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }});
55+ histdetadpi[0 ][0 ] = mHistogramRegistry ->add <TH2>((dirName + static_cast <std::string>(histNames[0 ][0 ]) + static_cast <std::string>(histNameSEorME[meORse]) ).c_str (), " ; #Delta #eta; #Delta #phi" , kTH2F , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }});
56+ histdetadpi[0 ][1 ] = mHistogramRegistry ->add <TH2>((dirName + static_cast <std::string>(histNames[1 ][0 ]) + static_cast <std::string>(histNameSEorME[meORse]) ).c_str (), " ; #Delta #eta; #Delta #phi" , kTH2F , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }});
5657 if (plotForEveryRadii) {
5758 for (int i = 0 ; i < 9 ; i++) {
58- histdetadpiRadii[0 ][i] = mHistogramRegistryQA ->add <TH2>((dirName + static_cast <std::string>(histNamesRadii[0 ][i])).c_str (), " ; #Delta #eta; #Delta #phi" , kTH2F , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }});
59+ histdetadpiRadii[0 ][i] = mHistogramRegistryQA ->add <TH2>((dirName + static_cast <std::string>(histNamesRadii[0 ][i]) + static_cast <std::string>(histNameSEorME[meORse]) ).c_str (), " ; #Delta #eta; #Delta #phi" , kTH2F , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }});
5960 }
6061 }
6162 }
6263 if constexpr (mPartOneType == o2::aod::femtodreamparticle::ParticleType::kTrack && mPartTwoType == o2::aod::femtodreamparticle::ParticleType::kV0 ) {
6364 for (int i = 0 ; i < 2 ; i++) {
6465 std::string dirName = static_cast <std::string>(dirNames[1 ]);
65- histdetadpi[i][0 ] = mHistogramRegistry ->add <TH2>((dirName + static_cast <std::string>(histNames[0 ][i])).c_str (), " ; #Delta #eta; #Delta #phi" , kTH2F , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }});
66- histdetadpi[i][1 ] = mHistogramRegistry ->add <TH2>((dirName + static_cast <std::string>(histNames[1 ][i])).c_str (), " ; #Delta #eta; #Delta #phi" , kTH2F , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }});
66+ histdetadpi[i][0 ] = mHistogramRegistry ->add <TH2>((dirName + static_cast <std::string>(histNames[0 ][i]) + static_cast <std::string>(histNameSEorME[meORse]) ).c_str (), " ; #Delta #eta; #Delta #phi" , kTH2F , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }});
67+ histdetadpi[i][1 ] = mHistogramRegistry ->add <TH2>((dirName + static_cast <std::string>(histNames[1 ][i]) + static_cast <std::string>(histNameSEorME[meORse]) ).c_str (), " ; #Delta #eta; #Delta #phi" , kTH2F , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }});
6768 if (plotForEveryRadii) {
6869 for (int j = 0 ; j < 9 ; j++) {
69- histdetadpiRadii[i][j] = mHistogramRegistryQA ->add <TH2>((dirName + static_cast <std::string>(histNamesRadii[i][j])).c_str (), " ; #Delta #eta; #Delta #phi" , kTH2F , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }});
70+ histdetadpiRadii[i][j] = mHistogramRegistryQA ->add <TH2>((dirName + static_cast <std::string>(histNamesRadii[i][j]) + static_cast <std::string>(histNameSEorME[meORse]) ).c_str (), " ; #Delta #eta; #Delta #phi" , kTH2F , {{100 , -0.15 , 0.15 }, {100 , -0.15 , 0.15 }});
7071 }
7172 }
7273 }
@@ -128,6 +129,8 @@ class FemtoDreamDetaDphiStar
128129 HistogramRegistry* mHistogramRegistryQA = nullptr ; // /< For QA output
129130 static constexpr std::string_view dirNames[2 ] = {" kTrack_kTrack/" , " kTrack_kV0/" };
130131
132+ static constexpr std::string_view histNameSEorME[3 ] = {" _SEandME" , " _SE" , " _ME" };
133+
131134 static constexpr std::string_view histNames[2 ][2 ] = {{" detadphidetadphi0Before_0" , " detadphidetadphi0Before_1" },
132135 {" detadphidetadphi0After_0" , " detadphidetadphi0After_1" }};
133136 static constexpr std::string_view histNamesRadii[2 ][9 ] = {{" detadphidetadphi0Before_0_0" , " detadphidetadphi0Before_0_1" , " detadphidetadphi0Before_0_2" ,
@@ -150,6 +153,9 @@ class FemtoDreamDetaDphiStar
150153 float deltaEtaMax;
151154 float magfield;
152155 bool plotForEveryRadii = false ;
156+ // a possible bug was found, but this must be tested on hyperloop with larger statistics
157+ // possiboility to run old code is turned on so a proper comparison of both code versions can be done
158+ bool runOldVersion = true ;
153159
154160 std::array<std::array<std::shared_ptr<TH2>, 2 >, 2 > histdetadpi{};
155161 std::array<std::array<std::shared_ptr<TH2>, 9 >, 2 > histdetadpiRadii{};
@@ -175,7 +181,18 @@ class FemtoDreamDetaDphiStar
175181 // End: Get the charge from cutcontainer using masks
176182 float pt = part.pt ();
177183 for (size_t i = 0 ; i < 9 ; i++) {
178- tmpVec.push_back (phi0 - std::asin (0.3 * charge * 0.1 * magfield * tmpRadiiTPC[i] * 0.01 / (2 . * pt)));
184+ if (runOldVersion) {
185+ tmpVec.push_back (phi0 - std::asin (0.3 * charge * 0.1 * magfield * tmpRadiiTPC[i] * 0.01 / (2 . * pt)));
186+ }
187+ if (!runOldVersion) {
188+ auto arg = 0.3 * charge * magfield * tmpRadiiTPC[i] * 0.01 / (2 . * pt);
189+ // for very low pT particles, this value goes outside of range -1 to 1 at at large tpc radius; asin fails
190+ if (abs (arg) < 1 ) {
191+ tmpVec.push_back (phi0 - std::asin (0.3 * charge * magfield * tmpRadiiTPC[i] * 0.01 / (2 . * pt)));
192+ } else {
193+ tmpVec.push_back (999 );
194+ }
195+ }
179196 }
180197 }
181198
@@ -188,16 +205,23 @@ class FemtoDreamDetaDphiStar
188205 PhiAtRadiiTPC (part1, tmpVec1);
189206 PhiAtRadiiTPC (part2, tmpVec2);
190207 int num = tmpVec1.size ();
208+ int meaningfulEntries = num;
191209 float dPhiAvg = 0 ;
210+ float dphi;
192211 for (int i = 0 ; i < num; i++) {
193- float dphi = tmpVec1.at (i) - tmpVec2.at (i);
212+ if (tmpVec1.at (i) != 999 && tmpVec2.at (i) != 999 ) {
213+ dphi = tmpVec1.at (i) - tmpVec2.at (i);
214+ } else {
215+ dphi = 0 ;
216+ meaningfulEntries = meaningfulEntries - 1 ;
217+ }
194218 dphi = TVector2::Phi_mpi_pi (dphi);
195219 dPhiAvg += dphi;
196220 if (plotForEveryRadii) {
197221 histdetadpiRadii[iHist][i]->Fill (part1.eta () - part2.eta (), dphi);
198222 }
199223 }
200- return dPhiAvg / num ;
224+ return dPhiAvg / static_cast < float >(meaningfulEntries) ;
201225 }
202226};
203227
0 commit comments