@@ -52,7 +52,8 @@ struct ZdcExtraTableProducer {
5252 Configurable<float > maxZN{" maxZN" , 399.5 , " Max ZN signal" };
5353 Configurable<bool > tdcCut{" tdcCut" , false , " Flag for TDC cut" };
5454 Configurable<float > tdcZNmincut{" tdcZNmincut" , -2.5 , " Min ZN TDC cut" };
55- Configurable<float > tdcZNmaxcut{" tdcZNmaxcut" , -2.5 , " Max ZN TDC cut" };
55+ Configurable<float > tdcZNmaxcut{" tdcZNmaxcut" , 2.5 , " Max ZN TDC cut" };
56+ Configurable<bool > cfgUsePMC{" cfgUsePMC" , true , " Use common PM (true) or sum of PMs (false) " };
5657 // Event selections
5758 Configurable<bool > cfgEvSelSel8{" cfgEvSelSel8" , true , " Event selection: sel8" };
5859 Configurable<float > cfgEvSelVtxZ{" cfgEvSelVtxZ" , 10 , " Event selection: zVtx" };
@@ -94,6 +95,9 @@ struct ZdcExtraTableProducer {
9495 registry.add (" ZNAsumq" , " ZNAsumq; ZNA uncalib. sum PMQ; Entries" , {HistType::kTH1F , {{nBins, -0.5 , maxZN}}});
9596 registry.add (" ZNCsumq" , " ZNCsumq; ZNC uncalib. sum PMQ; Entries" , {HistType::kTH1F , {{nBins, -0.5 , maxZN}}});
9697
98+ registry.add (" ZNACentroid" , " ZNACentroid; ZNA Centroid; X; Y" , {HistType::kTH2F , {{50 , -1.5 , 1.5 }, {50 , -1.5 , 1.5 }}});
99+ registry.add (" ZNCCentroid" , " ZNCCentroid; ZNC Centroid; X; Y" , {HistType::kTH2F , {{50 , -1.5 , 1.5 }, {50 , -1.5 , 1.5 }}});
100+
97101 registry.add (" hEventCount" , " Number of Event; Cut; #Events Passed Cut" , {HistType::kTH1D , {{nEventSelections, 0 , nEventSelections}}});
98102 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (evSel_allEvents + 1 , " All events" );
99103 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (evSel_zvtx + 1 , " vtxZ" );
@@ -103,7 +107,7 @@ struct ZdcExtraTableProducer {
103107 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (evSel_kIsGoodZvtxFT0vsPV + 1 , " kIsGoodZvtxFT0vsPV" );
104108 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (evSel_kNoCollInTimeRangeStandard + 1 , " kNoCollInTimeRangeStandard" );
105109 registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (evSel_kIsVertexITSTPC + 1 , " kIsVertexITSTPC" );
106- registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (evSel_kIsGoodITSLayersAll + 1 , " kkIsGoodITSLayersAll " );
110+ registry.get <TH1>(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (evSel_kIsGoodITSLayersAll + 1 , " kIsGoodITSLayersAll " );
107111 }
108112
109113 template <typename TCollision>
@@ -208,18 +212,8 @@ struct ZdcExtraTableProducer {
208212 //
209213 double sumZNC = 0 ;
210214 double sumZNA = 0 ;
211- double pmqZNC[4 ] = {
212- 0 ,
213- 0 ,
214- 0 ,
215- 0 ,
216- };
217- double pmqZNA[4 ] = {
218- 0 ,
219- 0 ,
220- 0 ,
221- 0 ,
222- };
215+ double pmqZNC[4 ] = {};
216+ double pmqZNA[4 ] = {};
223217 //
224218 if (isZNChit) {
225219 for (int it = 0 ; it < nTowers; it++) {
@@ -246,8 +240,80 @@ struct ZdcExtraTableProducer {
246240 registry.get <TH1>(HIST (" ZNApm4" ))->Fill (pmqZNA[3 ]);
247241 registry.get <TH1>(HIST (" ZNAsumq" ))->Fill (sumZNA);
248242 }
249- if (isZNAhit || isZNChit)
250- zdcextras (pmcZNA, pmqZNA[0 ], pmqZNA[1 ], pmqZNA[2 ], pmqZNA[3 ], tdcZNC, pmcZNC, pmqZNC[0 ], pmqZNC[1 ], pmqZNC[2 ], pmqZNC[3 ], tdcZNA, centrality, foundBC.timestamp (), evSelection);
243+
244+ // Q-vectors (centroid) calculation
245+ // kBeamEne -- LHC Run 3 Pb-Pb collision energy (5.36 TeV per nucleon pair)
246+ constexpr float kBeamEne = 5.36 * 0.5 ;
247+
248+ // Provide coordinates of centroid over ZN (side C) front face
249+ constexpr float X[4 ] = {-1.75 , 1.75 , -1.75 , 1.75 };
250+ constexpr float Y[4 ] = {-1.75 , -1.75 , 1.75 , 1.75 };
251+ constexpr float kAlpha = 0.395 ; // saturation correction
252+
253+ float numXZNC = 0 ., numYZNC = 0 ., denZNC = 0 .;
254+ float numXZNA = 0 ., numYZNA = 0 ., denZNA = 0 .;
255+
256+ // Calculate weighted sums of the x and y coordinates
257+ constexpr int kNTowers = 4 ; // number of ZDC towers
258+ for (int i = 0 ; i < kNTowers ; i++) {
259+ if (pmqZNC[i] > 0 .) {
260+ float wZNC = std::pow (pmqZNC[i], kAlpha );
261+ numXZNC -= X[i] * wZNC; // numerator x (minus sign due to opposite orientation of ZNC)
262+ numYZNC += Y[i] * wZNC; // numerator y
263+ denZNC += wZNC; // denominator
264+ }
265+ if (pmqZNA[i] > 0 .) {
266+ float wZNA = std::pow (pmqZNA[i], kAlpha );
267+ numXZNA += X[i] * wZNA; // numerator x
268+ numYZNA += Y[i] * wZNA; // numerator y
269+ denZNA += wZNA; // denominator
270+ }
271+ }
272+ // Calculate centroid coordinates (in cm) with correction factor c depending on the number of spectator nucleons (nSpec)
273+
274+ float zncCommon = 0 ;
275+ float znaCommon = 0 ;
276+
277+ // Use sum of PMTs (cfgUsePMC == false) when common PMT is saturated
278+ if (cfgUsePMC) {
279+ zncCommon = pmcZNC;
280+ znaCommon = pmcZNA;
281+ } else {
282+ zncCommon = sumZNC;
283+ znaCommon = sumZNA;
284+ }
285+
286+ float centroidZNC[2 ], centroidZNA[2 ];
287+
288+ if (denZNC != 0 .) {
289+ float nSpecnC = zncCommon / kBeamEne ;
290+ float cZNC = 1.89358 - 0.71262 / (nSpecnC + 0.71789 );
291+ centroidZNC[0 ] = cZNC * numXZNC / denZNC;
292+ centroidZNC[1 ] = cZNC * numYZNC / denZNC;
293+ } else {
294+ centroidZNC[0 ] = 999 .;
295+ centroidZNC[1 ] = 999 .;
296+ }
297+ //
298+ if (denZNA != 0 .) {
299+ float nSpecnA = znaCommon / kBeamEne ;
300+ float cZNA = 1.89358 - 0.71262 / (nSpecnA + 0.71789 );
301+ centroidZNA[0 ] = cZNA * numXZNA / denZNA;
302+ centroidZNA[1 ] = cZNA * numYZNA / denZNA;
303+ } else {
304+ centroidZNA[0 ] = 999 .;
305+ centroidZNA[1 ] = 999 .;
306+ }
307+ registry.get <TH2>(HIST (" ZNCCentroid" ))->Fill (centroidZNC[0 ], centroidZNC[1 ]);
308+ registry.get <TH2>(HIST (" ZNACentroid" ))->Fill (centroidZNA[0 ], centroidZNA[1 ]);
309+
310+ auto vz = collision.posZ ();
311+ auto vx = collision.posX ();
312+ auto vy = collision.posY ();
313+
314+ if (isZNAhit || isZNChit) {
315+ zdcextras (pmcZNA, pmqZNA[0 ], pmqZNA[1 ], pmqZNA[2 ], pmqZNA[3 ], tdcZNA, centroidZNA[0 ], centroidZNA[1 ], pmcZNC, pmqZNC[0 ], pmqZNC[1 ], pmqZNC[2 ], pmqZNC[3 ], tdcZNC, centroidZNC[0 ], centroidZNC[1 ], centrality, vx, vy, vz, foundBC.timestamp (), evSelection);
316+ }
251317 }
252318 }
253319 }
0 commit comments