Skip to content

Commit a9e4550

Browse files
author
Prottay Das
committed
add c factor
1 parent 58d53ae commit a9e4550

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
@@ -86,6 +86,7 @@ struct spvector {
8686
Configurable<float> cfgCutCentralityMin{"cfgCutCentralityMin", 0.0f, "Centrality cut Min"};
8787
Configurable<bool> additionalEvSel{"additionalEvSel", false, "additionalEvSel"};
8888
Configurable<bool> usemem{"usemem", true, "usemem"};
89+
Configurable<bool> usecfactor{"usecfactor", false, "use c factor"};
8990

9091
struct : ConfigurableGroup {
9192
Configurable<int> QxyNbins{"QxyNbins", 100, "Number of bins in QxQy histograms"};
@@ -293,11 +294,6 @@ struct spvector {
293294
int lastRunNumber = -999;
294295
TH2D* gainprofile;
295296
TProfile* gainprofilevxy;
296-
/*THnF* hrecentereSp;
297-
TH2F* hrecenterecentSp;
298-
TH2F* hrecenterevxSp;
299-
TH2F* hrecenterevySp;
300-
TH2F* hrecenterevzSp;*/
301297
std::array<THnF*, 6> hrecentereSpA; // Array of 6 histograms
302298
std::array<TH2F*, 6> hrecenterecentSpA; // Array of 5 histograms
303299
std::array<TH2F*, 6> hrecenterevxSpA; // Array of 5 histograms
@@ -306,16 +302,9 @@ struct spvector {
306302
TProfile3D* shiftprofileA;
307303
TProfile3D* shiftprofileC;
308304

309-
// 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)
310-
//{
311305
Bool_t Correctcoarse(const THnF* hrecentereSp, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC)
312306
{
313307

314-
/*
315-
if (useRecentereSp && (currentRunNumber != lastRunNumber)) {
316-
hrecentereSp = ccdb->getForTimeStamp<THnF>(ConfRecentereSpp.value, ts);
317-
}*/
318-
319308
int binCoords[5];
320309

321310
// Get axes of the THnSparse
@@ -357,22 +346,13 @@ struct spvector {
357346
return kTRUE;
358347
}
359348

360-
// 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)
361-
//{
362349
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)
363350
{
364351

365352
if (!hrecenterecentSp || !hrecenterevxSp || !hrecenterevySp || !hrecenterevzSp) {
366353
std::cerr << "Error: One or more histograms are null." << std::endl;
367354
return false;
368355
}
369-
/*
370-
if (useRecenterefineSp && (currentRunNumber != lastRunNumber)) {
371-
hrecenterecentSp = ccdb->getForTimeStamp<TH2F>(ConfRecenterecentSpp.value, ts);
372-
hrecenterevxSp = ccdb->getForTimeStamp<TH2F>(ConfRecenterevxSpp.value, ts);
373-
hrecenterevySp = ccdb->getForTimeStamp<TH2F>(ConfRecenterevySpp.value, ts);
374-
hrecenterevzSp = ccdb->getForTimeStamp<TH2F>(ConfRecenterevzSpp.value, ts);
375-
}*/
376356

377357
double meanxAcent = hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality + 0.00001, 0.5));
378358
double meanyAcent = hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality + 0.00001, 1.5));
@@ -452,6 +432,7 @@ struct spvector {
452432
auto znaEnergy = zdc.energySectorZNA();
453433
auto zncEnergycommon = zdc.energyCommonZNC();
454434
auto znaEnergycommon = zdc.energyCommonZNA();
435+
auto beamEne = 5.36 * 0.5;
455436

456437
if (znaEnergycommon <= 0.0 || zncEnergycommon <= 0.0) {
457438
triggerevent = false;
@@ -504,6 +485,8 @@ struct spvector {
504485
auto alphaZDC = 0.395;
505486
constexpr double x[4] = {-1.75, 1.75, -1.75, 1.75};
506487
constexpr double y[4] = {-1.75, -1.75, 1.75, 1.75};
488+
double zncEnergycommonsum = 0.0;
489+
double znaEnergycommonsum = 0.0;
507490

508491
histos.fill(HIST("ZDCAmpCommon"), 0.5, vz, znaEnergycommon);
509492
histos.fill(HIST("ZDCAmpCommon"), 1.5, vz, zncEnergycommon);
@@ -522,6 +505,7 @@ struct spvector {
522505
return;
523506
} else {
524507
double ampl = gainequal * znaEnergy[iChA];
508+
znaEnergycommonsum += ampl;
525509
if (followpub) {
526510
ampl = TMath::Power(ampl, alphaZDC);
527511
}
@@ -537,6 +521,7 @@ struct spvector {
537521
return;
538522
} else {
539523
double ampl = gainequal * zncEnergy[iChA - 4];
524+
zncEnergycommonsum += ampl;
540525
if (followpub) {
541526
ampl = TMath::Power(ampl, alphaZDC);
542527
}
@@ -548,13 +533,26 @@ struct spvector {
548533
}
549534
}
550535

536+
auto cZNC = 1.0;
537+
auto cZNA = 1.0;
538+
551539
if (sumA > 0) {
552-
qxZDCA = qxZDCA / sumA;
553-
qyZDCA = qyZDCA / sumA;
540+
float nSpecnA = znaEnergycommonsum / beamEne;
541+
if (usecfactor)
542+
cZNA = 1.89358 - 0.71262 / (nSpecnA + 0.71789);
543+
else
544+
cZNA = 1.0;
545+
qxZDCA = cZNA * (qxZDCA / sumA);
546+
qyZDCA = cZNA * (qyZDCA / sumA);
554547
}
555548
if (sumC > 0) {
556-
qxZDCC = qxZDCC / sumC;
557-
qyZDCC = qyZDCC / sumC;
549+
float nSpecnC = zncEnergycommonsum / beamEne;
550+
if (usecfactor)
551+
cZNC = 1.89358 - 0.71262 / (nSpecnC + 0.71789);
552+
else
553+
cZNC = 1.0;
554+
qxZDCC = cZNC * (qxZDCC / sumC);
555+
qyZDCC = cZNC * (qyZDCC / sumC);
558556
}
559557

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

0 commit comments

Comments
 (0)