Skip to content

Commit 98e3b20

Browse files
author
Prottay Das
committed
added c factor for gain equalization
1 parent 88c5c11 commit 98e3b20

File tree

1 file changed

+53
-4
lines changed

1 file changed

+53
-4
lines changed

PWGLF/TableProducer/Common/zdcvector.cxx

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ struct zdcvector {
8585
Configurable<float> cfgCutCentralityMin{"cfgCutCentralityMin", 0.0f, "Centrality cut Min"};
8686
Configurable<bool> additionalEvSel{"additionalEvSel", false, "additionalEvSel"};
8787
Configurable<bool> usemem{"usemem", true, "usemem"};
88+
Configurable<bool> usecfactor{"usecfactor", false, "use c factor"};
8889

8990
struct : ConfigurableGroup {
9091
Configurable<int> vzFineNbins{"vzFineNbins", 20, "Number of bins in Vz fine histograms"};
@@ -119,6 +120,7 @@ struct zdcvector {
119120
AxisSpec vzfineAxis = {configbins.vzFineNbins, configbins.lfinebinVz, configbins.hfinebinVz, "vzfine"};
120121
AxisSpec centfineAxis = {configbins.centFineNbins, configbins.lfinebinCent, configbins.hfinebinCent, "V0M (%) fine"};
121122
AxisSpec VxyAxis = {2, 0, 2, "Vxy"};
123+
// AxisSpec EAxis = {500, 0, 1000, "Eaxis"};
122124

123125
histos.add("htpcnsigmapi", "htpcnsigmapi", kTH1F, {{50, -10, 10.0}});
124126
histos.add("hEvtSelInfo", "hEvtSelInfo", kTH1F, {{10, 0, 10.0}});
@@ -128,6 +130,14 @@ struct zdcvector {
128130
histos.add("ZDCAmp", "ZDCAmp", kTProfile2D, {channelZDCAxis, vzfineAxis});
129131
histos.add("ZDCAmpCommon", "ZDCAmpCommon", kTProfile2D, {{2, 0.0, 2.0}, vzfineAxis});
130132
histos.add("AvgVxy", "AvgVxy", kTProfile, {VxyAxis});
133+
/*histos.add("hZNA0", "hZNA0", kTH2D, {{centfineAxis}, {EAxis}}, true);
134+
histos.add("hZNA1", "hZNA1", kTH2D, {{centfineAxis}, {EAxis}}, true);
135+
histos.add("hZNA2", "hZNA2", kTH2D, {{centfineAxis}, {EAxis}}, true);
136+
histos.add("hZNA3", "hZNA3", kTH2D, {{centfineAxis}, {EAxis}}, true);
137+
histos.add("hZNC0", "hZNC0", kTH2D, {{centfineAxis}, {EAxis}}, true);
138+
histos.add("hZNC1", "hZNC1", kTH2D, {{centfineAxis}, {EAxis}}, true);
139+
histos.add("hZNC2", "hZNC2", kTH2D, {{centfineAxis}, {EAxis}}, true);
140+
histos.add("hZNC3", "hZNC3", kTH2D, {{centfineAxis}, {EAxis}}, true);*/
131141

132142
ccdb->setURL(cfgCcdbParam.cfgURL);
133143
ccdbApi.init("http://alice-ccdb.cern.ch");
@@ -141,6 +151,11 @@ struct zdcvector {
141151
TH2D* gainprofile;
142152
TProfile* gainprofilevxy;
143153

154+
// int lastRunNumberTimeRec = -999;
155+
// for time since start of run
156+
// int runForStartTime = -999;
157+
// uint64_t runStartTime = 0;
158+
144159
using MyCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::FT0sCorrected, aod::CentFT0Cs>;
145160
using AllTrackCandidates = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTPCFullKa>;
146161

@@ -180,13 +195,22 @@ struct zdcvector {
180195
return;
181196
}
182197

198+
// -------- define time since run start --------
199+
/*uint64_t ts = bc.timestamp();
200+
if (currentRunNumber != runForStartTime) {
201+
runStartTime = ts;
202+
runForStartTime = currentRunNumber;
203+
}
204+
double tsec = 1.e-3 * static_cast<double>(ts - runStartTime);
205+
*/
183206
histos.fill(HIST("hEvtSelInfo"), 1.5);
184207

185208
auto zdc = bc.zdc();
186209
auto zncEnergy = zdc.energySectorZNC();
187210
auto znaEnergy = zdc.energySectorZNA();
188211
auto zncEnergycommon = zdc.energyCommonZNC();
189212
auto znaEnergycommon = zdc.energyCommonZNA();
213+
auto beamEne = 5.36 * 0.5;
190214

191215
if (znaEnergycommon <= 0.0 || zncEnergycommon <= 0.0) {
192216
triggerevent = false;
@@ -222,6 +246,14 @@ struct zdcvector {
222246
}
223247

224248
histos.fill(HIST("hEvtSelInfo"), 5.5);
249+
/*histos.fill(HIST("hZNA0"), centrality, znaEnergy[0]);
250+
histos.fill(HIST("hZNA1"), centrality, znaEnergy[1]);
251+
histos.fill(HIST("hZNA2"), centrality, znaEnergy[2]);
252+
histos.fill(HIST("hZNA3"), centrality, znaEnergy[3]);
253+
histos.fill(HIST("hZNC0"), centrality, zncEnergy[0]);
254+
histos.fill(HIST("hZNC1"), centrality, zncEnergy[1]);
255+
histos.fill(HIST("hZNC2"), centrality, zncEnergy[2]);
256+
histos.fill(HIST("hZNC3"), centrality, zncEnergy[3]);*/
225257

226258
if (additionalEvSel && (!collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))) {
227259
triggerevent = false;
@@ -291,13 +323,28 @@ struct zdcvector {
291323
}
292324
}
293325

326+
auto znaEnergycommonsum = znaEnergy[0] + znaEnergy[1] + znaEnergy[2] + znaEnergy[3];
327+
auto zncEnergycommonsum = zncEnergy[0] + zncEnergy[1] + zncEnergy[2] + zncEnergy[3];
328+
auto cZNC = 1.0;
329+
auto cZNA = 1.0;
330+
294331
if (sumA > 0) {
295-
qxZDCA = qxZDCA / sumA;
296-
qyZDCA = qyZDCA / sumA;
332+
float nSpecnA = znaEnergycommonsum / beamEne;
333+
if (usecfactor)
334+
cZNA = 1.89358 - 0.71262 / (nSpecnA + 0.71789);
335+
else
336+
cZNA = 1.0;
337+
qxZDCA = cZNA * (qxZDCA / sumA);
338+
qyZDCA = cZNA * (qyZDCA / sumA);
297339
}
298340
if (sumC > 0) {
299-
qxZDCC = qxZDCC / sumC;
300-
qyZDCC = qyZDCC / sumC;
341+
float nSpecnC = zncEnergycommonsum / beamEne;
342+
if (usecfactor)
343+
cZNC = 1.89358 - 0.71262 / (nSpecnC + 0.71789);
344+
else
345+
cZNC = 1.0;
346+
qxZDCC = cZNC * (qxZDCC / sumC);
347+
qyZDCC = cZNC * (qyZDCC / sumC);
301348
}
302349

303350
if (sumA <= 1e-4 || sumC <= 1e-4) {
@@ -322,6 +369,8 @@ struct zdcvector {
322369
gainprofilevxy = ccdb->getForTimeStamp<TProfile>(confGainPathVxy.value, bc.timestamp());
323370
}
324371

372+
// LOG(info)<<"*****time stamp is:"<<tsec;
373+
325374
if (useCallibvertex) {
326375
vx = vx - gainprofilevxy->GetBinContent(1);
327376
vy = vy - gainprofilevxy->GetBinContent(2);

0 commit comments

Comments
 (0)