Skip to content

Commit 0a13129

Browse files
prottayCMTProttay Das
andauthored
[PWGLF] add c factor (#15771)
Co-authored-by: Prottay Das <prottay@alipap1.cern.ch>
1 parent 5f37d31 commit 0a13129

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

PWGLF/TableProducer/Common/spvector.cxx

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ struct spvector {
8383
Configurable<float> cfgCutCentralityMin{"cfgCutCentralityMin", 0.0f, "Centrality cut Min"};
8484
Configurable<bool> additionalEvSel{"additionalEvSel", false, "additionalEvSel"};
8585
Configurable<bool> usemem{"usemem", true, "usemem"};
86+
Configurable<bool> usecfactor{"usecfactor", false, "use c factor"};
8687

8788
struct : ConfigurableGroup {
8889
Configurable<int> QxyNbins{"QxyNbins", 100, "Number of bins in QxQy histograms"};
@@ -290,11 +291,6 @@ struct spvector {
290291
int lastRunNumber = -999;
291292
TH2D* gainprofile;
292293
TProfile* gainprofilevxy;
293-
/*THnF* hrecentereSp;
294-
TH2F* hrecenterecentSp;
295-
TH2F* hrecenterevxSp;
296-
TH2F* hrecenterevySp;
297-
TH2F* hrecenterevzSp;*/
298294
std::array<THnF*, 6> hrecentereSpA; // Array of 6 histograms
299295
std::array<TH2F*, 6> hrecenterecentSpA; // Array of 5 histograms
300296
std::array<TH2F*, 6> hrecenterevxSpA; // Array of 5 histograms
@@ -303,16 +299,9 @@ struct spvector {
303299
TProfile3D* shiftprofileA;
304300
TProfile3D* shiftprofileC;
305301

306-
// Bool_t Correctcoarse(int64_t ts, Configurable<std::string>& ConfRecentereSpp, bool useRecentereSp, int currentRunNumber, int lastRunNumber, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC)
307-
//{
308302
Bool_t Correctcoarse(const THnF* hrecentereSp, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC)
309303
{
310304

311-
/*
312-
if (useRecentereSp && (currentRunNumber != lastRunNumber)) {
313-
hrecentereSp = ccdb->getForTimeStamp<THnF>(ConfRecentereSpp.value, ts);
314-
}*/
315-
316305
int binCoords[5];
317306

318307
// Get axes of the THnSparse
@@ -354,22 +343,13 @@ struct spvector {
354343
return kTRUE;
355344
}
356345

357-
// Bool_t Correctfine(int64_t ts, Configurable<std::string>& ConfRecenterecentSpp, Configurable<std::string>& ConfRecenterevxSpp, Configurable<std::string>& ConfRecenterevySpp, Configurable<std::string>& ConfRecenterevzSpp, bool useRecenterefineSp, int currentRunNumber, int lastRunNumber, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC)
358-
//{
359346
Bool_t Correctfine(TH2F* hrecenterecentSp, TH2F* hrecenterevxSp, TH2F* hrecenterevySp, TH2F* hrecenterevzSp, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC)
360347
{
361348

362349
if (!hrecenterecentSp || !hrecenterevxSp || !hrecenterevySp || !hrecenterevzSp) {
363350
std::cerr << "Error: One or more histograms are null." << std::endl;
364351
return false;
365352
}
366-
/*
367-
if (useRecenterefineSp && (currentRunNumber != lastRunNumber)) {
368-
hrecenterecentSp = ccdb->getForTimeStamp<TH2F>(ConfRecenterecentSpp.value, ts);
369-
hrecenterevxSp = ccdb->getForTimeStamp<TH2F>(ConfRecenterevxSpp.value, ts);
370-
hrecenterevySp = ccdb->getForTimeStamp<TH2F>(ConfRecenterevySpp.value, ts);
371-
hrecenterevzSp = ccdb->getForTimeStamp<TH2F>(ConfRecenterevzSpp.value, ts);
372-
}*/
373353

374354
double meanxAcent = hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality + 0.00001, 0.5));
375355
double meanyAcent = hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality + 0.00001, 1.5));
@@ -449,6 +429,7 @@ struct spvector {
449429
auto znaEnergy = zdc.energySectorZNA();
450430
auto zncEnergycommon = zdc.energyCommonZNC();
451431
auto znaEnergycommon = zdc.energyCommonZNA();
432+
auto beamEne = 5.36 * 0.5;
452433

453434
if (znaEnergycommon <= 0.0 || zncEnergycommon <= 0.0) {
454435
triggerevent = false;
@@ -501,6 +482,8 @@ struct spvector {
501482
auto alphaZDC = 0.395;
502483
constexpr double x[4] = {-1.75, 1.75, -1.75, 1.75};
503484
constexpr double y[4] = {-1.75, -1.75, 1.75, 1.75};
485+
double zncEnergycommonsum = 0.0;
486+
double znaEnergycommonsum = 0.0;
504487

505488
histos.fill(HIST("ZDCAmpCommon"), 0.5, vz, znaEnergycommon);
506489
histos.fill(HIST("ZDCAmpCommon"), 1.5, vz, zncEnergycommon);
@@ -519,6 +502,7 @@ struct spvector {
519502
return;
520503
} else {
521504
double ampl = gainequal * znaEnergy[iChA];
505+
znaEnergycommonsum += ampl;
522506
if (followpub) {
523507
ampl = TMath::Power(ampl, alphaZDC);
524508
}
@@ -534,6 +518,7 @@ struct spvector {
534518
return;
535519
} else {
536520
double ampl = gainequal * zncEnergy[iChA - 4];
521+
zncEnergycommonsum += ampl;
537522
if (followpub) {
538523
ampl = TMath::Power(ampl, alphaZDC);
539524
}
@@ -545,13 +530,26 @@ struct spvector {
545530
}
546531
}
547532

533+
auto cZNC = 1.0;
534+
auto cZNA = 1.0;
535+
548536
if (sumA > 0) {
549-
qxZDCA = qxZDCA / sumA;
550-
qyZDCA = qyZDCA / sumA;
537+
float nSpecnA = znaEnergycommonsum / beamEne;
538+
if (usecfactor)
539+
cZNA = 1.89358 - 0.71262 / (nSpecnA + 0.71789);
540+
else
541+
cZNA = 1.0;
542+
qxZDCA = cZNA * (qxZDCA / sumA);
543+
qyZDCA = cZNA * (qyZDCA / sumA);
551544
}
552545
if (sumC > 0) {
553-
qxZDCC = qxZDCC / sumC;
554-
qyZDCC = qyZDCC / sumC;
546+
float nSpecnC = zncEnergycommonsum / beamEne;
547+
if (usecfactor)
548+
cZNC = 1.89358 - 0.71262 / (nSpecnC + 0.71789);
549+
else
550+
cZNC = 1.0;
551+
qxZDCC = cZNC * (qxZDCC / sumC);
552+
qyZDCC = cZNC * (qyZDCC / sumC);
555553
}
556554

557555
if (sumA <= 1e-4 || sumC <= 1e-4) {

0 commit comments

Comments
 (0)