@@ -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 ;
@@ -244,6 +276,8 @@ struct zdcvector {
244276 auto alphaZDC = 0.395 ;
245277 constexpr double x[4 ] = {-1.75 , 1.75 , -1.75 , 1.75 };
246278 constexpr double y[4 ] = {-1.75 , -1.75 , 1.75 , 1.75 };
279+ double zncEnergycommonsum = 0.0 ;
280+ double znaEnergycommonsum = 0.0 ;
247281
248282 histos.fill (HIST (" ZDCAmpCommon" ), 0.5 , vz, znaEnergycommon);
249283 histos.fill (HIST (" ZDCAmpCommon" ), 1.5 , vz, zncEnergycommon);
@@ -252,6 +286,7 @@ struct zdcvector {
252286 constexpr std::size_t ntow = 8 ;
253287 for (std::size_t iChA = 0 ; iChA < ntow; iChA++) {
254288 auto chanelid = iChA;
289+ gainequal = 1.0 ;
255290 if (useGainCallib && gainprofile) {
256291 gainequal = gainprofile->GetBinContent (gainprofile->FindBin (vz + 0.00001 , chanelid + 0.5 ));
257292 }
@@ -264,6 +299,7 @@ struct zdcvector {
264299 return ;
265300 } else {
266301 double ampl = gainequal * znaEnergy[iChA];
302+ znaEnergycommonsum += ampl;
267303 if (followpub) {
268304 ampl = std::pow (ampl, alphaZDC);
269305 }
@@ -280,6 +316,7 @@ struct zdcvector {
280316 return ;
281317 } else {
282318 double ampl = gainequal * zncEnergy[iChA - 4 ];
319+ zncEnergycommonsum += ampl;
283320 if (followpub) {
284321 ampl = std::pow (ampl, alphaZDC);
285322 }
@@ -291,13 +328,26 @@ struct zdcvector {
291328 }
292329 }
293330
331+ auto cZNC = 1.0 ;
332+ auto cZNA = 1.0 ;
333+
294334 if (sumA > 0 ) {
295- qxZDCA = qxZDCA / sumA;
296- qyZDCA = qyZDCA / sumA;
335+ float nSpecnA = znaEnergycommonsum / beamEne;
336+ if (usecfactor)
337+ cZNA = 1.89358 - 0.71262 / (nSpecnA + 0.71789 );
338+ else
339+ cZNA = 1.0 ;
340+ qxZDCA = cZNA * (qxZDCA / sumA);
341+ qyZDCA = cZNA * (qyZDCA / sumA);
297342 }
298343 if (sumC > 0 ) {
299- qxZDCC = qxZDCC / sumC;
300- qyZDCC = qyZDCC / sumC;
344+ float nSpecnC = zncEnergycommonsum / beamEne;
345+ if (usecfactor)
346+ cZNC = 1.89358 - 0.71262 / (nSpecnC + 0.71789 );
347+ else
348+ cZNC = 1.0 ;
349+ qxZDCC = cZNC * (qxZDCC / sumC);
350+ qyZDCC = cZNC * (qyZDCC / sumC);
301351 }
302352
303353 if (sumA <= 1e-4 || sumC <= 1e-4 ) {
@@ -322,6 +372,8 @@ struct zdcvector {
322372 gainprofilevxy = ccdb->getForTimeStamp <TProfile>(confGainPathVxy.value , bc.timestamp ());
323373 }
324374
375+ // LOG(info)<<"*****time stamp is:"<<tsec;
376+
325377 if (useCallibvertex) {
326378 vx = vx - gainprofilevxy->GetBinContent (1 );
327379 vy = vy - gainprofilevxy->GetBinContent (2 );
0 commit comments