Skip to content

Commit a0d7b39

Browse files
authored
[PWGEM/PhotonMeson] std::abs and std::fabs for PCM (#9785)
1 parent bea3abf commit a0d7b39

File tree

4 files changed

+26
-40
lines changed

4 files changed

+26
-40
lines changed

PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ struct PhotonConversionBuilder {
102102
Configurable<float> max_frac_shared_clusters_tpc{"max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"};
103103
Configurable<float> dcanegtopv{"dcanegtopv", 0.1, "DCA Neg To PV"};
104104
Configurable<float> dcapostopv{"dcapostopv", 0.1, "DCA Pos To PV"};
105-
Configurable<float> min_pt_leg_at_sv{"min_pt_leg_at_sv", 0.0, "min pT for v0 legs at SV"}; // this is obsolete.
106-
Configurable<float> max_mean_its_cluster_size{"max_mean_its_cluster_size", 16.f, "max. <ITS cluster size> x cos(lambda) for ITSonly tracks"}; // this is to suppress random combination for V0s with ITSonly tracks. default 3 + 1 for skimming.
107105
Configurable<float> maxX{"maxX", 83.1, "max X for track IU"};
108106
Configurable<float> min_pt_trackiu{"min_pt_trackiu", 0.05, "min pT for trackiu"}; // this comes from online processing. pT of track seed is above 50 MeV/c in B = 0.5 T, 20 MeV/c in B = 0.2 T.
109107

@@ -115,6 +113,7 @@ struct PhotonConversionBuilder {
115113
Configurable<float> max_dcav0dau_itsibss{"max_dcav0dau_itsibss", 1.0, "max distance btween 2 legs to V0s with ITS hits on ITSib SS"};
116114
Configurable<float> max_dcav0dau_tpc_inner_fc{"max_dcav0dau_tpc_inner_fc", 1.5, "max distance btween 2 legs to V0s with ITS hits on TPC inner FC"};
117115
Configurable<float> min_v0radius{"min_v0radius", 1.0, "min v0 radius"};
116+
Configurable<float> max_v0radius{"max_v0radius", 90.0, "max v0 radius"};
118117
Configurable<float> margin_r_its{"margin_r_its", 3.0, "margin for r cut in cm"};
119118
Configurable<float> margin_r_tpc{"margin_r_tpc", 7.0, "margin for r cut in cm"};
120119
Configurable<float> margin_r_itstpc_tpc{"margin_r_itstpc_tpc", 7.0, "margin for r cut in cm"};
@@ -320,21 +319,6 @@ struct PhotonConversionBuilder {
320319
return false;
321320
}
322321
}
323-
324-
if (isITSonlyTrack(track)) {
325-
uint32_t itsClusterSizes = track.itsClusterSizes();
326-
int total_cluster_size = 0, nl = 0;
327-
for (unsigned int layer = 0; layer < 7; layer++) {
328-
int cluster_size_per_layer = (itsClusterSizes >> (layer * 4)) & 0xf;
329-
if (cluster_size_per_layer > 0) {
330-
nl++;
331-
}
332-
total_cluster_size += cluster_size_per_layer;
333-
}
334-
if (static_cast<float>(total_cluster_size) / static_cast<float>(nl) * std::cos(std::atan(track.tgl())) > max_mean_its_cluster_size) {
335-
return false;
336-
}
337-
}
338322
}
339323

340324
return true;
@@ -376,7 +360,7 @@ struct PhotonConversionBuilder {
376360
}
377361

378362
template <typename TTrack, typename TShiftedTrack, typename TKFParticle>
379-
void fillTrackTable(TTrack const& track, TShiftedTrack const& shiftedtrack, TKFParticle const& kfp, float dcaXY, float dcaZ)
363+
void fillTrackTable(TTrack const& track, TShiftedTrack const& shiftedtrack, TKFParticle const& kfp, const float dcaXY, const float dcaZ)
380364
{
381365
v0legs(track.collisionId(), track.globalIndex(), track.sign(),
382366
kfp.GetPx(), kfp.GetPy(), kfp.GetPz(), dcaXY, dcaZ,
@@ -422,6 +406,11 @@ struct PhotonConversionBuilder {
422406

423407
// LOGF(info, "v0.collisionId() = %d , v0.posTrackId() = %d , v0.negTrackId() = %d", v0.collisionId(), v0.posTrackId(), v0.negTrackId());
424408

409+
// if(isTPConlyTrack(ele)){
410+
// // LOGF(info, "TPConly: ele.globalIndex() = %d, ele.x() = %f, ele.y() = %f, ele.z() = %f, ele.tgl() = %f, ele.alpha() = %f, ele.snp() = %f, ele.signed1Pt() = %f", ele.globalIndex(), ele.x(), ele.y(), ele.z(), ele.tgl(), ele.alpha(), ele.snp(), ele.signed1Pt());
411+
// // LOGF(info, "TPConly: ele.globalIndex() = %d, ele.cYY() = %f, ele.cZY() = %f, ele.cZZ() = %f, ele.cSnpY() = %f, ele.cSnpZ() = %f, ele.cSnpSnp() = %f, ele.cTglY() = %f, ele.cTglZ() = %f, ele.cTglSnp() = %f, ele.cTglTgl() = %f, ele.c1PtY() = %f, ele.c1PtZ() = %f, ele.c1PtSnp() = %f, ele.c1PtTgl() = %f, ele.c1Pt21Pt2() = %f", ele.globalIndex(), ele.cYY(), ele.cZY(), ele.cZZ(), ele.cSnpY(), ele.cSnpZ(), ele.cSnpSnp(), ele.cTglY(), ele.cTglZ(), ele.cTglSnp(), ele.cTglTgl(), ele.c1PtY(), ele.c1PtZ(), ele.c1PtSnp(), ele.c1PtTgl(), ele.c1Pt21Pt2());
412+
// }
413+
425414
// Calculate DCA with respect to the collision associated to the v0, not individual tracks
426415
gpu::gpustd::array<float, 2> dcaInfo;
427416

@@ -498,7 +487,7 @@ struct PhotonConversionBuilder {
498487
if (rxy < std::fabs(gammaKF_DecayVtx.GetZ()) * std::tan(2 * std::atan(std::exp(-max_eta_v0))) - margin_z) {
499488
return; // RZ line cut
500489
}
501-
if (rxy < min_v0radius) {
490+
if (rxy < min_v0radius || max_v0radius < rxy) {
502491
return;
503492
}
504493

@@ -596,9 +585,6 @@ struct PhotonConversionBuilder {
596585

597586
float pos_pt = RecoDecay::sqrtSumOfSquares(kfp_pos_DecayVtx.GetPx(), kfp_pos_DecayVtx.GetPy());
598587
float ele_pt = RecoDecay::sqrtSumOfSquares(kfp_ele_DecayVtx.GetPx(), kfp_ele_DecayVtx.GetPy());
599-
if (pos_pt < min_pt_leg_at_sv || ele_pt < min_pt_leg_at_sv) {
600-
return;
601-
}
602588

603589
if (isITSonlyTrack(pos) && pos_pt > maxpt_itsonly) {
604590
return;

PWGEM/PhotonMeson/Tasks/pcmQC.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ struct PCMQC {
134134

135135
// v0 info
136136
fRegistry.add("V0/hPt", "pT;p_{T,#gamma} (GeV/c)", kTH1F, {{2000, 0.0f, 20}}, false);
137-
fRegistry.add("V0/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {40, -1.0f, 1.0f}}, false);
137+
fRegistry.add("V0/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {200, -1.0f, 1.0f}}, false);
138138
fRegistry.add("V0/hRadius", "V0Radius; radius in Z (cm);radius in XY (cm)", kTH2F, {{200, -100, 100}, {200, 0.0f, 100.0f}}, false);
139139
fRegistry.add("V0/hCosPA", "V0CosPA;cosine pointing angle", kTH1F, {{100, 0.99f, 1.0f}}, false);
140140
fRegistry.add("V0/hCosPA_Rxy", "cos PA vs. R_{xy};R_{xy} (cm);cosine pointing angle", kTH2F, {{200, 0.f, 100.f}, {100, 0.99f, 1.0f}}, false);
@@ -160,7 +160,7 @@ struct PCMQC {
160160
// v0leg info
161161
fRegistry.add("V0Leg/hPt", "pT;p_{T,e} (GeV/c)", kTH1F, {{1000, 0.0f, 10}}, false);
162162
fRegistry.add("V0Leg/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{1000, -50, 50}}, false);
163-
fRegistry.add("V0Leg/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {40, -1.0f, 1.0f}}, false);
163+
fRegistry.add("V0Leg/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {200, -1.0f, 1.0f}}, false);
164164
fRegistry.add("V0Leg/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", kTH2F, {{200, -50.0f, 50.0f}, {200, -50.0f, 50.0f}}, false);
165165
fRegistry.add("V0Leg/hNclsTPC", "number of TPC clusters", kTH1F, {{161, -0.5, 160.5}}, false);
166166
fRegistry.add("V0Leg/hNcrTPC", "number of TPC crossed rows", kTH1F, {{161, -0.5, 160.5}}, false);

PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ struct PCMQCMC {
176176

177177
// v0 info
178178
fRegistry.add("V0/primary/hPt", "pT;p_{T,#gamma} (GeV/c)", kTH1F, {{2000, 0.0f, 20}}, false);
179-
fRegistry.add("V0/primary/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {40, -1.0f, 1.0f}}, false);
179+
fRegistry.add("V0/primary/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {200, -1.0f, 1.0f}}, false);
180180
fRegistry.add("V0/primary/hRadius", "V0Radius; radius in Z (cm);radius in XY (cm)", kTH2F, {{200, -100, 100}, {200, 0.0f, 100.0f}}, false);
181181
fRegistry.add("V0/primary/hCosPA", "V0CosPA;cosine pointing angle", kTH1F, {{100, 0.99f, 1.0f}}, false);
182182
fRegistry.add("V0/primary/hCosPA_Rxy", "cos PA vs. R_{xy};R_{xy} (cm);cosine pointing angle", kTH2F, {{200, 0.f, 100.f}, {100, 0.99f, 1.0f}}, false);
@@ -212,7 +212,7 @@ struct PCMQCMC {
212212
// v0leg info
213213
fRegistry.add("V0Leg/primary/hPt", "pT;p_{T,e} (GeV/c)", kTH1F, {{1000, 0.0f, 10}}, false);
214214
fRegistry.add("V0Leg/primary/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{1000, -50, 50}}, false);
215-
fRegistry.add("V0Leg/primary/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {40, -3.0f, 1.0f}}, false);
215+
fRegistry.add("V0Leg/primary/hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", kTH2F, {{90, 0, 2 * M_PI}, {200, -1.0f, 1.0f}}, false);
216216
fRegistry.add("V0Leg/primary/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", kTH2F, {{200, -50.0f, 50.0f}, {200, -50.0f, 50.0f}}, false);
217217
fRegistry.add("V0Leg/primary/hNclsTPC", "number of TPC clusters", kTH1F, {{161, -0.5, 160.5}}, false);
218218
fRegistry.add("V0Leg/primary/hNcrTPC", "number of TPC crossed rows", kTH1F, {{161, -0.5, 160.5}}, false);

PWGEM/PhotonMeson/Utils/PCMUtilities.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
//_______________________________________________________________________
2525
inline bool checkAP(const float alpha, const float qt, const float alpha_max = 0.95, const float qt_max = 0.05)
2626
{
27-
float ellipse = pow(alpha / alpha_max, 2) + pow(qt / qt_max, 2);
27+
float ellipse = std::pow(alpha / alpha_max, 2) + std::pow(qt / qt_max, 2);
2828
if (ellipse < 1.0) {
2929
return true;
3030
} else {
@@ -111,8 +111,8 @@ float getPtResolution(TV0 const& v0)
111111
float px = v0.px();
112112
float py = v0.py();
113113
float pt = v0.pt();
114-
float px_err = std::sqrt(fabs(v0.sigmaPx2()));
115-
float py_err = std::sqrt(fabs(v0.sigmaPy2()));
114+
float px_err = std::sqrt(std::fabs(v0.sigmaPx2()));
115+
float py_err = std::sqrt(std::fabs(v0.sigmaPy2()));
116116
float pxy_err = v0.sigmaPxPy();
117117
return std::sqrt(std::pow(px / pt * px_err, 2) + std::pow(py / pt * py_err, 2) + 2.f * px / pt * py / pt * pxy_err);
118118
}
@@ -123,8 +123,8 @@ float getPhiResolution(TV0 const& v0)
123123
float px = v0.px();
124124
float py = v0.py();
125125
float pt = v0.pt();
126-
float px_err = std::sqrt(fabs(v0.sigmaPx2()));
127-
float py_err = std::sqrt(fabs(v0.sigmaPy2()));
126+
float px_err = std::sqrt(std::fabs(v0.sigmaPx2()));
127+
float py_err = std::sqrt(std::fabs(v0.sigmaPy2()));
128128
float pxy_err = v0.sigmaPxPy();
129129
return std::sqrt(std::pow(px / pt / pt * py_err, 2) + std::pow(py / pt / pt * px_err, 2) - 2.f * px / pt / pt * py / pt / pt * pxy_err);
130130
}
@@ -137,9 +137,9 @@ float getThetaResolution(TV0 const& v0)
137137
float pz = v0.pz();
138138
float pt = v0.pt();
139139
float p = v0.p();
140-
float px_err = std::sqrt(fabs(v0.sigmaPx2()));
141-
float py_err = std::sqrt(fabs(v0.sigmaPy2()));
142-
float pz_err = std::sqrt(fabs(v0.sigmaPz2()));
140+
float px_err = std::sqrt(std::fabs(v0.sigmaPx2()));
141+
float py_err = std::sqrt(std::fabs(v0.sigmaPy2()));
142+
float pz_err = std::sqrt(std::fabs(v0.sigmaPz2()));
143143
float pxy_err = v0.sigmaPxPy();
144144
float pyz_err = v0.sigmaPyPz();
145145
float pzx_err = v0.sigmaPzPx();
@@ -154,9 +154,9 @@ float getEtaResolution(TV0 const& v0)
154154
float pz = v0.pz();
155155
float pt = v0.pt();
156156
float p = v0.p();
157-
float px_err = std::sqrt(fabs(v0.sigmaPx2()));
158-
float py_err = std::sqrt(fabs(v0.sigmaPy2()));
159-
float pz_err = std::sqrt(fabs(v0.sigmaPz2()));
157+
float px_err = std::sqrt(std::fabs(v0.sigmaPx2()));
158+
float py_err = std::sqrt(std::fabs(v0.sigmaPy2()));
159+
float pz_err = std::sqrt(std::fabs(v0.sigmaPz2()));
160160
float pxy_err = v0.sigmaPxPy();
161161
float pyz_err = v0.sigmaPyPz();
162162
float pzx_err = v0.sigmaPzPx();
@@ -170,9 +170,9 @@ float getPResolution(TV0 const& v0)
170170
float py = v0.py();
171171
float pz = v0.pz();
172172
float p = v0.p();
173-
float px_err = std::sqrt(fabs(v0.sigmaPx2()));
174-
float py_err = std::sqrt(fabs(v0.sigmaPy2()));
175-
float pz_err = std::sqrt(fabs(v0.sigmaPz2()));
173+
float px_err = std::sqrt(std::fabs(v0.sigmaPx2()));
174+
float py_err = std::sqrt(std::fabs(v0.sigmaPy2()));
175+
float pz_err = std::sqrt(std::fabs(v0.sigmaPz2()));
176176
float pxy_err = v0.sigmaPxPy();
177177
float pyz_err = v0.sigmaPyPz();
178178
float pzx_err = v0.sigmaPzPx();

0 commit comments

Comments
 (0)